forked from mashephe/AmpTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.settings
94 lines (67 loc) · 2.32 KB
/
Makefile.settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
######### DEFAULT COMPILER SETTINGS
CXX := gcc
CXX_FLAGS := -O3
GIT_VERSION := "$(shell git describe --abbrev=4 --dirty --always --tags)"
CXX_FLAGS += -DATVERSION=\"$(GIT_VERSION)\"
######### END DEFAULT COMPILER SETTINGS
######### USER BUILD SETTINGS
# These can be used to control preprocessor definitons to control
# the compilation of the code.
# Default behavior is to build with double precision stoarge for
# event-level data like amplitudes and kinematics -- speed and
# memory use can be optimized by make FP32=1 but at a risk of
# numerical issues in the minimization algorithm.
ifdef FP32
CXX_DEFINES := -DAMPTOOLS_GDOUBLE_FP32
else
CXX_DEFINES := -DAMPTOOLS_GDOUBLE_FP64
endif
# This option is here to so that likelihood values for the current
# version can be compared with those from version 0.13.1 and prior.
# At some point this build option will be deprecated. As of 0.14.1
# the legacy scaling is the default. The new scaling can be used
# but the likelihoods are not easy to compare on MPI vs. non-MPI
# implementations.
ifdef LEGACY_LN_LIK
CXX_DEFINES += -DUSE_LEGACY_LN_LIK_SCALING
endif
CXX_FLAGS += $(CXX_DEFINES)
######### END USER BUILD SETTINGS
######### MPI COMPILER SETTINGS
# to use MPI, an MPI compiler should be in the user path -- this will be used
# to compile MPI executables. In the project libraries (amplitudes, etc.)
# there should be no MPI specific code.
ifdef MPI
MPICXX := mpicxx
endif
######### END MPI SETTINGS
######### GPU / CUDA COMPILER SETTINGS
# to use CUDA the environment variable CUDA_INSTALL_PATH must be defined
# and the proper architecture specified for the GPU. In addition
# the nvcc compiler (likely in $CUDA_INSTALL_PATH/bin) needs to be in
# the user's path
NVCC := nvcc
NVCC_FLAGS := -m64 $(CXX_DEFINES)
ifndef GPU_ARCH
GPU_ARCH := sm_70
endif
NVCC_FLAGS += -arch=$(GPU_ARCH)
ifdef GPU # otherwise these variables will be empty to avoid problems
ifndef CUDA_INSTALL_PATH
$(error GPU build requested but CUDA_INSTALL_PATH is not defined.)
endif
# the path to cuda specific libraries can vary with architecture
CUDA_LIBS := -L$(CUDA_INSTALL_PATH)/lib64
CUDA_LINK := -lcudart
CXX_FLAGS += -DGPU_ARCH=\"$(GPU_ARCH)\"
endif
######### END GPU / CUDA SETTINGS
######### GENERAL CHECKS
# check for verbose output
ifdef VERBOSE
Q :=
vecho = @true
else
Q := @
vecho = @echo
endif