Skip to content

Commit cf1f819

Browse files
committed
Actually, fix everything this time
1 parent 60f4094 commit cf1f819

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

common/install_cpython.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,27 @@ function do_cpython_build {
2222

2323
local prefix="/opt/_internal/cpython-${py_ver}"
2424
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
2530
if [[ -z "${WITH_OPENSSL+x}" ]]; then
26-
local openssl_flags=""
31+
local openssl_flags=""
2732
else
2833
local openssl_flags="--with-openssl=${WITH_OPENSSL} --with-openssl-rpath=auto"
2934
fi
3035

3136
# -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
3338

3439
make -j40 > /dev/null
3540
make install > /dev/null
3641

42+
if [[ "${shared_flags}" == "--enable-shared" ]]; then
43+
patchelf --set-rpath '$ORIGIN/../lib' ${prefix}/bin/python3
44+
fi
45+
3746
popd
3847
rm -rf Python-$py_ver
3948
# Some python's install as bin/python3. Make them available as

manywheel/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ FROM base as openssl
3636
ADD ./common/install_openssl.sh install_openssl.sh
3737
RUN bash ./install_openssl.sh && rm install_openssl.sh
3838

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
4047
# build python
4148
COPY manywheel/build_scripts /build_scripts
4249
ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
@@ -59,13 +66,6 @@ FROM base as intel
5966
ADD ./common/install_mkl.sh install_mkl.sh
6067
RUN bash ./install_mkl.sh && rm install_mkl.sh
6168

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-
6969
FROM base as magma
7070
ARG BASE_CUDA_VERSION=10.2
7171
# Install magma

0 commit comments

Comments
 (0)