# NOTE:
# - Currently, this configuration does not compile the MATLAB API. After 
#	compiling, you will need to download the ISSM pre-compiled binaries from 
#	https://issm.jpl.nasa.gov/download/binaries, copy the contents of lib/ to 
#	$ISSM_DIR/lib-precompiled, then add $ISSM_DIR/lib-precompiled to the path 
#	in MATLAB.
#
# TODO:
# - Change PROJ installation script to latest version once Jenkins macOS build 
#	node has been upgraded.
#

MATLAB_PATH="/Applications/MATLAB_R2022b.app" # NOTE: Although we do not configure/compile MATLAB wrappers, we need to set this variable for testing

#--------------------#
# ISSM Configuration #
#--------------------#

ISSM_CONFIG='\
	--prefix=${ISSM_DIR} \
	--disable-static \
	--enable-development \
	--enable-debugging \
	--without-wrappers \
	--with-numthreads=8 \
	--with-fortran-lib="-L/opt/homebrew/lib/gcc/current -lgfortran" \
	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
'

#-------------------#
# External Packages #
#-------------------#

# List of external packages to be installed and their installation scripts
EXTERNALPACKAGES="
	autotools	install-mac.sh
	cmake		install.sh
	petsc		install-3.17-mac-silicon.sh
	triangle	install-mac.sh
	m1qn3		install.sh
	shell2junit	install.sh
"

#---------#
# Testing #
#---------#

# Test suites
MATLAB_TEST=1
PYTHON_TEST=0
JAVASCRIPT_TEST=0
EXAMPLES_TEST=0

# Number of CPUs used in ISSM compilation
#
# NOTE: One is usually safer as some packages are very sensitive to parallel
# 		compilation
#
NUMCPUS_INSTALL=4

# Number of CPUs used in the nightly runs
NUMCPUS_RUN=2

# Nightly run options
#
# See documentation in test/NightlyRun/runme.* for more information
#
# NOTE:
# - Tests 430, 441:442, 470:476 excluded because of large errors.
# - Tests 462-464, 517 excluded because of "Arrays have incompatible sizes for 
#	this operation."
# - Test 701:703 excluded because they use full Stokes equations
#
MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),430,435,441:442,462:464,470:476,517,701:703]"
PYTHON_NROPTIONS=""
