Skip to content

Commit

Permalink
Update packages for BLAS/LAPACK issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wortiz committed Dec 16, 2024
1 parent 1f0b567 commit 9f76c0f
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 37 deletions.
4 changes: 3 additions & 1 deletion tpls/tpl_tools/packages/arpack-ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ def configure_options(self, builder):
builder.add_option("-DBUILD_SHARED_LIBS:BOOL=ON")
else:
builder.add_option("-DBUILD_SHARED_LIBS:BOOL=OFF")
builder.add_option("-DBLAS_LIBRARIES=" + builder.env["BLAS_LIBRARIES"])
builder.add_option("-DLAPACK_LIBRARIES=" + builder.env["LAPACK_LIBRARIES"])
builder.add_option("-DMPI=ON")

def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("ARPACK_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
6 changes: 3 additions & 3 deletions tpls/tpl_tools/packages/bison.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def setDependencies(self, builder):

def register(self, builder):
registry = builder._registry
registry.append_environment_variable("BISON_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("BISON_DIR", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/catch2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("CATCH2_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def register(self, builder):
registry.register_executable(
os.path.join(builder.install_dir(), "bin", "cmake")
)
registry.append_environment_variable(
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
6 changes: 3 additions & 3 deletions tpls/tpl_tools/packages/flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def setDependencies(self, builder):

def register(self, builder):
registry = builder._registry
registry.append_environment_variable("FLEX_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("FLEX_DIR", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("FMT_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
4 changes: 2 additions & 2 deletions tpls/tpl_tools/packages/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("HDF5_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/lapack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def register(self, builder):
"LAPACK_LIBRARIES",
os.path.join(builder.install_dir(), "lib/liblapack" + ext),
)
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/metis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("METIS_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/mumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("MUMPS_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
4 changes: 2 additions & 2 deletions tpls/tpl_tools/packages/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("NETCDF_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/omega_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("OMEGA_H_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/openblas.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def register(self, builder):
"LAPACK_LIBRARIES",
os.path.join(builder.install_dir(), "lib/libopenblas" + ext),
)
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
4 changes: 2 additions & 2 deletions tpls/tpl_tools/packages/openmpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def register(self, builder):
"MPI_Fortran_COMPILER",
os.path.join(builder.install_dir(), "bin", "mpifort"),
)
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/parmetis.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("PARMETIS_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
3 changes: 2 additions & 1 deletion tpls/tpl_tools/packages/petsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("PETSC_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.set_environment_variable("PETSC_ARCH", "")
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/pnetcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("PNETCDF_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
4 changes: 3 additions & 1 deletion tpls/tpl_tools/packages/scalapack.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ def configure_options(self, builder):
builder.add_option("-DBUILD_SHARED_LIBS:BOOL=ON")
else:
builder.add_option("-DBUILD_SHARED_LIBS:BOOL=OFF")
builder.add_option("-DBLAS_LIBRARIES=" + builder.env["BLAS_LIBRARIES"])
builder.add_option("-DLAPACK_LIBRARIES=" + builder.env["LAPACK_LIBRARIES"])
builder.add_option("-DSCALAPACK_BUILD_TESTS=OFF")

def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("SCALAPACK_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/scotch.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("SCOTCH_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
6 changes: 3 additions & 3 deletions tpls/tpl_tools/packages/seacas.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def register(self, builder):
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("ACCESS", builder.install_dir())
registry.set_environment_variable("SEACAS_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.append_environment_variable(
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable(
"PATH", os.path.join(builder.install_dir(), "bin")
)
if builder.build_shared:
registry.append_environment_variable(
registry.prepend_environment_variable(
"PYTHONPATH", os.path.join(builder.install_dir(), "lib")
)
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("SPARSE_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/suitesparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("SUITESPARSE_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/superlu_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("SUPERLU_DIST_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
2 changes: 1 addition & 1 deletion tpls/tpl_tools/packages/trilinos.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ def register(self, builder):
registry = builder._registry
registry.register_package(self.name, builder.install_dir())
registry.set_environment_variable("TRILINOS_DIR", builder.install_dir())
registry.append_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
registry.prepend_environment_variable("CMAKE_PREFIX_PATH", builder.install_dir())
8 changes: 4 additions & 4 deletions tpls/tpl_tools/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def __init__(self):
def set_environment_variable(self, variable, value):
self.environment[variable] = value

def append_environment_variable(self, variable, value):
def prepend_environment_variable(self, variable, value):
if variable in self.environment.keys():
if type(self.environment[variable]) != list:
oldval = self.environment[variable]
self.environment[variable] = [oldval]
self.environment[variable].append(value)
self.environment[variable].insert(0,value)
else:
self.environment[variable] = value

Expand Down Expand Up @@ -114,9 +114,9 @@ def set_environment_variable(self, variable, value):
self.environment[variable] = value
self.config.set_environment_variable(variable, value)

def append_environment_variable(self, variable, value):
def prepend_environment_variable(self, variable, value):
if variable in self.environment:
self.environment[variable] += os.pathsep + value
else:
self.environment[variable] = value
self.config.append_environment_variable(variable, value)
self.config.prepend_environment_variable(variable, value)

0 comments on commit 9f76c0f

Please sign in to comment.