From 54fe0c2d84ab6d92ce7f920c0876c48dd95dcbc3 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Fri, 12 Nov 2021 14:05:10 -0500 Subject: [PATCH 01/22] Add spack recipe --- .spack/csg-eb.py | 20 ++++++++++++++++++++ CMakeLists.txt | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 .spack/csg-eb.py diff --git a/.spack/csg-eb.py b/.spack/csg-eb.py new file mode 100644 index 0000000..86c767b --- /dev/null +++ b/.spack/csg-eb.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class CsgEb(CMakePackage): + """Define Embedded Boundaries (for AMReX) using CSG""" + + homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" + url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" + + version("main", "e5f0e6b44f36573f90c2c75cd1097935") + version("spack", branch="spack") + + depends_on("pegtl") + depends_on("cgal") + depends_on("catch2") diff --git a/CMakeLists.txt b/CMakeLists.txt index 38703b8..9e9f2c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,3 +28,6 @@ target_include_directories(csg-eb ) target_compile_features(csg-eb PRIVATE cxx_std_17) + +install(TARGETS csg-eb + RUNTIME DESTINATION lib) -- GitLab From b60481b7709f4aca7c4b6b248b7e5e6b9b58af99 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Fri, 12 Nov 2021 14:14:35 -0500 Subject: [PATCH 02/22] fix --- .spack/csg-eb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.spack/csg-eb.py b/.spack/csg-eb.py index 86c767b..6842caf 100644 --- a/.spack/csg-eb.py +++ b/.spack/csg-eb.py @@ -11,6 +11,7 @@ class CsgEb(CMakePackage): homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" + git = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" version("main", "e5f0e6b44f36573f90c2c75cd1097935") version("spack", branch="spack") -- GitLab From d089b1de02cbdf5daef4d7f33cb9754893c5044c Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Fri, 12 Nov 2021 14:22:46 -0500 Subject: [PATCH 03/22] Add Spack to README --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index c42764c..a95d42d 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,24 @@ add_subdirectory(/path/to/repo/csg-eb) ```cmake target_link_libraries( PRIVATE csg) ``` + +## Install with Spack + +Another way to install csg-eb is with Spack. + +First, install Spack: + +``` shell +git clone -c feature.manyFiles=true https://github.com/spack/spack.git # Get Spack +source spack/share/spack/setup-env.sh # to put 'spack' command in PATH +spack compiler add # add compilers from PATH to spack configuration +``` + +Then define a recipe for csg-eb: +``` shell +spack create csg-eb # creates csg-eb.py package recipe in your local repo; opens it in your $EDITOR (probably vim?) +########################## Replace the contents of the `csg-eb.py` recipe with the contents of: .spack/csg-eb.py +spack spec csg-eb # preview install +spack install csg-eb # install csg-eb +spack load csg-eb # Adds directory with libcsg-eb.a to LD_LIBRARY_PATH +``` -- GitLab From 1e654b8cb6d034aa0015e7a0d66a31752c03b1d5 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Sat, 13 Nov 2021 07:25:06 -0500 Subject: [PATCH 04/22] Use local repo --- .../packages/csg-eb/package.py} | 0 .spack/repo/repo.yaml | 2 ++ README.md | 18 +++++------------ csg-eb.py | 20 +++++++++++++++++++ 4 files changed, 27 insertions(+), 13 deletions(-) rename .spack/{csg-eb.py => repo/packages/csg-eb/package.py} (100%) create mode 100644 .spack/repo/repo.yaml create mode 100644 csg-eb.py diff --git a/.spack/csg-eb.py b/.spack/repo/packages/csg-eb/package.py similarity index 100% rename from .spack/csg-eb.py rename to .spack/repo/packages/csg-eb/package.py diff --git a/.spack/repo/repo.yaml b/.spack/repo/repo.yaml new file mode 100644 index 0000000..007d87a --- /dev/null +++ b/.spack/repo/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: 'csg-eb-ns' diff --git a/README.md b/README.md index a95d42d..deaa17d 100644 --- a/README.md +++ b/README.md @@ -92,21 +92,13 @@ target_link_libraries( PRIVATE csg) ## Install with Spack -Another way to install csg-eb is with Spack. +Another way to install csg-eb is with Spack. See the [Spack documentation](https://spack.readthedocs.io) for instructions on how to install Spack. -First, install Spack: - -``` shell -git clone -c feature.manyFiles=true https://github.com/spack/spack.git # Get Spack -source spack/share/spack/setup-env.sh # to put 'spack' command in PATH -spack compiler add # add compilers from PATH to spack configuration -``` Then define a recipe for csg-eb: ``` shell -spack create csg-eb # creates csg-eb.py package recipe in your local repo; opens it in your $EDITOR (probably vim?) -########################## Replace the contents of the `csg-eb.py` recipe with the contents of: .spack/csg-eb.py -spack spec csg-eb # preview install -spack install csg-eb # install csg-eb -spack load csg-eb # Adds directory with libcsg-eb.a to LD_LIBRARY_PATH +spack repo add .spack/repo # add repo with csg-eb recipe +spack spec csg-eb # preview install +spack install csg-eb # install csg-eb +spack load csg-eb # Adds directory with libcsg-eb.a to LD_LIBRARY_PATH ``` diff --git a/csg-eb.py b/csg-eb.py new file mode 100644 index 0000000..ab77c2a --- /dev/null +++ b/csg-eb.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class CsgEb(CMakePackage): + """Define Embedded Boundaries (for AMReX) using CSG""" + + homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" + url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" + git = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" + + version("spack", branch="spack") + + depends_on("pegtl") + depends_on("cgal") + depends_on("catch2") -- GitLab From 7753789f8dddf5538825ddc9a4b16a69ba4b4d23 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Sat, 13 Nov 2021 07:26:40 -0500 Subject: [PATCH 05/22] revert --- csg-eb.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 csg-eb.py diff --git a/csg-eb.py b/csg-eb.py deleted file mode 100644 index ab77c2a..0000000 --- a/csg-eb.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack import * - - -class CsgEb(CMakePackage): - """Define Embedded Boundaries (for AMReX) using CSG""" - - homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" - url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" - git = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" - - version("spack", branch="spack") - - depends_on("pegtl") - depends_on("cgal") - depends_on("catch2") -- GitLab From eddad19570e8711ed6fcb5737eaada7f5764e654 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 09:53:02 -0500 Subject: [PATCH 06/22] Add variant for cgal --- .spack/repo/packages/csg-eb/package.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 6842caf..b399f65 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -16,6 +16,12 @@ class CsgEb(CMakePackage): version("main", "e5f0e6b44f36573f90c2c75cd1097935") version("spack", branch="spack") + variant("cgal", default=True, description="Build with CGAL Support") + depends_on("pegtl") - depends_on("cgal") depends_on("catch2") + depends_on("cgal", when="+cgal") + + def configure_args(self): + if "+cgal" in self.spec: + extra_args.append("-DCSG_CGAL_ENABLED=True") -- GitLab From 7f309a0909de2ec00435e336ebeb1a1a72925498 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 09:53:59 -0500 Subject: [PATCH 07/22] document --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index deaa17d..3edf3e2 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ Then define a recipe for csg-eb: ``` shell spack repo add .spack/repo # add repo with csg-eb recipe spack spec csg-eb # preview install -spack install csg-eb # install csg-eb +spack install csg-eb # install csg-eb (with CGAL support) +spack install csg-eb ~cgal # install csg-eb (without CGAL support) spack load csg-eb # Adds directory with libcsg-eb.a to LD_LIBRARY_PATH ``` -- GitLab From db34c703733b102111edfd6af4ef94e849d26235 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 11:35:27 -0500 Subject: [PATCH 08/22] debug --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97550c2..44609ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ endif() find_package(pegtl REQUIRED) if (CSG_CGAL_ENABLED) +message(FATAL_ERROR "NO.") find_package(CGAL REQUIRED) endif() @@ -37,5 +38,6 @@ target_compile_features(csg-eb PRIVATE cxx_std_17) install(TARGETS csg-eb RUNTIME DESTINATION lib) if (CSG_CGAL_ENABLED) +message(FATAL_ERROR "NO!") target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() -- GitLab From 1024c1770ecc3d39010d1c7925270fbab8182180 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 11:37:30 -0500 Subject: [PATCH 09/22] debug revert --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44609ff..97550c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ endif() find_package(pegtl REQUIRED) if (CSG_CGAL_ENABLED) -message(FATAL_ERROR "NO.") find_package(CGAL REQUIRED) endif() @@ -38,6 +37,5 @@ target_compile_features(csg-eb PRIVATE cxx_std_17) install(TARGETS csg-eb RUNTIME DESTINATION lib) if (CSG_CGAL_ENABLED) -message(FATAL_ERROR "NO!") target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() -- GitLab From 48424acc5b9ab62833d1777a11dbdb6d0f5542fc Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 11:40:47 -0500 Subject: [PATCH 10/22] test --- .spack/repo/packages/csg-eb/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index b399f65..5a56c9b 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -25,3 +25,5 @@ class CsgEb(CMakePackage): def configure_args(self): if "+cgal" in self.spec: extra_args.append("-DCSG_CGAL_ENABLED=True") + else: + extra_args.append("-DCSG_CGAL_ENABLED=False") -- GitLab From ad08935c79ba9b1a646967b902999c9107124d89 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 19:13:49 -0500 Subject: [PATCH 11/22] cmake_args --- .spack/repo/packages/csg-eb/package.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 5a56c9b..a7ea612 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -22,8 +22,7 @@ class CsgEb(CMakePackage): depends_on("catch2") depends_on("cgal", when="+cgal") - def configure_args(self): - if "+cgal" in self.spec: - extra_args.append("-DCSG_CGAL_ENABLED=True") - else: - extra_args.append("-DCSG_CGAL_ENABLED=False") + def cmake_args(self): + return "-DCSG_CGAL_ENABLED={}".format( + "True" if "+cgal" in self.spec else "False" + ) -- GitLab From a15f6735d2527ca4b4137e5d9d9571e8e84cb6e6 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Mon, 15 Nov 2021 19:19:00 -0500 Subject: [PATCH 12/22] ignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c795b05..ce8c7f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build \ No newline at end of file +__pycache__ +build -- GitLab From d82db3180a26dbad4c9978ba9778ee5a84da656d Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Tue, 16 Nov 2021 08:10:01 -0500 Subject: [PATCH 13/22] fix --- .spack/repo/packages/csg-eb/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index a7ea612..38a445d 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -23,6 +23,6 @@ class CsgEb(CMakePackage): depends_on("cgal", when="+cgal") def cmake_args(self): - return "-DCSG_CGAL_ENABLED={}".format( - "True" if "+cgal" in self.spec else "False" - ) + return [ + "-DCSG_CGAL_ENABLED={}".format("True" if "+cgal" in self.spec else "False") + ] -- GitLab From de44937974ec7d0f65bf8804be09629973d4f9c5 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Tue, 16 Nov 2021 09:04:16 -0500 Subject: [PATCH 14/22] install header --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97550c2..648b273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,10 @@ target_include_directories(csg-eb target_compile_features(csg-eb PRIVATE cxx_std_17) install(TARGETS csg-eb - RUNTIME DESTINATION lib) + PUBLIC_HEADER + RUNTIME DESTINATION lib + ) + if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() -- GitLab From 3f55c57498d9a26c7082a142989b04fadcb38079 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 10:59:04 -0500 Subject: [PATCH 15/22] install headers --- .spack/repo/packages/csg-eb/package.py | 7 ++++--- CMakeLists.txt | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 38a445d..81129db 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -5,16 +5,17 @@ from spack import * +CSG_REPO = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" +CSG_BRANCH = "spack" + class CsgEb(CMakePackage): """Define Embedded Boundaries (for AMReX) using CSG""" homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" - git = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" - version("main", "e5f0e6b44f36573f90c2c75cd1097935") - version("spack", branch="spack") + version("main", git=CSG_REPO, branch=CSG_BRANCH) variant("cgal", default=True, description="Build with CGAL Support") diff --git a/CMakeLists.txt b/CMakeLists.txt index 648b273..af5dd73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,11 @@ install(TARGETS csg-eb RUNTIME DESTINATION lib ) +file(GLOB headers "include/*.hpp") +install(FILES ${headers} + DESTINATION include + ) + if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() -- GitLab From 20fd27ba502626c059edeec07cbeba6470c7b913 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 14:51:57 -0500 Subject: [PATCH 16/22] fix install --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af5dd73..63d0707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,16 +28,15 @@ endif() add_subdirectory(src/csg) target_include_directories(csg-eb - PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include + PUBLIC $ + $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) target_compile_features(csg-eb PRIVATE cxx_std_17) -install(TARGETS csg-eb - PUBLIC_HEADER - RUNTIME DESTINATION lib - ) +install(TARGETS csg-eb EXPORT csgeb) +install(EXPORT csgeb DESTINATION "share") file(GLOB headers "include/*.hpp") install(FILES ${headers} -- GitLab From cceac435b507c74606dfaa9268755d92e0d135f7 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 15:09:29 -0500 Subject: [PATCH 17/22] fix install --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63d0707..0f68532 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ target_include_directories(csg-eb target_compile_features(csg-eb PRIVATE cxx_std_17) install(TARGETS csg-eb EXPORT csgeb) -install(EXPORT csgeb DESTINATION "share") +install(EXPORT csgeb DESTINATION ${CMAKE_INSTALL_PREFIX}) file(GLOB headers "include/*.hpp") install(FILES ${headers} -- GitLab From a999e287b5485e73b6f3e81b76f00119a4994726 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 15:53:02 -0500 Subject: [PATCH 18/22] fix install --- CMakeLists.txt | 14 +++++++++++++- CsgEbConfig.cmake | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 CsgEbConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f68532..6205845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,12 @@ target_include_directories(csg-eb target_compile_features(csg-eb PRIVATE cxx_std_17) -install(TARGETS csg-eb EXPORT csgeb) + +install(TARGETS csg-eb EXPORT csgeb + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + INCLUDES DESTINATION include +) install(EXPORT csgeb DESTINATION ${CMAKE_INSTALL_PREFIX}) file(GLOB headers "include/*.hpp") @@ -43,6 +48,13 @@ install(FILES ${headers} DESTINATION include ) +configure_file(CsgEbConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.cmake" + COPYONLY +) + +install(FILES CsgEbConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) + if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) endif() diff --git a/CsgEbConfig.cmake b/CsgEbConfig.cmake new file mode 100644 index 0000000..c901e36 --- /dev/null +++ b/CsgEbConfig.cmake @@ -0,0 +1,2 @@ +include(CMakeFindDependencyMacro) +include("${CMAKE_CURRENT_LIST_DIR}/CsgEb.cmake") -- GitLab From 956a6d8ac9c34868ccb5b8dd889de8edf0a0dcc7 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 15:57:09 -0500 Subject: [PATCH 19/22] fix --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6205845..2eff483 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,12 +36,12 @@ target_include_directories(csg-eb target_compile_features(csg-eb PRIVATE cxx_std_17) -install(TARGETS csg-eb EXPORT csgeb +install(TARGETS csg-eb EXPORT CsgEb LIBRARY DESTINATION lib ARCHIVE DESTINATION lib INCLUDES DESTINATION include ) -install(EXPORT csgeb DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(EXPORT CsgEb DESTINATION ${CMAKE_INSTALL_PREFIX}) file(GLOB headers "include/*.hpp") install(FILES ${headers} -- GitLab From a09d04bb5051da0affc0c69c6b83de01d51e4bcd Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 16:24:05 -0500 Subject: [PATCH 20/22] fix --- CMakeLists.txt | 24 +++++++++++++----------- CsgEbConfig.cmake | 2 -- 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 CsgEbConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2eff483..e845572 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,24 +36,26 @@ target_include_directories(csg-eb target_compile_features(csg-eb PRIVATE cxx_std_17) -install(TARGETS csg-eb EXPORT CsgEb - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - INCLUDES DESTINATION include -) -install(EXPORT CsgEb DESTINATION ${CMAKE_INSTALL_PREFIX}) - file(GLOB headers "include/*.hpp") install(FILES ${headers} DESTINATION include ) -configure_file(CsgEbConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.cmake" - COPYONLY +install(TARGETS csg-eb + EXPORT CsgEbConfig + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) +export(TARGETS csg-eb + NAMESPACE CsgEb:: + FILE "${CMAKE_CURRENT_BINARY_DIR}/CsgEbConfig.cmake" +) +install(EXPORT CsgEbConfig + DESTINATION "${CMAKE_INSTALL_PREFIX}" + NAMESPACE CsgEb:: ) -install(FILES CsgEbConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) if (CSG_CGAL_ENABLED) target_compile_definitions(csg-eb PUBLIC USE_CGAL) diff --git a/CsgEbConfig.cmake b/CsgEbConfig.cmake deleted file mode 100644 index c901e36..0000000 --- a/CsgEbConfig.cmake +++ /dev/null @@ -1,2 +0,0 @@ -include(CMakeFindDependencyMacro) -include("${CMAKE_CURRENT_LIST_DIR}/CsgEb.cmake") -- GitLab From 14b7e0bc4dee4bbefbdb399f965f7647f1cef786 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 17 Nov 2021 16:45:42 -0500 Subject: [PATCH 21/22] add cpath --- .spack/repo/packages/csg-eb/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 81129db..812650f 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -27,3 +27,12 @@ class CsgEb(CMakePackage): return [ "-DCSG_CGAL_ENABLED={}".format("True" if "+cgal" in self.spec else "False") ] + + def setup_run_environment(self, env): + env.prepend_path("CPATH", self.prefix.include) + + @property + def headers(self): + headers = find_all_headers(self.prefix.include) + headers.directories = [self.prefix.include] + return headers -- GitLab From 93ba1260475bf32f58454cc81605c561835b92e9 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 1 Dec 2021 11:34:57 -0500 Subject: [PATCH 22/22] branch main --- .spack/repo/packages/csg-eb/package.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.spack/repo/packages/csg-eb/package.py b/.spack/repo/packages/csg-eb/package.py index 812650f..5667497 100644 --- a/.spack/repo/packages/csg-eb/package.py +++ b/.spack/repo/packages/csg-eb/package.py @@ -6,14 +6,13 @@ from spack import * CSG_REPO = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb.git" -CSG_BRANCH = "spack" +CSG_BRANCH = "main" class CsgEb(CMakePackage): """Define Embedded Boundaries (for AMReX) using CSG""" homepage = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb" - url = "https://mfix.netl.doe.gov/gitlab/exa/csg-eb/-/archive/spack/csg-eb-spack.tar.gz" version("main", git=CSG_REPO, branch=CSG_BRANCH) -- GitLab