forked from ochubar/Radia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (51 loc) · 1.65 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
58
59
# This Makefile is to compile RADIA with optional compilation of FFTW-2.1.5 library.
#
# The following options are available:
# - `make all` - will compile FFTW, C++ core and Python lib;
# - `make fftw` - will compile FFTW only;
# - `make` - will compile C++ core and Python lib;
# - `make clean` - will clean temporary files.
#
# Updated by Maksim Rakitin (NSLS-II, BNL) on May 2, 2016.
root_dir = $(realpath .)
env_dir = $(root_dir)/env
ext_dir = $(root_dir)/ext_lib
gcc_dir = $(root_dir)/cpp/gcc
py_dir = $(root_dir)/cpp/py
fftw_version = fftw-2.1.5
fftw_dir = $(fftw_version)
fftw_file = $(fftw_version).tar.gz
log_fftw = /dev/null
examples_dir = $(env_dir)/radia_python
export MODE ?= 0
timeout=20
nofftw: core pylib
all: clean fftw core pylib
fftw:
if [ ! -d "$(ext_dir)" ]; then \
mkdir $(ext_dir); \
fi; \
cd $(ext_dir); \
if [ ! -f "$(fftw_file)" ]; then \
wget https://raw.githubusercontent.com/ochubar/SRW/master/ext_lib/$(fftw_file); \
fi; \
if [ -d "$(fftw_dir)" ]; then \
rm -rf $(fftw_dir); \
fi; \
tar -zxf $(fftw_file); \
cd $(fftw_dir); \
./configure --enable-float --with-pic; \
sed 's/^CFLAGS = /CFLAGS = -fPIC /' -i Makefile; \
make -j8 && cp fftw/.libs/libfftw.a $(ext_dir); \
cd $(root_dir); \
rm -rf $(ext_dir)/$(fftw_dir);
core:
#cd $(gcc_dir); make -j8 clean lib
cd $(gcc_dir); make clean lib
pylib:
cd $(py_dir); make python
clean:
rm -f $(ext_dir)/libfftw.a $(gcc_dir)/libradia.a $(gcc_dir)/radia*.so; \
rm -rf $(ext_dir)/$(fftw_dir)/py/build/;
if [ -d $(root_dir)/.git ]; then rm -f $(examples_dir)/radia*.so && (git checkout $(examples_dir)/radia*.so 2>/dev/null || :); fi;
.PHONY: all clean core fftw nofftw pylib