forked from pyoomph/pyoomph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·65 lines (52 loc) · 2.28 KB
/
install.sh
File metadata and controls
executable file
·65 lines (52 loc) · 2.28 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
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
COLOR_OUTPUT=-fdiagnostics-color=always
#if git help &>/dev/null ; then
#PYOOMPH_GIT_HASH=$(git rev-parse HEAD)
#PYOOMPH_BRANCH=$(git branch --show-current)
#export PYOOMPH_VERSION_INFO=-DPYOOMPH_GIT_HASH="\"${PYOOMPH_GIT_HASH}\""\ -DPYOOMPH_BRANCH="\"${PYOOMPH_BRANCH}\""
#else
#PYOOMPH_VERSION_INFO=
#fi
#PYVERS=$(python3 -c 'import sys; print(sys.version_info>=(3,10,12));')
PYVERS=$(python3 -c 'import pip; print(int(pip.__version__.split(".")[0])>=24);')
if [[ "$PYVERS" == "True" ]]; then
EDITABLE_MODE="--config-settings editable_mode=strict"
else
echo "ERROR: Please upgrade pip to at least version 24.0!"
echo "python -m pip install --upgrade pip"
exit
EDITABLE_MODE=
fi
if [[ "$PYOOMPH_CONFIG_FILE" == "" ]]; then
cd $(readlink -f $(dirname $0))
echo "Sourcing default config pyoomph_config.env"
source pyoomph_config.env || exit 1
PYOOMPH_CONFIG_FILE=pyoomph_config.env
else
echo "Sourcing custom config file $PYOOMPH_CONFIG_FILE"
source "$PYOOMPH_CONFIG_FILE" || exit 1
fi
if $PYOOMPH_USE_MPI; then
MPICCBINARY=mpic++
else
MPICCBINARY=$CXX
fi
if [[ $MPICCBINARY == "" ]]; then
MPICCBINARY=g++
fi
if [[ "$OSTYPE" != "darwin"* ]]; then
cd $(readlink -f $(dirname $0))
if which ccache &>/dev/null; then
NPY_NUM_BUILD_JOBS=4 CXX="$MPICCBINARY -pthread -g3 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro" CC="ccache $MPICCBINARY $COLOR_OUTPUT" LDSHARED="$MPICCBINARY -g3 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro" python3 -m pip install -v "$@" . $EDITABLE_MODE || exit 1
else
NPY_NUM_BUILD_JOBS=4 CXX="$MPICCBINARY -pthread -g3 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro" CC="$MPICCBINARY $COLOR_OUTPUT" LDSHARED="$MPICCBINARY -g3 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro" python3 -m pip install -v "$@" . $EDITABLE_MODE || exit 1
fi
else
if which ccache &>/dev/null; then
NPY_NUM_BUILD_JOBS=4 CXX="$MPICCBINARY -L/usr/local/lib" CC="ccache $MPICCBINARY -I/usr/local/include $COLOR_OUTPUT" LD="$MPICCBINARY" python3 -m pip install -v "$@" . $EDITABLE_MODE || exit 1
else
NPY_NUM_BUILD_JOBS=4 CXX="$MPICCBINARY -L/usr/local/lib" CC="$MPICCBINARY -I/usr/local/include $COLOR_OUTPUT" LD="$MPICCBINARY" python3 -m pip install -v "$@" . $EDITABLE_MODE || exit 1
fi
fi
#CC="ccache g++" python3 -m pip install -e . -v "$@"
#