help-octave
[Top][All Lists]
Advanced

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

Re: install netcdf package


From: Clinton Winant
Subject: Re: install netcdf package
Date: Fri, 27 Nov 2015 15:30:36 -0800

Hi Alexander, Dmitri and all the others.

Yes I did install netcdf manually because I need it to run with a 4 dimensional hydrodynamics model (ROMS).  That program runs with MPI, and users are instructed to compile netcdf with static libraries.  Since octave wants (requires?) netcdf with shared libraries, I have two sets of libraries.  Those in /usr/local/netcdf are the shared version:
address@hidden:~$ ls /usr/local/netcdf/lib
libnetcdf.a   libnetcdf.settings  libnetcdf.so.7      pkgconfig
libnetcdf.la  libnetcdf.so        libnetcdf.so.7.2.0
Can you confirm that to be compatible with octave netcdf must be installed as shared libraries?

I stumbled onto a way to get octave to build the netcdf package succesfully, by first installin ncview:

address@hidden:~$ ls /usr/local/netcdf/lib
libnetcdf.a   libnetcdf.settings  libnetcdf.so.7      pkgconfig
libnetcdf.la  libnetcdf.so        libnetcdf.so.7.2.0

After octave builds the netcdf package w/o error, after issuing:
>> pkg install -verbose -forge -auto netcdf

Might this suggest that those who built the octave package for ubuntu 15.10 forgot something that is supplied in the ncview package???????????


After uninstalling the netcdf package from octave, I tried setting paths as Alexander suggested, octave would not rebuild the package, but the error is different this time:

address@hidden:~$ export PATH=/usr/local/netcdf/bin:$PATH
address@hidden:~$ export LD_LIBRARY_PATH=/usr/local/netcdf/lib:$LD_LIBRARY_PATH
address@hidden:~$ octave --no-gui
GNU Octave, version 4.0.0
Copyright (C) 2015 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

warning: function /home/cdw/Software/Octave/cdw/clabel.m shadows a core library function
warning: called from
    /home/cdw/.octaverc at line 1 column 1
warning: function /home/cdw/Software/Octave/DAT/demo.m shadows a core library function
>> pkg list
no packages installed.
>> pkg install -verbose -forge -auto netcdf
mkdir (/tmp/oct-IOav7L)
untar (/home/cdw/netcdf-1.0.7.tar.gz, /tmp/oct-IOav7L)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for mkoctfile... /usr/bin/mkoctfile --verbose
checking for octave-config... /usr/bin/octave-config
g++ -c -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-4.0.0/octave/.. -I/usr/include/octave-4.0.0/octave -I/usr/include/hdf5/serial -I/usr/include/mpi -pthread -fopenmp -g -O2 -fstack-protector-strong -Wformat -Werror=format-security    conftest.cc -o conftest.o
g++ -shared -Wl,-Bsymbolic  -o conftest.oct  conftest.o   -L/usr/lib/x86_64-linux-gnu/octave/4.0.0 -L/usr/lib/x86_64-linux-gnu -loctinterp -loctave -Wl,-Bsymbolic-functions -Wl,-z,relro 
checking for F77_FUNC... g++ -c -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-4.0.0/octave/.. -I/usr/include/octave-4.0.0/octave -I/usr/include/hdf5/serial -I/usr/include/mpi -pthread -fopenmp -g -O2 -fstack-protector-strong -Wformat -Werror=format-security    conftest.cc -o conftest.o
yes
checking for octave... /usr/bin/octave
checking for VERSION in octave-config... 4.0.0
checking for CANONICAL_HOST_TYPE in octave-config... x86_64-pc-linux-gnu
checking for SHLEXT in octave-config... so
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for strip... strip
checking for nc-config... nc-config
configure: creating ./config.status
config.status: creating Makeconf
 
  "$prefix" is /home/cdw/octave/netcdf-1.0.7
  "$exec_prefix" is ${prefix}

octave commands will install into the following directories:
   m-files:   /usr/share/octave/4.0.0/site/m/octave-forge
   oct-files: /usr/lib/x86_64-linux-gnu/octave/4.0.0/site/oct/x86_64-pc-linux-gnu/octave-forge
   binaries:  /usr/lib/x86_64-linux-gnu/octave/4.0.0/site/exec/x86_64-pc-linux-gnu
