/
important_settings.apple_silicon_gfortran12
53 lines (42 loc) · 2.11 KB
/
important_settings.apple_silicon_gfortran12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# A central place to put all the important paths. You probably have to modify this to make things work.
# the fortran compiler
FORTRAN_COMPILER="gfortran-12"
# required compiler flags
FCFLAGS="-ffree-line-length-none -std=f2008 -cpp -fallow-argument-mismatch"
# extra flags, for debugging and such
FCFLAGS_EXTRA=""
# FCFLAGS_EXTRA="-fbacktrace -fcheck=all -finit-real=nan -finit-derived -fmax-errors=10 --pedantic --warn-all"
# FCFLAGS_EXTRA="-g -fbacktrace -fcheck=all -finit-real=nan -finit-derived -fmax-errors=10 --pedantic -Wall -Wextra -pedantic -Wcast-align -Wdisabled-optimization -Wmissing-include-dirs -Wshadow -Wunused -fdiagnostics-show-option -fcheck=all -Wstrict-overflow=0 -Wrealloc-lhs"
# optimization stuff. Go all in, sometimes
# OPTIMIZATION_LEVEL="-Ofast"
OPTIMIZATION_LEVEL="-O3"
OPTIMIZATION_SENSITIVE="-O0"
# the flag that sets the default real to a double.
DOUBLE_FLAG="-fdefault-real-8"
# The flag that tells the compiler where to put .o and .mod files.
MODULE_FLAG="-J"
# the header to put in python scripts.
PYTHONHEADER="#!/usr/bin/env python"
# Which gnuplot terminal to use by default.
# Choices: aqua, qt, wxt
GNUPLOTTERMINAL="aqua" # nice on OSX, needs aquaterm installed and gnuplot compiled with support for it.
# Precompiler flags. Selecting default gnuplot terminal, and make the progressbars work.
PRECOMPILER_FLAGS="-DGP${GNUPLOTTERMINAL} -Dclusterprogressbar -DAGRESSIVE_SANITY"
PRECOMPILER_FLAGS="-DGP${GNUPLOTTERMINAL} -Dclusterprogressbar"
# These are the BLAS/LAPACK libraries. On OSX with gfortran, use the built-in 'framework accelerate'
PATH_TO_BLASLAPACK_LIB=""
PATH_TO_BLASLAPACK_INC=""
BLASLAPACK_LIBS="-framework accelerate"
# I use fftw for Fourier transforms.
PATH_TO_FFTW_LIB="-L/opt/homebrew/lib"
PATH_TO_FFTW_INC="-I/opt/homebrew/include"
FFTW_LIBS="-lfftw3"
# Also need MPI
PATH_TO_MPI_LIB="-L/opt/homebrew/lib"
PATH_TO_MPI_INC="-I/opt/homebrew/include"
MPI_LIBS="-lmpi_mpifh -lmpi"
# I also use HDF5 every now and then
PATH_TO_HDF5_LIB="-L/path/to/your/local/hdf5-1.XX/build/lib"
PATH_TO_HDF5_INC="-I/path/to/your/local/hdf5-1.XX/build/include"
HDF5_LIBS="-lhdf5 -lhdf5_fortran"