From 8ac88d227892d32f37bf96cbeb40847599d82d65 Mon Sep 17 00:00:00 2001 From: Manas Rachh Date: Sun, 2 Jun 2024 21:09:43 -0400 Subject: [PATCH] fixes to make.inc --- make.inc.icc | 2 +- make.inc.macos.gnu | 8 +++----- make.inc.macos.intel | 10 ++++++++-- make.inc.macos.nag | 30 ++++++++++++++++++++++++++++++ make.inc.macos_arm64.gnu | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 make.inc.macos.nag create mode 100644 make.inc.macos_arm64.gnu diff --git a/make.inc.icc b/make.inc.icc index d09add0..4e26423 100644 --- a/make.inc.icc +++ b/make.inc.icc @@ -1,7 +1,7 @@ CC=icc CXX=icpc FC=ifort -FFLAGS= -fPIC -O3 -march=native -funroll-loops -mkl +FFLAGS= -fPIC -O3 -march=native -funroll-loops -mkl -w LIBS=-lm CLIBS = -lm -ldl -lifcore diff --git a/make.inc.macos.gnu b/make.inc.macos.gnu index 189b242..5051a7a 100644 --- a/make.inc.macos.gnu +++ b/make.inc.macos.gnu @@ -1,6 +1,6 @@ # makefile overrides # OS: macOS -# Compiler: gfortran 9.X +# Compiler: gfortran X.X/Clang # OpenMP: enabled # @@ -21,9 +21,7 @@ OMPLIBS = -lgomp # MATLAB interface: FDIR=$$(dirname `gfortran --print-file-name libgfortran.dylib`) -MFLAGS += -L${FDIR} -MEX = $(shell ls -d /Applications/MATLAB_R20**.app)/bin/mex -#LIBS = -lm -lstdc++.6 -#MEXLIBS= -lm -lstdc++.6 -lgfortran -ldl +MFLAGS +=-L${FDIR} +MEX = $(shell ls -d /Applications/MATLAB_R* | sort | tail -1)/bin/mex diff --git a/make.inc.macos.intel b/make.inc.macos.intel index 9d264e3..5797c02 100644 --- a/make.inc.macos.intel +++ b/make.inc.macos.intel @@ -7,7 +7,8 @@ CC=icc CXX=icpc FC=ifort -FFLAGS= -fPIC -O3 -march=native -funroll-loops -mkl + +FFLAGS= -fPIC -O3 -march=native -funroll-loops -mkl -std=legacy -w LIBS= #CLIBS = -lm -ldl -lifcore CLIBS = -lm -ldl @@ -26,6 +27,11 @@ endif # -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk OMPFLAGS = -qopenmp -OMPLIBS = +OMPLIBS = -qopenmp + +# MATLAB interface: +FDIR=$$(dirname `gfortran --print-file-name libgfortran.dylib`) +MFLAGS +=-L${FDIR} +MEX = $(shell ls -d /Applications/MATLAB_R* | sort | tail -1)/bin/mex diff --git a/make.inc.macos.nag b/make.inc.macos.nag new file mode 100644 index 0000000..6c07c8f --- /dev/null +++ b/make.inc.macos.nag @@ -0,0 +1,30 @@ +# make.inc for NAG Fortran compiler +# Online documentation: https://www.nag.com/nagware/np/r71_doc/manual/compiler_2_4.html#OPTIONS + +FC=nagfor + +# The path of libraries by NAG compiler +LIB_NAG = /usr/local/lib/NAG_Fortran + +# Brief descriptions of specified options below: +# -PIC: produce position-independent code +# -O2: optimization at a normal level +# -Ounroll=2: the depth of loo-unrolling +# -f90_sign: use the Fortran 77/90 version of the SIGN intrinsic instead of the Fortran 95 one +# -dcfuns: enable recognition of non-standard double precision complex intrinsic functions. +# -dusty: allows the compilation and execution of legacy software. +# -w=x77: suppresses extension warnings for obsolete but common extensions to Fortran 77. +# -w=unreffed: suppresses warning messages about variables set but never referenced. +# -w=unused: suppresses warning messages about unused entities. +# -ieee=full: set the mode of IEEE arithmetic operation according to full mode. + +# Main compile command for NAG Fortran compiler +FFLAGS = -PIC -O2 -Ounroll=1 -f90_sign -dcfuns -dusty -w=obs -w=x77 -w=unreffed -w=unused -ieee=full + +# Flags overwritten in makefile +OMPFLAGS = -openmp +# OMPLIBS = -lf71omp64 -L$(LIB_NAG) +OMPLIBS = -lf71omp64 -lf71rts -L$(LIB_NAG) +LIBS = -lf71rts -L$(LIB_NAG) +CLIBS = -lm -ldl -L$(LIB_NAG) +FFLAGS_DYN = -PIC diff --git a/make.inc.macos_arm64.gnu b/make.inc.macos_arm64.gnu new file mode 100644 index 0000000..acf5dd3 --- /dev/null +++ b/make.inc.macos_arm64.gnu @@ -0,0 +1,33 @@ +# makefile overrides +# OS: macOS +# Compiler: gfortran X.X/Clang +# OpenMP: enabled +# + +CC=gcc +CXX=g++ +FC=gfortran + +FFLAGS= -fPIC -O3 -arch arm64 -std=legacy -w -mno-outline-atomics +FFLAGS_DYN= -shared -fPIC +CFLAGS= -fPIC -O3 -arch arm64 -std=c99 +CXXFLAGS= -std=c++11 -DSCTL_PROFILE=-1 -fPIC -O3 -arch arm64 + + +ifeq ($(PREFIX),) + FMM_INSTALL_DIR=/usr/local/lib +endif + + +CFLAGS += -I src + +# OpenMP with gcc on OSX needs the following +OMPFLAGS = -fopenmp +OMPLIBS = -lgomp + +# MATLAB interface: +FDIR=$$(dirname `gfortran --print-file-name libgfortran.dylib`) +MFLAGS +=-L${FDIR} +MEX = $(shell ls -d /Applications/MATLAB_R* | sort | tail -1)/bin/mex + +