forked from threeML/threeML-analysis-workshop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_from_conda.sh
executable file
·78 lines (53 loc) · 2.15 KB
/
install_from_conda.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
#credit to Colas, Giacomo, and possibly others
set -e
# Set the conda environment name
export ENVIRONMENT_NAME=fvh_threeML
# Set the directory where we will install AERIE and the HAWC externals
export THREEML_TEST_DIR=~/threeML_tests
# Set the number of threads
export N_THREADS=4
# Create our conda environment installing the Fermi ST as well as threeML and the
# externals needed
conda create -y --name $ENVIRONMENT_NAME -c threeml -c conda-forge/label/cf201901 -c fermi fermitools threeml boost=1.63 cmake zeromq cppzmq healpix_cxx=3.31 pytest==3.9.3 matplotlib numba pyyaml==3.13 yaml==0.1.7 fermipy
# Activate the conda environment
source activate $ENVIRONMENT_NAME
#This version of numpy may not be available via conda.
pip install numpy==1.15.3
pip install naima
# Install root_numpy making sure it is built against the installed version of ROOT
pip uninstall root_numpy
export MACOSX_DEPLOYMENT_TARGET=10.10
pip install --no-binary :all: root_numpy
#another package needed for HAL
pip install reproject
# Install HAL
pip uninstall hawc_hal -y ; pip install git+https://github.com/threeML/hawc_hal.git
# Write setup file
# NOTE: variables will be expanded
cat > $HOME/init_conda_fvh.sh <<- EOM
# Empty potentially harmful variables
unset LD_LIBRARY_PATH
unset DYLD_LIBRARY_PATH
unset PYTHONPATH
# Activate environment
source activate $ENVIRONMENT_NAME
export FERMI_DIR=${CONDA_PREFIX}/share/fermitools/
export THREEML_TEST_DIR=${THREEML_TEST_DIR}
export PATH=$PATH
export PYTHONPATH=${PYTHONPATH}
if [ "$(uname)" == "Darwin" ]; then
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
else
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
fi
# Set this here so that following builds of AERIE or any other software will find their
# libraries
# flags for C++ needed for C++11 support (-Wno-narrowing is needed for clang)
export CXXFLAGS="-std=c++11 -I${CONDA_PREFIX}/include -Wno-narrowing"
export LDFLAGS="-Wl,-rpath,${CONDA_PREFIX}/lib,-rpath,${CONDA_PREFIX}/lib/root -L${CONDA_PREFIX}/lib -L${CONDA_PREFIX}/lib/root"
# These settings enhance a little performances in 3ML
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
EOM