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

Commit

Permalink
Improved debugger compiler flags
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 12, 2021
1 parent 5c61565 commit da07db9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 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) $< -o $@ \
-L$(SWIFTEST_HOME)/lib -lswiftest -L$(NETCDF_FORTRAN_HOME)/lib -lnetcdf -lnetcdff $(LMKL)
$(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) -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) -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) -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) -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) -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) -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) -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
18 changes: 10 additions & 8 deletions Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,23 @@ 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 -vecabi=cmdtarget -simd -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -xhost -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 -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin
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
PAR = -qopenmp -parallel
PAR = -qopenmp -parallel -parallel-source-info=2
HEAPARR = -heap-arrays 4194304
OPTREPORT = -qopt-report=5
IPRODUCTION = -no-wrap-margin -O3 -qopt-prefetch=0 -sox $(PAR) $(SIMDVEC) #$(HEAPARR)
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
Expand All @@ -63,13 +66,12 @@ GMEM = -fsanitize-address-use-after-scope -fstack-check -fsanitize=bounds-stri
GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries
GPRODUCTION = -O3 -ffree-line-length-none $(GPAR)

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 -qopt-matmul $(PAR)

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
FSTRICTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)
FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)

FSTRICTFLAGS = $(IDEBUG) #$(SIMDVEC) $(PAR)
FFLAGS = $(IDEBUG) #$(SIMDVEC) $(PAR)
FORTRAN = ifort
AR = xiar
CC = icc
Expand Down

0 comments on commit da07db9

Please sign in to comment.