alternatives:
   m-files:   /usr/share/octave/4.0.0/site/octave-forge-alternatives/m
   oct-files: /usr/lib/x86_64-linux-gnu/octave/4.0.0/site/octave-forge-alternatives/oct/x86_64-pc-linux-gnu

shell commands will install into the following directories:
   binaries:  ${exec_prefix}/bin
   man pages: ${datarootdir}/man
   libraries: ${exec_prefix}/lib
   headers:   ${prefix}/include

octave-forge is configured with
   octave:        /usr/bin/octave (version 4.0.0)
   mkoctfile:     /usr/bin/mkoctfile --verbose for Octave 0
   octave-config: /usr/bin/octave-config for Octave 0
   netCDF compiler flags:  -I/usr/local/netcdf/include
   netCDF libraries:  -L/usr/local/netcdf/lib -lnetcdf

make: Entering directory '/tmp/oct-IOav7L/netcdf/src'
/usr/bin/mkoctfile --verbose -DHAVE_OCTAVE_ -v -I/usr/local/netcdf/include __netcdf__.cc -L/usr/local/netcdf/lib -lnetcdf
g++ -c -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-4.0.0/octave/.. -I/usr/include/octave-4.0.0/octave -I/usr/include/hdf5/serial -I/usr/include/mpi -pthread -fopenmp -g -O2 -fstack-protector-strong -Wformat -Werror=format-security   -I/usr/local/netcdf/include  -DHAVE_OCTAVE_ __netcdf__.cc -o __netcdf__.o
g++ -shared -Wl,-Bsymbolic  -o __netcdf__.oct  __netcdf__.o   -L/usr/local/netcdf/lib -lnetcdf -L/usr/lib/x86_64-linux-gnu/octave/4.0.0 -L/usr/lib/x86_64-linux-gnu -loctinterp -loctave -Wl,-Bsymbolic-functions -Wl,-z,relro 
make: Leaving directory '/tmp/oct-IOav7L/netcdf/src'
copyfile /tmp/oct-IOav7L/netcdf/src/__netcdf__.oct /tmp/oct-IOav7L/netcdf/inst/x86_64-pc-linux-gnu-api-v50+
/home/cdw/octave/netcdf-1.0.7/x86_64-pc-linux-gnu-api-v50+/__netcdf__.oct: failed to load: /home/cdw/octave/netcdf-1.0.7/x86_64-pc-linux-gnu-api-v50+/__netcdf__.oct: undefined symbol: nc_set_chunk_cache
error: called from 'doc_cache_create>create_cache' in file /usr/share/octave/4.0.0/m/help/doc_cache_create.m near line 106, column 18
>>


If you actually get this far, please know that I am very, very grateful for your efforts, and those of the octave devellopers.  My work would not bepossible without this

On Fri, Nov 27, 2015 at 12:55 PM, Alexander Barth <address@hidden> wrote:
Dear Clinton,


It seems that you have installed netcdf manually by setting the option --prefix to /usr/local/netcdf, can you confirm?
Otherwise (i.e. without the prefix option) libnetcdf.so.7 would go to /usr/local/lib (and not /usr/local/netcdf/lib as in your case), as far as I know.

The linker knows about the libraries in /usr/local/lib, but not about /usr/local/netcdf/lib therefore the library is not found.

Does it work when you set in a shell these variables before starting octave?
export PATH=/usr/local/netcdf/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/netcdf/lib:$LD_LIBRARY_PATH

Regards,
Alex

On Thu, Nov 26, 2015 at 9:41 PM, Dmitri A. Sergatskov <address@hidden> wrote:
On Thu, Nov 26, 2015 at 12:27 PM, Clinton Winant <address@hidden> wrote:


machine:  hp z210, OS Ubuntu 15.10 Octave 4.4.4 



​It appears to me that you have stuff installed in ​some non-standard places.
Did you compile/installed Octave from source yourself?

​I do not know Ubuntu well, but expect it to provide those package pre-compiled.​

 
​Dmitri.
--


_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave




reply via email to

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