# Errors compiling m3tools

**URL:** <https://forum.cmascenter.org/t/errors-compiling-m3tools/5051>\
**Category:** m3tools\
**Created:** [July 3, 2024, 11:22am UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051 "2024-07-03T11:22:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmichals](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gmichals](https://forum.cmascenter.org/u/gmichals)\
**Post date:** [July 3, 2024, 11:22am UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/1 "2024-07-03T11:22:00Z")

</div>

Trying to compile ioapi3.2 on cluster running two 64-core AMD Epyc “Milan” processors. Im using Intel compiler and admin. installed netCDF C and netCDF fortran also compiled with intel (and curl and MPI) with netCDF4. Following the CMAS install instructions I used DEFINEFLAGS = -DIOAPI\_NCF4=1 (since netCDF4 was not disabled) and comment out OMPFLAGS = #-qopenmp, OMPLIBS = #-qopenmp in Makeinclude.Linux2\_x86\_64ifort.

ioapi looks to compile fine, but error chain pops up once m3tools starts to compile. I read and tried the fixes for the same problem to no avail. ChatGPT says the error are do to a linkage problem with netCDF, but all AI suggested fixes failed

Partial make.log when the trouble starts

make[1]: Leaving directory ‘/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/ioapi’  
(cd /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/m3tools ; make BIN=Linux2\_x86\_64ifort all)  
make[1]: Entering directory ‘/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/m3tools’  
cd /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort; ifort -auto -warn notruncated\_source /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort/airs2m3.o -L/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort -lioapi “`nf-config --flibs` `nc-config --libs`” -o airs2m3  
/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort/libioapi.a(init3.o): In function `init3_': init3.F90:(.text+0x6a): undefined reference to `nf\_inq\_libvers\_’  
/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort/libioapi.a(open3.o): In function `open3_': open3.F90:(.text+0xc01): undefined reference to `nf\_close\_’  
/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort/libioapi.a(opnfil3.o): In function `opnfil3_': opnfil3.F90:(.text+0xb0): undefined reference to `nf\_open\_’  
opnfil3.F90:(.text+0xe9): undefined reference to `nf_get_att_int_' opnfil3.F90:(.text+0x117): undefined reference to `nf\_get\_att\_int\_’  
opnfil3.F90:(.text+0x16a): undefined reference to `nf_get_att_int_' opnfil3.F90:(.text+0x198): undefined reference to `nf\_get\_att\_int\_’  
opnfil3.F90:(.text+0x1c6): undefined reference to `nf_get_att_int_' /depot/gmichals/apps/Greg_CMAQ/ioapi-3.2/Linux2_x86_64ifort/libioapi.a(opnfil3.o):opnfil3.F90:(.text+0x1f4): more undefined references to `nf\_get\_att\_int\_’ follow

---

<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 3, 2024, 11:35am UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/2 "2024-07-03T11:35:28Z")

</div>

> [@gmichals](#):
>
> cd /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort; ifort -auto -warn notruncated\_source /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort/airs2m3.o -L/depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/Linux2\_x86\_64ifort -lioapi “`nf-config --flibs` `nc-config --libs`” -o airs2m3

Are _nf-config_ and _nc-config_ in your `PATH`? (They need to be – or else do these commands “by hand” and put in the results here.).

And where did the double-quote come from? This needs to be a back-quote. Or else the result of this pair of commands

---

<div class="post-metadata">

**Author:** ![gmichals](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gmichals](https://forum.cmascenter.org/u/gmichals)\
**Post date:** [July 3, 2024, 12:06pm UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/3 "2024-07-03T12:06:45Z")

</div>

yes they are in my path. even tried explicit paths in the Makefile

include /depot/gmichals/apps/Greg\_CMAQ/ioapi-3.2/ioapi/Makeinclude.${BIN}

# Manually setting NetCDF paths and libraries

NETCDF\_C\_LIB\_DIR = /apps/spack/negishi/apps/netcdf-c/4.9.0-intel-19.1.3-lnodl34/lib  
NETCDF\_FORTRAN\_LIB\_DIR = /apps/spack/negishi/apps/netcdf-fortran/4.6.0-intel-19.1.3-lxhp25h/lib  
NETCDF\_INCLUDE\_DIR = /apps/spack/negishi/apps/netcdf-c/4.9.0-intel-19.1.3-lnodl34/include

# Setting CURL library path

CURL\_LIB\_DIR = /apps/spack/negishi/apps/curl/7.85.0-gcc-8.5.0-xsntqgd/lib

# Set environment variables

export CRAYPE\_LINK\_TYPE=static  
export LIBRARY\_PATH=$$LIBRARY\_PATH:$(CURL\_LIB\_DIR)

# Compiler flags

FFLAGS = -I$(IODIR) -I$(NETCDF\_INCLUDE\_DIR) {MODI} (OBJDIR) -DIOAPI\_NCF4 (ARCHFLAGS) (PARFLAGS) (FOPTFLAGS) (ARCHFLAGS)  
LDFLAGS = -I$(IODIR) (DEFINEFLAGS) (ARCHFLAGS)

# Libraries to link

LIBS = -L${OBJDIR} -L$(NETCDF\_C\_LIB\_DIR) -L$(NETCDF\_FORTRAN\_LIB\_DIR) -lioapi -lnetcdff -lnetcdf -lm (OMPLIBS) (ARCHLIB) $(ARCHLIBS)

VPATH = ${OBJDIR}

---

<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 3, 2024, 12:11pm UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/4 "2024-07-03T12:11:10Z")

</div>

So what does that **entire line that generates the error** look like ??

---

<div class="post-metadata">

**Author:** ![gmichals](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gmichals](https://forum.cmascenter.org/u/gmichals)\
**Post date:** [July 3, 2024, 12:25pm UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/5 "2024-07-03T12:25:25Z")

</div>

full make log  
[logfile.txt](https://forum.cmascenter.org/uploads/short-url/sFqslVClvKhhFHKrzgdsZICy0it.txt) (39.7 KB)

---

<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 3, 2024, 12:28pm UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/6 "2024-07-03T12:28:05Z")

</div>

I repeat: why those damned double-quotes ???

---

<div class="post-metadata">

**Author:** ![gmichals](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@gmichals](https://forum.cmascenter.org/u/gmichals)\
**Post date:** [July 3, 2024, 12:56pm UTC](https://forum.cmascenter.org/t/errors-compiling-m3tools/5051/7 "2024-07-03T12:56:55Z")

</div>

Found them in the ioapi3.2 Makefile not in m3tools Makefile looks to have been the problem! Thanks ive come to loathe the plethora of Makefiles, Makefile.seds over the past 3 days!
