@@ -60,19 +60,19 @@ def install_suitesparse(download_dir):
60
60
# if in CI, set RPATH to the install directory for SuiteSparse_config
61
61
# dylibs to find libomp.dylib when repairing the wheel
62
62
if os .environ .get ("CIBUILDWHEEL" ) == "1" :
63
- env [
64
- "CMAKE_OPTIONS "
65
- ] = f"-DCMAKE_INSTALL_PREFIX= { install_dir } -DCMAKE_INSTALL_RPATH= { install_dir } /lib"
63
+ env ["CMAKE_OPTIONS" ] = (
64
+ f"-DCMAKE_INSTALL_PREFIX= { install_dir } -DCMAKE_INSTALL_RPATH= { install_dir } /lib "
65
+ )
66
66
else :
67
67
env ["CMAKE_OPTIONS" ] = f"-DCMAKE_INSTALL_PREFIX={ install_dir } "
68
68
else :
69
69
# For AMD, COLAMD, BTF and KLU; do not set a BUILD RPATH but use an
70
70
# INSTALL RPATH in order to ensure that the dynamic libraries are found
71
71
# at runtime just once. Otherwise, delocate complains about multiple
72
72
# references to the SuiteSparse_config dynamic library (auditwheel does not).
73
- env [
74
- "CMAKE_OPTIONS "
75
- ] = f"-DCMAKE_INSTALL_PREFIX= { install_dir } -DCMAKE_INSTALL_RPATH= { install_dir } /lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
73
+ env ["CMAKE_OPTIONS" ] = (
74
+ f"-DCMAKE_INSTALL_PREFIX= { install_dir } -DCMAKE_INSTALL_RPATH= { install_dir } /lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE "
75
+ )
76
76
subprocess .run (make_cmd , cwd = build_dir , env = env , shell = True , check = True )
77
77
subprocess .run (install_cmd , cwd = build_dir , check = True )
78
78
@@ -269,14 +269,7 @@ def parallel_download(urls, download_dir):
269
269
future .result ()
270
270
271
271
# First check requirements: make and cmake
272
- try :
273
- subprocess .run (["make" , "--version" ])
274
- except OSError as error :
275
- raise RuntimeError ("Make must be installed." ) from error
276
- try :
277
- subprocess .run (["cmake" , "--version" ])
278
- except OSError as error :
279
- raise RuntimeError ("CMake must be installed." ) from error
272
+ check_build_tools ()
280
273
281
274
# Build in parallel wherever possible
282
275
os .environ ["CMAKE_BUILD_PARALLEL_LEVEL" ] = str (cpu_count ())
@@ -341,5 +334,16 @@ def parallel_download(urls, download_dir):
341
334
install_suitesparse (download_dir )
342
335
343
336
337
+ def check_build_tools ():
338
+ try :
339
+ subprocess .run (["make" , "--version" ])
340
+ except OSError as error :
341
+ raise RuntimeError ("Make must be installed." ) from error
342
+ try :
343
+ subprocess .run (["cmake" , "--version" ])
344
+ except OSError as error :
345
+ raise RuntimeError ("CMake must be installed." ) from error
346
+
347
+
344
348
if __name__ == "__main__" :
345
349
build_solvers ()
0 commit comments