Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Raven Makefile to Makefile list #162

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Raven Makefile to Makefile list
lpodavini committed Sep 24, 2024
commit c2f6bb633ca02f19660c9f274ca5b33e0524d4ca
125 changes: 125 additions & 0 deletions Makefiles/Makefile.raven-intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Compiler: Intel ifort/icc

ifdef CRAY_SYSTEM
FC=ftn
CC=cc
CXX=CC
else
FC=ifort
CC=icc
CXX=icpc
MPIFC=mpiifort
MPICC=mpiicc
MPICXX=mpiicpc
endif
F90FLAGS +=
CPPFLAGS += -DFCOMPILER=_INTEL_

ifndef DBLESIZEOPT
cmd=$(shell basename $(shell which $(FC)))
ifneq ($(cmd),$(FC))
$(error $(FC) not found)
endif
v1:=$(shell $(FC) -v 2>&1 | grep -i version | awk '{print $$NF}')
INTELMAJORVERSION=$(shell echo $(v1) | awk -F. '{print $$1}')
INTELMINORVERSION=$(shell echo $(v1) | awk -F. '{print $$2}')

DBLESIZEOPT=$(shell if [ $(INTELMAJORVERSION) -lt 10 ]; then echo "-double_size 128"; else echo "-double-size 128"; fi)
endif

ifdef DBLE
DBLEFLAGS = -r8 $(DBLESIZEOPT)
F90FLAGS += $(DBLEFLAGS)
endif

ifdef STATIC
LDFLAGS += -static
endif

ifdef DEBUG
# -check bounds option causes problem on mrf
# probably problem of Intel's mpi
# -CB do the same
# F90FLAGS += -g -implicitnone -warn all -check bounds -traceback
#nogen-interfaces prevents compiler generated interfaces being dumped to file.
F90FLAGS += -g -implicitnone -warn all -nogen-interfaces -CB -traceback
F90OPTFLAGS = -O0
CFLAGS += -g -w2 #-warn all -check bounds -traceback
COPTFLAGS =
else
ifdef OPT
ifeq ($(OPT),aggressive)
# -fast = -O3 -ipo -static
F90OPTFLAGS += -O3 -ipo
COPTFLAGS += -O3 -ipo
else
F90OPTFLAGS += -O2
COPTFLAGS += -O2
endif
endif

ifdef OPT
ifeq ($(CHIP),knl)
F90OPTFLAGS += -xMIC-AVX512
COPTFLAGS += -xMIC-AVX512
endif
ifeq ($(CHIP),haswell)
F90OPTFLAGS += -xCORE-AVX2
COPTFLAGS += -xCORE-AVX2
endif
ifeq ($(CHIP),ivy-bridge)
F90OPTFLAGS += -xCORE-AVX-I
COPTFLAGS += -xCORE-AVX-I
endif
ifeq ($(CHIP),sandy-bridge)
F90OPTFLAGS += -xAVX
COPTFLAGS += -xAVX
endif
ifeq ($(CHIP),xeon)
F90OPTFLAGS += -xW
COPTFLAGS += -xW
endif
ifeq ($(CHIP),pentium4)
F90OPTFLAGS += -xN
COPTFLAGS += -xN
endif
ifeq ($(CHIP),core2)
F90OPTFLAGS += -xT
COPTFLAGS += -xT
endif
ifeq ($(CHIP),skylake)
F90OPTFLAGS += -xCORE-AVX512 -mtune=skylake
COPTFLAGS += -xCORE-AVX512 -mtune=skylake
endif
endif

ifeq ($(findstring gprof,$(PROF)),gprof)
F90FLAGS += -pg
CFLAGS += -pg
endif
endif

ifdef USE_OPENMP
ifeq ($(shell if [ $(INTELMAJORVERSION) -lt 15 ]; then echo "old_version"; fi),old_version)
### deprecated option
F90FLAGS += -openmp
CFLAGS += -openmp
else
F90FLAGS += -qopenmp
CFLAGS += -qopenmp
endif
endif

ifdef USE_MIC
F90FLAGS += -mmic
CFLAGS += -mmic
endif

ifdef USE_LAPACK
LAPACK_LIB = -mkl -L$(MKLROOT)/lib/intel64
endif

NETCDF_INC = -I$(NETCDF_HOME)/include
NETCDF_LIB = -L$(NETCDF_HOME)/lib -lnetcdf -lnetcdff
FFT_INC = -I$(FFTW_HOME)/include
FFT_LIB = -L$(FFTW_HOME)/lib -lfftw3 -lfftw3_mpi