IOAPI 3.2 installtion error: undefined reference to `curl_easy_strerror'

Hello,

I am trying to install IOAPI3.2 using netcdf4.7.4 and pgi compiler. I have successfully installed ioapi which creates libioapi.a. Attached is Makeinclude file Makeinclude.Linux2_x86_64pg.txt (2.0 KB) where you can see i used

FOPTFLAGS = -O2 -V -Mnosecond_underscore
FPPFLAGS = -DF90=1
FSFLAGS = -Msave
ARCHFLAGS = -DFLDMN=1 -DAUTO_ARRAYS=1 -DF90=1 -DNDEBUG -DIOAPI_NCF4=1

But by using same settings when I tried install ‘m3tools’, I get the following error Makefile.txt (13.0 KB) :

[IqbalHossan@adeq m3tools]$ make

/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function reportobject': nc4hdf.c:(.text+0x4a9e): undefined reference to H5Iget_name’
nc4hdf.c:(.text+0x4b4a): undefined reference to H5Aget_name' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function reportopenobjectsT’:
nc4hdf.c:(.text+0x4c06): undefined reference to H5Fget_obj_count' nc4hdf.c:(.text+0x4c68): undefined reference to H5Fget_obj_ids’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function NC4_hdf5get_libversion': nc4hdf.c:(.text+0x4e79): undefined reference to H5get_libversion’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function NC4_hdf5get_superblock': nc4hdf.c:(.text+0x4ef5): undefined reference to H5Fget_create_plist’
nc4hdf.c:(.text+0x4f25): undefined reference to H5Pget_version' nc4hdf.c:(.text+0x4f54): undefined reference to H5Pclose’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function NC4_strict_att_exists': nc4hdf.c:(.text+0x5001): undefined reference to H5Aexists’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function NC4_walk': nc4hdf.c:(.text+0x5050): undefined reference to H5Gget_num_objs’
nc4hdf.c:(.text+0x508c): undefined reference to H5Gget_objname_by_idx' nc4hdf.c:(.text+0x50b6): undefined reference to H5Gget_objtype_by_idx’
nc4hdf.c:(.text+0x50e1): undefined reference to H5Gopen1' nc4hdf.c:(.text+0x5102): undefined reference to H5Gclose’
nc4hdf.c:(.text+0x514d): undefined reference to H5Dopen1' nc4hdf.c:(.text+0x515a): undefined reference to H5Aget_num_attrs’
nc4hdf.c:(.text+0x5175): undefined reference to H5Aopen_idx' nc4hdf.c:(.text+0x5194): undefined reference to H5Aget_name’
nc4hdf.c:(.text+0x51de): undefined reference to H5Aclose' nc4hdf.c:(.text+0x51f8): undefined reference to H5Dclose’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4hdf.o): In function NC4_hdf5_remove_filter': nc4hdf.c:(.text+0x5255): undefined reference to H5Dget_create_plist’
nc4hdf.c:(.text+0x527c): undefined reference to H5Premove_filter' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4info.o): In function NC4_read_ncproperties’:
nc4info.c:(.text+0x4d3): undefined reference to H5Aexists' nc4info.c:(.text+0x4ed): undefined reference to H5Aopen_name’
nc4info.c:(.text+0x51f): undefined reference to H5Aget_space' nc4info.c:(.text+0x52c): undefined reference to H5Aget_type’
nc4info.c:(.text+0x539): undefined reference to H5Tget_class' nc4info.c:(.text+0x558): undefined reference to H5Tget_size’
nc4info.c:(.text+0x5a2): undefined reference to H5Tget_native_type' nc4info.c:(.text+0x5c7): undefined reference to H5Aread’
nc4info.c:(.text+0x61f): undefined reference to H5Aclose' nc4info.c:(.text+0x63a): undefined reference to H5Sclose’
nc4info.c:(.text+0x655): undefined reference to H5Tclose' nc4info.c:(.text+0x670): undefined reference to H5Tclose’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4info.o): In function NC4_write_ncproperties': nc4info.c:(.text+0x715): undefined reference to H5Aexists’
nc4info.c:(.text+0x733): undefined reference to H5open' nc4info.c:(.text+0x73a): undefined reference to H5T_C_S1_g’
nc4info.c:(.text+0x743): undefined reference to H5Tcopy' nc4info.c:(.text+0x767): undefined reference to H5Tset_strpad’
nc4info.c:(.text+0x786): undefined reference to H5Tset_cset' nc4info.c:(.text+0x7ba): undefined reference to H5Tset_size’
nc4info.c:(.text+0x7d1): undefined reference to H5Screate' nc4info.c:(.text+0x800): undefined reference to H5Acreate1’
nc4info.c:(.text+0x828): undefined reference to H5Awrite' nc4info.c:(.text+0x844): undefined reference to H5Aclose’
nc4info.c:(.text+0x85f): undefined reference to H5Sclose' nc4info.c:(.text+0x87a): undefined reference to H5Tclose’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-nc4memcb.o): In function NC4_image_init': nc4memcb.c:(.text+0x834): undefined reference to H5open’
nc4memcb.c:(.text+0x83b): undefined reference to H5P_CLS_FILE_ACCESS_ID_g' nc4memcb.c:(.text+0x844): undefined reference to H5Pcreate’
nc4memcb.c:(.text+0x943): undefined reference to H5Pset_fapl_core' nc4memcb.c:(.text+0xa37): undefined reference to H5Pset_file_image_callbacks’
nc4memcb.c:(.text+0xa5c): undefined reference to H5Pset_file_image' nc4memcb.c:(.text+0xaae): undefined reference to H5check_version’
nc4memcb.c:(.text+0xad5): undefined reference to H5check_version' nc4memcb.c:(.text+0xaf2): undefined reference to H5check_version’
nc4memcb.c:(.text+0xb18): undefined reference to H5Fcreate' nc4memcb.c:(.text+0xb3a): undefined reference to H5Fopen’
nc4memcb.c:(.text+0xb76): undefined reference to H5Eauto_is_v2' nc4memcb.c:(.text+0xb9b): undefined reference to H5Eget_auto2’
nc4memcb.c:(.text+0xbaf): undefined reference to H5Eset_auto2' nc4memcb.c:(.text+0xbca): undefined reference to H5Eget_auto1’
nc4memcb.c:(.text+0xbd9): undefined reference to H5Eset_auto1' nc4memcb.c:(.text+0xbe9): undefined reference to H5Pclose’
nc4memcb.c:(.text+0xc0e): undefined reference to H5Eset_auto2' nc4memcb.c:(.text+0xc29): undefined reference to H5Eset_auto1’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-occurlfunctions.o): In function ocset_curlopt': occurlfunctions.c:(.text+0x6e): undefined reference to curl_easy_setopt’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-occurlfunctions.o): In function oc_curl_protocols': occurlfunctions.c:(.text+0xa54): undefined reference to curl_version_info’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ocdebug.o): In function ocreportcurlerror': ocdebug.c:(.text+0x1e3): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocfetchhttpcode': ochttp.c:(.text+0x31): undefined reference to curl_easy_getinfo’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocfetchurl_file': ochttp.c:(.text+0x8c): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0xb7): undefined reference to curl_easy_setopt' ochttp.c:(.text+0xdf): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x108): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x12f): undefined reference to curl_easy_perform’
ochttp.c:(.text+0x176): undefined reference to curl_easy_getinfo' ochttp.c:(.text+0x190): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocfetchurl': ochttp.c:(.text+0x1f8): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x223): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x24b): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x274): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x283): undefined reference to curl_easy_perform’
ochttp.c:(.text+0x296): undefined reference to curl_easy_strerror' ochttp.c:(.text+0x2ef): undefined reference to curl_easy_getinfo’
ochttp.c:(.text+0x34a): undefined reference to curl_easy_strerror' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function occurlopen’:
ochttp.c:(.text+0x549): undefined reference to curl_easy_init' ochttp.c:(.text+0x578): undefined reference to curl_easy_setopt’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function occurlclose': ochttp.c:(.text+0x5be): undefined reference to curl_easy_cleanup’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocfetchlastmodified': ochttp.c:(.text+0x5fc): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x625): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x643): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x661): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x67f): undefined reference to curl_easy_setopt’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o):ochttp.c:(.text+0x69d): more undefined references to curl_easy_setopt' follow /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocfetchlastmodified’:
ochttp.c:(.text+0x6ca): undefined reference to curl_easy_perform' ochttp.c:(.text+0x6f6): undefined reference to curl_easy_getinfo’
ochttp.c:(.text+0x710): undefined reference to curl_easy_strerror' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(liboc_la-ochttp.o): In function ocping’:
ochttp.c:(.text+0x792): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x7bb): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x7e4): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x80d): undefined reference to curl_easy_setopt’
ochttp.c:(.text+0x836): undefined reference to curl_easy_setopt' ochttp.c:(.text+0x88e): undefined reference to curl_easy_getinfo’
ochttp.c:(.text+0x8da): undefined reference to curl_easy_strerror' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdispatch_la-ddispatch.o): In function NCDISPATCH_initialize’:
ddispatch.c:(.text+0x346): undefined reference to curl_global_init' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdispatch_la-ddispatch.o): In function NCDISPATCH_finalize’:
ddispatch.c:(.text+0x374): undefined reference to curl_global_cleanup' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-hdf5attr.o): In function NC4_HDF5_rename_att’:
hdf5attr.c:(.text+0x5d2): undefined reference to H5Adelete' hdf5attr.c:(.text+0x624): undefined reference to H5Adelete’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-hdf5attr.o): In function NC4_HDF5_del_att': hdf5attr.c:(.text+0x89e): undefined reference to H5Adelete’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libnchdf5_la-hdf5create.o): In function nc4_create_file': hdf5create.c:(.text+0x21c): undefined reference to H5check_version’
hdf5create.c:(.text+0x243): undefined reference to H5check_version' hdf5create.c:(.text+0x260): undefined reference to H5check_version’
hdf5create.c:(.text+0x2c8): undefined reference to H5open' hdf5create.c:(.text+0x2cf): undefined reference to H5P_CLS_FILE_ACCESS_ID_g’
hdf5create.c:(.text+0x2d8): undefined reference to H5Pcreate' hdf5create.c:(.text+0x2fc): undefined reference to H5Pset_fclose_degree’
hdf5create.c:(.text+0x340): undefined reference to H5Pset_cache' hdf5create.c:(.text+0x364): undefined reference to H5Pset_libver_bounds’
hdf5create.c:(.text+0x379): undefined reference to H5open' hdf5create.c:(.text+0x380): undefined reference to H5P_CLS_FILE_CREATE_ID_g’
hdf5create.c:(.text+0x389): undefined reference to H5Pcreate' hdf5create.c:(.text+0x3ad): undefined reference to H5Pset_obj_track_times’
hdf5create.c:(.text+0x3cc): undefined reference to H5Pset_link_creation_order' hdf5create.c:(.text+0x3eb): undefined reference to H5Pset_attr_creation_order’
hdf5create.c:(.text+0x546): undefined reference to H5Pset_fapl_core' hdf5create.c:(.text+0x56b): undefined reference to H5Fcreate’
hdf5create.c:(.text+0x59e): undefined reference to H5Fcreate' hdf5create.c:(.text+0x5d3): undefined reference to H5Gopen2’
hdf5create.c:(.text+0x5f6): undefined reference to H5Pclose' hdf5create.c:(.text+0x604): undefined reference to H5Pclose’
hdf5create.c:(.text+0x650): undefined reference to H5Pclose' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_fetchhttpcode’:
d4http.c:(.text+0xc8): undefined reference to curl_easy_getinfo' d4http.c:(.text+0xe3): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_fetchurl_file': d4http.c:(.text+0x14d): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x17f): undefined reference to curl_easy_setopt' d4http.c:(.text+0x1ae): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x1de): undefined reference to curl_easy_setopt' d4http.c:(.text+0x208): undefined reference to curl_easy_perform’
d4http.c:(.text+0x25a): undefined reference to curl_easy_getinfo' d4http.c:(.text+0x281): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_fetchurl': d4http.c:(.text+0x2fe): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x32d): undefined reference to curl_easy_setopt' d4http.c:(.text+0x35d): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x384): undefined reference to curl_easy_setopt' d4http.c:(.text+0x3a8): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x3c2): undefined reference to curl_easy_perform' d4http.c:(.text+0x3d5): undefined reference to curl_easy_strerror’
d4http.c:(.text+0x435): undefined reference to curl_easy_getinfo' d4http.c:(.text+0x496): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_curlopen': d4http.c:(.text+0x693): undefined reference to curl_easy_init’
d4http.c:(.text+0x6c9): undefined reference to curl_easy_setopt' d4http.c:(.text+0x6fb): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_curlclose': d4http.c:(.text+0x745): undefined reference to curl_easy_cleanup’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_fetchlastmodified': d4http.c:(.text+0x78a): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x7ba): undefined reference to curl_easy_setopt' d4http.c:(.text+0x7df): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x804): undefined reference to curl_easy_setopt' d4http.c:(.text+0x829): undefined reference to curl_easy_setopt’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o):d4http.c:(.text+0x84e): more undefined references to curl_easy_setopt' follow /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_fetchlastmodified’:
d4http.c:(.text+0x882): undefined reference to curl_easy_perform' d4http.c:(.text+0x8b5): undefined reference to curl_easy_getinfo’
d4http.c:(.text+0x8d5): undefined reference to curl_easy_strerror' /home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4http.o): In function NCD4_ping’:
d4http.c:(.text+0x969): undefined reference to curl_easy_setopt' d4http.c:(.text+0x999): undefined reference to curl_easy_setopt’
d4http.c:(.text+0x9c9): undefined reference to curl_easy_setopt' d4http.c:(.text+0x9f9): undefined reference to curl_easy_setopt’
d4http.c:(.text+0xa58): undefined reference to curl_easy_getinfo' d4http.c:(.text+0xaa4): undefined reference to curl_easy_strerror’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4curlfunctions.o): In function set_curlopt': d4curlfunctions.c:(.text+0x104): undefined reference to curl_easy_setopt’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4curlfunctions.o): In function NCD4_curl_protocols': d4curlfunctions.c:(.text+0xa6e): undefined reference to curl_version_info’
/home/IqbalHossan/Documents/SMOKE/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdf.a(libdap4_la-d4curlfunctions.o): In function NCD4_reportcurlerror': d4curlfunctions.c:(.text+0xcde): undefined reference to curl_easy_strerror’
make: *** [airs2m3] Error 2

Where did you get your netCDF libraries? And why did you not follow the I/O API Build Instructions? https://cjcoats.github.io/ioapi/AVAIL.html#build

Acquire and build the netCDF library, libnetcdf.a (and libnetcdff.a for netCDF-4.1 or later), for each configuration. …See NOTES on netCDF-4 for configuring netCDF-4.

and https://cjcoats.github.io/ioapi/AVAIL.html#ncf4

NetCDF Version 4.x have lots of additional build options, that will require a complex set of additional libraries in your Makefiles and all other model-building systems. It is recommended that you disable these options by adding the command-line flags below to your netCDF configure command:

–disable-netcdf4 --disable-dap

…If you don’t build netCDF as indicated above, you will need additional libraries that may be discovered by running the netCDF commands

nc-config --libs
nf-config --libs

1 Like

Hello @cjcoats,

Thank you for your response. since I did not add
–disable-netcdf4 --disable-dap in my NetCDF building, I added [[[ according to Availability/Download of the BAMS/Models-3 I/O API If you build netCDF-4 without the --disable-netcdf4 , you will also need to add -DIOAPI_NCF4=1 either to the ARCHFLAGS in your Makeinclude.${BIN} or to the DEFINEFLAGS in your Makefile ]]]

-DIOAPI_NCF4=1 to the ARCHFLAGS in the Makeinclude.Linux2_x86_64pg file.

I am not sure If I understand the above mention line regarding DIOAPI_NCF4=1 option.

I greatly appreciate your help. Thanks in advance

netCDF4-with-HDF has INTEGER*8 operations; without HDF, it does not. -DIOAPI_NCF4=1 handles that situation – the I/O API needs to be able to work (i.e., compile and link) both with and without the INTEGER*8 ops…

Okay, One more question:

From the link: Availability/Download of the BAMS/Models-3 I/O API
It says " If you don’t build netCDF as indicated above, you will need additional libraries that may be discovered by running the netCDF commands

nc-config --libs
nf-config --libs 

"

My nc-config --libs and nf-config --libs are below:

[IqbalHossan@adeq soft]$ nc-config --libs
-L/usr/local/netcdf-4.7.4/lib -lnetcdf

[IqbalHossan@adeq soft]$ nf-config --libs
unknown option: --libs
Usage: nf-config [OPTION]

Available values for OPTION include:

–help display this help message and exit
–all display all options
–cc C compiler
–fc Fortran compiler
–cflags pre-processor and compiler flags
–fflags flags needed to compile a Fortran program
–has-dap whether OPeNDAP is enabled in this build
–has-nc2 whether NetCDF-2 API is enabled
–has-nc4 whether NetCDF-4/HDF-5 is enabled in this build
–has-f90 whether Fortran 90 API is enabled in this build
–has-f03 whether Fortran 2003 API is enabled in this build
–flibs libraries needed to link a Fortran program
–prefix Install prefix
–includedir Include directory
–version Library version

For the nf-config --libs, it is giving me ‘unknown option’ error. What does that mean?

Thank you

So, as your suggestion I have tried to built netcdf4.7.4 with --disable-dap option

./configure --disable-netcdf4 --disable-dap --prefix=/home/IqbalHossan/Documents/soft/netcdf-4.7.4

After that, the built was successful but when I do
nf-config --libs

It’s giving me same error as mentioned in previous comment

[IqbalHossan@adeq soft] nc-config --libs -L/home/IqbalHossan/Documents/soft/netcdf-4.7.4/lib -lnetcdf [IqbalHossan@adeq soft] nf-config --libs
unknown option: --libs
Usage: nf-config [OPTION]

Available values for OPTION include:

–help display this help message and exit
–all display all options
–cc C compiler
–fc Fortran compiler
–cflags pre-processor and compiler flags
–fflags flags needed to compile a Fortran program
–has-dap whether OPeNDAP is enabled in this build
–has-nc2 whether NetCDF-2 API is enabled
–has-nc4 whether NetCDF-4/HDF-5 is enabled in this build
–has-f90 whether Fortran 90 API is enabled in this build
–has-f03 whether Fortran 2003 API is enabled in this build
–flibs libraries needed to link a Fortran program
–prefix Install prefix
–includedir Include directory
–version Library version

Here is the list file generated for netcdf4.7.4

[IqbalHossan@adeq soft] cd netcdf-4.7.4/ [IqbalHossan@adeq netcdf-4.7.4] ls
bin include lib share
[IqbalHossan@adeq netcdf-4.7.4] cd lib/ [IqbalHossan@adeq lib] ls
libnetcdf.a libnetcdff.so libnetcdf.settings pkgconfig
libnetcdff.a libnetcdff.so.7 libnetcdf.so
libnetcdff.la libnetcdff.so.7.0.0 libnetcdf.so.18
libnetcdff.settings libnetcdf.la libnetcdf.so.18.0.0

Then I tried to build IOAPI 3.2 , I was able to compile ioapi but when I try to compile m3tools, I get this error:

cd /home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg; pgf90 airs2m3.o -L/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg -lioapi -lnetcdff -lnetcdf -o airs2m3
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_var1io.o): In function nf_get_var1_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_var1io.F90:784: multiple definition of nf_get_var1_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19686: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_var1io.o): In function nf_put_var1_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_var1io.F90:354: multiple definition of nf_put_var1_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19677: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_varaio.o): In function nf_get_vara_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_varaio.F90:955: multiple definition of nf_get_vara_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19704: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_varaio.o): In function nf_put_vara_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_varaio.F90:440: multiple definition of nf_put_vara_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19695: first defined here
make: *** [airs2m3] Error 2

Please help

OK, it looks like they’ve changed the --libs to --flibs. Don’t you love software-compatibility? ;-(

1 Like

Okay,
Here is the output Screenshot from 2021-03-25 11-37-05

But when I tried to use this libnetcdf.a libnetcdff.a in the IOAPI3.2 for m3tools compilation, (makefile for the m3tools Makefile.txt (13.0 KB)
I get the following errors:
cd /home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg; pgf90 airs2m3.o -L/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg -lioapi -lnetcdff -lnetcdf -o airs2m3
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_var1io.o): In function nf_get_var1_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_var1io.F90:784: multiple definition of nf_get_var1_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19686: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_var1io.o): In function nf_put_var1_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_var1io.F90:354: multiple definition of nf_put_var1_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19677: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_varaio.o): In function nf_get_vara_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_varaio.F90:955: multiple definition of nf_get_vara_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19704: first defined here
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libnetcdff.a(nf_varaio.o): In function nf_put_vara_int64_': /home/IqbalHossan/Documents/software/netcdf-fortran-4.5.3/fortran/nf_varaio.F90:440: multiple definition of nf_put_vara_int64_’
/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/Linux2_x86_64pg/libioapi.a(modncfio.o):/home/IqbalHossan/Documents/soft/ioapi-3.2-20200828/ioapi/modncfio.F90:19695: first defined here
make: *** [airs2m3] Error 2

Would you please help me with that?
Thanks

Your libnetcdff.a seems to have nf_put_vara_int64_, so you do not need the “dummy” placeholder-definition of that routine in MODULE MODNCFIO.

Add -DIOAPI_NCF4=1 to the compile flags, then make clean; make for the I/O API so that the dummy placeholder will not be enabled…

2 Likes

Thank you so much @cjcoats , it works