|
| 1 | +########################################################################################## |
| 2 | +# System specific configuration for OSIRIS |
| 3 | +# System: Linux / darwin |
| 4 | +# Compilers: GNU family ( gcc, gfortran ) |
| 5 | +########################################################################################## |
| 6 | + |
| 7 | +########################################################################################## |
| 8 | +# OSIRIS configuration |
| 9 | + |
| 10 | +DISABLE_PGC = 1 |
| 11 | +# DISABLE_TILES = 1 |
| 12 | +DISABLE_QED = 1 |
| 13 | +DISABLE_QEDCYL = 1 |
| 14 | +DISABLE_SHEAR = 1 |
| 15 | +DISABLE_RAD = 1 |
| 16 | +DISABLE_XXFEL = 1 |
| 17 | +DISABLE_NEUTRAL_SPIN = 1 |
| 18 | +DISABLE_GR = 1 |
| 19 | +DISABLE_CYLMODES = 1 |
| 20 | +# DISABLE_OVERDENSE = 1 |
| 21 | +DISABLE_OVERDENSE_CYL = 1 |
| 22 | + |
| 23 | +# Set the following to a system optimized timer, or leave commented to use a default one |
| 24 | +TIMER = __POSIX_TIMER__ |
| 25 | + |
| 26 | +# SIMD |
| 27 | +# Uncomment one of the following lines to enable SSE / AVX optimized code |
| 28 | +#SIMD = SSE |
| 29 | +SIMD = AVX |
| 30 | +#SIMD = MIC |
| 31 | +# Numeric precision (SINGLE|DOUBLE) |
| 32 | +#PRECISION = SINGLE |
| 33 | +PRECISION = DOUBLE |
| 34 | +#SIMD_FLAGS = -march=core-avx2 |
| 35 | +SIMD_FlAGS = -xavx |
| 36 | +#SIMD_FLAGS = -xHost |
| 37 | +#SIMD_FLAGS = -msse4.2 |
| 38 | + |
| 39 | +OPENMPI_ROOT = /usr/local/openmpi-4.1.4 |
| 40 | + |
| 41 | +########################################################################################## |
| 42 | +# Compilers |
| 43 | + |
| 44 | +# When compiling AVX code the following must be used to i) enable AVX code generation (-mavx) |
| 45 | +# and ii) use the clang integrated assembler instead of the GNU based system assembler. |
| 46 | + |
| 47 | +F90 = $(OPENMPI_ROOT)/bin/mpif90 -Wa,-q -cpp |
| 48 | + |
| 49 | +# Use this to specify specific options for compiling .f03 files |
| 50 | +F03 = $(F90) |
| 51 | +#F03 = $(F90) -std=f2003 |
| 52 | + |
| 53 | +cc = $(OPENMPI_ROOT)/bin/mpicc -Wa,-q |
| 54 | +CC = $(OPENMPI_ROOT)/bin/mpiCC -Wa,-q |
| 55 | + |
| 56 | +# Fortran preprocessor |
| 57 | +FPP = gcc -C -E -x assembler-with-cpp |
| 58 | + |
| 59 | +# This flag supresses some hyper-vigilant compilier warnings that have been deemed harmless. The list of warnings |
| 60 | +# can be found is ./source/config.mk.warnings. If you are having some strange issues that you need to debug |
| 61 | +# comment out DISABLE_PARANOIA and/or read the ./source/config.warnings file to allow the warnings if you think |
| 62 | +# they may help you find the issue. |
| 63 | +DISABLE_PARANOIA = YES |
| 64 | + |
| 65 | +########################################################################################## |
| 66 | +# Fortran flags |
| 67 | + |
| 68 | +# External name mangling |
| 69 | +UNDERSCORE = FORTRANSINGLEUNDERSCORE |
| 70 | + |
| 71 | +# Flag to enable compilation of .f03 files (not needed for gfortran) |
| 72 | +# F03_EXTENSION_FLAG = |
| 73 | + |
| 74 | +# ------------------------------- Compilation Targets ------------------------------------ |
| 75 | + |
| 76 | +# -fno-range-check is required because of the random module. |
| 77 | +# gfortran has a bug that considers -2147483648 to be outside the valid |
| 78 | +# int32 range |
| 79 | + |
| 80 | +# -pipe makes gfortran use pipes for internal process communication (instead of files) |
| 81 | +# which speeds up the ocmpilation process significantly |
| 82 | + |
| 83 | +# -ffree-line-length-none removes all constraints on line size |
| 84 | + |
| 85 | +F90FLAGS_all = -pipe -ffree-line-length-none -fno-range-check |
| 86 | + |
| 87 | +# OpenMP Support |
| 88 | +F90FLAGS_all += --openmp |
| 89 | +FPP += -D_OPENMP |
| 90 | + |
| 91 | +# Production |
| 92 | +# Intel Core i7 flags |
| 93 | + |
| 94 | +F90FLAGS_production = $(F90FLAGS_all) -Ofast -march=native |
| 95 | + |
| 96 | +# Debug |
| 97 | + |
| 98 | +# -std=f95 is too picky |
| 99 | + |
| 100 | +F90FLAGS_debug = $(F90FLAGS_all) -g -Og -fbacktrace -fbounds-check \ |
| 101 | + -Wall -fimplicit-none -pedantic \ |
| 102 | + -Wimplicit-interface -Wconversion -Wsurprising \ |
| 103 | + -Wunderflow -ffpe-trap=invalid,zero,overflow |
| 104 | + |
| 105 | +#-ffpe-trap=underflow,denormal is usually too picky. For example, it may raise an exception when |
| 106 | +# converting double precision values to single precision for diagnostics output if the |
| 107 | +# value is outside of valid single precision range (e.g. 1e-40). It may also raise |
| 108 | +# an exception if a wave amplitude gets very low in a PML region. Note that in these |
| 109 | +# situations the value is (correctly) rounded to 0. |
| 110 | + |
| 111 | +# Profile with Shark |
| 112 | +F90FLAGS_profile = -g $(F90FLAGS_production) |
| 113 | + |
| 114 | + |
| 115 | +########################################################################################## |
| 116 | +# C flags |
| 117 | + |
| 118 | +CFLAGS_production = -Ofast -march=native -std=c99 |
| 119 | + |
| 120 | +CFLAGS_debug = -Og -g -Wall -pedantic -march=native -std=c99 |
| 121 | +#-fsanitize=address |
| 122 | + |
| 123 | +CFLAGS_profile = -g $(CFLAGS_production) |
| 124 | + |
| 125 | +########################################################################################## |
| 126 | +# Linker flags |
| 127 | + |
| 128 | +# None required |
| 129 | +#LDFLAGS = |
| 130 | + |
| 131 | +########################################################################################## |
| 132 | +# Libraries |
| 133 | + |
| 134 | +# MPI |
| 135 | +MPI_FCOMPILEFLAGS = $(shell $(OPENMPI_ROOT)/bin/mpif90 --showme:compile) |
| 136 | +MPI_FLINKFLAGS = $(shell $(OPENMPI_ROOT)/bin/mpif90 --showme:link) |
| 137 | + |
| 138 | +# HDF5 |
| 139 | +H5_FCOMPILEFLAGS = -I/usr/include/hdf5/openmpi |
| 140 | +H5_FLINKFLAGS = -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/lib -lhdf5_fortran -lhdf5 -lz -lm |
| 141 | +# H5_HAVE_PARALLEL = 1 |
| 142 | + |
| 143 | +# FFTW |
| 144 | +FFTW_ROOT = /usr/local/fftw-3.3.10 |
| 145 | +FFTW_FCOMPILEFLAGS = -I$(FFTW_ROOT)/include |
| 146 | +# # flags for single precision |
| 147 | +# FFTW_FLINKFLAGS = -L$(FFTW_ROOT)/lib -lfftw3f |
| 148 | +# flags for double precision |
| 149 | +FFTW_FLINKFLAGS = -L$(FFTW_ROOT)/lib -lfftw3 |
0 commit comments