-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
Β·60 lines (44 loc) Β· 2.07 KB
/
build.sh
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
clear
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
##note this bug https://bugs.python.org/issue1011113 which may mean that python setup.py install ignores --build-base
######################## CMTH specific stuff ########################################
if [ "$HOME" = "/home/tch14" ]; then
echo -e "${GREEN}Machine recognised as CMTH${NC}"
. /home/tch14/miniconda3/etc/profile.d/conda.sh
echo -e "sourced /home/tch14/miniconda3/etc/profile.d/conda.sh${NC}"
conda activate intelpython3.5
echo -e "activated cmth_intelpython3 conda environment${NC}"
DIR="./cmth"
###################### CX1 specific stuff ########################################
elif [ "$HOME" = "/rds/general/user/tch14/home" ]; then
echo -e "${GREEN}Machine recognised as CX1${NC}"
module load intel-suite anaconda3/personal
echo "Loaded intel-suite and anaconda3/personal"
. /apps/jupyterhub/2018-02-19/anaconda/etc/profile.d/conda.sh
conda activate /home/tch14/anaconda3/envs/idp
echo "activated idp conda environment"
source $MKL_HOME/bin/mklvars.sh intel64
echo "sourced mklvars.sh"
#doing this fixes a bug with the fact that on cx1 /tmp is on a differnt filesystem to ~
TMPDIR="./cx1/tmp"
DIR="./cx1"
else
echo "Machine not recognised as cx1 or cmth"
fi
###################### general stuff ########################################
echo -e "${GREEN}Numpy include dirs are:${NC}"
echo $(python -c 'import numpy; print(numpy.get_include())')
echo -e "${GREEN}Starting Build${NC}"
mkdir -p ${DIR}_build
mkdir -p ${DIR}_dist
#python setup.py build --build-base=$BUILD_DIR bdist_wheel
#python setup.py build install
python setup.py build --build-base=${DIR}_build bdist_wheel --dist-dir=${DIR}_dist
echo 'Wheel file path is ' ${DIR}_dist/$(ls -t ${DIR}_dist | head -n 1)
pip uninstall -y FKMC
pip install ${DIR}_dist/$(ls -t ${DIR}_dist | head -n 1)
#mv /workspace/tch14/conda-envs/cmth_intelpython3/lib/python3.6/site-packages/FKMC-0-py3.6-linux-x86_64.egg/MC /workspace/tch14/conda-envs/cmth_intelpython3/lib/python3.6/site-packages/FKMC-0-py3.6-linux-x86_64.egg/FKMC
mv FKMC/*.c ${DIR}_build
mv FKMC/*.html ${DIR}_build