From 53a76761d0dcd91c0833952306500edd3bdc2d28 Mon Sep 17 00:00:00 2001 From: MichaelLaufer <70094649+MichaelLaufer@users.noreply.github.com> Date: Wed, 26 Oct 2022 05:04:04 +0300 Subject: [PATCH] Scotch: 'link_error_lib' variant - Link error handling library to libscotch/libptscotch (#33297) --- .../repos/builtin/packages/py-pyfr/package.py | 2 +- .../libscotch-scotcherr-link-7.0.1.patch | 20 +++++++++++++++++++ .../repos/builtin/packages/scotch/package.py | 7 +++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/scotch/libscotch-scotcherr-link-7.0.1.patch diff --git a/var/spack/repos/builtin/packages/py-pyfr/package.py b/var/spack/repos/builtin/packages/py-pyfr/package.py index 3e1d094c21..504f0e7e6b 100644 --- a/var/spack/repos/builtin/packages/py-pyfr/package.py +++ b/var/spack/repos/builtin/packages/py-pyfr/package.py @@ -57,7 +57,7 @@ class PyPyfr(PythonPackage, CudaPackage, ROCmPackage): # Optional dependencies depends_on("py-scipy", when="+scipy", type=("build", "run")) depends_on("metis@5.0:", when="+metis", type=("run")) - depends_on("scotch@6.0:", when="+scotch", type=("run")) + depends_on("scotch@7.0.1: +link_error_lib", when="+scotch", type=("run")) depends_on("cuda@8.0: +allow-unsupported-compilers", when="@:1.14.0 +cuda", type=("run")) depends_on("cuda@11.4.0: +allow-unsupported-compilers", when="@1.15.0: +cuda", type=("run")) depends_on("rocblas@5.2.0:", when="+hip", type=("run")) diff --git a/var/spack/repos/builtin/packages/scotch/libscotch-scotcherr-link-7.0.1.patch b/var/spack/repos/builtin/packages/scotch/libscotch-scotcherr-link-7.0.1.patch new file mode 100644 index 0000000000..40e4ade883 --- /dev/null +++ b/var/spack/repos/builtin/packages/scotch/libscotch-scotcherr-link-7.0.1.patch @@ -0,0 +1,20 @@ +--- a/src/libscotch/CMakeLists.txt ++++ b/src/libscotch/CMakeLists.txt +@@ -508,7 +508,7 @@ add_library(scotch + set_target_properties(scotch PROPERTIES VERSION + ${SCOTCH_VERSION}.${SCOTCH_RELEASE}.${SCOTCH_PATCHLEVEL}) + add_dependencies(scotch parser_yy_c parser_ll_c) +-target_link_libraries(scotch PUBLIC m) ++target_link_libraries(scotch PUBLIC m scotcherr) + target_include_directories(scotch PUBLIC + $ + $ +@@ -748,7 +748,7 @@ if(BUILD_PTSCOTCH) + set_target_properties(ptscotch PROPERTIES + VERSION ${SCOTCH_VERSION}.${SCOTCH_RELEASE}.${SCOTCH_PATCHLEVEL} + COMPILE_FLAGS -DSCOTCH_PTSCOTCH) +- target_link_libraries(ptscotch PUBLIC scotch MPI::MPI_C) ++ target_link_libraries(ptscotch PUBLIC ptscotcherr scotch MPI::MPI_C) + target_include_directories(ptscotch PUBLIC + $ + $ diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index 672706a635..166455876e 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -44,6 +44,12 @@ class Scotch(CMakePackage): "metis", default=False, description="Expose vendored METIS/ParMETIS libraries and wrappers" ) variant("int64", default=False, description="Use int64_t for SCOTCH_Num typedef") + variant( + "link_error_lib", + default=False, + when="@7.0.1", + description="Link error handling library to libscotch/libptscotch", + ) # Does not build with flex 2.6.[23] depends_on("flex@:2.6.1,2.6.4:", type="build") @@ -57,6 +63,7 @@ class Scotch(CMakePackage): patch("metis-headers-6.0.4.patch", when="@6.0.4") patch("libscotchmetis-return-6.0.5a.patch", when="@6.0.5a") + patch("libscotch-scotcherr-link-7.0.1.patch", when="@7.0.1 +link_error_lib") # Vendored dependency of METIS/ParMETIS conflicts with standard # installations