Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package for fiat based on builtin but adding um as a version #150

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

penguian
Copy link
Contributor

Closes #147

This package is used by the um package to add DR_HOOK as per #148.

This package is based on the builtin package, with the following differences.

  1. It uses the ACCESS-NRI/fiat repository.
  2. It adds a "um" version that uses the "um" branch of ACCESS-NRI/fiat. This branch adds a modified version of DR_HOOK_DEFAULT that allows a communicator to be specified.
  3. It does not patch the "um" version.
  4. It adds "CMAKE_*_COMPILER" defines to cmake_args so that CMake can find the mpifc compiler, etc.
$ diff -U0 -w spack/var/spack/repos/builtin/packages/fiat/package.py spack-packages/packages/fiat/package.py 
--- spack/var/spack/repos/builtin/packages/fiat/package.py	2024-09-25 09:25:23.000000000 +1000
+++ spack-packages/packages/fiat/package.py	2024-09-25 10:05:27.000000000 +1000
@@ -5,0 +6,2 @@
+# Based on spack/var/spack/repos/builtin/packages/fiat/package.py
+
@@ -14 +16 @@
-    git = "https://github.com/ecmwf-ifs/fiat.git"
+    git = "https://github.com/ACCESS-NRI/fiat.git"
@@ -17 +19 @@
-    maintainers("climbfuji")
+    maintainers("climbfuji", "penguian")
@@ -21,0 +24 @@
+    version("um", branch="um", no_cache=True)
@@ -42 +45 @@
-    patch("intel_warnings_v110.patch", when="@:1.1.0")
+    patch("intel_warnings_v110.patch", when="@0:1.1.0")
@@ -51 +54,8 @@
-
+        if "+mpi" in self.spec:
+            args.extend(
+                [
+                    self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc),
+                    self.define("CMAKE_CXX_COMPILER", self.spec["mpi"].mpicxx),
+                    self.define("CMAKE_Fortran_COMPILER", self.spec["mpi"].mpifc),
+                ]
+            )

@penguian penguian self-assigned this Sep 25, 2024
@penguian penguian linked an issue Sep 25, 2024 that may be closed by this pull request
Copy link
Collaborator

@harshula harshula left a comment

Choose a reason for hiding this comment

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

When built with @um does Spack consider that version to be less than 1.1.0?

@penguian
Copy link
Contributor Author

When built with @um does Spack consider that version to be less than 1.1.0?

Yes. I was expecting that it would be greater than 1.2.0, but it doesn't work that way: "String components are considered less than numeric components" so "um" < "0". Special string components are an exception.

@penguian penguian merged commit a2e7667 into main Sep 26, 2024
1 check passed
@penguian penguian deleted the 147-add-package-for-fiat branch September 26, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Add package for fiat
2 participants