File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,27 @@ function do_cpython_build {
22
22
23
23
local prefix=" /opt/_internal/cpython-${py_ver} "
24
24
mkdir -p ${prefix} /lib
25
+ if [[ -n $( which patchelf) ]]; then
26
+ local shared_flags=" --enable-shared"
27
+ else
28
+ local shared_flags=" --disable-shared"
29
+ fi
25
30
if [[ -z " ${WITH_OPENSSL+x} " ]]; then
26
- local openssl_flags=" "
31
+ local openssl_flags=" "
27
32
else
28
33
local openssl_flags=" --with-openssl=${WITH_OPENSSL} --with-openssl-rpath=auto"
29
34
fi
30
35
31
36
# -Wformat added for https://bugs.python.org/issue17547 on Python 2.6
32
- CFLAGS=" -Wformat" ./configure --prefix=${prefix} ${openssl_flags} --enable-shared > /dev/null
37
+ CFLAGS=" -Wformat" ./configure --prefix=${prefix} ${openssl_flags} ${shared_flags} > /dev/null
33
38
34
39
make -j40 > /dev/null
35
40
make install > /dev/null
36
41
42
+ if [[ " ${shared_flags} " == " --enable-shared" ]]; then
43
+ patchelf --set-rpath ' $ORIGIN/../lib' ${prefix} /bin/python3
44
+ fi
45
+
37
46
popd
38
47
rm -rf Python-$py_ver
39
48
# Some python's install as bin/python3. Make them available as
Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ FROM base as openssl
36
36
ADD ./common/install_openssl.sh install_openssl.sh
37
37
RUN bash ./install_openssl.sh && rm install_openssl.sh
38
38
39
- FROM base as python
39
+ # EPEL for cmake
40
+ FROM base as patchelf
41
+ # Install patchelf
42
+ ADD ./common/install_patchelf.sh install_patchelf.sh
43
+ RUN bash ./install_patchelf.sh && rm install_patchelf.sh
44
+ RUN cp $(which patchelf) /patchelf
45
+
46
+ FROM patchelf as python
40
47
# build python
41
48
COPY manywheel/build_scripts /build_scripts
42
49
ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
@@ -59,13 +66,6 @@ FROM base as intel
59
66
ADD ./common/install_mkl.sh install_mkl.sh
60
67
RUN bash ./install_mkl.sh && rm install_mkl.sh
61
68
62
- # EPEL for cmake
63
- FROM base as patchelf
64
- # Install patchelf
65
- ADD ./common/install_patchelf.sh install_patchelf.sh
66
- RUN bash ./install_patchelf.sh && rm install_patchelf.sh
67
- RUN cp $(which patchelf) /patchelf
68
-
69
69
FROM base as magma
70
70
ARG BASE_CUDA_VERSION=10.2
71
71
# Install magma
You can’t perform that action at this time.
0 commit comments