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: Ismael Núñez-Riboni
Subject: Re: octcdf-1.1.4 yields recompile with -fPIC
Date: Thu, 12 Apr 2012 11:16:33 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

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

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...


reply via email to

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