Skip to content

Commit acc5051

Browse files
authored
Patch for building [email protected], [email protected], and [email protected]:2.61 with Intel oneAPI 2025.2; add [email protected] (spack#1592)
* Bug fix for Intel oneAPI 2025.2 that allows building [email protected] * [@spackbot] updating style on behalf of climbfuji * Use 'for' to apply patch in repos/spack_repo/builtin/packages/yafyaml/package.py * Patch for building [email protected] with [email protected] * [@spackbot] updating style on behalf of climbfuji * Patch for building mapl with [email protected] * [@spackbot] updating style on behalf of climbfuji * Add [email protected], and constrain workaround for [email protected] to @:2.61 --------- Co-authored-by: climbfuji <[email protected]>
1 parent 71676b9 commit acc5051

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

repos/spack_repo/builtin/packages/mapl/package.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class Mapl(CMakePackage):
3939
version("develop", branch="develop")
4040
version("main", branch="main")
4141

42+
version("2.62.0", sha256="5973a8cac75c55fcc0f4c5256f7d485ab99d2a52ff42d4359ce8d0f3f94d9133")
4243
version("2.61.0", sha256="bb768fd60214d5b6fe6120e08a5ebd869f576392a3252a4715fd7c32d0dea97a")
4344
version("2.60.0", sha256="470f4da9cc516fdf8206dbc84ab13f53792f3af5e54cd5315ff70d44e5700788")
4445
version("2.59.0", sha256="a1137bf62e885256d295c66929cd77658a559f88dbed4f433544f432c5c7a059")
@@ -140,11 +141,17 @@ class Mapl(CMakePackage):
140141

141142
# Versions later than 3.14 remove FindESMF.cmake
142143
# from ESMA_CMake.
144+
resource(
145+
name="esma_cmake",
146+
git="https://github.com/GEOS-ESM/ESMA_cmake.git",
147+
tag="v3.65.0",
148+
when="@2.62:",
149+
)
143150
resource(
144151
name="esma_cmake",
145152
git="https://github.com/GEOS-ESM/ESMA_cmake.git",
146153
tag="v3.64.0",
147-
when="@2.60:",
154+
when="@2.60:2.61",
148155
)
149156
resource(
150157
name="esma_cmake",
@@ -344,6 +351,9 @@ class Mapl(CMakePackage):
344351
# when using apple-clang version 15.x or newer, need to use the llvm-openmp library
345352
depends_on("llvm-openmp", when="%apple-clang@15:", type=("build", "run"))
346353

354+
# https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
355+
depends_on("gcc", when="@:2.61 ^[email protected]", type="build")
356+
347357
def cmake_args(self):
348358
args = [
349359
self.define_from_variant("BUILD_WITH_PFLOGGER", "pflogger"),
@@ -369,6 +379,11 @@ def cmake_args(self):
369379
if gfortran_major_ver >= 10:
370380
fflags.append("-fallow-invalid-boz")
371381
fflags.append("-fallow-argument-mismatch")
382+
383+
# https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
384+
if self.spec.satisfies("@:2.61 ^[email protected]"):
385+
fflags.append(f"-fpp-name={join_path(self.stage.source_path, 'cpp_wrapper.sh')}")
386+
372387
if fflags:
373388
args.append(self.define("CMAKE_Fortran_FLAGS", " ".join(fflags)))
374389

@@ -415,6 +430,22 @@ def patch(self):
415430
"(target_link_libraries[^)]+PUBLIC )", r"\1 %s " % nc_flags, "pfio/CMakeLists.txt"
416431
)
417432

433+
# https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
434+
if self.spec.satisfies("@:2.61 ^[email protected]"):
435+
cpp_wrapper = """#!/usr/bin/env bash
436+
cpp -P -traditional-cpp -undef \"$@\"
437+
"""
438+
with open(join_path(self.stage.source_path, "cpp_wrapper.sh"), "w") as f:
439+
f.write(cpp_wrapper)
440+
set_executable(join_path(self.stage.source_path, "cpp_wrapper.sh"))
441+
442+
filter_file(
443+
"SYSTEM_DSO_EXTENSION = SYSTEM_DSO_SUFFIX",
444+
"SYSTEM_DSO_EXTENSION = 'SYSTEM_DSO_SUFFIX'",
445+
"shared/DSO_Utilities.F90",
446+
string=True,
447+
)
448+
418449
def setup_build_environment(self, env: EnvironmentModifications) -> None:
419450
# esma_cmake, an internal dependency of mapl, is
420451
# looking for the cmake argument -DBASEDIR, and

repos/spack_repo/builtin/packages/pflogger/package.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ class Pflogger(CMakePackage):
7676
msg="pFlogger only works with the Fujitsu compiler from version 1.13.0 onwards",
7777
)
7878

79+
# https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
80+
conflicts(
81+
82+
when="@:1.16.0",
83+
msg="oneAPI 2025.2 only works with pflogger 1.16.1 onwards",
84+
)
85+
86+
@when("@1.16.1 ^[email protected]")
87+
def patch(self):
88+
filter_file("_RC)", "rc=status); _VERIFY(status,'',rc)", "src/Config.F90", string=True)
89+
7990
depends_on("[email protected]:3", type="build", when="@:1.16")
8091
depends_on("[email protected]:", type="build", when="@1.17:")
8192

repos/spack_repo/builtin/packages/yafyaml/package.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ class Yafyaml(CMakePackage):
6969

7070
conflicts("%[email protected]:", when="@:1.3.0", msg="GCC 13.3+ only works with yafyaml 1.4.0 onwards")
7171

72+
# https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
73+
conflicts(
74+
"%[email protected]", when="@:1.5.0", msg="oneAPI 2025.2 only works with yafyaml 1.5.1 onwards"
75+
)
76+
77+
@when("@1.5.1 ^[email protected]")
78+
def patch(self):
79+
for pf in ["src/Nodes/BaseNode_implementation.F90", "src/Lexer.F90"]:
80+
filter_file("__RC__)", "rc=status); __VERIFY__(status)", pf, string=True)
81+
7282
variant(
7383
"build_type",
7484
default="Release",

0 commit comments

Comments
 (0)