From 53298b7265948ad96bd7a91df7ef5bd0e35f34f6 Mon Sep 17 00:00:00 2001 From: Jacob Merson Date: Fri, 30 Apr 2021 03:00:26 -0400 Subject: [PATCH] Update cmake exports to use single config file --- CMakeLists.txt | 6 ++++++ cmake/lasConfig.cmake.in | 16 ++++++++++++++ core/CMakeLists.txt | 4 ++-- scripts/bgq-env.sh | 6 ------ scripts/bgq-timing-batch.sh | 17 --------------- scripts/config.sh | 43 ------------------------------------- scripts/config_bgq.sh | 16 -------------- scripts/config_dcs.sh | 25 --------------------- scripts/config_erp.sh | 16 -------------- scripts/timing-tests.sh | 7 ------ sparskit/CMakeLists.txt | 2 +- src/CMakeLists.txt | 8 +++---- 12 files changed, 29 insertions(+), 137 deletions(-) create mode 100644 cmake/lasConfig.cmake.in delete mode 100755 scripts/bgq-env.sh delete mode 100755 scripts/bgq-timing-batch.sh delete mode 100755 scripts/config.sh delete mode 100755 scripts/config_bgq.sh delete mode 100644 scripts/config_dcs.sh delete mode 100644 scripts/config_erp.sh delete mode 100755 scripts/timing-tests.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 90fc160..b487414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,3 +137,9 @@ if (WITH_PETSC) find_package(PkgConfig REQUIRED) pkg_check_modules(PETSc REQUIRED IMPORTED_TARGET GLOBAL PETSc) endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lasConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/lasConfig.cmake @ONLY) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/lasConfig.cmake + DESTINATION ${ConfigPackageLocation}) diff --git a/cmake/lasConfig.cmake.in b/cmake/lasConfig.cmake.in new file mode 100644 index 0000000..c8e6202 --- /dev/null +++ b/cmake/lasConfig.cmake.in @@ -0,0 +1,16 @@ +include(CMakeFindDependencyMacro) + + + +if(@WITH_MPI@) + find_dependency(MPI) +endif() +if(@WITH_PUMI@) + find_dependency(SCOREC) +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/las_las.cmake) +# las_lascore.cmake needs to be included after las_las.cmake +if(@WITH_PUMI@) + include(${CMAKE_CURRENT_LIST_DIR}/las_lascore.cmake) +endif() diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 89faed6..4239d9a 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -35,5 +35,5 @@ endif() set_target_properties(las_core PROPERTIES PUBLIC_HEADER "${las_core_install}") target_include_directories(las_core PUBLIC $ $ ${include_dirs}) target_link_libraries(las_core PUBLIC las SCOREC::apf ${link_libs}) -install(TARGETS las_core EXPORT las_coreConfig LIBRARY DESTINATION lib ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include) -install(EXPORT las_coreConfig DESTINATION lib/cmake) +install(TARGETS las_core EXPORT las_lascore LIBRARY DESTINATION lib ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include) +install(EXPORT las_lascore DESTINATION ${ConfigPackageLocation} ) diff --git a/scripts/bgq-env.sh b/scripts/bgq-env.sh deleted file mode 100755 index 86a0894..0000000 --- a/scripts/bgq-env.sh +++ /dev/null @@ -1,6 +0,0 @@ -module load cmake \ -xl \ -hdf5/xl/1.8.13 \ -zoltan/xl/3.8 \ -parmetis/xl/4.0.3 \ -proprietary/simmetrix/simModSuite/12.0-170408dev-xl \ No newline at end of file diff --git a/scripts/bgq-timing-batch.sh b/scripts/bgq-timing-batch.sh deleted file mode 100755 index a394b02..0000000 --- a/scripts/bgq-timing-batch.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -#SBATCH --job-name=las-timing -#SBATCH --partition=debug -#SBATCH -t 05 -#SBATCH -D /gpfs/u/barn/PASC/PASCtbnw/las/build/test/ -#SBATCH --mail-type=ALL -#SBATCH - -if [ "$#" -ne 3 ] ; then - echo "Usage: " $0 " [model] [mesh] " -fi - -EXES="petsc_raw petsc_lasops petsc_call petsc_cvirt petsc_virtual" -for EXE in ${EXES} ; do - echo "running " $EXE - srun -n 1 -o timing_${EXE}.log $EXE $1 $2 -done \ No newline at end of file diff --git a/scripts/config.sh b/scripts/config.sh deleted file mode 100755 index 165300b..0000000 --- a/scripts/config.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -x -PREFIX=/gpfs/u/scratch/PASC/shared/install/las -#CUDA_INC_PATH=$DEVROOT/install/cuda/9.1/include \ -#CUDA_PATH=$DEVROOT/install/cuda/9.1/ \ -BUILD=Debug -#BUILD=RelWithDebugInfo -HOSTNAME=`hostname` -if [ "$HOSTNAME" == "q.ccni.rpi.edu" ]; then - cmake .. \ - -DCMAKE_C_COMPILER=`which mpicc` \ - -DCMAKE_CXX_COMPILER=`which mpicxx` \ - -DCMAKE_Fortran_COMPILER=`which mpif77` \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=0 \ - -DSCOREC_DIR=/gpfs/u/scratch/PASC/shared/install/core/lib/cmake/SCOREC/ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="$PREFIX" \ - -DPETSC_DIR=/gpfs/u/scratch/PASC/shared/install/petsc-3.9.2/xl \ - -DPETSC_ARCH=/ \ - -DBUILD_SPARSKIT=ON \ - -DWITH_KOKKOS=FALSE \ - -DBUILD_TESTS=FALSE -else - cmake .. \ - -DCMAKE_BUILD_TYPE=$BUILD \ - -DCMAKE_C_COMPILER=mpicc \ - -DCMAKE_CXX_COMPILER=mpicxx \ - -DCMAKE_Fortran_COMPILER=mpif77 \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ - -DSCOREC_DIR=$DEVROOT/install/core/$BUILD/lib/cmake/SCOREC/ \ - -DCMAKE_INSTALL_PREFIX=$DEVROOT/install/las/$BUILD \ - -DPETSC_DIR="$PETSC_DIR" \ - -DPETSC_ARCH="$PETSC_ARCH" \ - -DBUILD_SPARSKIT=ON \ - -DWITH_KOKKOS=FALSE \ - -DBUILD_TESTS=TRUE -fi - -# -DCUDA_TOOLKIT_ROOT_DIR=$DEVROOT/install/cuda/9.1/bin \ -# -DCUDA_CUDART_LIBRARY=$DEVROOT/install/cuda/9.1/lib64/libcudart_static.a - -# -DENABLE_SIMMETRIX=TRUE \ -# -DSCOREC_LIB_DIR=$DEVROOT/install/core/lib \ -# -DSCOREC_INCLUDE_DIR=$DEVROOT/install/core/include \ diff --git a/scripts/config_bgq.sh b/scripts/config_bgq.sh deleted file mode 100755 index 625f7b8..0000000 --- a/scripts/config_bgq.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -x -PREFIX=/gpfs/u/home/PASC/PASCmrsn/scratch/install/las - - cmake /gpfs/u/home/PASC/PASCmrsn/barn/las/ \ - -DCMAKE_C_COMPILER=`which mpicc` \ - -DCMAKE_CXX_COMPILER=`which mpicxx` \ - -DCMAKE_Fortran_COMPILER=`which mpif77` \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=0 \ - -DSCOREC_DIR=/gpfs/u/home/PASC/PASCmrsn/scratch/install/core/lib/cmake/SCOREC/ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="$PREFIX" \ - -DPETSC_DIR=/gpfs/u/home/PASC/PASCmrsn/scratch/install/petsc-3.9.2/xl \ - -DPETSC_ARCH=/ \ - -DBUILD_SPARSKIT=ON \ - -DWITH_KOKKOS=FALSE \ - -DBUILD_TESTS=FALSE diff --git a/scripts/config_dcs.sh b/scripts/config_dcs.sh deleted file mode 100644 index 3ba5f17..0000000 --- a/scripts/config_dcs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -#mpicc=/gpfs/u/home/PASC/PASCmrsn/scratch/test_compile/mpicc -#mpicxx=/gpfs/u/home/PASC/PASCmrsn/scratch/test_compile/mpicxx -#mpif77=/gpfs/u/home/PASC/PASCmrsn/scratch/test_compile/mpif77 -export OMPI_CXX=xlc++_r - - cmake /gpfs/u/home/PASC/PASCmrsn/barn/las/ \ - -DCMAKE_C_COMPILER=`which mpicc` \ - -DCMAKE_CXX_COMPILER=`which mpicxx` \ - -DCMAKE_Fortran_COMPILER=`which mpif77` \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=0 \ - -DSCOREC_DIR=/gpfs/u/home/PASC/PASCmrsn/scratch/dcs/install/core/lib/cmake/SCOREC/ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/gpfs/u/home/PASC/PASCmrsn/scratch/dcs/install/las \ - -DPETSC_DIR="$PETSC_DIR" \ - -DPETSC_ARCH="$PETSC_ARCH" \ - -DBUILD_SPARSKIT=ON \ - -DWITH_KOKKOS=FALSE \ - -DBUILD_TESTS=FALSE \ - -DCMAKE_CXX_FLAGS="-Ofast -std=c++11 -Wall" \ - -DCMAKE_C_FLAGS="-Ofast -Wall" \ - -DCMAKE_Fortran_FLAGS="-Ofast -Wall" - #-DCMAKE_C_FLAGS="-O5" \ - #-DCMAKE_CXX_FLAGS="-O5 -sdt=c++11" \ - #-DCMAKE_Fortran_FLAGS="-O5" \ diff --git a/scripts/config_erp.sh b/scripts/config_erp.sh deleted file mode 100644 index 3376244..0000000 --- a/scripts/config_erp.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -PREFIX=/gpfs/u/home/PASC/PASCmrsn/scratch/install-erp/las - - cmake /gpfs/u/home/PASC/PASCmrsn/barn/las/ \ - -DCMAKE_C_COMPILER=`which mpicc` \ - -DCMAKE_CXX_COMPILER=`which mpicxx` \ - -DCMAKE_Fortran_COMPILER=`which mpif77` \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=0 \ - -DSCOREC_DIR=/gpfs/u/home/PASC/PASCmrsn/scratch/install-erp/core/lib/cmake/SCOREC/ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="$PREFIX" \ - -DPETSC_DIR="$PETSC_DIR" \ - -DPETSC_ARCH="$PETSC_ARCH" \ - -DBUILD_SPARSKIT=ON \ - -DWITH_KOKKOS=FALSE \ - -DBUILD_TESTS=FALSE diff --git a/scripts/timing-tests.sh b/scripts/timing-tests.sh deleted file mode 100755 index 2dbcca7..0000000 --- a/scripts/timing-tests.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -TIMING_EXES="petsc_raw petsc_lasops petsc_call petsc_cvirt petsc_virtual" -EXE_DIR=$DEVROOT/las/build/test/ -for EXE in $TIMING_EXES; do - mpirun -np 1 $EXE_DIR/$EXE $DEVROOT/problems/simple_cube/models/cube_test.smd $EXE_DIR/cube_24.smb -done diff --git a/sparskit/CMakeLists.txt b/sparskit/CMakeLists.txt index 4c2b546..07e3881 100644 --- a/sparskit/CMakeLists.txt +++ b/sparskit/CMakeLists.txt @@ -11,4 +11,4 @@ set(sparskit_source src/tred2EISPACK.f src/utils.f ) add_library(sparskit STATIC ${sparskit_source}) -install(TARGETS sparskit EXPORT lasConfig DESTINATION lib) +install(TARGETS sparskit EXPORT las_las DESTINATION lib) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8cbcb6e..c412a28 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -110,7 +110,7 @@ set(include_dirs $ $