Hello everyone,
Disclaimer: I am completely inexperienced when it comes to software.
I am trying to install I/O API on my M1 mac, but I just can’t seem to compile it successfully. I have tried in the regular zsh and in rosetta. I think a big problem is I don’t know how to write the Makeinclude file for my machine type. I also am relying on GCC and gfortran, which I understand can be kind of fickle.
If anyone has successfully installed I/O API on a mac M1 and could walk me through it, I would really really appreciate it.
Here is the Makeinclude.OSX_x86_gfortran file that I tried:
VERSION “Id: Makeinclude.OSX_x86 100 2015-01-16 16:52:16Z coats ”
03/2016 by CJC for MAC OSX gfortran/gcc.
12/2013 by CJC: Conditional preprocessor-code “-DNEED_ARGS=1”
to implement IARGC() and GETARG() for compilers
(“gfortran” version 4.8 or later to be exact) that insist on
enforcing F2003-only with no backwards nor industry-standards compatibility.
Remove “-DNEED_ARGS=1” from ARCHFLAGS for gfortran-4.7.x and earlier
Use “-march=native -mtune=native” if compile-platform and compute-platform
are the same, for processor specific instruction-set and optimization.
Use “-Wall -Wsurprising” for full diagnostics.
AR = ar
CC = gcc -arch x86_64
FC = gfortran -arch x86_64
M4 = m4
CPP = cpp
LINK = gcc -arch x86_64
MODI = -I ## Module-include-directory command
E132 = -ffixed-line-length-132
MFLAGS = -ffast-math -funroll-loops -m64 -Wall -Wsurprising -march=x86-64 -mtune=generic
OMPFLAGS = -fopenmp
OMPLIBS = -fopenmp
COPTFLAGS = -O3 -fno-common {MFLAGS}
FOPTFLAGS = -O3 {MFLAGS}
FPPFLAGS = -DF90=1
FSFLAGS = -fno-automatic
ARCHFLAGS = -DF90=1 -DAUTO_ARRAYS=1 -DMACH=1 -DFLDMN=1 -DNEED_ARGS=1
PARFLAGS =
ARCHLIB =
M4DEFFILE =
PVMLIBS =
And the current error I get when I try to run make is something like this:
~/build/ioapi-3.2/ioapi/modncfio.F90:2323:58:
2323 | ISTAT = NF_GET_VARA_REAL( FID, VID, DIMS, DELS, GRID )
| 1
…
13424 | ISTAT = NF_GET_VARA_REAL( FID, VID, DIMS, DELS, GRID )
| 2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
make: *** [modncfio.o] Error 1