Skip to content

Commit 8f7473a

Browse files
authored
Work on fixing auditwheel error on Linux (#368)
* Update cibuildwheel version to attempt to fix auditwheel error. * Bump version of OpenBLAS and SuiteSparse used in wheels. * Add libgmp to wheels, which is a new dependency for suitesparse * Fix typo and add MPFR to wheel dependencies. * Install the xz tool with yum when building wheels. * Only build static gmp and mpfr, since suitesparse is also static. * Build gmp and mpfr with PIC. Patch suitesparse to have correct linking order when doing static linking * Move wheel builds back to daily test.
1 parent ea07d20 commit 8f7473a

File tree

5 files changed

+165
-14
lines changed

5 files changed

+165
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
python-version: '3.7'
6060
- name: Install cibuildwheel
6161
run: |
62-
python -m pip install twine cibuildwheel==1.5.0
62+
python -m pip install twine cibuildwheel==1.6.3
6363
- name: Build wheel
6464
run: |
6565
python -m cibuildwheel --output-dir wheelhouse
@@ -92,7 +92,7 @@ jobs:
9292
python-version: '3.7'
9393
- name: Install cibuildwheel
9494
run: |
95-
python -m pip install twine cibuildwheel==1.5.0
95+
python -m pip install twine cibuildwheel==1.6.3
9696
- name: Build wheel
9797
run: |
9898
python -m cibuildwheel --output-dir wheelhouse
@@ -111,7 +111,7 @@ jobs:
111111
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
112112
CIBW_BUILD_VERBOSITY: 3
113113
CIBW_ENVIRONMENT_LINUX: "PATH=/usr/lib64/mpich-3.2/bin:${PATH} TOAST_BUILD_BLAS_LIBRARIES='-lopenblas -fopenmp -lm -lgfortran' TOAST_BUILD_LAPACK_LIBRARIES='-lopenblas -fopenmp -lm -lgfortran' TOAST_BUILD_CMAKE_VERBOSE_MAKEFILE=ON"
114-
CIBW_ENVIRONMENT_MACOS:
114+
CIBW_ENVIRONMENT_MACOS:
115115
CIBW_BEFORE_BUILD_LINUX: ./wheels/install_deps_linux.sh
116116
CIBW_BEFORE_BUILD_MACOS: ./wheels/install_deps_osx.sh
117117
CIBW_BEFORE_TEST: pip3 install numpy && pip3 install mpi4py
@@ -125,7 +125,7 @@ jobs:
125125
python-version: '3.7'
126126
- name: Install cibuildwheel
127127
run: |
128-
python -m pip install twine cibuildwheel==1.5.0
128+
python -m pip install twine cibuildwheel==1.6.3
129129
- name: Build wheel
130130
run: |
131131
python -m cibuildwheel --output-dir wheelhouse

.github/workflows/wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
python-version: '3.7'
5757
- name: Install cibuildwheel
5858
run: |
59-
python -m pip install cibuildwheel==1.5.0
59+
python -m pip install cibuildwheel==1.6.3
6060
- name: Build wheel
6161
run: |
6262
python -m cibuildwheel --output-dir wheelhouse
@@ -90,7 +90,7 @@ jobs:
9090
python-version: '3.7'
9191
- name: Install cibuildwheel
9292
run: |
93-
python -m pip install cibuildwheel==1.5.0
93+
python -m pip install cibuildwheel==1.6.3
9494
- name: Build wheel
9595
run: |
9696
python -m cibuildwheel --output-dir wheelhouse
@@ -124,7 +124,7 @@ jobs:
124124
python-version: '3.7'
125125
- name: Install cibuildwheel
126126
run: |
127-
python -m pip install cibuildwheel==1.5.0
127+
python -m pip install cibuildwheel==1.6.3
128128
- name: Build wheel
129129
run: |
130130
python -m cibuildwheel --output-dir wheelhouse

wheels/install_deps_linux.sh

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ pushd $(dirname $0) >/dev/null 2>&1
1212
topdir=$(pwd)
1313
popd >/dev/null 2>&1
1414

15+
# Install xz
16+
17+
yum -y install xz
18+
1519
# Get newer cmake with pip
1620
pip install cmake
1721

@@ -57,9 +61,64 @@ tar xzf ${mpich_pkg} \
5761

5862
pip install mpi4py
5963

64+
# libgmp
65+
66+
gmp_version=6.2.0
67+
gmp_dir=gmp-${gmp_version}
68+
gmp_pkg=${gmp_dir}.tar.xz
69+
70+
echo "Fetching libgmp"
71+
72+
if [ ! -e ${gmp_pkg} ]; then
73+
curl -SL https://ftp.gnu.org/gnu/gmp/${gmp_pkg} -o ${gmp_pkg}
74+
fi
75+
76+
echo "Building libgmp..."
77+
78+
rm -rf ${gmp_dir}
79+
tar xf ${gmp_pkg} \
80+
&& pushd ${gmp_dir} >/dev/null 2>&1 \
81+
&& CC="${CC}" CFLAGS="${CFLAGS}" \
82+
./configure \
83+
--enable-static \
84+
--disable-shared \
85+
--with-pic \
86+
--prefix="${PREFIX}" \
87+
&& make -j ${MAKEJ} \
88+
&& make install \
89+
&& popd >/dev/null 2>&1
90+
91+
# libmpfr
92+
93+
mpfr_version=4.1.0
94+
mpfr_dir=mpfr-${mpfr_version}
95+
mpfr_pkg=${mpfr_dir}.tar.xz
96+
97+
echo "Fetching libmpfr"
98+
99+
if [ ! -e ${mpfr_pkg} ]; then
100+
curl -SL https://www.mpfr.org/mpfr-current/${mpfr_pkg} -o ${mpfr_pkg}
101+
fi
102+
103+
echo "Building libmpfr..."
104+
105+
rm -rf ${mpfr_dir}
106+
tar xf ${mpfr_pkg} \
107+
&& pushd ${mpfr_dir} >/dev/null 2>&1 \
108+
&& CC="${CC}" CFLAGS="${CFLAGS}" \
109+
./configure \
110+
--enable-static \
111+
--disable-shared \
112+
--with-pic \
113+
--with-gmp="${PREFIX}" \
114+
--prefix="${PREFIX}" \
115+
&& make -j ${MAKEJ} \
116+
&& make install \
117+
&& popd >/dev/null 2>&1
118+
60119
# Install Openblas
61120

62-
openblas_version=0.3.9
121+
openblas_version=0.3.10
63122
openblas_dir=OpenBLAS-${openblas_version}
64123
openblas_pkg=${openblas_dir}.tar.gz
65124

@@ -142,7 +201,7 @@ tar xzf ${aatm_pkg} \
142201

143202
# Install SuiteSparse
144203

145-
ssparse_version=5.7.2
204+
ssparse_version=5.8.1
146205
ssparse_dir=SuiteSparse-${ssparse_version}
147206
ssparse_pkg=${ssparse_dir}.tar.gz
148207

wheels/install_deps_osx.sh

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,62 @@ MAKEJ=2
3131

3232
PREFIX=/usr/local
3333

34+
# libgmp
35+
36+
gmp_version=6.2.0
37+
gmp_dir=gmp-${gmp_version}
38+
gmp_pkg=${gmp_dir}.tar.xz
39+
40+
echo "Fetching libgmp"
41+
42+
if [ ! -e ${gmp_pkg} ]; then
43+
curl -SL https://ftp.gnu.org/gnu/gmp/${gmp_pkg} -o ${gmp_pkg}
44+
fi
45+
46+
echo "Building libgmp..."
47+
48+
rm -rf ${gmp_dir}
49+
tar xf ${gmp_pkg} \
50+
&& pushd ${gmp_dir} >/dev/null 2>&1 \
51+
&& CC="${CC}" CFLAGS="${CFLAGS}" \
52+
&& CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
53+
./configure \
54+
--enable-static \
55+
--disable-shared \
56+
--with-pic \
57+
--prefix="${PREFIX}" \
58+
&& make -j ${MAKEJ} \
59+
&& make install \
60+
&& popd >/dev/null 2>&1
61+
62+
# libmpfr
63+
64+
mpfr_version=4.1.0
65+
mpfr_dir=mpfr-${mpfr_version}
66+
mpfr_pkg=${mpfr_dir}.tar.xz
67+
68+
echo "Fetching libmpfr"
69+
70+
if [ ! -e ${mpfr_pkg} ]; then
71+
curl -SL https://www.mpfr.org/mpfr-current/${mpfr_pkg} -o ${mpfr_pkg}
72+
fi
73+
74+
echo "Building libmpfr..."
75+
76+
rm -rf ${mpfr_dir}
77+
tar xf ${mpfr_pkg} \
78+
&& pushd ${mpfr_dir} >/dev/null 2>&1 \
79+
&& CC="${CC}" CFLAGS="${CFLAGS}" \
80+
./configure \
81+
--enable-static \
82+
--disable-shared \
83+
--with-pic \
84+
--with-gmp="${PREFIX}" \
85+
--prefix="${PREFIX}" \
86+
&& make -j ${MAKEJ} \
87+
&& make install \
88+
&& popd >/dev/null 2>&1
89+
3490
# Install FFTW
3591

3692
fftw_version=3.3.8
@@ -91,7 +147,7 @@ tar xzf ${aatm_pkg} \
91147

92148
# Install SuiteSparse
93149

94-
ssparse_version=5.7.2
150+
ssparse_version=5.8.1
95151
ssparse_dir=SuiteSparse-${ssparse_version}
96152
ssparse_pkg=${ssparse_dir}.tar.gz
97153

wheels/suitesparse.patch

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff -urN SuiteSparse-5.7.2_orig/Makefile SuiteSparse-5.7.2/Makefile
2-
--- SuiteSparse-5.7.2_orig/Makefile 2020-04-08 13:42:59.000000000 -0700
3-
+++ SuiteSparse-5.7.2/Makefile 2020-05-27 07:26:10.020688473 -0700
4-
@@ -266,6 +266,9 @@
1+
diff -urN SuiteSparse-5.8.1_orig/Makefile SuiteSparse-5.8.1/Makefile
2+
--- SuiteSparse-5.8.1_orig/Makefile 2020-07-14 16:04:44.000000000 -0700
3+
+++ SuiteSparse-5.8.1/Makefile 2020-10-13 16:16:26.558744640 -0700
4+
@@ -281,6 +281,9 @@
55
# hardcoded below.
66
include/metis.h:
77
ifeq (,$(MY_METIS_LIB))
@@ -11,3 +11,39 @@ diff -urN SuiteSparse-5.7.2_orig/Makefile SuiteSparse-5.7.2/Makefile
1111
- ( cd metis-5.1.0 && $(MAKE) config shared=1 prefix=$(SUITESPARSE) cc=$(CC) )
1212
- ( cd metis-5.1.0 && $(MAKE) )
1313
- ( cd metis-5.1.0 && $(MAKE) install )
14+
diff -urN SuiteSparse-5.8.1_orig/SLIP_LU/Demo/Makefile SuiteSparse-5.8.1/SLIP_LU/Demo/Makefile
15+
--- SuiteSparse-5.8.1_orig/SLIP_LU/Demo/Makefile 2020-07-14 16:04:44.000000000 -0700
16+
+++ SuiteSparse-5.8.1/SLIP_LU/Demo/Makefile 2020-10-14 12:07:18.326605012 -0700
17+
@@ -20,7 +20,7 @@
18+
19+
# LDFLAGS = -L../../lib
20+
21+
-LDLIBS += -lm -lgmp -lmpfr -lcolamd -lamd -lsliplu
22+
+LDLIBS += -lsliplu -lcolamd -lamd -lmpfr -lgmp -lm
23+
CS = $(LDLIBS)
24+
25+
26+
diff -urN SuiteSparse-5.8.1_orig/SLIP_LU/Lib/Makefile SuiteSparse-5.8.1/SLIP_LU/Lib/Makefile
27+
--- SuiteSparse-5.8.1_orig/SLIP_LU/Lib/Makefile 2020-07-14 16:04:44.000000000 -0700
28+
+++ SuiteSparse-5.8.1/SLIP_LU/Lib/Makefile 2020-10-14 12:07:50.250795155 -0700
29+
@@ -20,7 +20,7 @@
30+
# CFLAGS += -Wall -Wextra -Wpedantic -Werror
31+
32+
# SLIP_LU depends on SuiteSparse_config, AMD, COLAMD, M, GMP, and MPFR
33+
-LDLIBS += -lsuitesparseconfig -lamd -lcolamd -lm -lgmp -lmpfr
34+
+LDLIBS += -lsuitesparseconfig -lamd -lcolamd -lmpfr -lgmp -lm
35+
36+
C = $(CC) $(CF) -I../Include -I../../COLAMD/Include -I../../AMD/Include -I../../SuiteSparse_config
37+
38+
diff -urN SuiteSparse-5.8.1_orig/SLIP_LU/Tcov/Makefile SuiteSparse-5.8.1/SLIP_LU/Tcov/Makefile
39+
--- SuiteSparse-5.8.1_orig/SLIP_LU/Tcov/Makefile 2020-07-14 16:04:44.000000000 -0700
40+
+++ SuiteSparse-5.8.1/SLIP_LU/Tcov/Makefile 2020-10-14 12:08:36.691080983 -0700
41+
@@ -21,7 +21,7 @@
42+
-I../../SuiteSparse_config -I../../COLAMD/Include -I../../AMD/Include \
43+
-DSLIP_GMP_LIST_INIT=2 -DSLIP_LU_TCOV
44+
45+
-LDLIBS += -lm -lgmp -lmpfr -lcolamd -lamd -lsuitesparseconfig
46+
+LDLIBS += -lsuitesparseconfig -lcolamd -lamd -lmpfr -lgmp -lm
47+
48+
# run all statement coverage tests, and then check for 100% coverage
49+
run: runtests

0 commit comments

Comments
 (0)