[Thread Prev][Thread Next][Index]

Re: [ferret_users] Building pyferret for Suse Linux 11 failed



Hi Martin,

The easiest solution that might work, if the problem is the older OS with python2.7, is to use the RHEL6 version that uses python 2.6, but then change the name of the $FER_DIR/lib/python2.6 subdirectory $FER_DIR/lib/python2.7.  Run Finstall, specifying python2.7 as the python executable and do some testing.  I am not sure if this will work, but it is simple to try.

If you do have to building it yourself:

(1) Are libcurl.so and libgfortran.so also available in those (or some other) directory?  The linker will be looking for the shared object libraries without the added version number.  If these are not available, then that is the problem.  To get these .so libraries, it would be best to install the development packages for these libraries.  
But if you cannot install the development packages, you could make a link to these libraries, leaving off the version number in the target filename, in the pyferret-1.0.2-source/lib directory: "ln -s /usr/lib64/libcurl.so.4 pyferret-1.0.2-source/lib/libcurl.so" and similar with libgfortran.so wherever it may be.  Since pyferret-1.0.2-source/lib is already on the search path when looking for libraries, the linker should then find these libraries.  If this works, but then you get a similar message when you try to run pyferret, you might need to do something similar thing in the installation directory; get back to me if that is the case.

(2) If libcurl.so and libgfortran.so are available, then I noticed your compile line starts with "-L /usr/lib64", and it should be "-L/usr/lib64".  This options gives a directory to search for libraries.  Some compilers/linkers allow a space in that option, but some do not.  I think this directory should be automatically searched, so I suspect this is not the problem.  I am also not sure where these options in your linking are coming from; maybe from an environment variable you have set?

As far as the linker that gets used, that version of the linker (the ld executable) is what /usr/bin/gcc chose to use.  That should be the correct linker for the gcc used.

I am surprised to hear the .o-files are not removed.  Was there any error message with running "make clean" indicating that it did not complete?  


If the above answers did not solve your problem, here are some more details about how PyFerret is built.  
The first compiling steps are building all the usual Ferret libraries using the Makefiles.  Then for building the python modules, including this last linking step, the numpy.distutils python package is used.  (The numpy.distutils package is used instead of the plain distutils package because the numpy version knows how to work with Fortran.)  In the main Makefile, these steps are executed by "$(PYTHON_EXE) setup.py build".  So you will need to investigate options for numpy.distutils, and possibly modify values in setup.py, to change the linking behavior.  Hopefully this will not be necessary.


Hope this helps,
Karl



On Thu, Apr 10, 2014 at 3:21 AM, Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx> wrote:
Good morning,

I am trying to build pyferret (latest release) for Linux Suse 11. More recent
system versions would be compatible with the UBUNTU binary, but the machine is
is a CRAY and I have no influence on the system version. So I have to make the best from what
I have got.

The compiler is gcc/gfortran 4.81., phython is version 2.7.6, 3.3.3 is also available.

I choose the compiler and python version loading modules. (This is not the tricky CRAY programming environment.)

After adjusting site_specific.mk to find JAVA, netcdf ....
BUILDTYPE    = x86_64-linux
PYTHON_EXE    = python2.7

I try make. This runs almost through (great) but finally I end up with the error message:

