Git Product home page Git Product logo

Comments (13)

DennisHeimbigner avatar DennisHeimbigner commented on August 20, 2024

The netcdf cxx is a wrapper around the netcdf-c library. So, you need to build
and install netcdf-c library first.

from netcdf-cxx4.

aeiou6630 avatar aeiou6630 commented on August 20, 2024

Thanks for your reply.

The cluster already have netcdf-c, so I did include it when configuring (B)-(6). Besides, I've also installed netcdf-c-4.7.0 locally and include it when configuring (C)-(2).

Is that what you mentioned?

from netcdf-cxx4.

DennisHeimbigner avatar DennisHeimbigner commented on August 20, 2024

Not quite. Looking at the config log, it does not look like you have -lnetcdf
set.
The other question is: when you built netcdf-c library did you by any chance
disable netcdf-4 support?

from netcdf-cxx4.

aeiou6630 avatar aeiou6630 commented on August 20, 2024

Hi,

I guess the problem was failure to linking the ./configure to the library of netcdf-c, as you mentioned. But I couldn't figure it out by myself. Specifically, when the configuring process needed to access the /lib directory, it somehow entered the /include directory, thus couldn't find what it needed.

Like this:
configure:16997: checking for library containing nc_create
configure:17028: gcc -o conftest -g -O2 -I/oasis/tscc/scratch/fchang/netcdf4/netcdf-c-4.7.0/install/include conftest.c >&5
/tmp/cc0x1f2b.o: In function "main":
/oasis/tscc/scratch/fchang/netcdf4/netcdf-cxx4-4.3.0/conftest.c:44: undefined reference to "nc_create"

