# Airs2m3 error 2 while compiling m3tool in IOAPI3.2

**URL:** https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126
**Category:** m3tools
**Created:** [March 20, 2022, 9:18pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126 "2022-03-20T21:18:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)
#### Post date: [March 20, 2022, 9:18pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/1 "2022-03-20T21:18:31Z")

</div>

Hi, I am trying to compile IOAPI 3.2 with ifort, and it succeeds when “make” under /ioapi, and there is libioapi.a under /Linux5\_x86\_64ifort.

My loaded modules include:  
intel/19.1.2.254 cray-hdf5/1.12.1.1 cray-netcdf/4.8.1.1

But when I tried to compile m3tool, it shows the attached air2m3 error message.  
I also attach Makefile in m3tool.

Thanks your time.

[log\_ifort.txt](https://forum.cmascenter.org/uploads/short-url/xREz1FX7JQ3WROLOuIukDDOqUHG.txt) (5.7 KB)  
[Makefile.txt](https://forum.cmascenter.org/uploads/short-url/j7NQ0x27Y3mE3QWbMdPyzRIGgzg.txt) (11.9 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: [March 20, 2022, 9:34pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/2 "2022-03-20T21:34:22Z")

</div>

See [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AVAIL.html#ncf4](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4):

> …NetCDF Version 4.x have lots of additional build options, that will require a complex set of additional libraries in your _Makefile_s 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`
> 
> or (depending upon netCDF version; don’t you love consistency and compatibility !?? )
> 
> `--disable-netcdf-4 --disable-dap`
> 
> 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_, since defining netCDF-4 causes netCDF to change parts of the netCDF-3 interface.

---

<div class="post-metadata">

### Author: ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)
#### Post date: [March 21, 2022, 4:35am UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/3 "2022-03-21T04:35:01Z")

</div>

Thanks for your time.

If I understand correctly, adding --disable-netcdf4 --disable-dap is in Makefile of NetCDF4 compilation. Is that right?

If so, I may not be able to solve it because NetCDF4 was not compiled on my personal computer but on the super computer (NERSC Cori). Should I connect with the helpdesk?

Also, I tried an alternative to compile with ftn, because in the previous Cori, ftn works.  
Still, ioapi compilation succeeds, but m3tools compiling still has the attached error message.  
[log\_ftn.txt](https://forum.cmascenter.org/uploads/short-url/rFv7zi7ztw48yQFN5Z2RGRKoiFQ.txt) (11.4 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: [March 21, 2022, 12:14pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/4 "2022-03-21T12:14:56Z")

</div>

> …add `-DIOAPI_NCF4=1` either to the `ARCHFLAGS` in your **I/O API** _Makeinclude.${BIN}_ or to the `DEFINEFLAGS` in your **I/O API** _Makefile_

---

<div class="post-metadata">

### Author: ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)
#### Post date: [March 21, 2022, 1:52pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/5 "2022-03-21T13:52:03Z")

</div>

Thanks for your reply, @cjcoats .

I tried the following 4 combinations for compiling ioapi/m3tools, but only ioapi succeeded. m3tools compilation still failed.

Under Linux5\_x86\_64ifort:  
(1) -DIOAPI\_NCF4=1 in _Makeinclude.Linux5\_x86\_64ifort_  
(2) activate -DIOAPI\_NCF4=1 in _Makefile_ without -DIOAPI\_NCF4=1 in _Makeinclude.Linux5\_x86\_64ifort_

Under Linux5\_x86\_64ftn:  
(3) -DIOAPI\_NCF4=1 in _Makeinclude.Linux5\_x86\_64ftn_  
(4) activate -DIOAPI\_NCF4=1 in _Makefile_ without -DIOAPI\_NCF4=1 in _Makeinclude.Linux5\_x86\_64ftn_

I attached the error message.  
[log\_ftn.txt](https://forum.cmascenter.org/uploads/short-url/l9ZZiogDSnFt70QDLu6nURWgtmw.txt) (9.4 KB)  
[log\_ifort.txt](https://forum.cmascenter.org/uploads/short-url/z866bMuWHCcWlILKwCTHqrXa7c6.txt) (4.2 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: [March 21, 2022, 2:59pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/6 "2022-03-21T14:59:44Z")

</div>

> [@cjcoats](#):
>
> …NetCDF Version 4.x have lots of additional build options, that will require a complex set of additional libraries in your _Makefile_ s and all other model-building systems.

Run the net CDF commands _ncconfig_ and _nfconfig_ to find out what extra libraries you will need. Then contact your system administrator for where to find these libraries.

Or else build your own netCDF (as most people do), following the I/O API recommendations.

And note that you need to build netCDF with the **same compiler** you use for everything else: for example, an _ifort/icc_ netCDF won’t necessarily work with a _gfortran/gcc_ I/O API and vice versa…

---

<div class="post-metadata">

### Author: ![ckuo6](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ckuo6](https://forum.cmascenter.org/u/ckuo6)
#### Post date: [March 29, 2022, 11:20pm UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/7 "2022-03-29T23:20:03Z")

</div>

Hi, @cjcoats

Some updates and one naive question.  
The system administrator suggests exporting CRAYPE\_LINK\_TYPE and LIBRARY\_PATH before the m3tool compilation.  
So I add the two command lines in m3tools/Makefile as follows:

export CRAYPE\_LINK\_TYPE=static  
export LIBRARY\_PATH=$LIBRARY\_PATH:/global/common/cori/usg/curl/7.50.1/hsw/lib

I attach the message. It seems there is no error but I am not sure.  
[log\_m3tools.txt](https://forum.cmascenter.org/uploads/short-url/etCRBEv7TiOSbxTcEoLiOrrUvdN.txt) (107.0 KB)

Can you give me a hint how to make sure I successfully compiled m3tools?

All files under /Linux5\_x86\_64ftn include

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/9/93f605a8d3620dee7ee38a337823460b51435391.png)

---

<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: [March 30, 2022, 11:01am UTC](https://forum.cmascenter.org/t/airs2m3-error-2-while-compiling-m3tool-in-ioapi3-2/3126/8 "2022-03-30T11:01:46Z")

</div>

See [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AVAIL.html#build](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#build)  
or  
[https://cjcoats.github.io/ioapi/AVAIL.html#build](https://cjcoats.github.io/ioapi/AVAIL.html#build):

> **Top-Level make targets include the following:**  
> …  
> **make test** (for I/O API 3.2 post-March 25, or I/O API 4.0)
> 
> > Subsequent to _make all_, the command make test from the installations `${BASEDIR}` runs a series of tests that ensures the I/O API and _m3tools_ programs are correctly installed, and demonstrate various I/O API capabilities…
