Skip to content

Commit

Permalink
Tested Sonoma configuration on apple M3
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloprf committed Mar 13, 2024
1 parent 8d3084e commit 93ce7bd
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
51 changes: 51 additions & 0 deletions platform/build/make.inc.OSX_SONOMA_M3
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#---------------------------------------------------
#
# brew installation instructions on OSX Sonoma,
# tested on a brand new M3 Max chip. PRF
#
# 1) install brew if not there yet
# 2) Install compilers and packages:
# brew install gfortran
# brew install open-mpi
# brew install fftw
# brew install netcdf
# brew install netcdf-fortran
# 3) if using python3, make sure python is understood:
# ln -s -f /usr/local/bin/python3 /usr/local/bin/python
#
#---------------------------------------------------

# Compilers and flags

FC = mpif90 -I$(GACODE_ROOT)/modules -J$(GACODE_ROOT)/modules -fPIC -framework Accelerate
F77 = mpif77 -std=legacy
CC = ${FC}

GOMPTEST := $(shell ${CC} -v 2>&1 | grep " version " | grep gcc >/dev/null; echo $$?)
ifeq ($(GOMPTEST),0)
FOMP =-fopenmp
endif

FMATH =-fdefault-real-8 -fdefault-double-8
FOPT =-O3
FDEBUG =-Wall -fcheck=all -ffpe-trap=invalid,zero,overflow -g -fbacktrace
F2PY = f2py

# System math libraries

LMATH = /opt/homebrew/lib/libfftw3.a
FFTW_INC = /opt/homebrew/include

ifdef FANN_ROOT
# neural net libraries
NN_LIB=-L$(GACODE_ROOT)/../neural/ -I$(GACODE_ROOT)/../neural/ -lbrainfuse -lfann
endif

# NetCDF libraries

NETCDF = -L/opt/homebrew/lib -lnetcdff -L/opt/homebrew/lib -Wl,-headerpad_max_install_names -lnetcdf
NETCDF_INC = /opt/homebrew/lib

# Archive

ARCH = ar cr
18 changes: 18 additions & 0 deletions platform/exec/exec.OSX_SONOMA_M3
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# GACODE Parallel execution script (OSX_MONTEREY)
#
# NOTES:
# Used openmpi, so use mpirun rather than mpiexec

simdir=${1}
nmpi=${2}
exec=${3}
nomp=${4}
numa=${5}
mpinuma=${6}

echo $simdir

cd $simdir
export OMP_NUM_THREADS=$nomp
mpirun -np $nmpi $exec

0 comments on commit 93ce7bd

Please sign in to comment.