Skip to content
10 changes: 9 additions & 1 deletion repos/spack_repo/builtin/packages/scotch/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class Scotch(CMakePackage, MakefilePackage):
version("6.0.0", sha256="8206127d038bda868dda5c5a7f60ef8224f2e368298fbb01bf13fa250e378dd4")
version("5.1.10b", sha256="54c9e7fafefd49d8b2017d179d4f11a655abe10365961583baaddc4eeb6a9add")

build_system(conditional("cmake", when="@7:"), "makefile", default="cmake")
build_system("cmake", conditional("makefile", when="@:6"), default="cmake")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this means that for versions 6 and earlier, both cmake and makefile are an option, and the default is cmake?

The original line 47 to me reads like cmake available from version 7 and makefile available for all versions, suggesting that the cmake build wasn't available for versions 6 and earlier?

If I am right (probably not ...) and our goal is to switch from makefile for version 6 to cmake for version 7, then this is sufficient?

build_system("make", when="@:6"))
build_system("cmake", when="@7:"))

The issue with that is that line 48 effectively precludes building scotch@:6 with oneapi. But maybe that's ok. After all, we weren't able to build scotch with oneapi until recently.

@AlexanderRichert-NOAA thoughts?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this means that for versions 6 and earlier, both cmake and makefile are an option, and the default is cmake?

The original line 47 to me reads like cmake available from version 7 and makefile available for all versions, suggesting that the cmake build wasn't available for versions 6 and earlier?

7: -- only cmake for build system
:6 -- cmake or makefile, default cmake

based on your comment from JCSDA/spack-stack#2075

If I am right (probably not ...) and our goal is to switch from makefile for version 6 to cmake for version 7, then this is sufficient?

build_system("make", when="@:6"))
build_system("cmake", when="@7:"))

I was trying to allow cmake or makefile for :6 but restrict to cmake for 7: -- if it's best to only build with makefile for :6, your suggestion does that. I am certainly agnostic about it.

The issue with that is that line 48 effectively precludes building scotch@:6 with oneapi. But maybe that's ok. After all, we weren't able to build scotch with oneapi until recently.

That is the point of line 48.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. git diff can be so confusing. Thanks for the clarification.

conflicts("build_system=makefile", when="%oneapi")

variant("threads", default=True, description="use POSIX Pthreads within Scotch and PT-Scotch")
variant(
"mpi_thread",
Expand Down Expand Up @@ -183,6 +185,12 @@ def cmake_args(self):
c_flags.append("-DINTSIZE32")
args.append(self.define("CMAKE_C_FLAGS", " ".join(c_flags)))

# oneapi C and Fortran compilers aggressively optimize floating point exception checks
if self.spec.satisfies("%oneapi@2023:"):
fcflags = "-fp-model=precise -fp-speculation=safe"
args.extend(["-DCMAKE_Fortran_FLAGS=%s" % fcflags])
args.extend(["-DCMAKE_C_FLAGS=%s" % fcflags])

return args

def is_64bit(self):
Expand Down