Yes, you should be able to build a netcdf library that supports both netcdf-enhanced(hdf5) and hdf4(read-only). By default, the hdf5 support is enabled, so you should just be able to add the --enable-hdf4 option to ./configure to get what you want. Dont forget to add the path to the hdf4 library to LDFLAGS before building. As for szip, it is not normally enabled by either hdf4 or hdf5, so you will have to rebuild those libraries with szip support (if you did not already do this). Then when you build the netcdf library, if it detects that hdf5 was built with szip support, it will build the netcdf library with szip support. Not sure why nc-config is not showing szip; probably an error in our configuration process. You might look at the file "libnetcdf.settings" that should exist in the netcdf build directory and see if it mentions szip. > > I have codes that need netcdf with hdf4 support and also newer codes that > require netcdf with hdf5 support. Can i compile a single netcdf program > with both hdf4 and hdf4 support or i must have two builds of netcdf i.e. > one with hdf4 and another with hdf5? If i can do both in one netcdf > program, how? > > Secondly, how do i ensure that szip is recognized or captured in the netcdf > build/compilation; szip is not being recognized when I do nc-config --all ? > See below > > *NB - i am building all my prerequisites i.e - szip, zlib and hdf5 into the > same directories* > > > $nc-config --all > > --cc -> icc > --cflags -> -I/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/include > -I/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/include > --libs -> -L/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/lib -lnetcdf > > --has-c++ -> no > --cxx -> > > --has-c++4 -> no > --cxx4 -> > > --has-fortran -> no > --has-dap -> yes > --has-nc2 -> yes > --has-nc4 -> yes > --has-hdf5 -> yes > --has-hdf4 -> no # can i have both hdf4 and hdf5 enabled > --has-logging -> no > --has-pnetcdf -> no > --has-szlib -> # how come there is nothing here? but its > compiled into hdf5 > > --prefix -> /home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL > --includedir-> /home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/include > --libdir -> /home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/lib > --version -> netCDF 220.127.116.11 > > > *Compilation configurations* > > export CPPFLAGS="-I/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/include" > export LDFLAGS="-L/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/lib" > > > ## zlib > CC=icc CFLAGS='-O3 -xHost -ip -m64' \ > ./configure --prefix=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL 2>&1 | > tee logZLIB1211_INTEL_CONFIG.txt > > > ##szip > ./configure --prefix=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL 2>&1 | tee > logSZIP_INTEL_CONFIG.txt > > ### hdf5-1.8.16 > CC=icc CFLAGS='-O3 -xHost -ip -m64' CXX=icpc F9X=ifort FC=ifort > FCFLAGS='-O3 -xHost -ip -m64' \ > ./configure --prefix=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL > --enable-fortran --enable-cxx \ > --with-zlib=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL \ > --with-szlib=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL 2>&1 | tee > logHDF5_INTEL_CONFIG.txt > > ### LD_LIBRARY_PATH > export > LD_LIBRARY_PATH="/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL/lib:$LD_LIBRARY_PATH" > > > #### netcdf-18.104.22.168 > # options --with-zlib/hdf5/szlib though on the unidata website dont work; I > do > CC=icc CXX=icpc CFLAGS='-O3 -xHost -ip -no-prec-div' CXXFLAGS='-O3 -xHost > -ip -no-prec-div'\ > F77=ifort FC=ifort F90=ifort FFLAGS='-O3 -xHost -ip -no-prec-div' CPP='icc > -E'\ > CXXCPP='icpc -E' \ > ./configure --enable-netcdf-4 --enable-shared > --prefix=/home/rwas/BUILD_PREREQ_SUPER_ncdf4/INSTALL 2>&1 | tee > logNetcdfC4411.txt > > > Thanks > > > > -------- > Tendayi > > =Dennis Heimbigner Unidata Ticket Details =================== Ticket ID: AAT-303974 Department: Support netCDF Priority: Normal Status: Open =================== 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.
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.