help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octcdf-1.1.4 yields recompile with -fPIC


From: Alexander Barth
Subject: Re: octcdf-1.1.4 yields recompile with -fPIC
Date: Fri, 20 Apr 2012 12:53:11 +0200
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

Hello Ismael,

When you have multiple copies of NetCDF installed on your system, you need to be sure that you consistently use the same (during compilation, linking and when you use it). I never had problems in using the "system" netcdf library in /usr/lib (I am using a 64-bit kernel too), so why not use this one. What does
nc-config --libs return?

When you compile octcdf, please use the verbose option. So you can verify which path are used (options -I and -L).

You can also check with
ldd 
/home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+/netcdf.oct
that the same netcdf library is used.

Note that LD_LIBRARY_PATH uses the path of the file (/path/to) and not the complete file name (/path/to/libfoo.so), but this should not be necessary if the libary is in /usr/lib.

I should never be necessary to recompile octave to make one of the octave-forge 
packages to works.

Cheers,
Alex


On 12/04/2012 11:16, Ismael Núñez-Riboni wrote:
On 04/11/2012 06:58 PM, Ismael Núñez-Riboni wrote:
Thanks for the amazingly quick answer!

If for some reason you do need to build NetCDF yourself, then build a
dynamic link of it.

Indeed, I build Unidata NetCDF myself. I knew that Ubuntu includes a
NetCDF library now, but I specifically need the Unidata library for
another package. I believe thus I can do 2 things:

1) Perhaps I could link to the Ubuntu NetCDF library (and not the the
Unidata one, which seems to be default) when I compile Octave? Do you
know how to do this? (I think something like ./cofigure
--with-netcdf=path2Ubuntu-netcdf).

2) I build now a shared library of the Unidata NetCDF (configure with
--enable-shared) and I'm recompiling octave now, which takes some
time... I can tell tomorrow if this worked but I guess 1) is the
simplest solution...


Number 2 did not work. I successfully compiled netCDF with --enable-shared but Octave still cannot find the shared object:

octave:3> pkg([install_dir,'octcdf-1.1.4.tar.gz'],'install')
warning: X11 DISPLAY environment variable not set
warning: X11 DISPLAY environment variable not set
warning: X11 DISPLAY environment variable not set
warning: load_path: /home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+: No such file or directory /home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+/netcdf.oct: failed to load: libnetcdf.so.4: cannot open shared object file: No such file or directory error: called from `gen_doc_cache>create_cache' in file /usr/local/share/octave/3.6.1/m/help/gen_doc_cache.m near line 94, column 17
error: called from:
error:   /usr/local/share/octave/3.6.1/m/pkg/pkg.m at line 869, column 5
error:   /usr/local/share/octave/3.6.1/m/pkg/pkg.m at line 383, column 9

I tried then:

A) A soft link to the shared netCDF object:

sudo ln -s /usr/local/lib/libnetcdf.so.4.0.0 /home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+/netcdf.oct

This fails because at the moment of installing the netCDF package inside Octave, pkg overwrites the target folder (and with it the soft link). At the end Octave tells again that the shared object does not exist.

B) Export the shared object:

export LD_LIBRARY_PATH=/usr/local/lib/libnetcdf.so.4
it should have been
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH


Which yields a similar error:

/home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+/netcdf.oct: failed to load: /home/ismael/octave/octcdf-1.1.4/x86_64-unknown-linux-gnu-api-v48+/netcdf.oct: undefined symbol: nc_put_att_double error: called from `gen_doc_cache>create_cache' in file /usr/local/share/octave/3.6.1/m/help/gen_doc_cache.m near line 94, column 17
error: called from:
error:   /usr/local/share/octave/3.6.1/m/pkg/pkg.m at line 869, column 5
error:   /usr/local/share/octave/3.6.1/m/pkg/pkg.m at line 383, column 9

I think I need to configure octave with the path to the either the ubuntu netcdf library or to the unidata netcdf library, something like "./cofigure --with-netcdf=path2Ubuntu-netcdf" but I simply do not know how to do this...
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]