Commit 695f5ded authored by Rainer Weinberger's avatar Rainer Weinberger

added SYSTYPE "Ubuntu" to Makefile

parent 1a40bb80
...@@ -37,11 +37,12 @@ CONFIGVARS := $(shell cat $(BUILD_DIR)/arepoconfig.h) ...@@ -37,11 +37,12 @@ CONFIGVARS := $(shell cat $(BUILD_DIR)/arepoconfig.h)
RESULT := $(shell SRC_DIR=$(SRC_DIR) BUILD_DIR=$(BUILD_DIR) ./git_version.sh) RESULT := $(shell SRC_DIR=$(SRC_DIR) BUILD_DIR=$(BUILD_DIR) ./git_version.sh)
# Default # Default
MPICH_INCL =
MPICH_LIB = -lmpich MPICH_LIB = -lmpich
GMP_LIB = -lgmp GMP_LIB = -lgmp
GSL_LIB = -lgsl -lgslcblas GSL_LIB = -lgsl -lgslcblas
MATH_LIB = -lm -lstdc++ MATH_LIB = -lm -lstdc++
HWLOC_LIB = -lhwloc HWLOC_LIB = -lhwloc
# e.g. Mac OS using MacPorts modules for openmpi, fftw, gsl, hdf5 and hwloc # e.g. Mac OS using MacPorts modules for openmpi, fftw, gsl, hdf5 and hwloc
...@@ -59,10 +60,33 @@ HWLOC_LIB = -L/opt/local/lib -lhwloc ...@@ -59,10 +60,33 @@ HWLOC_LIB = -L/opt/local/lib -lhwloc
# libraries that are included on demand, depending on Config.sh options # libraries that are included on demand, depending on Config.sh options
FFTW_INCL = -I/opt/local/include -I/usr/local/include FFTW_INCL = -I/opt/local/include -I/usr/local/include
FFTW_LIBS = -L/opt/local/lib -I/usr/local/lib FFTW_LIBS = -L/opt/local/lib -I/usr/local/lib
HDF5_INCL = -I/opt/local/include -DH5_USE_16_API HDF5_INCL = -I/opt/local/include -DH5_USE_16_API
HDF5_LIB = -L/opt/local/lib -lhdf5 -lz HDF5_LIB = -L/opt/local/lib -lhdf5 -lz
HWLOC_INCL= -I/opt/local/include HWLOC_INCL= -I/opt/local/include
endif endif
# end of Darwin
# Ubuntu Linux
ifeq ($(SYSTYPE),"Ubuntu")
# compiler and its optimization options
OPTIMIZE = -std=c11 -ggdb -O3 -Wall -Wno-format-security -Wno-unknown-pragmas -Wno-unused-function
# overwrite default:
MPICH_INCL= -I/usr/lib/x86_64-linux-gnu/openmpi/include/
MPICH_LIB = -L/usr/lib/x86_64-linux-gnu/openmpi/lib/ -lmpi
GSL_INCL =
GSL_LIB = -lgsl -lgslcblas
HWLOC_LIB = -lhwloc
# libraries that are included on demand, depending on Config.sh options
FFTW_INCL =
FFTW_LIBS =
HDF5_INCL = -I/usr/include/hdf5/serial/ -DH5_USE_16_API
HDF5_LIB = -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5 -lz
HWLOC_INCL=
endif
# end of Ubuntu
# insert the library paths for your system here, similar to SYSTYPE "Darwin" above # insert the library paths for your system here, similar to SYSTYPE "Darwin" above
...@@ -197,7 +221,7 @@ INCL += debug_md5/Md5.h \ ...@@ -197,7 +221,7 @@ INCL += debug_md5/Md5.h \
time_integration/timestep.h \ time_integration/timestep.h \
utils/dtypes.h \ utils/dtypes.h \
utils/generic_comm_helpers2.h \ utils/generic_comm_helpers2.h \
utils/timer.h utils/timer.h
ifeq (TWODIMS,$(findstring TWODIMS,$(CONFIGVARS))) ifeq (TWODIMS,$(findstring TWODIMS,$(CONFIGVARS)))
OBJS += mesh/voronoi/voronoi_2d.o OBJS += mesh/voronoi/voronoi_2d.o
...@@ -224,7 +248,7 @@ ifeq (COOLING,$(findstring COOLING,$(CONFIGVARS))) ...@@ -224,7 +248,7 @@ ifeq (COOLING,$(findstring COOLING,$(CONFIGVARS)))
OBJS += cooling/cooling.o OBJS += cooling/cooling.o
INCL += cooling/cooling_vars.h \ INCL += cooling/cooling_vars.h \
cooling/cooling_proto.h cooling/cooling_proto.h
SUBDIRS += cooling SUBDIRS += cooling
endif endif
ifeq (FOF,$(findstring FOF,$(CONFIGVARS))) ifeq (FOF,$(findstring FOF,$(CONFIGVARS)))
...@@ -271,20 +295,20 @@ endif ...@@ -271,20 +295,20 @@ endif
FFTW_LIB = FFTW_LIB =
ifeq (PMGRID, $(findstring PMGRID, $(CONFIGVARS))) ifeq (PMGRID, $(findstring PMGRID, $(CONFIGVARS)))
ifeq (DOUBLEPRECISION_FFTW,$(findstring DOUBLEPRECISION_FFTW,$(CONFIGVARS))) # test for double precision libraries ifeq (DOUBLEPRECISION_FFTW,$(findstring DOUBLEPRECISION_FFTW,$(CONFIGVARS))) # test for double precision libraries
FFTW_LIB = $(FFTW_LIBS) -lfftw3 FFTW_LIB = $(FFTW_LIBS) -lfftw3
else else
FFTW_LIB = $(FFTW_LIBS) -lfftw3f FFTW_LIB = $(FFTW_LIBS) -lfftw3f
endif endif
endif endif
ifneq (HAVE_HDF5,$(findstring HAVE_HDF5,$(CONFIGVARS))) ifneq (HAVE_HDF5,$(findstring HAVE_HDF5,$(CONFIGVARS)))
HDF5_INCL = HDF5_INCL =
HDF5_LIB = HDF5_LIB =
endif endif
ifneq (IMPOSE_PINNING,$(findstring IMPOSE_PINNING,$(CONFIGVARS))) ifneq (IMPOSE_PINNING,$(findstring IMPOSE_PINNING,$(CONFIGVARS)))
HWLOC_INCL = HWLOC_INCL =
HWLOC_LIB = HWLOC_LIB =
endif endif
...@@ -292,7 +316,7 @@ endif ...@@ -292,7 +316,7 @@ endif
#combine compiler options# #combine compiler options#
########################## ##########################
CFLAGS = $(OPTIMIZE) $(HDF5_INCL) $(GSL_INCL) $(FFTW_INCL) $(HWLOC_INCL) -I$(BUILD_DIR) CFLAGS = $(OPTIMIZE) $(MPICH_INCL) $(HDF5_INCL) $(GSL_INCL) $(FFTW_INCL) $(HWLOC_INCL) -I$(BUILD_DIR)
LIBS = $(GMP_LIB) $(MATH_LIB) $(MPICH_LIB) $(HDF5_LIB) $(GSL_LIB) $(FFTW_LIB) $(HWLOC_LIB) LIBS = $(GMP_LIB) $(MATH_LIB) $(MPICH_LIB) $(HDF5_LIB) $(GSL_LIB) $(FFTW_LIB) $(HWLOC_LIB)
...@@ -320,7 +344,7 @@ RESULT := $(shell mkdir -p $(SUBDIRS) ) ...@@ -320,7 +344,7 @@ RESULT := $(shell mkdir -p $(SUBDIRS) )
#build rules# #build rules#
############# #############
all: check build all: check build
build: $(EXEC) build: $(EXEC)
...@@ -356,7 +380,7 @@ check: $(CONFIG_CHECK) ...@@ -356,7 +380,7 @@ check: $(CONFIG_CHECK)
check_docs: $(DOCS_CHECK) check_docs: $(DOCS_CHECK)
$(CONFIG_CHECK): $(TO_CHECK) $(CONFIG) check.py $(CONFIG_CHECK): $(TO_CHECK) $(CONFIG) check.py
@$(PYTHON) check.py 2 $(CONFIG) $(CONFIG_CHECK) defines_extra $(TO_CHECK) @$(PYTHON) check.py 2 $(CONFIG) $(CONFIG_CHECK) defines_extra $(TO_CHECK)
$(BUILD_DIR)/%.o.check: $(SRC_DIR)/%.c Template-Config.sh defines_extra check.py $(BUILD_DIR)/%.o.check: $(SRC_DIR)/%.c Template-Config.sh defines_extra check.py
...@@ -388,4 +412,3 @@ $(BUILD_DIR)/Makefile.check: Makefile Template-Config.sh defines_extra check.py ...@@ -388,4 +412,3 @@ $(BUILD_DIR)/Makefile.check: Makefile Template-Config.sh defines_extra check.py
$(BUILD_DIR)/Config.check: Template-Config.sh check.py $(BUILD_DIR)/Config.check: Template-Config.sh check.py
@$(PYTHON) check.py 4 Template-Config.sh $@ @$(PYTHON) check.py 4 Template-Config.sh $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment