Skip to content
Snippets Groups Projects
Commit a278a6c2 authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

There was no ifndef CXXFLAGS, thus its value was not respected if set outside

Added some indentation to make the ifdef nesting a bit less cryptic
parent 5410dfee
No related branches found
No related tags found
No related merge requests found
# FC defines the fortran compiler to use. If undefined, GNU Make tries to use `f77` # FC defines the fortran compiler to use. If undefined, GNU Make tries to use `f77`
ifndef FC ifndef FC
override FC=gfortran override FC=gfortran
endif endif
# FCFLAGS defines the compilation options for the fortran compiler # FCFLAGS defines the compilation options for the fortran compiler
ifndef FCFLAGS ifndef FCFLAGS
override FCFLAGS=-std=legacy -O3 override FCFLAGS=-std=legacy -O3
endif endif
# AR defines the command to create static library files # AR defines the command to create static library files
ifndef AR ifndef AR
override AR=ar override AR=ar
endif endif
# ARFLAGS defines the flags for AR to create static library files # ARFLAGS defines the flags for AR to create static library files
ifndef ARFLAGS ifndef ARFLAGS
override ARFLAGS=-rs override ARFLAGS=-rs
endif endif
# PICFLAGS defines the additional flags for the c++ compiler to create objects suitable for shared library creation # PICFLAGS defines the additional flags for the c++ compiler to create objects suitable for shared library creation
ifndef PICFLAGS ifndef PICFLAGS
override PICFLAGS=-fPIC override PICFLAGS=-fPIC
endif endif
# LDFLAGS defines the default linker flags # LDFLAGS defines the default linker flags
ifndef LDFLAGS ifndef LDFLAGS
override LDFLAGS= override LDFLAGS=
endif endif
# CXX defines the default C++ compiler to use. If undefined, GNU Make tries to use g++ # CXX defines the default C++ compiler to use. If undefined, GNU Make tries to use g++
ifndef CXX ifndef CXX
ifdef USE_MPI ifdef USE_MPI
override CXX=mpicxx override CXX=mpicxx
else else
override CXX=g++ override CXX=g++
endif endif
endif endif
ifdef USE_MPI ifdef USE_MPI
override MPI_CXXFLAGS+=-DUSE_MPI override MPI_CXXFLAGS+=-DUSE_MPI
endif endif
# HDF5_INCLUDE defines the default path to the HDF5 include files to use # HDF5_INCLUDE defines the default path to the HDF5 include files to use
ifndef HDF5_INCLUDE ifndef HDF5_INCLUDE
override HDF5_INCLUDE=/usr/include/hdf5/serial override HDF5_INCLUDE=/usr/include/hdf5/serial
endif endif
# define (outside) USE_LAPACK for lapacke support, LAPACK_ILP64 for ilp64 interface, MKL_ILP64 the same if using MKL implementation # define (outside) USE_LAPACK for lapacke support, LAPACK_ILP64 for ilp64 interface, MKL_ILP64 the same if using MKL implementation
ifdef USE_LAPACK ifdef USE_LAPACK
# define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces # define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces
ifdef USE_ILP64 ifdef USE_ILP64
ifndef LAPACK_ILP64 ifndef LAPACK_ILP64
override LAPACK_ILP64=1 override LAPACK_ILP64=1
endif #LAPACK_ILP64 endif #LAPACK_ILP64
endif endif
# define (outside) USE_MKL to use the MKL implementation of lapacke # define (outside) USE_MKL to use the MKL implementation of lapacke
ifdef USE_MKL ifdef USE_MKL
# define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces # define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces
ifdef USE_ILP64 ifdef USE_ILP64
ifndef MKL_ILP64 ifndef MKL_ILP64
override MKL_ILP64=1 override MKL_ILP64=1
endif #MKL_ILP64 endif #MKL_ILP64
endif endif #USE_ILP64
ifndef LAPACK_INCLUDE ifndef LAPACK_INCLUDE
# this is for the MKL implementation # this is for the MKL implementation
override LAPACK_INCLUDE=$(MKLROOT)/include override LAPACK_INCLUDE=$(MKLROOT)/include
endif #LAPACK_INCLUDE endif #LAPACK_INCLUDE
ifndef LAPACK_LDFLAGS ifndef LAPACK_LDFLAGS
# this is for the MKL implementation # this is for the MKL implementation
# define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces # define (outside) USE_ILP64 for long long int support in lapack/mkl/magma interfaces
ifdef USE_ILP64 ifdef USE_ILP64
override LAPACK_LDFLAGS=-L$(MKLROOT)/lib -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl override LAPACK_LDFLAGS=-L$(MKLROOT)/lib -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl
else else
override LAPACK_LDFLAGS=-L$(MKLROOT)/lib -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl override LAPACK_LDFLAGS=-L$(MKLROOT)/lib -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl
endif endif #USE_ILP64
endif #LAPACK_LDFLAGS endif #LAPACK_LDFLAGS
# the next else refers to USE_MKL # the next else refers to USE_MKL
else #this is for when USE_MKL is _not_ defined else #this is for when USE_MKL is _not_ defined
ifndef LAPACK_INCLUDE ifndef LAPACK_INCLUDE
# this is for standard "vanilla" lapacke64 # this is for standard "vanilla" lapacke64
override LAPACK_INCLUDE=/usr/include override LAPACK_INCLUDE=/usr/include
endif # LAPACK_INCLUDE endif # LAPACK_INCLUDE
ifndef LAPACK_LDFLAGS ifndef LAPACK_LDFLAGS
ifdef USE_ILP64 ifdef USE_ILP64
# this is for standard "vanilla" lapacke64 # this is for standard "vanilla" lapacke64
override LAPACK_LDFLAGS=-llapacke64 override LAPACK_LDFLAGS=-llapacke64
else else
override LAPACK_LDFLAGS=-llapacke override LAPACK_LDFLAGS=-llapacke
endif endif #USE_ILP64
endif #LAPACK_LDFLAGS endif #LAPACK_LDFLAGS
# the next endif is for USE_MKL # the next endif is for USE_MKL
endif endif
#the next endif is for USE_LAPACK #the next endif is for USE_LAPACK
endif endif
# define (outside) USE_MAGMA for magma support # define (outside) USE_MAGMA for magma support
ifdef USE_MAGMA ifdef USE_MAGMA
ifdef MAGMA_LIB ifndef MAGMA_LDFLAGS
override MAGMA_LDFLAGS= -L$(MAGMA_LIB) ifdef MAGMA_LIB
endif override MAGMA_LDFLAGS= -L$(MAGMA_LIB)
ifdef CUDA_HOME endif
override MAGMA_LDFLAGS+= -L$(CUDA_HOME)/lib64 ifdef CUDA_HOME
endif override MAGMA_LDFLAGS+= -L$(CUDA_HOME)/lib64
override MAGMA_LDFLAGS+= -lmagma -lcudart endif
override MAGMA_LDFLAGS+= -lmagma -lcudart
#the next endif is for MAGMA_LDFLAGS
endif
#the next endif is for USE_MAGMA #the next endif is for USE_MAGMA
endif endif
# define (outside) USE_NVTX for NVIDIA profiling # define (outside) USE_NVTX for NVIDIA profiling
ifdef USE_NVTX ifdef USE_NVTX
override NVTX_FLAGS= -DUSE_NVTX ifndef NVTX_CXXFLAGS
ifdef CUDA_HOME override NVTX_CXXFLAGS= -DUSE_NVTX
override NVTX_FLAGS+= -I$(CUDA_HOME)/include ifdef CUDA_HOME
override NVTX_CXXFLAGS+= -I$(CUDA_HOME)/include
# closes CUDA_HOME # closes CUDA_HOME
endif endif
# closes NVTX_CXXFLAGS
endif
# closes USE_NVTX # closes USE_NVTX
endif endif
# CXXFLAGS defines the default compilation options for the C++ compiler # CXXFLAGS defines the default compilation options for the C++ compiler
ifndef CXXFLAGS ifndef CXXFLAGS
override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) $(MPI_CXXFLAGS) $(NVTX_FLAGS) override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) $(MPI_CXXFLAGS) $(NVTX_CXXFLAGS)
ifdef USE_OPENMP ifdef USE_OPENMP
override CXXFLAGS+= -fopenmp override CXXFLAGS+= -fopenmp
# closes USE_OPENMP # closes USE_OPENMP
endif endif
ifdef USE_ILP64
ifdef USE_ILP64 override CXXFLAGS+= -DUSE_ILP64
override CXXFLAGS+= -DUSE_ILP64 endif
endif ifdef USE_LAPACK
override CXXFLAGS+= -DUSE_LAPACK
ifdef USE_LAPACK ifdef USE_ILP64
override CXXFLAGS+= -DUSE_LAPACK override CXXFLAGS+= -DLAPACK_ILP64
ifdef USE_ILP64 endif
override CXXFLAGS+= -DLAPACK_ILP64
endif
# closes USE_LAPACK # closes USE_LAPACK
endif endif
ifdef USE_MKL
ifdef USE_MKL override CXXFLAGS+= -DUSE_MKL -I$(MKLROOT)/include
override CXXFLAGS+= -DUSE_MKL -I$(MKLROOT)/include ifdef USE_ILP64
ifdef USE_ILP64 override CXXFLAGS+= -DMKL_ILP64
override CXXFLAGS+= -DMKL_ILP64 endif
endif
# closes USE_MKL # closes USE_MKL
endif endif
ifdef USE_OPENMP
ifdef USE_OPENMP override CXXFLAGS+= -fopenmp
override CXXFLAGS+= -fopenmp
# closes USE_OPENMP # closes USE_OPENMP
endif endif
ifdef USE_MAGMA
ifdef USE_MAGMA override CXXFLAGS+= -DUSE_MAGMA
override CXXFLAGS+= -DUSE_MAGMA ifdef CUDA_HOME
ifdef CUDA_HOME override CXXFLAGS+= -I$(CUDA_HOME)/include
override CXXFLAGS+= -I$(CUDA_HOME)/include endif
endif ifdef MAGMA_INCLUDE
ifdef MAGMA_INCLUDE override CXXFLAGS+= -I$(MAGMA_INCLUDE)
override CXXFLAGS+= -I$(MAGMA_INCLUDE) endif
endif ifdef USE_ILP64
ifdef USE_ILP64 override CXXFLAGS+= -DMAGMA_ILP64
override CXXFLAGS+= -DMAGMA_ILP64 endif
endif
# closes USE_MAGMA # closes USE_MAGMA
endif
#closes CXXFLAGS
endif endif
# closes CXXFLAGS
endif
# HDF5_LIB defines the default path to the HDF5 libraries to use # HDF5_LIB defines the default path to the HDF5 libraries to use
# CXXLDFLAGS defines the default linker flags to use for C++ codes # CXXLDFLAGS defines the default linker flags to use for C++ codes
ifndef CXXLDFLAGS ifndef CXXLDFLAGS
ifndef HDF5_LIB ifndef HDF5_LIB
override HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial override HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial
endif endif
override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(STATICFLAG) override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(STATICFLAG)
ifdef USE_LAPACK ifdef USE_LAPACK
override CXXLDFLAGS+= $(LAPACK_LDFLAGS) override CXXLDFLAGS+= $(LAPACK_LDFLAGS)
endif endif
ifdef USE_MAGMA ifdef USE_MAGMA
override CXXLDFLAGS+= $(MAGMA_LDFLAGS) override CXXLDFLAGS+= $(MAGMA_LDFLAGS)
endif endif
override CXXLDFLAGS+= $(LDFLAGS) override CXXLDFLAGS+= $(LDFLAGS)
endif endif
#SOFLAGS defines the additional flags for the c++ compiler to create a shared object file #SOFLAGS defines the additional flags for the c++ compiler to create a shared object file
ifndef SOFLAGS ifndef SOFLAGS
override SOFLAGS=-shared override SOFLAGS=-shared
endif endif
%.o : %.f %.o : %.f
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment