# M3Tools Error - Airs2m3

**URL:** <https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275>\
**Category:** I/O API\
**Created:** [July 29, 2023, 7:49pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275 "2023-07-29T19:49:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvs28](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nvs28](https://forum.cmascenter.org/u/nvs28)\
**Post date:** [July 29, 2023, 7:49pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/1 "2023-07-29T19:49:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 29, 2023, 7:58pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/2 "2023-07-29T19:58:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nvs28](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nvs28](https://forum.cmascenter.org/u/nvs28)\
**Post date:** [July 29, 2023, 8:09pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/3 "2023-07-29T20:09:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 29, 2023, 8:24pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/4 "2023-07-29T20:24:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nvs28](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nvs28](https://forum.cmascenter.org/u/nvs28)\
**Post date:** [July 29, 2023, 8:26pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/5 "2023-07-29T20:26:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nvs28](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nvs28](https://forum.cmascenter.org/u/nvs28)\
**Post date:** [July 29, 2023, 9:05pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/6 "2023-07-29T21:05:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 30, 2023, 11:15am UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/7 "2023-07-30T11:15:24Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![nvs28](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@nvs28](https://forum.cmascenter.org/u/nvs28)\
**Post date:** [July 31, 2023, 4:11pm UTC](https://forum.cmascenter.org/t/m3tools-error-airs2m3/4275/8 "2023-07-31T16:11:13Z")

</div>

Thank you, downgrading to version 4.4.1 worked.
