-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmake.top
78 lines (66 loc) · 2.98 KB
/
make.top
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
#####################################################################################
#
#The MIT License (MIT)
#
#Copyright (c) 2017-2022 Tim Warburton, Noel Chalmers, Jesse Chan, Ali Karakus
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
#
#####################################################################################
#can be GNU or INTEL
HIPBONE_ARCH=GNU
#absolute path to HIPBONE
export HIPBONE_DIR:=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
export HIPBONE_INCLUDE_DIR=${HIPBONE_DIR}/include
export HIPBONE_LIBS_DIR=${HIPBONE_DIR}/libs
export OPENBLAS_DIR?=/usr/lib/x86_64-linux-gnu
export HIPBONE_BLAS_LIB=-L${OPENBLAS_DIR} -lopenblas
#include OCCA
export OCCA_DIR=${HIPBONE_DIR}/occa
#compilers to use for C/C++
export HIPBONE_CC = mpicc
export HIPBONE_CXX= mpic++
export HIPBONE_LD = mpic++
export HIPBONE_INCLUDES=-I${HIPBONE_INCLUDE_DIR} -I${OCCA_DIR}/include
export HIPBONE_LIBS= ${HIPBONE_BLAS_LIB} \
-Wl,-rpath,$(OCCA_DIR)/lib -Wl,-rpath,${OPENBLAS_DIR} -L$(OCCA_DIR)/lib -locca
ifneq (,${debug})
export HIPBONE_CFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas
export HIPBONE_CXXFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas -std=c++17
export HIPBONE_DEFINES=-DLIBP_DEBUG
else
export HIPBONE_CFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function
export HIPBONE_CXXFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function -std=c++17
export HIPBONE_DEFINES=
ifeq (GNU,${HIPBONE_ARCH})
HIPBONE_CFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
HIPBONE_CXXFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
else ifeq (INTEL,${HIPBONE_ARCH})
HIPBONE_CFLAGS+=-funroll-loops -xHost
HIPBONE_CXXFLAGS+=-funroll-loops -xHost
else
$(error unknown arch for [HIPBONE_ARCH] specified)
endif
endif
export OBJ_COLOR = \033[0;36m
export LIB_COLOR = \033[0;34m
export EXE_COLOR = \033[0;32m
export SOL_COLOR = \033[0;33m
export NO_COLOR = \033[m
export HIPBONE_MAKETOP_LOADED=true