Project

General

Profile

CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7

Added by Gus Correa over 3 years ago

Dear CDO experts

I am trying to build CDO 1.9.8 on Linux CentOS 7.

If I configure with:

--enable-python=yes
and/or
--enable-ruby=yes

I get one of these error messages:

configure: error: Ruby bindings: Please enable SWIG with '--enable-swig'!
configure: error: ../../cdo-1.9.8/libcdi/configure failed for libcdi

configure: error: Python bindings: Please enable SWIG with '--enable-swig'!
configure: error: ../../cdo-1.9.8/libcdi/configure failed for libcdi

Then, if I add

--enable-swig=yes (which is not documented in configure --help),

I get one of these error messages when I run make,
and in fact the directories libcdi/interfaces/python and libcdi/interfaces/ruby don't even exist.
I.e., I presume Swig didn't create them. (?)


libtool: link: g++ -g -O2 -o .libs/CdiInfo CdiInfo.o ./.libs/libcdipp.a /opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/src/.libs/libcdi.so -leccodes -lhdf5 -lnetcdf -lm -luuid -pthread -Wl,-rpath -Wl,/opt/sw/cdo/1.9.8/lib
make2: *
No rule to make target `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/../../cdo-1.9.8/libcdi/interfaces/cdi.i', needed by `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/interfaces/ruby/cdi_wrapper.cpp'. Stop.
make2: Leaving directory `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/interfaces' **


libtool: link: g++ -g -O2 -o .libs/CdiInfo CdiInfo.o ./.libs/libcdipp.a /opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/src/.libs/libcdi.so -leccodes -lhdf5 -lnetcdf -lm -luuid -pthread -Wl,-rpath -Wl,/opt/sw/cdo/1.9.8/lib
make2:
No rule to make target `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/../../cdo-1.9.8/libcdi/interfaces/cdi.i', needed by `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/interfaces/python/cdi_wrapper.cpp'. Stop.
make2: Leaving directory `/opt/swinst/cdo/1.9.8/build_gnu-4.8.5/libcdi/interfaces'
make1: *
* [all-recursive] Error 1 **

So, I presume that swig is not doing what it is supposed to do in CDO 1.9.8.

So far I could only build CDO 1.9.8 without Python and Ruby interfaces.
It is not a big problem, but it would be interesting to have Python and Ruby support.

By contrast, in CDO 1.9.7.1, I can enable Python and Ruby,
and as long as I don't enable swig make runs without errors,
so I can build CDO 1.9.7.1 with Python and Ruby support.

Is there any workaround to this problem?

Thank you,
Gus Correa


Replies (5)

RE: CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7 - Added by Ralf Mueller over 3 years ago

hi Gus!

you seem to mix CDO and CDI: when you install cdo from source, than CDI is build is a special way which suites the way CDO is using CDI. CDI is build automatically when building CDO - you don't have to do anything in addition to ./configure ; make; make install for CDO.

none of the enable-switches you mentioned are used for building CDO - just follow the documentation for installing CDO. Or did you and there are things like this mentioned there? Maybe the docu can be improved, idk.

cheers
ralf

RE: CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7 - Added by Gus Correa over 3 years ago

Thank you for your answer, Ralf.

I build CDI along with CDO.
I.e., in my CDO configure command
I have (among other things):
--enable-cdi-lib=yes
It is simpler to build both together, as I am doing, I suppose.
Maybe I should have mentioned CDI instead of CDO in my message "Subject" line.

Yes, the error messages are exactly as in my previous email.
I understand they come from CDI.
Still, it seems to me that Swig is not doing what it is supposed to do.
I do have swig installed on CentOS 7 (from packages via yum).

I don't know much about Swig, but I read it can be used to create
interfaces between C/C++ programs (like CDI, I guess), and Python,
Ruby and other languages.
The error message says there is "no rule to make target ... cdi.i",
and actually the directories libcdi/interfaces/{python,ruby} are not
even created, therefore cdi_wrapper.cpp doesn't exist either.
Maybe it is something that is not right with the Makefile?

If I disable python, ruby (and swig), then both CDO and CDI build correctly.
So, I suppose this means that the problem is localized on the Python and Ruby
interfaces to CDI.

Anyway, this is not a big deal for me.
I just thought it would be helpful to the CDI developers to know about
the problem I had.

Thank you,
Gus Correa

RE: CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7 - Added by Ralf Mueller over 3 years ago

hi again Gus!
sure, thx for the report. I didn't work with the swig-based bindings of CDI lately. Will check if they still work.

Do you need something like this? or was is just out of curiosity?

cheers
ralf

RE: CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7 - Added by Ralf Mueller over 3 years ago

On my box (ArchLinux) a build of CDI (not through CDO) with --enable-ruby --enable-python --enable-swig --with-netcdf worked out-of-the-box I could also run the test.rb and test.py with an in-source build.

When I call this for building CDO I get an error, but different like yours.

Some more general remarks
  • all three option --enable-ruby --enable-python --enable-swig are marked as experimental. So they are not ready for production use
  • if you want to build and install CDI, please use the a cdi-release from here: https://code.mpimet.mpg.de/projects/cdi/files
  • CDI has more features like MPI and Fortran bindings that can need extra tweaking. building this through CDO is a bad idea IMO

cheers
ralf

RE: CDO 1.9.8 build error: make fails with Python or Ruby and Swig enabled on CentOS 7 - Added by Gus Correa over 3 years ago

Hi Ralf

This was mostly out of curiosity.
I built CDO 1.9.8 and CDI without Python, Ruby and Swig,
and that is perfectly fine.

CentOS 7 has a 3.10 kernel, and I wonder if the swig package is also old,
so, may not handle things the way your ArchLinux computer does.

Anyway, my purpose was primarily to report that issue to the CDI developers.

Thank you!
Gus Correa

    (1-5/5)