-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.top
79 lines (67 loc) · 2.91 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
79
#####################################################################################
#
#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
LIBP_ARCH=GNU
#absolute path to StreamParanumal
export STREAM_DIR:=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
export LIBP_DIR=${STREAM_DIR}
export LIBP_INCLUDE_DIR=${STREAM_DIR}/include
export LIBP_LIBS_DIR=${STREAM_DIR}/libs
export LIBP_BLAS_DIR?=/usr/lib/x86_64-linux-gnu
export LIBP_BLAS_LIB=-L${LIBP_BLAS_DIR} -lopenblas
#include OCCA
export OCCA_DIR=${STREAM_DIR}/occa
#compilers to use for C/C++
export LIBP_CC = mpicc
export LIBP_CXX= mpic++
export LIBP_LD = mpic++
export LIBP_INCLUDES=-I${LIBP_INCLUDE_DIR} -I${OCCA_DIR}/include
export LIBP_LIBS= ${LIBP_BLAS_LIB} \
-Wl,-rpath,$(OCCA_DIR)/lib -L$(OCCA_DIR)/lib -locca
ifneq (,${debug})
export LIBP_CFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas
export LIBP_CXXFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas -std=c++17
export LIBP_DEFINES=-DLIBP_DEBUG
else
export LIBP_CFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function
export LIBP_CXXFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function -std=c++17
export LIBP_DEFINES=
ifeq (GNU,${LIBP_ARCH})
LIBP_CFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
LIBP_CXXFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
else ifeq (INTEL,${LIBP_ARCH})
LIBP_CFLAGS+=-funroll-loops -xHost
LIBP_CXXFLAGS+=-funroll-loops -xHost
else
$(error unknown arch for [LIBP_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 LIBP_MAKETOP_LOADED=true