8000 CI temporary fix for linking against system libs (#20654) · rth/scikit-learn@6b2d5a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b2d5a9

Browse files
authored
CI temporary fix for linking against system libs (scikit-learn#20654)
1 parent dde6fb5 commit 6b2d5a9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

build_tools/azure/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ if [[ "$DISTRIB" == "conda" ]]; then
5656
# instead because llvm-ar errors
5757
export AR=/usr/bin/ar
5858
fi
59+
else
60+
# FIXME: temporary fix to link against system libraries on linux
61+
export LDFLAGS="$LDFLAGS -Wl,--sysroot=/"
5962
fi
6063
make_conda $TO_INSTALL
6164
setup_ccache
@@ -81,6 +84,8 @@ elif [[ "$DISTRIB" == "debian-32" ]]; then
8184
$(get_dep joblib $JOBLIB_VERSION)
8285

8386
elif [[ "$DISTRIB" == "conda-pip-latest" ]]; then
87+
# FIXME: temporary fix to link against system libraries on linux
88+
export LDFLAGS="$LDFLAGS -Wl,--sysroot=/"
8489
# Since conda main channel usually lacks behind on the latest releases,
8590
# we use pypi to test against the latest releases of the dependencies.
8691
# conda is still used as a convenient way to install Python and pip.
@@ -96,6 +101,8 @@ elif [[ "$DISTRIB" == "conda-pip-latest" ]]; then
96101
# and install a version less than 3.0.0 until the issue #18316 is solved.
97102
python -m pip install "lightgbm<3.0.0" --no-deps
98103
elif [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then
104+
# FIXME: temporary fix to link against system libraries on linux
105+
export LDFLAGS="$LDFLAGS -Wl,--sysroot=/"
99106
make_conda "ccache python=$PYTHON_VERSION"
100107
python -m pip install -U pip
101108
echo "Installing numpy and scipy master wheels"

sklearn/_build_utils/openmp_helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ def check_openmp_support():
6464
extra_preargs = os.getenv("LDFLAGS", None)
6565
if extra_preargs is not None:
6666
extra_preargs = extra_preargs.strip().split(" ")
67+
# FIXME: temporary fix to link against system libraries on linux
68+
# "-Wl,--sysroot=/" should be removed
6769
extra_preargs = [
6870
flag
6971
for flag in extra_preargs
70-
if flag.startswith(("-L", "-Wl,-rpath", "-l"))
72+
if flag.startswith(("-L", "-Wl,-rpath", "-l", "-Wl,--sysroot=/"))
7173
]
7274

7375
extra_postargs = get_openmp_flag

0 commit comments

Comments
 (0)
0