Skip to content

Commit 48da3c0

Browse files
committed
ifort 16 Makefile update
1 parent 6c4b10f commit 48da3c0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Diff for: source/Makefile

+14-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ ifeq "$(ifortErr)" "0"
1515
F90C = ifort
1616
#use this if mpif90 is trying to use gfortran: MPIF90C = mpif90 -f90=ifort
1717

18-
FFLAGS = -mkl -openmp -O3 -no-prec-div -fpp
19-
DEBUGFLAGS = -mkl -openmp -g -check all -check noarg_temp_created -traceback -fpp -fpe0
18+
FFLAGS = -mkl -O3 -no-prec-div -fpp
19+
DEBUGFLAGS = -mkl -g -check all -check noarg_temp_created -traceback -fpp -fpe0
2020
#add -fpe0 to check for floating point errors (think lowLike also throws these harmlessly)
2121
MODOUT = -module $(OUTPUT_DIR)
2222
LAPACKL =
2323

24+
ifortVer_major = $(shell ifort -v 2>&1 | cut -d " " -f 3 | cut -d. -f 1)
25+
ifeq ($(shell test $(ifortVer_major) -gt 15; echo $$?),0)
26+
FFLAGS+= -qopenmp
27+
DEBUGFLAGS+= -qopenmp
28+
else
29+
FFLAGS+= -openmp
30+
DEBUGFLAGS+= -openmp
31+
endif
32+
2433
ifeq ($(STATIC),YES)
2534
#so you can re-distribute the binary to another machine
2635
#static link details from https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
@@ -36,8 +45,9 @@ MPIF90C = ftn
3645
endif
3746

3847
else
39-
#gfortran 5.0 and earlier will not work (many F2003 bugs)
40-
#gfortran 6 trunk should work, and perhaps GCC 5.2 when available; see virtual machines for up-to-date environments
48+
#gfortran 5.x and earlier will not work (many F2003 bugs)
49+
#gfortran 6 should work (though currently still buggy for debug compile);
50+
#see CosmoBox virtual machines for stable environments
4151
F90C = gfortran
4252
FFLAGS = -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4
4353
DEBUGFLAGS = -cpp -g -fbounds-check -fbacktrace -ffree-line-length-none -fopenmp -fmax-errors=4 -ffpe-trap=invalid,overflow,zero

0 commit comments

Comments
 (0)