Could you give me some instruction on how to set the path of library? (I guess that's the -lnetcdf you mentioned) Thank you!


### Steps I took
I put the entire process of how I built it in the following. You can skip A, B, C and D.

A. Load Module
(A1) module unload intel
(A2) module load gnu openmpi_ib

B. Build zlib
(B1) cd /oasis/tscc/scratch/fchang/zlib/
(B2) wget https://www.zlib.net/zlib-1.2.11.tar.gz
(B3) tar -xzvf zlib-1.2.11.tar.gz
(B4) cd zlib-1.2.11
(B5) mkdir install
(B6) ./configure --prefix=/oasis/tscc/scratch/fchang/zlib/zlib-1.2.11/
(B7) make check
(B8) make install

C. Build hdf5
(C1) cd /oasis/tscc/scratch/fchang/hdf5
(C2) wget https://support.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.10.5.tar.gz
(C3) tar -xzvf hdf5-1.10.5.tar.gz
(C4) cd hdf5-1.10.5
(C5) mkdir install
(C6) ./configure --prefix=/oasis/tscc/scratch/fchang/hdf5/hdf5-1.10.5/install
(C7) make check
(C8) make install

D. Build Netcdf-c
(D1) cd /oasis/tscc/scratch/fchang/netcdf4
(D2) wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-c-4.7.0.tar.gz
(D3) tar -xzvf netcdf-c-4.7.0.tar.gz
(D4) cd netcdf-c-4.7.0
(D5) mkdir install
(D6) ./configure --prefix="/oasis/tscc/scratch/fchang/netcdf4/netcdf-c-4.7.0/install" CPPFLAGS="-I/oasis/tscc/scratch/fchang/hdf5/hdf5-1.10.5/install/include -I/oasis/tscc/scratch/fchang/zlib/zlib-1.2.11/install/include" LDFLAGS="-L/oasis/tscc/scratch/fchang/hdf5/hdf5-1.10.5/install/lib -L/oasis/tscc/scratch/fchang/zlib/zlib-1.2.11/install/lib"
(D7) make check
(D8) make install

E. Build Netcdf-cxx
(E1) cd /oasis/tscc/scratch/fchang/netcdf4
(E2) wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx4-4.3.0.tar.gz
(E3) tar -xzvf netcdf-cxx4-4.3.0.tar.gz
(E4) cd netcdf-cxx4-4.3.0
(E5) mkdir install
(E6) ./configure -prefix=/oasis/tscc/scratch/fchang/netcdf4/netcdf-cxx4-4.3.0/install CPPFLAGS=-I/oasis/tscc/scratch/fchang/netcdf4/netcdf-c-4.7.0/install/include LDFLAGs=-L/oasis/tscc/scratch/fchang/netcdf4/netcdf-c-4.7.0/install/lib LD_LIBRARY_PATH=/opt/gnu/gcc/lib64:/opt/gnu/gmp/lib:/opt/gnu/mpfr/lib:/opt/gnu/mpc/lib:LD_LIBRARY_PATH:/oasis/tscc/scratch/fchang/netcdf4/netcdf-c-4.7.0/install/lib

### Error message and config.log
Configure Failure.zip

from netcdf-cxx4.

UrosCvijan avatar UrosCvijan commented on August 20, 2024

Did you get any solution for this? I have the same issue, same steps I did and still getting the error NetCDF must be built with netCDF-4 enabled.

from netcdf-cxx4.

aeiou6630 avatar aeiou6630 commented on August 20, 2024

Hi,

Sorry I haven't quite figured out this problem yet. I switched my focus to other things afterwards.

But I guess you can try adding this option in the command when configuring netcdf-c:
--enable-netcdf-4

Not sure if it helps though.

from netcdf-cxx4.

UrosCvijan avatar UrosCvijan commented on August 20, 2024

Hi,

I tried with all possible flags but to no avail. Thanks for fast response.

from netcdf-cxx4.

syaoo avatar syaoo commented on August 20, 2024

Has it been solved? I also have this problem. and I have successfully installed netcdf-c-4.7.4.
here is some log:

checking whether filter testing should be run... yes
checking netCDF v2 API present... yes
checking netCDF-4 present... no
checking netCDF has logging... no
checking netCDF has dap... no
checking netCDF has pnetcdf... no
checking netCDF has filter support... yes
configure: error: NetCDF must be built with netCDF-4 enabled

from netcdf-cxx4.

WardF avatar WardF commented on August 20, 2024

Let me take another look at this. The config.log indicates that it is using nc_use_parallel_enabled, for some reason to indicate nc4 functionality. I'll get a fix for this, once I confirm that's what is going on. What happens if you use cmake to try to configure? Assuming you have cmake available?

from netcdf-cxx4.

WardF avatar WardF commented on August 20, 2024

@syaoo can you provide the config.log file generated?

from netcdf-cxx4.

syaoo avatar syaoo commented on August 20, 2024

@syaoo can you provide the config.log file generated?
I've tried to replicate the problem, but I'm not sure it's the same cause as before. Here is config.log file:
netcdf-cxx-config.log
I remember solving it before, but I'm not sure what was done. Now it works when you give the correct path to the NetCDF library:

./configure -prefix=/home/test/dir1/local/netcdf-cxx  CPPFLAGS="-I/home/test/dir1/local/netcdf/include -I/home/test/dir1/local/hdf5/include -I/home/test/dir1/local/zlib/include" LDFLAGS="-L/home/test/dir1/local/netcdf/lib -L/home/test/dir1/local/hdf5/lib -L/home/test/dir1/local/zlib/lib"

If the path is not given or the path is wrong, this problem occurs, like this:

./configure -prefix=/home/test/dir1/local/netcdf-cxx  CPPFLAGS="-I/home/test/dir1/local/netcdf/include -I/home/test/dir1/local/hdf5/include -I/home/test/dir1/local/zlib/include" LDFLAGS="-L/home/test/dir1/local/hdf5/lib -L/home/test/dir1/local/zlib/lib"

from netcdf-cxx4.

jprestop avatar jprestop commented on August 20, 2024

I was helping a user install software for which NetCDF-CXX was a dependency, and she experienced this same problem. She was able to get NetCDF-CXX to configure and then build by adding " LIBS="-L${LIB_DIR}/lib -lhdf5_hl -lhdf5 -lz -lnetcdf" " to to the configure line like this:

./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include LIBS="-L${LIB_DIR}/lib -lhdf5_hl -lhdf5 -lz -lnetcdf"

from netcdf-cxx4.

aeiou6630 avatar aeiou6630 commented on August 20, 2024

Thanks for your reply!

from netcdf-cxx4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.