-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
142 lines (123 loc) · 3.7 KB
/
Makefile.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
# This is the Makefile for the python related programs
#
# Make sure you have defined $PYTHON as this directory first
# then type:
#
# ./configure [--with-cuda]
# make install
#
# If this fails, consult https://github.com/agnwinds/python/wiki/Installing-Python
# for manual install.
CMAKE = mpicc
GSL_LOCATION = $(PYTHON)/software/gsl-2.6
CUNIT_LOCATION = $(PYTHON)/software/cunit-3.2.7
INSTALL_LIBS = True
ifeq (True, $(INSTALL_LIBS))
# GNU Science library -- math routines
MOVE_GSL = \
mkdir $(PYTHON)/include/gsl; \
mv $(GSL_LOCATION)/include/gsl/* $(PYTHON)/include/gsl; \
mv $(GSL_LOCATION)/lib/lib* $(PYTHON)/lib;
INSTALL_GSL = \
cd $(GSL_LOCATION); \
./configure --disable-shared --prefix=$(GSL_LOCATION) cc=gcc CPP=cpp; \
make -i; \
make check 2>&1; \
make -i install; \
make clean; \
$(MOVE_GSL)
INSTALL_GSL_NO_CHECK = \
cd $(GSL_LOCATION); \
./configure --disable-shared --prefix=$(GSL_LOCATION) cc=gcc CPP=cpp; \
make -i; \
make -i install; \
make clean; \
$(MOVE_GSL)
# CUnit -- unit test framework: built using CMake, so only build if installed
ifneq ($(shell which cmake), )
INSTALL_CUNIT = \
mkdir -p $(PYTHON)/include/CUnit; \
cd $(CUNIT_LOCATION); \
mkdir -p build; \
cd build; \
cmake ..; \
cmake --build .; \
mv CUnit/libcunit.a $(PYTHON)/lib; \
cp ../CUnit/CUnit/*.h $(PYTHON)/include/CUnit/; \
cd ..; \
rm -rf build;
MAKE_CHECK = \
cd $(PYTHON)/source; \
make check CC=$(CMAKE)
else
INSTALL_CUNIT = echo 'Unable to install CUnit as CMake (https://cmake.org) is not installed'
MAKE_CHECK =
endif
else
INSTALL_GSL = echo 'Not installing GSL due to INSTALL_LIBS != True'
INSTALL_GSL_NO_CHECK = echo 'Not installing GSL due to INSTALL_LIBS != True'
INSTALL_CUNIT = echo 'Not installing CUnit due to INSTALL_LIBS != True'
MAKE_CHECK =
endif
MAKE_PYTHON = \
cd $(PYTHON)/source; \
make CC=$(CMAKE) INDENT=no all \
# Compile and install the libraries and Python
install:
@echo 'Installing Python. the radiative transfer code'
@echo 'Installing in directory '$(PYTHON)
# Then make GSL library
@echo 'Installing GSL library...'
$(INSTALL_GSL)
# Now make the unit test framework
@echo 'Installing CUnit library...'
$(INSTALL_CUNIT)
# Finally, make the latest release
@echo 'Making source code...'
$(MAKE_PYTHON)
@echo 'all done'
# Install Python for travis -- as above, minus post-installation checks for GSL
gh_workflow_install:
@echo 'Installing Python. the radiative transfer code'
@echo 'Installing in directory '$(PYTHON)
# Then make GSL library
@echo 'Installing GSL library...'
$(INSTALL_GSL_NO_CHECK)
# Then make CUnit Library
@echo 'Installing CUnit library...'
$(INSTALL_CUNIT)
#finally, make the latest release
@echo 'Making source code...'
$(MAKE_PYTHON)
@echo 'all done'
# Runs Python's unit tests
check:
cd $(PYTHON)/source; make check
# Runs through the install for GSL and post-installation checks
gsl:
@echo 'Installing the GNU Science Library'
$(INSTALL_GSL)
# Runs through the install for CUnit
cunit:
@echo 'Installing CUnit unit test framework'
$(INSTALL_CUNIT)
# Run the regular clean for the libraries and Python. CUnit doesn't need this,
# as we delete the CMake build directory after installing it
clean:
rm -f *.o *~
cd $(GSL_LOCATION); make clean;
rm -rf $(CUNIT_LOCATION)/build
cd $(PYTHON)/source/; make clean
# Runs a more rigorous clean for the libraries and Python. CUnit doesn't need
# this, as we delete the CMake build directory after installing it
distclean:
rm -f *.o *~
cd $(GSL_LOCATION); make distclean
rm -rf $(CUNIT_LOCATION)/build
cd $(PYTHON)/source/; make clean
# Remove just the libraries
rm_lib:
rm -rf $(PYTHON)/include/gsl
rm -rf $(PYTHON)/include/CUnit
rm -f $(PYTHON)/lib/lib*