-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test CMake find_package (*.cmake files).
- Loading branch information
Showing
11 changed files
with
180 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,12 @@ arpack-ng - 3.9.0 | |
* Support for NAG's nagfor Fortran compiler | ||
|
||
[ Franck Houssen ] | ||
* Test CMake find_package (*.cmake files). | ||
* [BUG FIX] autotools: ICB must be checked first (MPI changes compilers). | ||
* [BUG FIX] BLAS/LAPACK: allow suffixes in case BLAS/LAPACK can not provide ICB. | ||
* [BUG FIX] Compile C programs with ICB. | ||
* arpackmm: command line bug fix. | ||
* arpackmm: restart bug fix. | ||
|
||
[ Haoyang Liu ] | ||
* CMake: minimum required version changed to 3.0 | ||
|
@@ -24,10 +27,6 @@ arpack-ng - 3.9.0 | |
[ Robert Schütz ] | ||
* use CMAKE_INSTALL_FULL_<dir> in arpack.pc | ||
|
||
[ Franck Houssen ] | ||
* arpackmm: command line bug fix. | ||
* arpackmm: restart bug fix. | ||
|
||
-- Sylvestre Ledru <[email protected]> Mon, 07 Dec 2020 11:37:40 +0100 | ||
|
||
arpack-ng - 3.8.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Config file for the arpack-ng package. | ||
# | ||
# To use arpack from CMake, use ARPACK::ARPACK target: | ||
# find_package(arpackng) | ||
# add_executable(main main.f) | ||
# target_include_directories(main INTERFACE ARPACK::ARPACK) | ||
# target_link_libraries(main ARPACK::ARPACK) | ||
# | ||
# To use parpack from CMake, use PARPACK::PARPACK target: | ||
# find_package(arpackng) | ||
# add_executable(main main.f) | ||
# target_include_directories(main INTERFACE PARPACK::PARPACK) | ||
# target_link_libraries(main PARPACK::PARPACK) | ||
|
||
# Create arpack targets. | ||
add_library(ARPACK::ARPACK INTERFACE IMPORTED) | ||
set_target_properties(ARPACK::ARPACK PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/arpack-ng") | ||
set_target_properties(ARPACK::ARPACK PROPERTIES INTERFACE_LINK_DIRECTORIES "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@") | ||
set_target_properties(ARPACK::ARPACK PROPERTIES INTERFACE_LINK_LIBRARIES "arpack") | ||
|
||
# Create parpack targets. | ||
set(MPI "@MPI@") | ||
if (MPI) | ||
add_library(PARPACK::PARPACK INTERFACE IMPORTED) | ||
set_target_properties(PARPACK::PARPACK PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/arpack-ng") | ||
set_target_properties(PARPACK::PARPACK PROPERTIES INTERFACE_LINK_DIRECTORIES "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@") | ||
set_target_properties(PARPACK::PARPACK PROPERTIES INTERFACE_LINK_LIBRARIES "parpack") | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash -eu | ||
# Testing that find_package works. | ||
# Note: this script must not be added to the test suite as it will change cmake options. | ||
|
||
# 1. Define temporary directory. | ||
|
||
export TMP_DIR="/tmp/tstCMakeInstall" | ||
mkdir -p "${TMP_DIR}" | ||
|
||
# 2. Rerun cmake with prefix, install arpack-ng. | ||
# Note: this script must not be added to the test suite as it will change cmake options. | ||
|
||
export TMP_PREFIX="${TMP_DIR}/local" | ||
cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON . | ||
make all install | ||
|
||
# 3. Setup environment for find_package to work (what you typically in module-environment files). | ||
|
||
cd "${TMP_DIR}" | ||
export ARCH="$(ls ./local/lib/)" | ||
export PKG_CONFIG_PATH="${TMP_PREFIX}/lib/${ARCH}/pkgconfig" | ||
export arpackng_DIR="${TMP_PREFIX}/lib/${ARCH}/cmake/arpack-ng" | ||
|
||
# 4. Create new cmake project, in temporary directory, with files from arpack-ng. | ||
|
||
mkdir -p tstCMakeInstall | ||
cd tstCMakeInstall | ||
|
||
cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnband.f" . | ||
cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnbdr1.f" . | ||
cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnbdr3.f" . | ||
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv1.f" . | ||
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv3.f" . | ||
|
||
echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "project(tstCMakeInstall Fortran)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt | ||
echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt | ||
echo "find_package(MPI REQUIRED COMPONENTS Fortran)" >> CMakeLists.txt | ||
echo "find_package(arpackng REQUIRED)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "add_executable(dnbdr1 dnband.f dnbdr1.f)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr1 INTERFACE BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr1 BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr1 INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr1 LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr1 INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr1 ARPACK::ARPACK)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "add_executable(pdndrv1 dnband.f pdndrv1.f)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv1 INTERFACE BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv1 BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv1 INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv1 LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv1 INTERFACE MPI::MPI_Fortran)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv1 MPI::MPI_Fortran)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv1 INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv1 ARPACK::ARPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv1 INTERFACE PARPACK::PARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv1 PARPACK::PARPACK)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "find_package(PkgConfig REQUIRED)" >> CMakeLists.txt | ||
echo "pkg_check_modules(ARPACK IMPORTED_TARGET REQUIRED arpack)" >> CMakeLists.txt | ||
echo "pkg_check_modules(PARPACK IMPORTED_TARGET REQUIRED parpack)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "add_executable(dnbdr3 dnband.f dnbdr3.f)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr3 INTERFACE BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr3 BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr3 INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr3 LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(dnbdr3 INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(dnbdr3 PkgConfig::ARPACK)" >> CMakeLists.txt | ||
echo "" >> CMakeLists.txt | ||
echo "add_executable(pdndrv3 dnband.f pdndrv3.f)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv3 INTERFACE BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv3 BLAS::BLAS)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv3 INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv3 LAPACK::LAPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv3 INTERFACE MPI::MPI_Fortran)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv3 MPI::MPI_Fortran)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv3 INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv3 PkgConfig::ARPACK)" >> CMakeLists.txt | ||
echo "target_include_directories(pdndrv3 INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt | ||
echo "target_link_libraries(pdndrv3 PkgConfig::PARPACK)" >> CMakeLists.txt | ||
|
||
# 5. Build and test this new project with cmake: for this to be possible, find_package must work. | ||
|
||
mkdir -p build | ||
cd build | ||
|
||
cmake .. | ||
make all VERBOSE=1 | ||
|
||
./dnbdr1 | ||
mpirun -n 2 ./pdndrv1 | ||
./dnbdr3 | ||
mpirun -n 2 ./pdndrv3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters