M3Tools Error - Airs2m3

Hi,

I am getting the following error while trying to compile ioapi and m3tools using ifort and netcdf. Netcdf was compiled with --disable-netcdf4 --disable-dap.

I have also updated Archflags with DIOAPI_NCF4=1. The error is shown below. I would appreciate any tips/guidance on resolving the issue. Thank you!

cd /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort; ifort -auto -warn notruncated_source -Bstatic -static-intel -DIOAPI_NCF4=1 airs2m3.o -L/home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort -lioapi -lnetcdff -lnetcdf -qopenmp -qopenmp-link=static -shared-intel -Bstatic -o airs2m3
ifort: command line warning #10121: overriding ‘-static-intel’ with ‘-shared-intel’
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-ddispatch.o): in function NCDISPATCH_finalize': ddispatch.c:(.text+0x7): undefined reference to curl_global_cleanup’
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-ddispatch.o): in function NCDISPATCH_initialize': ddispatch.c:(.text+0x14e): undefined reference to curl_global_init’
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_read': dhttp.c:(.text+0x8f): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0xa3): undefined reference to curl_easy_perform' ld: dhttp.c:(.text+0xbe): undefined reference to curl_easy_getinfo’
ld: dhttp.c:(.text+0xd2): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x109): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x139): undefined reference to curl_easy_strerror' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function setupconn’:
dhttp.c:(.text+0x1a2): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x1c3): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x1e4): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x205): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x226): undefined reference to curl_easy_setopt' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o):dhttp.c:(.text+0x269): more undefined references to curl_easy_setopt’ follow
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function setupconn': dhttp.c:(.text+0x41b): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x44b): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x479): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x4a8): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x4d7): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x510): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x52a): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x53e): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x56d): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x598): undefined reference to curl_easy_strerror' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_set_method’:
dhttp.c:(.text+0x626): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x648): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x65d): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x67e): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x69b): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x6c5): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x6fe): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x70e): undefined reference to curl_easy_strerror’
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_reset': dhttp.c:(.text+0x75a): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x778): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x796): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x7b4): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x7cf): undefined reference to curl_easy_setopt’
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o):dhttp.c:(.text+0x7f8): more undefined references to curl_easy_setopt' follow ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_reset’:
dhttp.c:(.text+0x8af): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x8e1): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x90d): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x93c): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0x96b): undefined reference to curl_easy_strerror' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o):dhttp.c:(.text+0x99a): more undefined references to curl_easy_strerror’ follow
ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_write': dhttp.c:(.text+0xac7): undefined reference to curl_easy_perform’
ld: dhttp.c:(.text+0xae3): undefined reference to curl_easy_getinfo' ld: dhttp.c:(.text+0xb03): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0xb37): undefined reference to curl_easy_strerror' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_size’:
dhttp.c:(.text+0xc49): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0xc66): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0xc81): undefined reference to curl_easy_perform' ld: dhttp.c:(.text+0xc9f): undefined reference to curl_easy_getinfo’
ld: dhttp.c:(.text+0xce9): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0xd07): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0xd5e): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0xd8d): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0xdf4): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0xe29): undefined reference to curl_easy_strerror’
ld: dhttp.c:(.text+0xe5b): undefined reference to curl_easy_strerror' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_close’:
dhttp.c:(.text+0x1283): undefined reference to curl_easy_cleanup' ld: /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a(libdispatch_la-dhttp.o): in function nc_http_init_verbose’:
dhttp.c:(.text+0x179c): undefined reference to curl_easy_init' ld: dhttp.c:(.text+0x17bf): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x17ff): undefined reference to curl_easy_setopt' ld: dhttp.c:(.text+0x181e): undefined reference to curl_easy_setopt’
ld: dhttp.c:(.text+0x182e): undefined reference to curl_easy_strerror' ld: dhttp.c:(.text+0x185e): undefined reference to curl_easy_strerror’
make[1]: *** [Makefile:248: airs2m3] Error 1
make[1]: Leaving directory ‘/home/camxsvc/libraries/ioapi3.2/m3tools’
make: *** [Makefile:205: all] Error 2

Look at the results of the command
nm /home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a | grep curl
For a correctly --disable-netcdf4 --disable-dap netCDF build, this grep should return empty. Otherwise, either re-build netCDF until it does, or else run your netCDF- build’s ncconfig --libs and nfconfig --flibs to find out what extra libraries you need to add to all program-builds using this netCDF library-set.

Hi,

Thank you for prompt response. I am getting the following message. Looks like I will have to reinstall netcdf, correct? Do you have recommendations on any flags I should be using while compiling netcdf.
camxsvc@USWS211DCAMLA02:~/libraries/ioapi3.2$ nm home/camxsvc/libraries/ioapi3.2/Linux2_x86_64ifort/libnetcdf.a | grep curl
U curl_global_cleanup
U curl_global_init
U curl_easy_cleanup
U curl_easy_getinfo
U curl_easy_init
U curl_easy_perform
U curl_easy_setopt
U curl_easy_strerror

In the process for building your netCDF-C and netCDF-Fortran:

First, do a make distclean to ensure that none of the “old” build remains.
Then do configure --help to find out what the options are, and then choose the most “vanilla” – that leaves out DAP and CURL, particularly.
Then configure <options>; make; make test accordingly

Thank you, I will try it now and keep you posted.

Hi,

I tried several configure options and each one of them shows “-lcurl” option (see below). Am I missing something here?

  1. –disable-dap --disable-hdf5
  2. –disable-dap --disable-hdf5 --disable-netcdf-4
  3. –disable-dap --disable-netcdf4

Compiling Options


C Compiler: /home/camxsvc/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/icc
CFLAGS: -fno-strict-aliasing
CPPFLAGS:
LDFLAGS:
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library: yes
Static Library: yes
Extra libraries: -lm -lsz -lxml2 -lcurl
XML Parser: libxml2

Thank you!

Which version of netCDF.

As a workaround, you may need to back off to an earlier netCDF version. 4.4.1 works with the disable-dap --disable-netcdf4

Thank you, downgrading to version 4.4.1 worked.