Skip to content

Commit 88714f5

Browse files
committed
Attempt to set BLAS path
1 parent cc356a5 commit 88714f5

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

install_KLU_Sundials.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def install_suitesparse():
165165
"install",
166166
]
167167
# Set CMAKE_OPTIONS as environment variables to pass to the GNU Make command
168+
cmake_options = ""
168169
env = os.environ.copy()
169170
for libdir in klu_dependencies:
170171
build_dir = os.path.join(suitesparse_src, libdir)
@@ -175,19 +176,28 @@ def install_suitesparse():
175176
# if in CI, set RPATH to the install directory for SuiteSparse_config
176177
# dylibs to find libomp.dylib when repairing the wheel
177178
if os.environ.get("CIBUILDWHEEL") == "1":
178-
env["CMAKE_OPTIONS"] = (
179-
f"-DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR} -DCMAKE_INSTALL_RPATH={DEFAULT_INSTALL_DIR}/lib"
179+
cmake_options = (
180+
f" -DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR}"
181+
f" -DCMAKE_INSTALL_RPATH={DEFAULT_INSTALL_DIR}/lib"
180182
)
181183
else:
182-
env["CMAKE_OPTIONS"] = f"-DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR}"
184+
cmake_options = f"-DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR}"
183185
else:
184186
# For AMD, COLAMD, BTF and KLU; do not set a BUILD RPATH but use an
185187
# INSTALL RPATH in order to ensure that the dynamic libraries are found
186188
# at runtime just once. Otherwise, delocate complains about multiple
187189
# references to the SuiteSparse_config dynamic library (auditwheel does not).
188-
env["CMAKE_OPTIONS"] = (
189-
f"-DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR} -DCMAKE_INSTALL_RPATH={DEFAULT_INSTALL_DIR}/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
190+
cmake_options = (
191+
f" -DCMAKE_INSTALL_PREFIX={DEFAULT_INSTALL_DIR}"
192+
f" -DCMAKE_INSTALL_RPATH={DEFAULT_INSTALL_DIR}/lib"
193+
f" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE"
194+
f" -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
190195
)
196+
vcpkg_dir = os.environ.get("VCPKG_ROOT_DIR", None)
197+
triplet = os.environ.get("VCPKG_DEFAULT_TRIPLET", None)
198+
if vcpkg_dir:
199+
cmake_options += f" -DBLAS_ROOT={vcpkg_dir}/{triplet}/lib"
200+
env["CMAKE_OPTIONS"] = cmake_options
191201
subprocess.run(make_cmd, cwd=build_dir, env=env, shell=True, check=True)
192202
subprocess.run(install_cmd, cwd=build_dir, check=True)
193203

0 commit comments

Comments
 (0)