feat(linux): portable build works on linux + benchmarks
This commit is contained in:
@@ -589,15 +589,7 @@ def build_zlib(
|
||||
build.mkdir(parents=True, exist_ok=True)
|
||||
cmake_configure(args, args.zlib_source, build, options, env)
|
||||
run(
|
||||
[
|
||||
args.cmake,
|
||||
"--build",
|
||||
build,
|
||||
"--target",
|
||||
"zlibstatic",
|
||||
"--parallel",
|
||||
str(args.jobs),
|
||||
],
|
||||
[args.cmake, "--build", build, "--parallel", str(args.jobs)],
|
||||
env=env,
|
||||
)
|
||||
run([args.cmake, "--install", build], env=env)
|
||||
@@ -658,7 +650,7 @@ def build_hypre(
|
||||
options = common_cmake_args(
|
||||
args,
|
||||
build_type,
|
||||
c_compiler=mpicc if features["mpi"] else args.cc,
|
||||
c_compiler=args.cc,
|
||||
) + [
|
||||
f"-DHYPRE_ENABLE_MPI={'ON' if features['mpi'] else 'OFF'}",
|
||||
f"-DHYPRE_ENABLE_OPENMP={'ON' if features['openmp'] else 'OFF'}",
|
||||
@@ -668,6 +660,12 @@ def build_hypre(
|
||||
"-DHYPRE_BUILD_EXAMPLES=OFF",
|
||||
"-DHYPRE_BUILD_TESTS=OFF",
|
||||
]
|
||||
if features["mpi"]:
|
||||
# Keep CMake's compiler identity on the host compiler and let FindMPI
|
||||
# interrogate the wrapper. Treating mpicc itself as CMAKE_C_COMPILER
|
||||
# makes MPI's include path look implicit, so CUDA translation units
|
||||
# compiled by nvcc do not receive mpi.h.
|
||||
options.append(f"-DMPI_C_COMPILER={mpicc}")
|
||||
if features["cuda"]:
|
||||
options.extend(
|
||||
[
|
||||
@@ -1336,7 +1334,10 @@ def build_mfem(
|
||||
f"-DGSLIB_DIR={bundle_root(args, 'include/gslib/gslib.h')}"
|
||||
)
|
||||
if features["zlib"]:
|
||||
options.append(f"-DZLIB_ROOT={bundle_root(args, 'include/zlib.h')}")
|
||||
zlib_root = bundle_root(args, "include/zlib.h")
|
||||
options.append(f"-DZLIB_ROOT={zlib_root}")
|
||||
if args.host_system == "emscripten":
|
||||
options.append(f"-DZLIB_LIBRARY={zlib_root / 'lib' / 'libz.a'}")
|
||||
if features["sundials"]:
|
||||
options.append(
|
||||
f"-DSUNDIALS_DIR={bundle_root(args, 'include/sundials/sundials_config.h')}"
|
||||
|
||||
Reference in New Issue
Block a user