-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy-3.5.1.sh
executable file
·68 lines (63 loc) · 2.18 KB
/
deploy-3.5.1.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
#!/bin/bash -e
. /etc/profile.d/modules.sh
SOURCE_FILE=${NAME}-${VERSION}.tar.gz
module add deploy
module add bzip2
module add tcltk
module add sqlite
module add readline
module add ncurses
module add openssl/1.0.2j
module add gcc/${GCC_VERSION}
cd ${WORKSPACE}/Python-${VERSION}/build-${BUILD_NUMBER}
rm -rf *
../configure --prefix=${SOFT_DIR}-gcc-${GCC_VERSION} \
--enable-shared \
--enable-loadable-sqlite-extensions \
--with-system-ffi \
--with-tcltk-includes=${TCL_DIR}/include \
--with-tcltk-libs=${TCL_DIR}/lib \
--with-ensurepip=upgrade
make
# "Warning
# make install can overwrite or masquerade the python binary. make altinstall is therefore recommended instead of make install since it
# only installs exec_prefix/bin/pythonversion.
# see : https://docs.python.org/2/using/unix.html#building-python
make install
VERSION_MAJOR=${VERSION:0:3} # Should be 2.7 or 3.4 or similar
echo $?
mkdir -p modules
(
cat <<MODULE_FILE
#%Module1.0
## $NAME modulefile
##
proc ModulesHelp { } {
puts stderr " This module does nothing but alert the user"
puts stderr " that the [module-info name] module is not available"
}
conflict python
module add gcc/${GCC_VERSION}
module-whatis "$NAME $VERSION. compiled for GCC ${GCC_VERSION}"
setenv PYTHON_VERSION $VERSION
setenv PYTHON_DIR $::env(CVMFS_DIR)/$::env(SITE)/$::env(OS)/$::env(ARCH)/$NAME/$VERSION-gcc-${GCC_VERSION}
setenv PYTHONHOME $::env(PYTHON_DIR)
setenv PYTHONPATH $::env(PYTHON_DIR)/lib/python${VERSION_MAJOR}
prepend-path PATH $::env(PYTHON_DIR)/bin
prepend-path LD_LIBRARY_PATH $::env(PYTHON_DIR)/lib
prepend-path GCC_INCLUDE_DIR $::env(PYTHON_DIR)/include
MODULE_FILE
) > modules/$VERSION-gcc-${GCC_VERSION}
# this should probably be in $PYTHON_MODULES instead of $LIBRARY_MODULES
mkdir -p ${LIBRARIES}/${NAME}
cp modules/${VERSION}-gcc-${GCC_VERSION} ${LIBRARIES}/${NAME}
module avail ${NAME}
module add python/${VERSION}-gcc-${GCC_VERSION}
echo "Our python is"
which python3
python3 --version
## run some checks
echo "PYTHONHOME is $PYTHONHOME"
echo "checking easy_install and pip"
which easy_install-${VERSION_MAJOR}
which pip${VERSION_MAJOR}