Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updated compiler flags to consolidate include and link flags into Mak…
Browse files Browse the repository at this point in the history
…efile.Defines, and modified advisor profiling flags
  • Loading branch information
daminton committed Nov 11, 2021
1 parent 79a42f3 commit 7d6bd44
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ MODULES = $(SWIFTEST_MODULES) $(USER_MODULES)
.PHONY : all mod fast strict drivers bin clean force

% : %.f90 force
$(FORTRAN) $(FFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) $< -o $@ \
-L$(SWIFTEST_HOME)/lib -lswiftest -L$(NETCDF_FORTRAN_HOME)/lib -lnetcdf -lnetcdff $(LMKL) $(LADVIXE)
$(FORTRAN) $(FFLAGS) $(INCLUDES) $< -o $@ \
-L$(SWIFTEST_HOME)/lib $(LINKS)
$(INSTALL_PROGRAM) $@ $(SWIFTEST_HOME)/bin
rm -f $@

Expand All @@ -79,7 +79,7 @@ all:

mod:
cd $(SWIFTEST_HOME)/src/modules/; \
$(FORTRAN) $(FFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c $(MODULES); \
$(FORTRAN) $(FFLAGS) $(INCLUDES) -c $(MODULES); \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o; \
$(INSTALL_DATA) *.mod *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.mod *.smod
Expand Down Expand Up @@ -188,34 +188,34 @@ strict:
ln -s $(SWIFTEST_HOME)/Makefile .; \
make strictdir
cd $(SWIFTEST_HOME)/src/helio; \
$(FORTRAN) $(FSTRICTFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c helio_kick.f90; \
$(FORTRAN) $(FSTRICTFLAGS) $(INCLUDES) -c helio_kick.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smod
cd $(SWIFTEST_HOME)/src/symba; \
$(FORTRAN) $(FSTRICTFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c symba_kick.f90; \
$(FORTRAN) $(FSTRICTFLAGS) $(INCLUDES) -c symba_kick.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smod
cd $(SWIFTEST_HOME)/src/rmvs; \
$(FORTRAN) $(FSTRICTFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c rmvs_kick.f90; \
$(FORTRAN) $(FSTRICTFLAGS) $(INCLUDES) -c rmvs_kick.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smod
cd $(SWIFTEST_HOME)/src/whm; \
$(FORTRAN) $(FSTRICTFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c whm_kick.f90; \
$(FORTRAN) $(FSTRICTFLAGS) $(INCLUDES) -c whm_kick.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smod

fastdir:
$(FORTRAN) $(FFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c *.f90; \
$(FORTRAN) $(FFLAGS) $(INCLUDES) -c *.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smod

strictdir:
$(FORTRAN) $(FSTRICTFLAGS) -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include $(IMKL) $(IADVIXE) -c *.f90; \
$(FORTRAN) $(FSTRICTFLAGS) $(INCLUDES) -c *.f90; \
$(AR) rv $(SWIFTEST_HOME)/lib/libswiftest.a *.o *.smod; \
$(INSTALL_DATA) *.smod $(SWIFTEST_HOME)/include; \
rm -f *.o *.smo
Expand Down
43 changes: 34 additions & 9 deletions Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,53 @@ SWIFTEST_HOME = $(ROOT_DIR)
USER_MODULES =
COLLRESOLVE_HOME = $(ROOT_DIR)/collresolve/

#NETCDF_FORTRAN_HOME = /home/daminton/local


# Compiler definitions

# DO NOT include in FFLAGS the "-c" option to compile object only
# this is done explicitly as needed in the Makefile
ADVIXE_FLAGS = -g -O2 -qopt-report=5 -vec -shared-intel -ldl -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -traceback
#Be sure to set the environment variable KMP_FORKJOIN_FRAMES=1 for OpenMP debuging in vtune

IDEBUG = -O0 -init=snan,arrays -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -qopt-matmul -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin
STRICTREAL = -fp-model=precise -prec-div -prec-sqrt -assume protect-parens
SIMDVEC = -simd -xhost -align all -assume contiguous_assumed_shape -vecabi=cmdtarget -fp-model no-except -fma
SIMDVEC = -simd -xhost -align all -pad -assume contiguous_assumed_shape -vecabi=cmdtarget -fp-model no-except -fma
PAR = -qopenmp -parallel
HEAPARR = -heap-arrays 4194304
OPTREPORT = -qopt-report=5
ADVIXE_FLAGS = -g -O2 -qopt-report=5 -shared-intel -traceback $(SIMDVEC) $(PAR)
#Be sure to set the environment variable KMP_FORKJOIN_FRAMES=1 for OpenMP debuging in vtune/advisor

IPRODUCTION = -no-wrap-margin -O3 -qopt-prefetch=0 -qopt-matmul -sox $(PAR) $(SIMDVEC) #$(HEAPARR)

#gfortran flags
GDEBUG = -g -Og -fbacktrace -fbounds-check -ffree-line-length-none
GPAR = -fopenmp -ftree-parallelize-loops=4
GMEM = -fsanitize-address-use-after-scope -fstack-check -fsanitize=bounds-strict -fsanitize=undefined -fsanitize=signed-integer-overflow -fsanitize=object-size -fstack-protector-all
GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries
GPRODUCTION = -O3 -ffree-line-length-none $(GPAR)

MKL_ROOT = /apps/spack/bell/apps/intel-parallel-studio/cluster.2019.5-intel-19.0.5-4brgqlf/mkl/lib
IMKL = -I$(MKLROOT)/include
LMKL = -L$(MKLROOT)/lib/intel64 -qopt-matmul
INCLUDES = -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include -I$(MKLROOT)/include -I$(ADVISOR_2019_DIR)/include/intel64
LINKS = -L$(MKLROOT)/lib/intel64 -L$(NETCDF_FORTRAN_HOME)/lib -L$(ADVISOR_2019_DIR)/lib64 -lswiftest -lnetcdf -lnetcdff -ladvisor

FSTRICTFLAGS = $(ADVIXE_FLAGS) $(STRICTREAL) $(SIMDVEC) $(PAR)
FFLAGS = $(ADVIXE_FLAGS) -fp-model=fast $(SIMDVEC) $(PAR)
# FSTRICTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)
# FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)

FSTRICTFLAGS = $(ADVIXE_FLAGS) $(STRICTREAL)
FFLAGS = $(ADVIXE_FLAGS) -fp-model=fast
FORTRAN = ifort
AR = xiar
CC = icc

CC = icc
#FORTRAN = gfortran
#FFLAGS = $(GDEBUG) $(GMEM) #$(GPAR)
#FSTRICTFLAGS = $(GDEBUG) $(GMEM) #$(GPAR)
#AR = ar
#CC = cc

# DO NOT include in CFLAGS the "-c" option to compile object only
# this is done explicitly as needed in the Makefile

CFLAGS = -O3 -w -m64 -std=c99

64_BIT_REALS = -r8
Expand Down

0 comments on commit 7d6bd44

Please sign in to comment.