-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMake.rules.in
95 lines (76 loc) · 1.96 KB
/
Make.rules.in
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
#
# Copyright (C) 2011, 2014 International Business Machines
#
# Author: Frank Liu, IBM
#
# All Rights Reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
#
# top level switches
CC = @CC@
CXX = @CXX@
FC = @F77@
AR = @AR@
RANLIB = @RANLIB@
CXX_STDCXX_0X_FLAG = @CXX_STDCXX_0X_FLAG@
LOC_HAVE_LIBZ = @LOC_HAVE_LIBZ@
# where to find the libraries
LIBHOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
# optimization flags
OPT_FLAG = -O3
# Debug
MYDEBUG =
# bits info
# remove 32 bit support
BITS = -m64
# arch type
ARCH := $(shell uname )
## gfortran libs
LIBFORTRAN = @LDFLAGS@ -lgfortran
## where to find blas, returned by ax_loc_blas
ifeq (${ARCH},Darwin)
BLAS = -L${LIBHOME}/ThirdParty/BLAS -lblas
DYNPATH_CMD = DYLD_FALLBACK_LIBRARY_PATH=../ThirdParty/UF
else
BLAS = @LOC_BLAS_LIBS@
DYNPATH_CMD = LD_LIBRARY_PATH=../ThirdParty/UF
endif
# where to find required libraries
SPLINE_HOME=$(LIBHOME)/ThirdParty/CMLIB
UF_HOME=$(LIBHOME)/ThirdParty/UF
BLAS_HOME=$(LIBHOME)/ThirdParty/BLAS
# sprnt library
SRC_HOME=${LIBHOME}/src
SPT_HOME=${LIBHOME}/spt
UTL_HOME=${LIBHOME}/util
# test
TEST_HOME=${LIBHOME}/examples
## get git hash
GET_GIT_HASH := $(shell git rev-parse --short=8 HEAD 1>&2 >/dev/null; echo $$?)
ifneq ($(GET_GIT_HASH),0)
GIT_HASH := "xxxxxxxx"
else
GIT_HASH := $(shell git rev-parse --short=8 HEAD)
endif
# detect number of cores, works only on linux and mac os
# detect the number of cores
# OS flag only works for Linux and Mac
OS := $(shell uname -s)
ifeq ($(OS),Linux)
NPROC := $(shell grep -c ^processor /proc/cpuinfo)
else
# need to handle mac OS
NPROC := $(shell sysctl -n hw.ncpu)
endif
# x86 assumption: 2 thread per core, minimal 1
NPROC := $(shell echo "$(NPROC)/2"|bc)
ifeq ($(NPROC),0)
NPROC := 1
endif
# we are done
# Local Variables:
# mode: makefile
# End: