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

[netCDF #XEI-893423]: Problems while linking



Hello,

This is an interesting issue.  What are you trying to build, when the linking 
fails? You mention that the linking to netcdf_c++4 is failing, but libnetcdf is 
the core C library, not the C++ interface.  If the issue is at runtime, you 
might need to update your LD_LIBRARY_PATH to reflect the location of the 
libraries; this is used by the runtime to load the library at, well, runtime.  

So, if I understand correctly, the issue occurs when you run the program, and 
it is  runtime load error for the C library.  Try setting the LD_LIBRARY_PATH 
environmental variable when running, and let us know what happens.

Thanks!

-Ward

> Hello,
> 
> 
> I would like to build the netcdf_c++. I wrote the following script for 
> building the library and its dependencies.
> 
> build_zlib(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd zlib
> mkdir install_dir
> ZDIR=$PWD/install_dir
> ./configure --prefix=${ZDIR}
> make -j8 check
> make install
> cd ..
> }
> 
> build_hdf() {
> rm -rf tiledb
> git submodule update --remote tiledb
> cd hdf5
> mkdir install_dir
> H5DIR=$PWD/install_dir
> autoreconf -if
> ./configure --with-zlib=${ZDIR} --prefix=${H5DIR} --enable-hl
> make -j8 check
> make install
> cd ..
> }
> 
> build_netcdf_c(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd netcdf-c
> mkdir install_dir
> NCDIR=$PWD/install_dir
> autoreconf -if
> ./configure CPPFLAGS="-I${H5DIR}/include -I${ZDIR}/include" 
> LDFLAGS="-L${H5DIR}/lib -L${ZDIR}/lib" --prefix=${NCDIR} --disable-dap
> make -j8 check
> make install
> cd ..
> }
> 
> build_netcdf_cpp(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd netcdf-cxx4
> mkdir install_dir
> NCPPDIR=$PWD/install_dir
> autoreconf -if
> ./configure CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include" 
> LDFLAGS="-L${NCDIR}/lib -L${H5DIR}/lib" --prefix=${NCPPDIR}
> make check
> make install
> cd ..
> }
> 
> 
> I was able to build everything the way I did, but I can't link to netcdf_c++4.
> I use cmake as my build system. All library files are copied to the lib 
> directory inside the project directory.
> 
> link_directories(lib)
> 
> link_libraries(Qt5::Core stdc++fs netcdf_c++ tiledb)
> 
> I am also able to build my application with these settings, but when I try to 
> run it I'll get an error:
> error while loading shared libraries: libnetcdf.so.15: cannot open shared 
> object file: No such file or directory
> 
> 
> I can't figure out whats wrong, because libnetcdf.so.15 does actually exist 
> in the lib folder I included in cmake.
> Would appreciate any help.
> 
> 
> 
> 
> 
> 
> Hello,
> 
> 
> I would like to build the netcdf_c++. I wrote the following script for 
> building the library and its dependencies.
> 
> build_zlib(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd zlib
> mkdir install_dir
> ZDIR=$PWD/install_dir
> ./configure --prefix=${ZDIR}
> make -j8 check
> make install
> cd ..
> }
> 
> build_hdf() {
> rm -rf tiledb
> git submodule update --remote tiledb
> cd hdf5
> mkdir install_dir
> H5DIR=$PWD/install_dir
> autoreconf -if
> ./configure --with-zlib=${ZDIR} --prefix=${H5DIR} --enable-hl
> make -j8 check
> make install
> cd ..
> }
> 
> build_netcdf_c(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd netcdf-c
> mkdir install_dir
> NCDIR=$PWD/install_dir
> autoreconf -if
> ./configure CPPFLAGS="-I${H5DIR}/include -I${ZDIR}/include" 
> LDFLAGS="-L${H5DIR}/lib -L${ZDIR}/lib" --prefix=${NCDIR} --disable-dap
> make -j8 check
> make install
> cd ..
> }
> 
> build_netcdf_cpp(){
> rm -rf tiledb
> git submodule update --remote tiledb
> cd netcdf-cxx4
> mkdir install_dir
> NCPPDIR=$PWD/install_dir
> autoreconf -if
> ./configure CPPFLAGS="-I${NCDIR}/include -I${H5DIR}/include" 
> LDFLAGS="-L${NCDIR}/lib -L${H5DIR}/lib" --prefix=${NCPPDIR}
> make check
> make install
> cd ..
> }
> 
> 
> I was able to build everything the way I did, but I can't link to netcdf_c++4.
> I use cmake as my build system. All library files are copied to the lib 
> directory inside the project directory.
> 
> link_directories(lib)
> 
> link_libraries(Qt5::Core stdc++fs netcdf_c++ tiledb)
> 
> I am also able to build my application with these settings, but when I try to 
> run it I'll get an error:
> error while loading shared libraries: libnetcdf.so.15: cannot open shared 
> object file: No such file or directory
> 
> 
> I can't figure out whats wrong, because libnetcdf.so.15 does actually exist 
> in the lib folder I included in cmake.
> Would appreciate any help.
> 
> 
> 
> 
> 
> 


Ticket Details
===================
Ticket ID: XEI-893423
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.