-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (50 loc) · 1.05 KB
/
Makefile
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
## Makefile
##
## default variable setting
##
MAKE=$(shell which make)
PYTHON ?= $(shell which python)
PYTHONCONFIG ?= $(shell which python3-config)
CC ?= $(shell which gcc)
UNAME := $(shell uname)
PREFIX=$(shell echo $(PetraM))
ifeq ($(PREFIX),)
PREFIX := /usr/local/PetraM
endif
### compilers
MPILIB ?= mpi
MPICC ?= mpicc
MPICXX ?= mpicxx
MPIFC ?= mpifort
MPIFL ?= mpifort
#
# these are to absorb the difference between linux and macOS
#
# no-compact-unwind (this option is not used anymore...)
NOCOMPACTUNWIND ?=
ifeq ($(UNAME), Darwin)
NOCOMPACTUNWIND = -Wl,-no_compact_unwind
endif
MPI_INC_DIR ?= $(PREFIX)/include
MUMPS_SOLVE_DIR ?= $(PREFIX)/lib
MUMPS_INC_DIR ?= $(PREFIX)/include
MKL ?=
CC=${MPICC}
CXX=${MPICXX}
export
default: so
.PHONEY:all install
##
cxx:
$(MAKE) -C petram/ext cxx
cleancxx:
$(MAKE) -C petram/ext cleancxx
so:
$(PYTHON) setup.py build
install:
mkdir -p $(PREFIX)
for dir in $(PREFIX); do mkdir -p $(PREFIX)/$$dir; done
$(PYTHON) -m pip install ./ --prefix=$(PREFIX)
clean:
$(MAKE) -C petram/ext clean
rm -rf build/*