Compiliation of CRYSTAL 17 on Apple Silicon
-
Dear All,
I'm looking at upgrading to crystal23 but in the meantime has anyone had success in compiling from objects on an apple silicon system? I was thinking of using brew installed openmpi.
Does anyone have a suitable include file?
Jack
-
Hi Jack,
compiling from objects on Apple Silicon is possible, but there are two critical requirements:-
You must use OpenMPI built with the same GNU Fortran version used to compile the object files (in particular gfortran 12.1)
-
You must use the MPI compiler wrappers (mpif90, mpicc, mpicxx) instead of the plain compilers for the final linking stage
The default include file is almost correct. The only necessary changes are the compiler definitions. Replace the first lines with:
F90 = mpif90 LD = $(F90) PLD = mpif90Keep the rest unchanged.
Important notes
The OpenMPI you use must be built against gfortran 12.1. You can check with:
mpif90 --showor
mpif90 --versionand verify that it points to gfortran-12.
Do not mix different GNU Fortran versions (e.g. gfortran 13 or Apple clang).
A mismatch here is the most common cause of runtime failures. -