-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake.inc.cpu
63 lines (54 loc) · 2.06 KB
/
make.inc.cpu
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
# This is an example configuration for CPU backend (default)
# Uncomment to use single precision (default is double precision)
# H2OPUS_USE_SINGLE_PRECISION = 1
# detect if MKL is available
ifneq ($(MKLROOT),)
# Tell H2OPUS to take advantage of MKL routines
H2OPUS_USE_MKL = 1
else
ifdef H2OPUS_USE_MKL
undefine H2OPUS_USE_MKL
endif
endif
# C++ compiler
CXX ?= g++
# if you want to use the distributed version, use the MPI compiler
# H2OPUS_USE_MPI = 1
# CXX = mpicxx
# Compiler flags
CXXFLAGS = -Wall -fPIC -fopenmp -O3 -std=c++14 -pthread -DH2OPUS_PROFILING_ENABLED
# Linker flags
LDFLAGS = -lstdc++ -ldl -lpthread -lm -fopenmp
# special math headers and linking line
ifneq ($(MKLROOT),)
# We use the random number generator library VSL
BLAS_INCDIR = $(MKLROOT)/include
#alternatively, we can use CXXCPPFLAGS
#CXXCPPFLAGS += -I/$(MKLROOT)/include
# We link against the multithreaded version
# BLAS calls within batched routines will be sequential because we use
# mkl_domain_set_num_threads(H2OPUS_BATCH_BLAS_THREADS, MKL_DOMAIN_BLAS)
# use CXXCPPFLAGS = -DH2OPUS_BATCH_BLAS_THREADS=n to change the default value of 1
BLAS_LIBS = -Wl,-rpath,$(MKLROOT)/lib/intel64 -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core
else
# this example file uses openblas
# but you can use your favorite BLAS/LAPACK distro
# H2OPUS has special support for
# - MKL (see above)
# - BLIS/FLAME (see make.inc.aocl)
# - ESSL (see make.inc.ibm)
# - ASL (see make.inc.nec)
ifneq ($(OPENBLAS_DIR),)
BLAS_LIBS = -Wl,-rpath,$(OPENBLAS_DIR)/lib -L$(OPENBLAS_DIR)/lib -lopenblas
else # fallback to system-wide availability
BLAS_LIBS = -llapack -lblas
endif
# Specify Fortran name mangling (default is add)
# H2OPUS_FMANGLE_TYPE = add # e.g. dgemm -> dgemm_
# H2OPUS_FMANGLE_TYPE = upper # e.g. dgemm -> DGEMM
# H2OPUS_FMANGLE_TYPE = nochange # e.g. dgemm -> dgemm
endif
# for CPU only builds, we need Thrust headers
THRUST_INCDIR = $(THRUST_DIR)/include
#alternatively, we can use CXXCPPFLAGS
#CXXCPPFLAGS += $(THRUST_DIR)/include