netcdf-fortran
netcdf-fortran copied to clipboard
netcdf-fortran-4.5.3 fails to configure with netcdf-c-4.8.0: "configure: error: netcdf-c version 4.7.4 or greater is required"
netcdf-fortran-4.5.3, with netcdf-c-4.8.0 previously installed, on Linux CentOS 7.9, with gcc and gfortran 4.8.5.
$ export LD_LIBRARY_PATH=/opt/swinst/netCDF/C/gnu-4.8.5/lib [This is where the netcdf-c-4.8.0 libraries are installed.]
$ cd ../build_gnu-4.8.5/ [Trying to configure off the source tree (with VPATH), but got the same error if directly on the source tree.]
$ LD_LIBRARY_PATH=/opt/swinst/netCDF/C/gnu-4.8.5/lib ../netcdf-fortran-4.5.3/configure --prefix=/opt/swinst/netCDF/fortran/gnu-4.8.5 ... checking for library containing dlopen... -ldl checking netcdf.h usability... yes checking netcdf.h presence... yes checking for netcdf.h... yes checking for library containing nc_open... -lnetcdf checking for nc_def_opaque... yes checking for nccreate... yes checking for nc_set_log_level... no checking for oc_open... yes checking for nc_def_var_szip... no configure: error: netcdf-c version 4.7.4 or greater is required [<- ERROR MESSAGE]
However, nm shows that the nc_def_var_szip symbol is there, and so is nc_set_log_level
nm ../../C/gnu-4.8.5/lib/libnetcdf.a |grep nc_def_var_szip 0000000000000216 T nc_def_var_szip nm ../../C/gnu-4.8.5/lib/libnetcdf.a |grep nc_set_log_level 00000000000021cd T nc_set_log_level
Am I missing something? Do I have to downgrade to netcdf-c-4.7.4 or 4.7.X?
Thank you, Gus Correa
If you run 'which ncdump', is anything returned? The only thing that makes sense is if there is another libnetcdf installed elsewhere on the system in one of the default library locations, and that that library is the one that the linker is finding. Is nc-config
available on your system?
Actually, what happens if you run the following?
$ CFLAGS="-I$(/opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --includedir)" LDFLAGS="-L$(/opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --libs)" ./configure --prefix=/opt/swinst/netCDF/fortran/gnu-4.8.5
If this fails, first check I didn't introduce a typo by copying by hand, and assuming there aren't any typos, what happens if you run the following?
$ /opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --all
Thank you for your answer.
Sure there is another boilerplate netcdf library installed from Linux packages. which ncdump outputs the boilerplate: /bin/ncdump It is pretty common to have two, even many different versions of the same library in a system, to handle different compilers, programs that require different library versions, etc.
However, I tried to direct configure not to use the boilerplate but the 4.8.0 using the recipe in the netcdf C 4.8.0 web page: https://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html and consists in setting the LD_LIBRARY_PATH to point to the alternative netcdf (4.8.0) library. That recipe clearly doesn't work.
Now, following your suggestion (with slightly different paths) here is what I nc-config from 4.8..0 outputs:
$/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --includedir /opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/include $/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --libs -L/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/lib -lnetcdf
Trying to compile with explicit CFLAGS and LDFLAGS as suggested:
CFLAGS="-I$(/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --includedir)" LDFLAGS="-L$(/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --libs)" ./configure --prefix=/opt/swinst/netCDF/fortran/4.5.3/gnu-4.8.5 ... checking for nc_set_log_level... no checking for oc_open... yes checking for nc_def_var_szip... no configure: error: netcdf-c version 4.7.4 or greater is required [<- Same error again.]
Oh, I presume I should use --libdir instead of --libs, to get just the directory path: $/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --libdir /opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/lib
So, trying again with --libdir:
$CFLAGS="-I$(/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config
--includedir)"
LDFLAGS="-L$(/opt/swinst/netCDF/C/4.8.0/gnu-4.8.5/bin/nc-config --libdir)"
./configure --prefix=/opt/swinst/netCDF/fortran/4.5.3/gnu-4.8.5
...
checking for nc_set_log_level... yes
checking for oc_open... yes
checking for nc_def_var_szip... yes [<- Passed the
previous point of failure!]
checking for nc_get_chunk_cache_ints... yes
checking netCDF logging present... yes
...
checking size of float... 0
checking size of double... 0
checking size of off_t... configure: error: in
/opt/swinst/netCDF/fortran/4.5.3/netcdf-fortran-4.5.3': configure: error: cannot compute sizeof (off_t) * [<- Unfortunately it hit another error.]* See
config.log' for more details
Is there a way to go across this other error?
Thank you, Gus Correa
On Thu, Jul 8, 2021 at 5:53 PM Ward Fisher @.***> wrote:
If you run 'which ncdump', is anything returned? The only thing that makes sense is if there is another libnetcdf installed elsewhere on the system in one of the default library locations, and that that library is the one that the linker is finding. Is nc-config available on your system?
Actually, what happens if you run the following?
$ CFLAGS="-I$(/opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --includedir)" LDFLAGS="-L$(/opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --libs)" ./configure --prefix=/opt/swinst/netCDF/fortran/gnu-4.8.5
If this fails, first check I didn't introduce a typo by copying by hand, and assuming there aren't any typos, what happens if you run the following?
$ /opt/swinst/netCDF/C/gnu-4.8.5/bin/nc-config --all
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/netcdf-fortran/issues/299#issuecomment-876770244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIZALXUZNE7QIQACCDQHB3TWYM5HANCNFSM5ABOPWOQ .
@gus-correa I believe I know what is going on here, can you attach the config.log
file generated so that I can confirm? I believe the issue is an empty environmental variable, but once I can confirm that that is what's happening, I can provide the appropriate fix. Thanks!
Thank you for your answer. Please find attached the config.log file.
On Fri, Jul 9, 2021 at 1:05 PM Ward Fisher @.***> wrote:
@gus-correa https://github.com/gus-correa I believe I know what is going on here, can you attach the config.log file generated so that I can confirm? I believe the issue is an empty environmental variable, but once I can confirm that that is what's happening, I can provide the appropriate fix. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Unidata/netcdf-fortran/issues/299#issuecomment-877329652, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIZALUYMC5DPFKJYJDINLLTW4T7NANCNFSM5ABOPWOQ .
@gus-correa Hi Gus, I'm not seeing the file attached to the github issue comment thread, can you confirm it was uploaded?
I attached config.log to the email, but GitHub doesn't seem to like it this way. Anyway, I am trying to upload it directly here. config.log
I encountered a similar error when attempting to build with gfortran 11 installed via a conda environment (such that libraries aren't necessarily in the default locations). A successful workaround was to add the directory where HDF is installed to LD_LIBRARY_PATH
, which I think means that CMAKE_PREFIX_PATH isn't being linked against within CMakeLists.txt.
On my ubuntu machine I uninstalled all the netcdf packages from apt and I got a new error, which led me here: https://github.com/Unidata/netcdf-fortran/issues/73 Once I follow that workaround, this error doesn't come up whether or not other netcdf packages are installed with apt. I think that this configure process will check LD_LIBRARY_PATH first and standard locations second, which effectively hides the real problem. Maybe there should be some warning or output like, "hey, we didn't find anything in LD_LIBRARY_PATH, we'll look elsewhere"
@gus-correa did you find this error solution? i am trying to install WRF 4.3 but netcdf fortran is not installing, giving same error.
@zexhan07 The following worked for me,
git clone [email protected]:Unidata/netcdf-fortran.git
cd netcdf-fortran
git checkout v4.5.3
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="$LIB_DIR" \
-DnetCDF_LIBRARIES="$LIB_DIR/lib/libnetcdf.so" \
-DnetCDF_INCLUDE_DIR="$LIB_DIR/include" \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=ON \
-DNC_EXTRA_DEPS=jpeg \
-DCMAKE_INSTALL_PREFIX="$LIB_DIR/netcdf-fortran" \
-G "Unix Makefiles" -Wno-dev ..
make
make test
make install
I see the conda-forge feedstock defines a few paths in the compilation flags and had to use LD_LIBRARY_PATH
before running their tests.
I still use configure when I build as a conda package and it works without these fiddles, but a conda-bld environment defines a lot of variables to stop my machine's native libraries leaking into the build.
Same error with netcdf-c-4.8.1
and netcdf-fortran-4.5.4
. I use ccmake 3.22.2
:
Found m4: /usr/bin/m4
Found netCDF CMake package: netCDF::netcdf
CMake Error at CMakeLists.txt:643 (message):
netcdf-c version 4.7.4 or greater is required
Configuring incomplete, errors occurred!
See also "/ifs/opt/src/netcdf-fortran-4.5.4/BUILD/CMakeFiles/CMakeOutput.log".
See also "/ifs/opt/src/netcdf-fortran-4.5.4/BUILD/CMakeFiles/CMakeError.log".
It found netCDF_DIR
:
BUILDNAME Linux-4.18.0-147.el8.x86_64-x86_64
BUILDNAME_PREFIX
BUILDNAME_SUFFIX
BUILD_BENCHMARKS ON
BUILD_SHARED_LIBS ON
BUILD_TESTING ON
CMAKE_BUILD_TYPE DEBUG
CMAKE_INSTALL_PREFIX /ifs/opt/netcdf-fortran/intel/2020/4.5.4
CTEST_MEMORYCHECK_COMMAND valgrind
ENABLE_LARGE_FILE_TESTS ON
ENABLE_PARALLEL_TESTS OFF
Fortran_INSTALL_MODDIR include
NC4F_M4 /usr/bin/m4
NC_DOT /usr/bin/dot
NF_M4 /usr/bin/m4
PACKAGE netcdf-fortran
TEST_WITH_VALGRIND OFF
TMP_BUILDNAME Linux-4.18.0-147.el8.x86_64-x86_64
UNAME /usr/bin/uname
netCDF_DIR /ifs/opt/netcdf/intel/2020/4.8.1/lib64/cmake/netCDF
nc-config --all
reports:
This netCDF 4.8.1 has been built with the following features:
--cc -> /ifs/opt/intel/2020/compilers_and_libraries_2020.4.304/linux/bin/intel64/icc
--cflags -> -I/ifs/opt/netcdf/intel/2020/4.8.1/include
--libs -> -L/ifs/opt/netcdf/intel/2020/4.8.1/lib64 -lnetcdf
--static -> -lhdf5_hl-shared -lhdf5-shared -lm -lszip -lcurl
--has-c++ -> no
--cxx ->
--has-c++4 -> no
--cxx4 ->
--has-fortran -> no
--has-dap -> yes
--has-dap2 -> yes
--has-dap4 -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> no
--has-logging -> no
--has-pnetcdf -> no
--has-szlib -> yes
--has-cdf5 -> yes
--has-parallel4 -> no
--has-parallel -> no
--has-nczarr -> yes
--prefix -> /ifs/opt/netcdf/intel/2020/4.8.1
--includedir -> /ifs/opt/netcdf/intel/2020/4.8.1/include
--libdir -> /ifs/opt/netcdf/intel/2020/4.8.1/lib64
--version -> netCDF 4.8.1
The CMakeError.log
file is attached.
CMakeError.log
(Correction) Trying to set netCDF_LIBRARIES
and netCDF_INCLUDE_DIR
in the command line did not work.
Setting CPPFLAGS
and LDFLAGS
appropriately for netcdf-c (using nc-config
), and then using the old ./configure ...
method works.
@prehensilecode which configuration or commands did you use? Would you share it here?
As for me, this problem was solved simply by setting the NETCDF variable in the environment. Do not forget to do it after compiling netcdf-c!
@prehensilecode which configuration or commands did you use? Would you share it here?
Sorry, it has been almost a year, so I don’t remember exactly.
I would look at the output of nc-config
, which shows the values:
-
--cflags -> -I/ifs/opt/netcdf/intel/2020/4.8.1/include
-
--libs -> -L/ifs/opt/netcdf/intel/2020/4.8.1/lib64 -lnetcdf
So, set
-
CPPFLAGS=-I/ifs/opt/netcdf/intel/2020/4.8.1/include
-
LDFLAGS="-L/ifs/opt/netcdf/intel/2020/4.8.1/lib64 -Wl,-rpath,/ifs/opt/netcdf/intel/2020/4.8.1/lib64 -lnetcdf"
Of course, adjust the paths to the output of your own installation of nc-config
.
OK, I cannot reproduce this error, except by deliberately linking to an older version of netcdf-c.
Are you sure you are setting LDFLAGS correctly to point to the lib directory of your netcdf-c install?
Hi, I have been working to try to install NetCDF-Fortran for WRF modeling needs. I believe I successfully installed NetCDF-C (did make test and it reported success). I followed all in the above and any from the internet I can possibly understand and try to run configure. The nearest successful configure created was using the following command: CFLAGS="-I$(/home/tes/WRF_libs/netcdf2/bin/nc-config --includedir)" LDFLAGS="-L$(/home/tes/WRF_libs/netcdf2/bin/nc-config --libdir --libs)" ./configure --prefix=/home/tes/WRF_libs/netcdf2 --disable-dependency-tracking --disable-shared
Also attached are: Makefile created using the above configuration setup and it's config.log files. When I do "make check", returns an error as: Makefile:317: *** missing separator. Stop. So, I opened the 'Makefile' and added a forward-slash, as in " " for lines above 317 (i.e. at end of line 316), 332, & 334 in the attached "Makefile". But after another 'make check', it returns the details below and even if I try to add tabs or forward-slash as per my readings, I am completely stuck here.
Making check in libsrc
make[1]: Entering directory /home/tes/WRF_libs/netcdf-fortran-4.6.0/libsrc' Makefile:200: *** missing separator. Stop. make[1]: Leaving directory
/home/tes/WRF_libs/netcdf-fortran-4.6.0/libsrc'
make: *** [check-recursive] Error 1
I use gcc/g++/gfortran v5.5.0 to compile my c/c++/gfortran programs in x86_64 GNU/Linux running on Scientific Linux 7.9 (Nitrogen) config.log Makefile.log
Thank you! Tes
OK, any time you are tempted to open up a Makefile and edit, just stop right there. That is never necessary.
So now you are getting through the configure for netcdf-fortran, but getting another problem? Please post here the entire output of the latest configure you have working.
Thanks, here are a couple configure execution outputs (I hope these are what you are looking for):
(1, when this command is used):
CFLAGS="-I$(/home/tes/WRF_libs/netcdf2/bin/nc-config --includedir)" LDFLAGS="-L$(/home/tes/WRF_libs/netcdf2/bin/nc-config --libdir --libs)" ./configure --prefix=/home/tes/WRF_libs/netcdf2 --disable-shared
===>
configure: netCDF-Fortran 4.6.0
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: checking user options
checking whether make supports the include directive... yes (GNU style)
checking for gcc... /usr/bin/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 the compiler supports GNU C... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to enable C11 features... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking dependency style of /usr/bin/gcc... gcc3
checking if netCDF was built with CDF5... yes
checking if netCDF was built with Zstandard compression... no
checking if netCDF was built with pnetcdf... no
checking if netCDF was built with HDF5 parallel I/O features... no
checking if netCDF was built with any parallel I/O features... no
checking if netCDF-fortran should be built with HDF5 parallel I/O features... no
checking if netCDF was built with support for szip writes... no
checking if netCDF was built with support for quantize... yes
checking for valgrind... no
checking whether parallel IO tests should be run... no
checking whether a user specified program to run mpi programs... mpiexec
checking whether netCDF documentation should be generated... no
checking for doxygen... doxygen
checking for dot... no
configure: WARNING: dot not found - will use simple charts in documentation
configure: finding C compiler
checking for gcc... (cached) /usr/bin/gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether /usr/bin/gcc accepts -g... (cached) yes
checking for /usr/bin/gcc option to enable C11 features... (cached) none needed
checking whether /usr/bin/gcc understands -c and -o together... (cached) yes
checking dependency style of /usr/bin/gcc... (cached) gcc3
checking for an ANSI C-conforming const... yes
checking for a sed that does not truncate output... /usr/bin/sed
configure: finding Fortran compiler
checking whether the compiler supports GNU Fortran... yes
checking whether /usr/bin/gfortran accepts -g... yes
checking whether the compiler supports GNU Fortran 77... yes
checking whether /usr/bin/gfortran accepts -g... yes
checking whether Fortran compiler is checked for ISO_C_BINDING support... yes
checking for Fortran flag to compile .f90 files... none
checking fortran 90 modules inclusion flag... -I
checking if Fortran compiler supports Fortran 2003 ISO_C_BINDING... yes
checking if Fortran compiler supports Fortran 2008 ISO_FORTRAN_ENV additions... yes
checking if Fortran compiler supports TS29113 standard extension... yes
checking if Fortran compiler supports allow-mismatch flag... no
checking if Fortran compiler supports mismatch_all flag... no
checking whether fortran type sizes should be checked... yes
checking whether large file (> 2GB) tests should be run... no
checking whether benchmarks should be run... yes
checking where to put large temp files if large file tests are run... .
configure: setting up libtool
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by /usr/bin/gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from /usr/bin/gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /usr/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/bin/gcc static flag -static works... no
checking if /usr/bin/gcc supports -c -o file.o... yes
checking if /usr/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for /usr/bin/gfortran option to produce PIC... -fPIC
checking if /usr/bin/gfortran PIC flag -fPIC works... yes
checking if /usr/bin/gfortran static flag -static works... no
checking if /usr/bin/gfortran supports -c -o file.o... yes
checking if /usr/bin/gfortran supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gfortran linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for /usr/bin/gfortran option to produce PIC... -fPIC
checking if /usr/bin/gfortran PIC flag -fPIC works... yes
checking if /usr/bin/gfortran static flag -static works... no
checking if /usr/bin/gfortran supports -c -o file.o... yes
checking if /usr/bin/gfortran supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gfortran linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: finding other utilities
configure: trying to set fortran flags for this platform
checking what FC is set to... /usr/bin/gfortran
checking for special C compiler options needed for large files... no
checking for FILE_OFFSET_BITS value needed for large files... no
checking for /usr/bin/nm... /usr/bin/nm -B
checking nm flags...
checking for C-equivalent to Fortran routine "SUB"... sub
checking for Fortran "byte"... yes
checking for Fortran "integer2"... yes
checking for Fortran "integer8"... yes
checking if Fortran "byte" is C "signed char"... yes
checking if Fortran "byte" is C "short"... no
checking if Fortran "byte" is C "int"... no
checking if Fortran "byte" is C "long"... no
checking if Fortran "integer2" is C "short"... yes
checking if Fortran "integer2" is C "int"... no
checking if Fortran "integer2" is C "long"... no
checking if Fortran "integer8" is C "short"... no
checking if Fortran "integer8" is C "int"... no
checking if Fortran "integer8" is C "long long"... yes
checking if Fortran "integer" is C "int"... yes
checking if Fortran "real" is C "float"... yes
checking if Fortran "doubleprecision" is C "double"... yes
checking for Fortran-equivalent to netCDF "byte"... byte
checking for Fortran-equivalent to netCDF "short"... integer*2
configure: checking types, headers, and functions
checking for floor in -lm... yes
checking for library containing dlopen... none required
checking for netcdf.h... yes
checking for library containing nc_open... -lnetcdf
checking for nc_def_opaque... yes
checking for nccreate... yes
checking for nc_set_log_level... yes
checking for oc_open... no
checking for nc_def_var_szip... yes
checking netCDF logging present... yes
checking netCDF v2 API present... yes
checking netCDF-4 present... no
checking whether to test the filter API... no
checking for stdlib.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/param.h... yes
checking for locale.h... yes
checking for stdio.h... (cached) yes
checking for stdarg.h... yes
checking for errno.h... yes
checking for ctype.h... yes
checking for fcntl.h... yes
checking for malloc.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for getopt.h... yes
checking for sys/time.h... (cached) yes
checking for sys/resource.h... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for egrep... (cached) /usr/bin/grep -E
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for vprintf... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for size_t... (cached) yes
checking for off_t... yes
checking for ssize_t... yes
checking for ptrdiff_t... yes
checking for uchar... no
checking for longlong... no
checking whether char is unsigned... no
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of float... 4
checking size of double... 8
checking size of off_t... 8
checking size of size_t... 8
checking size of ptrdiff_t... 8
configure: generating header files and makefiles
configure: WARNING: cache variable ac_cv_env_LDFLAGS_value contains a newline
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating nf-config
config.status: creating netcdf-fortran.pc
config.status: creating libnetcdff.settings
config.status: creating docs/Makefile
config.status: creating fortran/Makefile
config.status: creating nf_test/Makefile
config.status: creating nf_test4/Makefile
config.status: creating nf03_test/Makefile
config.status: creating nf03_test4/Makefile
config.status: creating CMakeExtras/Makefile
config.status: creating libsrc/Makefile
config.status: creating examples/Makefile
config.status: creating examples/F90/Makefile
config.status: creating examples/F77/Makefile
config.status: linking nf_test/ref_fills.nc to nf_test/fills.nc
config.status: executing depfiles commands
config.status: error: in /home/tes/WRF_libs/netcdf-fortran-4.6.0': config.status: error: Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See
config.log' for more details
configure: WARNING: cache variable ac_cv_env_LDFLAGS_value contains a newline
===<
(2, when '--disable-dependency-tracking is added from above last few lines):
CFLAGS="-I$(/home/tes/WRF_libs/netcdf2/bin/nc-config --includedir)" LDFLAGS="-L$(/home/tes/WRF_libs/netcdf2/bin/nc-config --libdir --libs)" ./configure --prefix=/home/tes/WRF_libs/netcdf2 --disable-dependency-tracking --disable-shared
===> Posted here starts from the 'error' down the final result, as the top above are all the same <=== config.status: executing depfiles commands config.status: executing libtool commands
NetCDF Fortran Configuration Summary
==============================
General
Library Version: 4.6.0 Configured On: Fri Apr 14 09:58:14 PDT 2023 Host System: x86_64-pc-linux-gnu Build Directory: /home/tes/WRF_libs/netcdf-fortran-4.6.0 Install Prefix: /home/tes/WRF_libs/netcdf2
Compiling Options
Fortran Compiler: /usr/bin/gfortran FFLAGS: -g -O2 LDFLAGS: -L/home/tes/WRF_libs/netcdf2/lib -L/home/tes/WRF_libs/netcdf2/lib -L/home/tes/WRF_libs/grib2/lib -lnetcdf -lm -ldl -lsz -lbz2 -lxml2 -lcurl -lnetcdf -lz C Compiler: /usr/bin/gcc CPPFLAGS: -I/home/tes/WRF_libs/netcdf2/include CFLAGS: -I/home/tes/WRF_libs/netcdf2/include -DLONGLONG_IS_LONG Shared Library: no Static Library: yes Extra libraries: -lnetcdf -lm
Features
F03: yes Dap Support: no Logging Support: yes NetCDF-2 API: yes NetCDF-4 API: no CDF5 Support: yes Parallel IO: no NetCDF4 Parallel IO: no PnetCDF Parallel IO: no SZIP Write Support: no Zstandard Support: no Quantize: yes configure: WARNING: cache variable ac_cv_env_LDFLAGS_value contains a newline ===< Thank you!
OK, now put up the full output of make check.
OK, now put up the full output of make check.
It's just a one-line report: [t.ghidey@aeolus netcdf-fortran-4.6.0]$ make check Makefile:317: *** missing separator. Stop. [t.ghidey@aeolus netcdf-fortran-4.6.0]$
Start again with a new unpacking of netcdf-fortran.
Thanks again! it is still the same. I have had this repeated zillion times, as in: [t.ghidey@aeolus WRF_libs]$ rm -r netcdf-fortran-4.6.0/ [t.ghidey@aeolus WRF_libs]$ ls netcdf-fortran-4.6.0 ls: cannot access netcdf-fortran-4.6.0: No such file or directory [t.ghidey@aeolus WRF_libs]$ tar xzf lib.gzfiles/netcdf-fortran-4.6.0.tar.gz [t.ghidey@aeolus WRF_libs]$ ls netcdf-fortran-4.6.0 acinclude.m4 configure fortran missing nf_test4 aclocal.m4 configure.ac install-sh netCDF-FortranConfig.cmake.in README.md CMakeExtras COPYRIGHT libnetcdff.settings.in netcdf-fortran.pc.in RELEASE_NOTES.md CMakeLists.txt CTestConfig.cmake.in libsrc nf03_test test-driver compile depcomp ltmain.sh nf03_test4 config.guess docs m4 nf-config.cmake.in config.h.cmake.in examples Makefile.am nf-config.in config.sub F03Interfaces_LICENSE Makefile.in nf_test [t.ghidey@aeolus WRF_libs]$ CFLAGS="-I$(/home/tes/WRF_libs/netcdf2/bin/nc-config --includedir)" LDFLAGS="-L$(/home/tes/WRF_libs/netcdf2/bin/nc-config --libdir --libs)" ./configure --prefix=/home/tes/WRF_libs/netcdf2 --disable-shared >& configure1.out
====> After reporting the bootstrapping issue, I added the Unidata recommended optimizer and results still the same as posted above earlier today <==== [t.ghidey@aeolus netcdf-fortran-4.6.0]$ vi configure1.out [t.ghidey@aeolus netcdf-fortran-4.6.0]$ CFLAGS="-I$(/home/tes/WRF_libs/netcdf2/bin/nc-config --includedir)" LDFLAGS="-L$(/home/tes/WRF_libs/netcdf2/bin/nc-config --libdir --libs)" ./configure --prefix=/home/tes/WRF_libs/netcdf2 --disable-dependency-tracking --disable-shared >& configure2.out [t.ghidey@aeolus netcdf-fortran-4.6.0]$ vi configure2.out [t.ghidey@aeolus netcdf-fortran-4.6.0]$ make check Makefile:317: *** missing separator. Stop. [t.ghidey@aeolus netcdf-fortran-4.6.0]$
Hi, I met another problem, when i compile netcdf-fortran-4.5.2 as wrf onLineTutorial suggested, Warning occurred: configure: WARNING: unrecognized options: --disable-dap, --disable-netcdf-4 that cause error when I try to compile WRF, I clean the environment, but I do have another version netcdf(4.1.3) in another file
Best Regards, config.log
--disable-dap
and --disable-netcdf-4
are options for the netcdf-c
library, not netcdf-fortran
. configure
for netcdf-fortran
should detect whether the C library was built with DAP and NETCDF4 automatically.