Skip to content

Commit

Permalink
Added config files adapted to Brew libraries for MacOS (#432)
Browse files Browse the repository at this point in the history
Co-authored-by: Antonello Zito <[email protected]>
  • Loading branch information
antonellozito and Antonello Zito authored Jan 7, 2025
1 parent 6fb223e commit b6cbb86
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions platform/build/make.inc.GFORTRAN_OSX_BREW
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#---------------------------------------------------
# OSX,gfortran+openmpi from Homebrew
#
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# brew install gcc open-mpi netcdf netcdf-fortran fftw
#---------------------------------------------------

IDENTITY="OSX gfortran+openmpi from Homebrew"

MAKE = make

MF90 = mpif90

# Compilers and flags

FC = ${MF90} -std=f2008 -fall-intrinsics -I$(FFTW_INC) -I$(GACODE_ROOT)/modules -J$(GACODE_ROOT)/modules -I/opt/local/include -fPIC
F77 = ${MF90} -w -fallow-argument-mismatch

FOMP = -fopenmp
FMATH = -fdefault-real-8 -fdefault-double-8
FOPT = -O3 -m64 -framework Accelerate
FDEBUG = -Wall -g -fcheck=all -fbacktrace -fbounds-check -O0 -Wextra -finit-real=nan -Wunderflow -ffpe-trap=invalid,zero,overflow
#F2PY = f2py-2.7

# System libraries

LMATH = -L$(BREW_LIB) -lfftw3
NETCDF = -L$(BREW_LIB) -lnetcdff -lnetcdf

# Archive

ARCH = ar cr

ifdef FANN_ROOT
# neural net libraries
NN_LIB=-L$(GACODE_ROOT)/../neural/ -I$(GACODE_ROOT)/../neural/ -lbrainfuse -lfann
endif
6 changes: 6 additions & 0 deletions platform/env/env.GFORTRAN_OSX_BREW
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

export BREW_LIB=$(brew --prefix)/lib
export LD_LIBRARY_PATH=$(brew --prefix)/lib:$LD_LIBRARY_PATH
export FFTW_INC=$(brew --prefix fftw)/include
export NETCDF_INC=$(brew --prefix netcdf)/include
17 changes: 17 additions & 0 deletions platform/exec/exec.GFORTRAN_OSX_BREW
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# GACODE Parallel execution script (GFORTRAN_OSX_MACPORTS)
#
# NOTES:
# Used mpich2-1.0.3, 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 ; mpiexec --oversubscribe -np $nmpi $exec

0 comments on commit b6cbb86

Please sign in to comment.