forked from ddrake/coeus-ngsolve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_python3
executable file
·36 lines (30 loc) · 960 Bytes
/
install_python3
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
#!/bin/bash
if [[ -z $1 ]]
then
echo "Please specify the desired version, e.g. 3.6.8"
exit 1
fi
module load gcc-8.2.0
# Install the specified version of Python3
# in the common subdirectory of the user's home directory
# Currently NGSolve depends on Python 3.6
BASE_DIR=$HOME
export SRC_DIR=$BASE_DIR/common/src
export INSTALL_DIR=$BASE_DIR/common/install
mkdir -p $INSTALL_DIR
mkdir -p $SRC_DIR
PYTHON_VER_NO=$1
PYTHON_VERSION=Python-$PYTHON_VER_NO
cd $SRC_DIR
wget https://www.python.org/ftp/python/$PYTHON_VER_NO/$PYTHON_VERSION.tgz
tar xvf Python-$PYTHON_VER_NO.tgz
export BUILD_DIR=$SRC_DIR/$PYTHON_VERSION/build
mkdir -p $BUILD_DIR && cd $BUILD_DIR
../configure --prefix=$INSTALL_DIR --enable-shared
make -j10
make install
# You may want to do this sort of thing...
#pip3 install numpy scipy matplotlib sympy ipython
# etc ...
# If you want to use mpi4py, you can pip install that too
# but first do this: module load openmpi-2.0/gcc-8.2.0