-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_trilerp.sh
executable file
·38 lines (32 loc) · 1.77 KB
/
build_trilerp.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
# This builds script works for a V100
# If you have a dev build of CCTBX built with CONDA,
# then point to the conda installation:
export CPRE=/global/cfs/cdirs/lcls/dermen/d9114_sims/CrystalX/conda_base
export CCTBX_MOD=/global/cfs/cdirs/lcls/dermen/d9114_sims/CrystalNew/modules
# Download cub package for block reduction https://nvlabs.github.io/cub/
export CUB=./CUB/cub-1.8.0/cub
# these arch flags work for v100 and cuda 11
export NVCCFLAGS='--generate-code=arch=compute_70,code=sm_70'
nvcc -c cuda_trilerp.cu -I$CUB -I$CPRE/include -I$CPRE/include/python3.8 \
-I$CCTBX_MOD/eigen -L$CPRE/lib -L$CPRE/lib/python3.8/config-3.8-x86_64-linux-gnu/ \
-l python3.8 -lboost_python38 -lboost_system -lboost_numpy38 \
--compiler-options=-lstdc++,-fPIC,-O3 --expt-relaxed-constexpr $NVCCFLAGS \
-o cuda_trilerp.o
nvcc -c orient_match.cu -I$CPRE/include -I$CPRE/include/python3.8 \
-I$CCTBX_MOD/eigen -L$CPRE/lib -L$CPRE/lib/python3.8/config-3.8-x86_64-linux-gnu/ \
-l python3.8 -lboost_python38 -lboost_system -lboost_numpy38 \
--compiler-options=-lstdc++,-fPIC,-O3 --expt-relaxed-constexpr $NVCCFLAGS \
-o orient_match.o
nvcc -c emc_ext.cpp -I$CUB -I$CPRE/include -I$CPRE/include/python3.8 \
-I$CCTBX_MOD/eigen -L$CPRE/lib -L$CPRE/lib/python3.8/config-3.8-x86_64-linux-gnu/ \
-lpython3.8 -lboost_python38 -lboost_system -lboost_numpy38 \
--compiler-options=-lstdc++,-fPIC,-O3 --expt-relaxed-constexpr \
-o emc_ext.o
# build the shared library
g++ -shared emc_ext.o cuda_trilerp.o orient_match.o \
-L$CPRE/lib -L$CPRE/lib/python3.8/config-3.8-x86_64-linux-gnu/ \
-L$CUDA_HOME/lib64 -lpython3.8 -lboost_python38 \
-lboost_numpy38 -lcudart \
-o emc.so
# NOTE: import with python: "from simemc.emc import lerpy"
# (just ensure the folder containing emc.so is in PYTHONPATH)