-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_build_dev_venv
More file actions
executable file
·57 lines (46 loc) · 2.08 KB
/
_build_dev_venv
File metadata and controls
executable file
·57 lines (46 loc) · 2.08 KB
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
#!/bin/bash
set -e
test -z "$PYTHON" && PYTHON=python3
### create virtual environment for CATCH development
test ! -e .venv && $PYTHON -m venv .venv --prompt='catch-v1'
source .venv/bin/activate
test -z "$PYTHON_ROOT" && PYTHON_ROOT=`${PYTHON} -c "import sys; print(sys.exec_prefix)"`
python3 -m pip install -U pip setuptools wheel
pushd .
mkdir -p build
cd build
# install abseil from source, as per s2geometry's readme
# (it must be configured with -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
# We are using C++11, and the last version to support it is LTS 20220623.1
if [ ! -e $VIRTUAL_ENV/lib/libabsl_base.a ]; then
ABSEIL_TAG=20220623.1
test ! -e ${ABSEIL_TAG}.tar.gz && wget https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_TAG}.tar.gz
test ! -e abseil-cpp-${ABSEIL_TAG} && tar xzf ${ABSEIL_TAG}.tar.gz
cd abseil-cpp-${ABSEIL_TAG}
mkdir -p build
cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON ..
make -j $(nproc)
make install
cd ../..
fi
export LDFLAGS="-L$VIRTUAL_ENV/lib -Wl,-rpath=$VIRTUAL_ENV/lib"
export CXXFLAGS="-I$VIRTUAL_ENV/include"
if [ ! -e $VIRTUAL_ENV/lib/libs2.so ]; then
S2_TAG=v0.10.0
test ! -e ${S2_TAG}.tar.gz && wget https://github.com/google/s2geometry/archive/refs/tags/${S2_TAG}.tar.gz
test ! -e s2geometry-${S2_TAG:1} && tar xzf ${S2_TAG}.tar.gz
cd s2geometry-${S2_TAG:1}
patch src/python/CMakeLists.txt ../../s2geometry-v0.10-py-cmakelists.patch
mkdir -p build
cd build
cmake -DWITH_PYTHON=ON -DCMAKE_PREFIX_PATH=${VIRTUAL_ENV} -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=${VIRTUAL_ENV} -Wno-dev -DPython3_FIND_STRATEGY=LOCATION -DPython3_ROOT_DIR=${PYTHON_ROOT} ..
make -j $(nproc)
make install
fi
popd
# install python libraries
python3 -m pip install numpy sbpy cython psycopg2-binary
python3 -m pip install -e git+https://git@github.com/Small-Bodies-Node/sbsearch.git#egg=sbsearch
python3 -m pip install -e .[test,figures]
python3 -m pip install pycairo pygobject ipython