/usr/bin/gcc -shared -L /usr/lib64 -lm -ldl -lpthread -lutil -I/sw/tools/python/2.7.6/generic/include/python2.7 -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/fer/common -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/fer/grdel -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/fer/cferbind -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/fmt/cmn -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/ppl/include -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/ppl/tmap_inc -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/pyfermod -I/sw/viz/ferret/py_ferret_102_py_27/pyferret-1.0.2-source/external_functions/ef_utility -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/sw/dataformats/netcdf/4.3.0/smp1/gnu/include -Dcrptd_cat_argument -Ddouble_p -Dgfortran -Dreclen_in_bytes -Dunix -Dxgks -DG77_SIGNAL -DG77 -DINTERNAL_READ_FORMAT_BUG -DLINUX -DMANDATORY_FORMAT_WIDTHS -DNEED_IAND -DNO_DOUBLE_ESCAPE_SLASH -DNO_OPEN_CARRIAGECONTROL -DNO_OPEN_READONLY -DNO_OPEN_RECORDTYPE -DNO_OPEN_SHARED -DNO_PASSED_CONCAT -DNO_PREPEND_STRING -DSTAR_1_SUPPORTED -DVOID_SIGHANDLER -DX_REFRESH -DXT_CODE -m64 -fPIC -Dlint -D_SSIZE_T -D_POSIX_VERSION -Dsun4 -O build/temp.linux-x86_64-2.7/pyfermod/pyefcn_custom_axes.o build/temp.linux-x86_64-2.7/pyfermod/pyefcn_get_error.o build/temp.linux-x86_64-2.7/pyfermod/copy_pystat_data.o build/temp.linux-x86_64-2.7/pyfermod/pyefcn_init.o build/temp.linux-x86_64-2.7/pyfermod/libpyferret.o build/temp.linux-x86_64-2.7/pyfermod/decref_pyobj.o build/temp.linux-x86_64-2.7/pyfermod/pyefcn_compute.o build/temp.linux-x86_64-2.7/pyfermod/pyefcn_result_limits.o build/temp.linux-x86_64-2.7/pyfermod/set_memory.o fer/ef_utility/ef_get_arg_type.o fer/ef_utility/ef_get_bad_flags.o fer/ef_utility/ef_get_cx_list.o fer/ef_utility/ef_get_mres.o fer/ef_utility/ef_get_mr_list.o fer/ef_utility/ef_get_one_val.o fer/ef_utility/ef_get_result_type.o fer/ef_utility/ef_put_string.o fer/ef_utility/ef_put_string_ptr.o fer/ef_utility/ef_set_alt_fcn_name_sub.o fer/ef_utility/ef_set_arg_desc_sub.o fer/ef_utility/ef_set_arg_name_sub.o fer/ef_utility/ef_set_arg_type.o fer/ef_utility/ef_set_arg_unit_sub.o fer/ef_utility/ef_set_axis_extend.o fer/ef_utility/ef_set_axis_influence.o fer/ef_utility/ef_set_axis_influence_6d.o fer/ef_utility/ef_set_axis_inheritance.o fer/ef_utility/ef_set_axis_inheritance_6d.o fer/ef_utility/ef_set_axis_limits.o fer/ef_utility/ef_set_axis_reduction.o fer/ef_utility/ef_set_axis_reduction_6d.o fer/ef_utility/ef_set_custom_axis_sub.o fer/ef_utility/ef_set_desc_sub.o fer/ef_utility/ef_set_freq_axis_sub.o fer/ef_utility/ef_set_has_vari_args.o fer/ef_utility/ef_set_num_args.o fer/ef_utility/ef_set_num_work_arrays.o fer/ef_utility/ef_set_piecemeal_ok.o fer/ef_utility/ef_set_piecemeal_ok_6d.o fer/ef_utility/ef_set_result_type.o fer/ef_utility/ef_set_work_array_dims.o fer/ef_utility/ef_set_work_array_dims_6d.o fer/ef_utility/ef_set_work_array_lens.o fer/ef_utility/ef_set_work_array_lens_6d.o fer/ef_utility/ef_version_test.o fer/ef_utility/ef_bail_out.o fer/ef_utility/ef_get_arg_info.o fer/ef_utility/ef_get_arg_mem_subscripts.o fer/ef_utility/ef_get_arg_mem_subscripts_6d.o fer/ef_utility/ef_get_arg_string.o fer/ef_utility/ef_get_arg_subscripts.o fer/ef_utility/ef_get_arg_subscripts_6d.o fer/ef_utility/ef_get_arg_ss_extremes.o fer/ef_utility/ef_get_arg_ss_extremes_6d.o fer/ef_utility/ef_get_axis_calendar.o fer/ef_utility/ef_get_axis_dates.o fer/ef_utility/ef_get_axis_info.o fer/ef_utility/ef_get_axis_info_6d.o fer/ef_utility/ef_get_axis_modulo_len.o fer/ef_utility/ef_get_box_hi_lim.o fer/ef_utility/ef_get_box_limits.o fer/ef_utility/ef_get_box_lo_lim.o fer/ef_utility/ef_get_box_size.o fer/ef_utility/ef_get_coordinates.o fer/ef_utility/ef_get_one_arg_string.o fer/ef_utility/ef_get_one_val_sub.o fer/ef_utility/ef_get_one_val_sub_sub.o fer/ef_utility/ef_get_res_mem_subscripts.o fer/ef_utility/ef_get_res_mem_subscripts_6d.o fer/ef_utility/ef_get_res_subscripts.o fer/ef_utility/ef_get_res_subscripts_6d.o fer/ef_utility/ef_get_string_arg_element.o fer/ef_utility/ef_get_string_arg_element_6d.o fer/ef_utility/ef_get_string_arg_element_len.o fer/ef_utility/ef_get_string_arg_element_len_6d.o fer/ef_utility/ef_get_string_arg_elem_len_sub.o fer/ef_utility/ef_get_string_arg_element_sub.o fer/ef_utility/ef_get_string_arg_max_len.o fer/ef_utility/ef_get_wrk_mem_subscripts.o fer/ef_utility/ef_set_arg_desc.o fer/ef_utility/ef_get_wrk_mem_subscripts_6d.o fer/ef_utility/ef_set_alt_fcn_name.o fer/ef_utility/ef_set_arg_name.o fer/ef_utility/ef_set_arg_unit.o fer/ef_utility/ef_set_custom_axis.o fer/ef_utility/ef_set_freq_axis.o fer/ef_utility/ef_set_desc.o fer/ef_utility/ef_set_real_to_string.o fer/special/fakes3.o fer/special/ferret_dispatch.o fer/special/ferret_query_f.o fer/special/gui_fakes.o fer/special/linux_routines.o fer/special/xmake_date_data.o fer/special/xrevision_type_data.o fer/special/xplatform_type_data.o -Llib -L/sw/dataformats/netcdf/4.3.0/smp1/gnu/lib -L/sw/dataformats/hdf5/1.8.12/smp1/gnu/lib -L/sw/tools/python/2.7.6/generic/lib -L/sw/tools/python/2.7.6/generic/lib -ltmapadds -lcmp -lour -lplt -lpll -lepi -lusr -lsym -ltmap -lccr -lcferbind -lctx -ldat -ldoo -lefi -lefn -lfmt -lgnl -lgrdel -lino -lmem -locn -lferplt -lpyf -lrpn -lstk -lutl -lxeq -ltmapadds -lcmp -lour -lplt -lpll -lepi -lusr -lsym -ltmap -lccr -lcferbind -lctx -ldat -ldoo -lefi -lefn -lfmt -lgnl -lgrdel -lino -lmem -locn -lferplt -lpyf -lrpn -lstk -lutl -lxeq -ltmapadds -lcmp -lour -lplt -lpll -lepi -lusr -lsym -ltmap -lccr -lcferbind -lctx -ldat -ldoo -lefi -lefn -lfmt -lgnl -lgrdel -lino -lmem -locn -lferplt -lpyf -lrpn -lstk -lutl -lxeq -ltmapadds -lcmp -lour -lplt -lpll -lepi -lusr -lsym -ltmap -lccr -lcferbind -lctx -ldat -ldoo -lefi -lefn -lfmt -lgnl -lgrdel -lino -lmem -locn -lferplt -lpyf -lrpn -lstk -lutl -lxeq -ltmapadds -lcmp -lour -lplt -lpll -lepi -lusr -lsym -ltmap -lccr -lcferbind -lctx -ldat -ldoo -lefi -lefn -lfmt -lgnl -lgrdel -lino -lmem -locn -lferplt -lpyf -lrpn -lstk -lutl -lxeq -lpython2.7 -lpython2.7 -o build/lib.linux-x86_64-2.7/pyferret/libpyferret.so -Wl,/sw/dataformats/netcdf/4.3.0/smp1/gnu/lib/libnetcdff.a -Wl,/sw/dataformats/netcdf/4.3.0/smp1/gnu/lib/libnetcdf.a -Wl,/sw/dataformats/hdf5/1.8.12/smp1/gnu/lib/libhdf5_hl.a -Wl,/sw/dataformats/hdf5/1.8.12/smp1/gnu/lib/libhdf5.a -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lcairo -lcurl -lz -lgfortran -ldl -lm -fPIC [0m
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lcurl
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lgfortran

The point is, that the wrong linker is called.

which ld, which gcc or which gfortran

gives the right answer. Here libgfortran is available, usr/bin/gcc has only the dynamic one libgfortran.

libcurl.so.4  is available in /usr/lib64

I searched the Makefile how to fix this, but I do not have any idea.

make clean
does not remove the .o-files.

Any help or suggestion is very welcome,
Martin Schmidt



--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and TMAP/PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement