From 1b525b649c81b13b5d2e7398d52c54b5d29b7f40 Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 13:26:52 +0200 Subject: [PATCH 01/13] Fix installation tests: compile and run icb_arpack_c. --- ICB/Makefile.am | 1 + cmake/tstCMakeInstall.sh.in | 26 ++++++++++++++++++++++++-- pkg-config/tstAutotoolsInstall.sh.in | 28 +++++++++++++++++----------- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ICB/Makefile.am b/ICB/Makefile.am index 8587e08a9..bbe6ec72f 100644 --- a/ICB/Makefile.am +++ b/ICB/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) +pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@ pkginclude_HEADERS = debug_c.h debug_c.hpp pkginclude_HEADERS += stat_c.h stat_c.hpp pkginclude_HEADERS += arpack.h arpack.hpp diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 747b5eee7..c3a80093c 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -17,7 +17,7 @@ export LIBSUFFIX="${1%-*}" echo "LIBSUFFIX: $LIBSUFFIX" export ITF64SUFFIX="${1#*-}" echo "ITF64SUFFIX: $ITF64SUFFIX" -cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" . +cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DICB=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" . make all install tree "${TMP_PREFIX}" @@ -34,6 +34,8 @@ arpack_cmake_dir="${arpack_cmake_dir%/*}" # Same as dirname CMAKE_PREFIX_PATH="${arpack_cmake_dir%/*}" # cmake directory # 4. Create new cmake project, in temporary directory, with files from arpack-ng. +# The first targets are compiled with *.cmake files generated by cmake. +# The second targets are compiled with *.pc files generated by cmake. mkdir -p tstCMakeInstall cd tstCMakeInstall @@ -43,10 +45,11 @@ 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" . +cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt echo "" >> CMakeLists.txt -echo "project(tstCMakeInstall Fortran)" >> CMakeLists.txt +echo "project(tstCMakeInstall Fortran C)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt @@ -60,6 +63,14 @@ echo "target_include_directories(dnbdr1 INTERFACE LAPACK::LAPACK)" >> CMake 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(icb_arpack_c icb_arpack_c.c)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c 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 @@ -84,6 +95,14 @@ echo "target_include_directories(dnbdr3 INTERFACE LAPACK::LAPACK)" >> CMake 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(icb_arpack_c_pkg icb_arpack_c.c)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_c_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_c_pkg 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 @@ -106,6 +125,9 @@ cmake .. -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" || exit 1 make all VERBOSE=1 || exit 1 ./dnbdr1 || exit 1 +./icb_arpack_c || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 + ./dnbdr3 || exit 1 +./icb_arpack_c_pkg || exit 1 mpirun -n 2 ./pdndrv3 || exit 1 diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 544b66358..26eee94d3 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -1,6 +1,6 @@ #!/bin/bash -eu # Testing that PKG_CHECK_MODULES works. -# Note: this script must not be added to the test suite as it will change cmake options. +# Note: this script must not be added to the test suite as it will change configure options. echo "***************************************************************************************" @@ -10,8 +10,8 @@ export TMP_DIR="/tmp/tstAutotoolsInstall" rm -fr "${TMP_DIR}" # Make sure we restart from scratch. 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. +# 2. Rerun autotools with prefix, install arpack-ng. +# Note: this script must not be added to the test suite as it will change configure options. make clean make distclean @@ -22,7 +22,7 @@ export LIBSUFFIX="${1%-*}" echo "LIBSUFFIX: $LIBSUFFIX" export ITF64SUFFIX="${1#*-}" echo "ITF64SUFFIX: $ITF64SUFFIX" -LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi +LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi --enable-icb make all install tree "${TMP_PREFIX}" @@ -33,7 +33,7 @@ export PKG_CONFIG_PATH="$(find ${TMP_PREFIX} -name arpack${LIBSUFFIX}${ITF64SUFF export PKG_CONFIG_PATH="${PKG_CONFIG_PATH%/*}" # Same as dirname. echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH" -# 4. Create new cmake project, in temporary directory, with files from arpack-ng. +# 4. Create new autotools project, in temporary directory, with files from arpack-ng. mkdir -p tstAutotoolsInstall cd tstAutotoolsInstall @@ -42,6 +42,7 @@ cp "${PROJECT_SOURCE_DIR}/EXAMPLES/BAND/dnband.f" . cp "${PROJECT_SOURCE_DIR}/EXAMPLES/BAND/dnbdr1.f" . cp "${PROJECT_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/pdndrv1.f" . cp -fr "${PROJECT_SOURCE_DIR}/m4" . +cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" . echo "AC_PREREQ([2.68]) " > configure.ac echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac @@ -82,7 +83,7 @@ echo "ACLOCAL_AMFLAGS = -I m4 echo " " >> Makefile.am echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am echo " " >> Makefile.am -echo "bin_PROGRAMS = dnbdr1 pdndrv1 " >> Makefile.am +echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c " >> Makefile.am echo " " >> Makefile.am echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am @@ -91,13 +92,18 @@ echo " echo "pdndrv1_SOURCES = pdndrv1.f dnband.f " >> Makefile.am echo "pdndrv1_FFLAGS = \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am echo "pdndrv1_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_Fortran_LIBS)" >> Makefile.am +echo " " >> Makefile.am +echo "icb_arpack_c_SOURCES = icb_arpack_c.c " >> Makefile.am +echo "icb_arpack_c_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am +echo "icb_arpack_c_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am -# 5. Build and test this new project with cmake: for this to be possible, PKG_CHECK_MODULES must work. +# 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work. autoreconf --force --verbose --install -./configure -make all +./configure || exit 1 +make all || exit 1 -./dnbdr1 -mpirun -n 2 ./pdndrv1 +./dnbdr1 || exit 1 +./icb_arpack_c || exit 1 +mpirun -n 2 ./pdndrv1 || exit 1 From c46da4f87a0288a2e5f726076f6534afe88547ee Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 13:55:09 +0200 Subject: [PATCH 02/13] Fix installation tests: compile and run icb_arpack_cpp. --- cmake/tstCMakeInstall.sh.in | 21 ++++++++++++++++++++- pkg-config/tstAutotoolsInstall.sh.in | 10 +++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index c3a80093c..5b4d4d2a0 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -46,10 +46,11 @@ 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" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . +cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" . echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt echo "" >> CMakeLists.txt -echo "project(tstCMakeInstall Fortran C)" >> CMakeLists.txt +echo "project(tstCMakeInstall Fortran C CXX)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt @@ -71,6 +72,14 @@ echo "target_include_directories(icb_arpack_c INTERFACE LAPACK::LAPACK)" >> CMak echo "target_link_libraries(icb_arpack_c LAPACK::LAPACK)" >> CMakeLists.txt echo "target_include_directories(icb_arpack_c INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_arpack_c ARPACK::ARPACK)" >> CMakeLists.txt +echo "" >> CMakeLists.txt +echo "add_executable(icb_arpack_cpp icb_arpack_cpp.cpp)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp 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 @@ -103,6 +112,14 @@ echo "target_include_directories(icb_arpack_c_pkg INTERFACE LAPACK::LAPACK)" echo "target_link_libraries(icb_arpack_c_pkg LAPACK::LAPACK)" >> CMakeLists.txt echo "target_include_directories(icb_arpack_c_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_arpack_c_pkg PkgConfig::ARPACK)" >> CMakeLists.txt +echo "" >> CMakeLists.txt +echo "add_executable(icb_arpack_cpp_pkg icb_arpack_cpp.cpp)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_arpack_cpp_pkg 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 @@ -126,8 +143,10 @@ make all VERBOSE=1 || exit 1 ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 +./icb_arpack_cpp || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 ./dnbdr3 || exit 1 ./icb_arpack_c_pkg || exit 1 +./icb_arpack_cpp_pkg || exit 1 mpirun -n 2 ./pdndrv3 || exit 1 diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 26eee94d3..852f13313 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -43,6 +43,7 @@ cp "${PROJECT_SOURCE_DIR}/EXAMPLES/BAND/dnbdr1.f" . cp "${PROJECT_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/pdndrv1.f" . cp -fr "${PROJECT_SOURCE_DIR}/m4" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" . +cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp" . echo "AC_PREREQ([2.68]) " > configure.ac echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac @@ -50,6 +51,8 @@ echo "AM_INIT_AUTOMAKE([foreign]) " echo "AC_CONFIG_MACRO_DIR([m4]) " >> configure.ac echo " " >> configure.ac echo "AC_PROG_FC " >> configure.ac +echo "AC_PROG_CC " >> configure.ac +echo "AC_PROG_CXX " >> configure.ac echo "AC_PROG_MKDIR_P " >> configure.ac echo "AC_PROG_MAKE_SET " >> configure.ac echo "PKG_PROG_PKG_CONFIG " >> configure.ac @@ -83,7 +86,7 @@ echo "ACLOCAL_AMFLAGS = -I m4 echo " " >> Makefile.am echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am echo " " >> Makefile.am -echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c " >> Makefile.am +echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp " >> Makefile.am echo " " >> Makefile.am echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am @@ -96,6 +99,10 @@ echo " echo "icb_arpack_c_SOURCES = icb_arpack_c.c " >> Makefile.am echo "icb_arpack_c_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am echo "icb_arpack_c_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am +echo " " >> Makefile.am +echo "icb_arpack_cpp_SOURCES = icb_arpack_cpp.cpp " >> Makefile.am +echo "icb_arpack_cpp_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am +echo "icb_arpack_cpp_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am # 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work. @@ -106,4 +113,5 @@ make all || exit 1 ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 +./icb_arpack_cpp || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 From f4b2f31a64e5ddf6a08cf478467ed06197f11a60 Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 17:40:31 +0200 Subject: [PATCH 03/13] Fix installation tests: compile and run icb_parpack_c. --- cmake/tstCMakeInstall.sh.in | 29 +++++++++++++++++++++++++++- pkg-config/tstAutotoolsInstall.sh.in | 15 +++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 5b4d4d2a0..6a405b9ed 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -47,6 +47,7 @@ cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv1.f" . cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv3.f" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" . +cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_c.c" . echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt echo "" >> CMakeLists.txt @@ -54,7 +55,7 @@ echo "project(tstCMakeInstall Fortran C CXX)" >> CMake 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(MPI REQUIRED COMPONENTS Fortran C)" >> CMakeLists.txt echo "find_package(arpackng REQUIRED)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "add_executable(dnbdr1 dnband.f dnbdr1.f)" >> CMakeLists.txt @@ -92,6 +93,18 @@ echo "target_include_directories(pdndrv1 INTERFACE ARPACK::ARPACK)" >> CMake 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 "add_executable(icb_parpack_c icb_parpack_c.c)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c INTERFACE MPI::MPI_C)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c MPI::MPI_C)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c INTERFACE PARPACK::PARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c PARPACK::PARPACK)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "find_package(PkgConfig REQUIRED)" >> CMakeLists.txt echo "pkg_check_modules(ARPACK IMPORTED_TARGET REQUIRED arpack${LIBSUFFIX}${ITF64SUFFIX})" >> CMakeLists.txt @@ -132,6 +145,18 @@ echo "target_include_directories(pdndrv3 INTERFACE PkgConfig::ARPACK)" >> CMake 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 +echo "" >> CMakeLists.txt +echo "add_executable(icb_parpack_c_pkg icb_parpack_c.c)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c_pkg INTERFACE MPI::MPI_C)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c_pkg MPI::MPI_C)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c_pkg PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_c_pkg INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_c_pkg PkgConfig::PARPACK)" >> CMakeLists.txt # 5. Build and test this new project with cmake: for this to be possible, find_package must work. @@ -145,8 +170,10 @@ make all VERBOSE=1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 +mpirun -n 2 ./icb_parpack_c || exit 1 ./dnbdr3 || exit 1 ./icb_arpack_c_pkg || exit 1 ./icb_arpack_cpp_pkg || exit 1 mpirun -n 2 ./pdndrv3 || exit 1 +mpirun -n 2 ./icb_parpack_c_pkg || exit 1 diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 852f13313..66422a9c1 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -44,6 +44,7 @@ cp "${PROJECT_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/pdndrv1.f" . cp -fr "${PROJECT_SOURCE_DIR}/m4" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp" . +cp "${PROJECT_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_c.c" . echo "AC_PREREQ([2.68]) " > configure.ac echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac @@ -68,6 +69,12 @@ echo "AX_MPI([], AC_MSG_ERROR([could not compile a Fortran MPI test program]))" echo "F77=\$MPIF77 " >> configure.ac echo "AC_SUBST([MPI_Fortran_LIBS]) " >> configure.ac echo " " >> configure.ac +echo "AC_LANG_PUSH([C]) " >> configure.ac +echo "AX_MPI([], AC_MSG_ERROR([could not compile a C MPI test program])) " >> configure.ac +echo "AC_SUBST([MPI_C_LIBS], ["\$MPILIBS \$FCLIBS"]) " >> configure.ac +echo "CC=\$MPICC " >> configure.ac +echo "AC_LANG_POP([C]) " >> configure.ac +echo " " >> configure.ac echo "PKG_CHECK_MODULES([ARPACK], [arpack${LIBSUFFIX}${ITF64SUFFIX}]) " >> configure.ac echo "AC_SUBST([ARPACK_CFLAGS]) " >> configure.ac echo "AC_SUBST([ARPACK_LIBS]) " >> configure.ac @@ -86,7 +93,7 @@ echo "ACLOCAL_AMFLAGS = -I m4 echo " " >> Makefile.am echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am echo " " >> Makefile.am -echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp " >> Makefile.am +echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp icb_parpack_c " >> Makefile.am echo " " >> Makefile.am echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am @@ -103,6 +110,10 @@ echo " echo "icb_arpack_cpp_SOURCES = icb_arpack_cpp.cpp " >> Makefile.am echo "icb_arpack_cpp_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am echo "icb_arpack_cpp_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am +echo " " >> Makefile.am +echo "icb_parpack_c_SOURCES = icb_parpack_c.c " >> Makefile.am +echo "icb_parpack_c_CPPFLAGS = \$(AM_CPPFLAGS) \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am +echo "icb_parpack_c_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_C_LIBS) " >> Makefile.am # 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work. @@ -114,4 +125,6 @@ make all || exit 1 ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 + mpirun -n 2 ./pdndrv1 || exit 1 +mpirun -n 2 ./icb_parpack_c || exit 1 From 2239bf22e6b295c714a431bea911a176b74f8ded Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 18:02:03 +0200 Subject: [PATCH 04/13] Fix installation tests: compile and run icb_parpack_cpp. --- cmake/tstCMakeInstall.sh.in | 29 +++++++++++++++++++++++++++- pkg-config/tstAutotoolsInstall.sh.in | 14 +++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 6a405b9ed..35ec2c667 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -48,6 +48,7 @@ cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv3.f" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" . cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_c.c" . +cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp" . echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt echo "" >> CMakeLists.txt @@ -55,7 +56,7 @@ echo "project(tstCMakeInstall Fortran C CXX)" >> CMake echo "" >> CMakeLists.txt echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt -echo "find_package(MPI REQUIRED COMPONENTS Fortran C)" >> CMakeLists.txt +echo "find_package(MPI REQUIRED COMPONENTS Fortran C CXX)" >> CMakeLists.txt echo "find_package(arpackng REQUIRED)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "add_executable(dnbdr1 dnband.f dnbdr1.f)" >> CMakeLists.txt @@ -105,6 +106,18 @@ echo "target_include_directories(icb_parpack_c INTERFACE ARPACK::ARPACK)" >> C echo "target_link_libraries(icb_parpack_c ARPACK::ARPACK)" >> CMakeLists.txt echo "target_include_directories(icb_parpack_c INTERFACE PARPACK::PARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_parpack_c PARPACK::PARPACK)" >> CMakeLists.txt +echo "" >> CMakeLists.txt +echo "add_executable(icb_parpack_cpp icb_parpack_cpp.cpp)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp INTERFACE MPI::MPI_CXX)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp MPI::MPI_CXX)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp INTERFACE PARPACK::PARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp PARPACK::PARPACK)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "find_package(PkgConfig REQUIRED)" >> CMakeLists.txt echo "pkg_check_modules(ARPACK IMPORTED_TARGET REQUIRED arpack${LIBSUFFIX}${ITF64SUFFIX})" >> CMakeLists.txt @@ -157,6 +170,18 @@ echo "target_include_directories(icb_parpack_c_pkg INTERFACE PkgConfig::ARPACK)" echo "target_link_libraries(icb_parpack_c_pkg PkgConfig::ARPACK)" >> CMakeLists.txt echo "target_include_directories(icb_parpack_c_pkg INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_parpack_c_pkg PkgConfig::PARPACK)" >> CMakeLists.txt +echo "" >> CMakeLists.txt +echo "add_executable(icb_parpack_cpp_pkg icb_parpack_cpp.cpp)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp_pkg INTERFACE MPI::MPI_CXX)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp_pkg MPI::MPI_CXX)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp_pkg PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(icb_parpack_cpp_pkg INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt +echo "target_link_libraries(icb_parpack_cpp_pkg PkgConfig::PARPACK)" >> CMakeLists.txt # 5. Build and test this new project with cmake: for this to be possible, find_package must work. @@ -171,9 +196,11 @@ make all VERBOSE=1 || exit 1 ./icb_arpack_cpp || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 mpirun -n 2 ./icb_parpack_c || exit 1 +mpirun -n 2 ./icb_parpack_cpp || exit 1 ./dnbdr3 || exit 1 ./icb_arpack_c_pkg || exit 1 ./icb_arpack_cpp_pkg || exit 1 mpirun -n 2 ./pdndrv3 || exit 1 mpirun -n 2 ./icb_parpack_c_pkg || exit 1 +mpirun -n 2 ./icb_parpack_cpp_pkg || exit 1 diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 66422a9c1..63293637c 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -45,6 +45,7 @@ cp -fr "${PROJECT_SOURCE_DIR}/m4" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp" . cp "${PROJECT_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_c.c" . +cp "${PROJECT_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp" . echo "AC_PREREQ([2.68]) " > configure.ac echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac @@ -75,6 +76,12 @@ echo "AC_SUBST([MPI_C_LIBS], ["\$MPILIBS \$FCLIBS"]) " echo "CC=\$MPICC " >> configure.ac echo "AC_LANG_POP([C]) " >> configure.ac echo " " >> configure.ac +echo "AC_LANG_PUSH([C++]) " >> configure.ac +echo "AX_MPI([], AC_MSG_ERROR([could not compile a C++ MPI test program])) " >> configure.ac +echo "AC_SUBST([MPI_CXX_LIBS], ["\$MPILIBS \$FCLIBS"]) " >> configure.ac +echo "CXX=\$MPICXX " >> configure.ac +echo "AC_LANG_POP([C++]) " >> configure.ac +echo " " >> configure.ac echo "PKG_CHECK_MODULES([ARPACK], [arpack${LIBSUFFIX}${ITF64SUFFIX}]) " >> configure.ac echo "AC_SUBST([ARPACK_CFLAGS]) " >> configure.ac echo "AC_SUBST([ARPACK_LIBS]) " >> configure.ac @@ -93,7 +100,7 @@ echo "ACLOCAL_AMFLAGS = -I m4 echo " " >> Makefile.am echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am echo " " >> Makefile.am -echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp icb_parpack_c " >> Makefile.am +echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp icb_parpack_c icb_parpack_cpp " >> Makefile.am echo " " >> Makefile.am echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am @@ -114,6 +121,10 @@ echo " echo "icb_parpack_c_SOURCES = icb_parpack_c.c " >> Makefile.am echo "icb_parpack_c_CPPFLAGS = \$(AM_CPPFLAGS) \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am echo "icb_parpack_c_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_C_LIBS) " >> Makefile.am +echo " " >> Makefile.am +echo "icb_parpack_cpp_SOURCES = icb_parpack_cpp.cpp " >> Makefile.am +echo "icb_parpack_cpp_CPPFLAGS = \$(AM_CPPFLAGS) \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am +echo "icb_parpack_cpp_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_CXX_LIBS) " >> Makefile.am # 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work. @@ -128,3 +139,4 @@ make all || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 mpirun -n 2 ./icb_parpack_c || exit 1 +mpirun -n 2 ./icb_parpack_cpp || exit 1 From 7f0e2dca4aaa9035ec21b7cc9d9f7172a47e9544 Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 19:14:26 +0200 Subject: [PATCH 05/13] Fix installation tests: compile and run arpackmm. --- .gitignore | 1 - CMakeLists.txt | 3 --- EXAMPLES/MATRIX_MARKET/Makefile.am | 1 + Makefile.am | 4 ++-- cmake/tstCMakeInstall.sh.in | 15 ++++++++++++++- configure.ac | 1 - pkg-config/arpackSolver.pc.in | 10 ---------- pkg-config/tstAutotoolsInstall.sh.in | 12 ++++++++++-- 8 files changed, 27 insertions(+), 20 deletions(-) delete mode 100644 pkg-config/arpackSolver.pc.in diff --git a/.gitignore b/.gitignore index a8ebcfc23..cad9087a8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ libtool .deps/ arpack*.pc parpack*.pc -arpackSolver*.pc arpackdef.h arpackicb.h tstAutotoolsInstall.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 690cad4ad..3edba8382 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -831,8 +831,6 @@ string(REPLACE ";" " " PARPACK_PC_LIBS_PRIVATE "${PARPACK_PC_LIBS_PRIVATE}") configure_file(pkg-config/arpack.pc.in "${PROJECT_BINARY_DIR}/arpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY) configure_file(pkg-config/parpack.pc.in "${PROJECT_BINARY_DIR}/parpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY) -configure_file(pkg-config/arpackSolver.pc.in "${PROJECT_BINARY_DIR}/arpackSolver${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY) - install(TARGETS arpack EXPORT arpackngTargets @@ -861,7 +859,6 @@ if(ICB) endif() if (EIGEN) install(FILES EXAMPLES/MATRIX_MARKET/arpackSolver.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR}) - install(FILES "${PROJECT_BINARY_DIR}/arpackSolver${LIBSUFFIX}${ITF64SUFFIX}.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() endif() diff --git a/EXAMPLES/MATRIX_MARKET/Makefile.am b/EXAMPLES/MATRIX_MARKET/Makefile.am index 6be7da2bc..a24240bed 100644 --- a/EXAMPLES/MATRIX_MARKET/Makefile.am +++ b/EXAMPLES/MATRIX_MARKET/Makefile.am @@ -10,6 +10,7 @@ TESTS = arpackmm.sh issue401.sh issue215.sh arpackmm_SOURCES = arpackmm.cpp +pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@ if EIGEN pkginclude_HEADERS = arpackSolver.hpp endif diff --git a/Makefile.am b/Makefile.am index 8bf932a97..124c79146 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ endif EXTRA_DIST = README.md PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \ detect_arpack_bug.m4 CMakeLists.txt -pkgconfig_DATA = arpack@LIBSUFFIX@@ITF64SUFFIX@.pc parpack@LIBSUFFIX@@ITF64SUFFIX@.pc arpackSolver@LIBSUFFIX@@ITF64SUFFIX@.pc +pkgconfig_DATA = arpack@LIBSUFFIX@@ITF64SUFFIX@.pc parpack@LIBSUFFIX@@ITF64SUFFIX@.pc # Due to the LIBSUFFIX/ITF64SUFFIX, configure doesn't automatically clean this file: -DISTCLEANFILES = arpack@LIBSUFFIX@@ITF64SUFFIX@.pc parpack@LIBSUFFIX@@ITF64SUFFIX@.pc arpackSolver@LIBSUFFIX@@ITF64SUFFIX@.pc +DISTCLEANFILES = arpack@LIBSUFFIX@@ITF64SUFFIX@.pc parpack@LIBSUFFIX@@ITF64SUFFIX@.pc diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 35ec2c667..b7d026405 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -17,7 +17,7 @@ export LIBSUFFIX="${1%-*}" echo "LIBSUFFIX: $LIBSUFFIX" export ITF64SUFFIX="${1#*-}" echo "ITF64SUFFIX: $ITF64SUFFIX" -cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DICB=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" . +cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DICB=ON -DEIGEN=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" . make all install tree "${TMP_PREFIX}" @@ -49,6 +49,7 @@ cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" . cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_c.c" . cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp" . +cp "@PROJECT_SOURCE_DIR@/EXAMPLES/MATRIX_MARKET/arpackmm.cpp" . echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt echo "" >> CMakeLists.txt @@ -58,6 +59,7 @@ echo "find_package(BLAS REQUIRED)" >> CMake echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt echo "find_package(MPI REQUIRED COMPONENTS Fortran C CXX)" >> CMakeLists.txt echo "find_package(arpackng REQUIRED)" >> CMakeLists.txt +echo "find_package(Eigen3 3.3 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 @@ -82,6 +84,16 @@ echo "target_include_directories(icb_arpack_cpp INTERFACE LAPACK::LAPACK)" >> CM echo "target_link_libraries(icb_arpack_cpp LAPACK::LAPACK)" >> CMakeLists.txt echo "target_include_directories(icb_arpack_cpp INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_arpack_cpp ARPACK::ARPACK)" >> CMakeLists.txt +echo "" >> CMakeLists.txt +echo "add_executable(arpackmm arpackmm.cpp)" >> CMakeLists.txt +echo "target_include_directories(arpackmm INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(arpackmm BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(arpackmm INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(arpackmm LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(arpackmm INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(arpackmm ARPACK::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(arpackmm INTERFACE Eigen3::Eigen)" >> CMakeLists.txt +echo "target_link_libraries(arpackmm Eigen3::Eigen)" >> 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 @@ -194,6 +206,7 @@ make all VERBOSE=1 || exit 1 ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 +./arpackmm -h || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 mpirun -n 2 ./icb_parpack_c || exit 1 mpirun -n 2 ./icb_parpack_cpp || exit 1 diff --git a/configure.ac b/configure.ac index e8cccdc4f..4c43bab51 100644 --- a/configure.ac +++ b/configure.ac @@ -349,7 +349,6 @@ AC_SUBST([PARPACK_PC_LIBS_PRIVATE], ["$LAPACK_LIBS $BLAS_LIBS $MPI_Fortran_LIBS" AC_CONFIG_FILES([ arpack$LIBSUFFIX$ITF64SUFFIX.pc:pkg-config/arpack.pc.in parpack$LIBSUFFIX$ITF64SUFFIX.pc:pkg-config/parpack.pc.in - arpackSolver$LIBSUFFIX$ITF64SUFFIX.pc:pkg-config/arpackSolver.pc.in ], [], [LIBSUFFIX="$LIBSUFFIX"; ITF64SUFFIX="$ITF64SUFFIX"]) dnl We do NOT want arpackng*.cmake files to be created: @MPI@ can not be replaced. diff --git a/pkg-config/arpackSolver.pc.in b/pkg-config/arpackSolver.pc.in deleted file mode 100644 index 8bffa75c7..000000000 --- a/pkg-config/arpackSolver.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -includedir=@includedir@/arpack@ITF64SUFFIX@ - -Name: arpackSolver -Description: Utility to test arpack with matrix market files -Version: @PACKAGE_VERSION@ -URL: @PACKAGE_URL@ -Requires: arpack, eigen3 >= 3.3 -Cflags: -I${includedir} diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 63293637c..46500aa47 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -22,7 +22,7 @@ export LIBSUFFIX="${1%-*}" echo "LIBSUFFIX: $LIBSUFFIX" export ITF64SUFFIX="${1#*-}" echo "ITF64SUFFIX: $ITF64SUFFIX" -LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi --enable-icb +LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi --enable-icb --enable-eigen make all install tree "${TMP_PREFIX}" @@ -46,6 +46,7 @@ cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" . cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp" . cp "${PROJECT_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_c.c" . cp "${PROJECT_SOURCE_DIR}/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp" . +cp "${PROJECT_SOURCE_DIR}/EXAMPLES/MATRIX_MARKET/arpackmm.cpp" . echo "AC_PREREQ([2.68]) " > configure.ac echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac @@ -82,6 +83,8 @@ echo "AC_SUBST([MPI_CXX_LIBS], ["\$MPILIBS \$FCLIBS"]) " echo "CXX=\$MPICXX " >> configure.ac echo "AC_LANG_POP([C++]) " >> configure.ac echo " " >> configure.ac +echo "PKG_CHECK_MODULES([EIGEN3], [eigen3 >= 3.3]) " >> configure.ac +echo " " >> configure.ac echo "PKG_CHECK_MODULES([ARPACK], [arpack${LIBSUFFIX}${ITF64SUFFIX}]) " >> configure.ac echo "AC_SUBST([ARPACK_CFLAGS]) " >> configure.ac echo "AC_SUBST([ARPACK_LIBS]) " >> configure.ac @@ -100,7 +103,7 @@ echo "ACLOCAL_AMFLAGS = -I m4 echo " " >> Makefile.am echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am echo " " >> Makefile.am -echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp icb_parpack_c icb_parpack_cpp " >> Makefile.am +echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp icb_parpack_c icb_parpack_cpp arpackmm " >> Makefile.am echo " " >> Makefile.am echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am @@ -118,6 +121,10 @@ echo "icb_arpack_cpp_SOURCES = icb_arpack_cpp.cpp echo "icb_arpack_cpp_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am echo "icb_arpack_cpp_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am echo " " >> Makefile.am +echo "arpackmm_SOURCES = arpackmm.cpp " >> Makefile.am +echo "arpackmm_CPPFLAGS = \$(ARPACK_CFLAGS) \$(EIGEN3_CFLAGS) " >> Makefile.am +echo "arpackmm_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am +echo " " >> Makefile.am echo "icb_parpack_c_SOURCES = icb_parpack_c.c " >> Makefile.am echo "icb_parpack_c_CPPFLAGS = \$(AM_CPPFLAGS) \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am echo "icb_parpack_c_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_C_LIBS) " >> Makefile.am @@ -136,6 +143,7 @@ make all || exit 1 ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 +./arpackmm -h || exit 1 mpirun -n 2 ./pdndrv1 || exit 1 mpirun -n 2 ./icb_parpack_c || exit 1 From 031ea2554d2b086f0ca792839de2af0388efd7aa Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 19:18:35 +0200 Subject: [PATCH 06/13] Update change log. --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 7e37f57fb..2ce7c42ff 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ arpack-ng - 3.9.1 * README: Add details on Windows installation. [ Franck Houssen ] + * [BUG FIX] Fix install: headers in /path/to/local/include/arpack for ICB samples * [BUG FIX] Fix install: headers in /path/to/local/include/arpack * arpackmm: allow for using LA/SA magnitudes. * Rename icbexmm option into eigen option. From 798f87698f4b7a7f4aafd0f9a95aa1e8b755632a Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 20:55:42 +0200 Subject: [PATCH 07/13] [CI] Add eigen to test installs. --- .github/workflows/jobs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 843c6aa08..1f63e2c4e 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -40,7 +40,7 @@ jobs: - name: Update OS run: sudo apt-get update - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake - name: Run job run: | mkdir build @@ -88,7 +88,7 @@ jobs: - name: Update OS run: sudo apt-get update - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool - name: Run job run: | ./bootstrap From 4bd39d7a393cee0ef4e1d62eb646339f4583097f Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 20:57:24 +0200 Subject: [PATCH 08/13] [CI] Increase CMake version to avoid deprecation messages in logs. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3edba8382..971570642 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) if (NOT DEFINED CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type") From a0ee97487e6e571f91cbc7bd3722a2c9e660b0ad Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 21:04:46 +0200 Subject: [PATCH 09/13] README: document use of *.pc and *.cmake files. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index af40e4c2d..409063a80 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,10 @@ $ LIBS="-framework Accelerate" FFLAGS="-ff2c -fno-second-underscore" FCFLAGS="-f ## Using arpack-ng from your own codebase +The *.pc and *.cmake files provided by `arpack-ng` are only pointing to arpack libraries. +If you need other libraries (like MPI), you must add them alongside arpack (see CMake example below). +Examples are provided in `tstCMakeInstall.sh` and `tstAutotoolsInstall.sh` generated after running cmake/configure. + ### With autotools First, set `PKG_CONFIG_PATH` to the location in the installation directory where `arpack.pc` lies. @@ -314,9 +318,12 @@ To use PARPACK in your Cmake builds, use `PARPACK::PARPACK` target: ```cmake FIND_PACKAGE(arpackng) +FIND_PACKAGE(MPI REQUIRED COMPONENTS Fortran) ADD_EXECUTABLE(main main.f) TARGET_INCLUDE_DIRECTORIES(main PUBLIC PARPACK::PARPACK) TARGET_LINK_LIBRARIES(main PARPACK::PARPACK) +TARGET_INCLUDE_DIRECTORIES(main PUBLIC MPI::MPI_Fortran) +TARGET_LINK_LIBRARIES(main MPI::MPI_Fortran) ``` Note: Make sure to update `CMAKE_MODULE_PATH` env variable (otheriwse, `find_package` won't find arpack-ng cmake file). From cdcb80a0ff7b9e4d1877c96eed7bdf48e28071cc Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 12 Aug 2023 21:33:05 +0200 Subject: [PATCH 10/13] Export LD_LIBRARY_PATH before running binaries. --- cmake/tstCMakeInstall.sh.in | 2 ++ pkg-config/tstAutotoolsInstall.sh.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index b7d026405..117b3f42d 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -203,6 +203,8 @@ cd build cmake .. -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" || exit 1 make all VERBOSE=1 || exit 1 +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/tmp/tstCMakeInstall/local/lib" + ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 diff --git a/pkg-config/tstAutotoolsInstall.sh.in b/pkg-config/tstAutotoolsInstall.sh.in index 46500aa47..31d16e699 100755 --- a/pkg-config/tstAutotoolsInstall.sh.in +++ b/pkg-config/tstAutotoolsInstall.sh.in @@ -140,6 +140,8 @@ autoreconf --force --verbose --install ./configure || exit 1 make all || exit 1 +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/tmp/tstAutotoolsInstall/local/lib" + ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 From a857b807218fcb6e27572888d2d43fe7d901cb05 Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sun, 13 Aug 2023 10:56:55 +0200 Subject: [PATCH 11/13] [CI] Increase CMake version to avoid deprecation messages in logs. --- cmake/tstCMakeInstall.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 117b3f42d..67e15d5ce 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -51,7 +51,7 @@ cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_c.c" . cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_cpp.cpp" . cp "@PROJECT_SOURCE_DIR@/EXAMPLES/MATRIX_MARKET/arpackmm.cpp" . -echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt +echo "cmake_minimum_required(VERSION 3.5)" > CMakeLists.txt echo "" >> CMakeLists.txt echo "project(tstCMakeInstall Fortran C CXX)" >> CMakeLists.txt echo "" >> CMakeLists.txt From 5a2f9424734deff540ac83fcfa72d18a46f7a60a Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sun, 13 Aug 2023 10:59:18 +0200 Subject: [PATCH 12/13] CMake test install: add comments + make it symmetric with autotools's one. --- cmake/tstCMakeInstall.sh.in | 52 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/cmake/tstCMakeInstall.sh.in b/cmake/tstCMakeInstall.sh.in index 67e15d5ce..f22a1f24d 100755 --- a/cmake/tstCMakeInstall.sh.in +++ b/cmake/tstCMakeInstall.sh.in @@ -42,9 +42,7 @@ 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" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" . cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" . cp "@PROJECT_SOURCE_DIR@/PARPACK/TESTS/MPI/icb_parpack_c.c" . @@ -55,6 +53,8 @@ echo "cmake_minimum_required(VERSION 3.5)" > CMake echo "" >> CMakeLists.txt echo "project(tstCMakeInstall Fortran C CXX)" >> CMakeLists.txt echo "" >> CMakeLists.txt +echo "# Targets compiled with *.cmake files generated by cmake" >> 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 C CXX)" >> CMakeLists.txt @@ -131,17 +131,19 @@ echo "target_link_libraries(icb_parpack_cpp ARPACK::ARPACK)" >> echo "target_include_directories(icb_parpack_cpp INTERFACE PARPACK::PARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_parpack_cpp PARPACK::PARPACK)" >> CMakeLists.txt echo "" >> CMakeLists.txt +echo "# Targets compiled with with *.pc files generated by cmake" >> CMakeLists.txt +echo "" >> CMakeLists.txt echo "find_package(PkgConfig REQUIRED)" >> CMakeLists.txt echo "pkg_check_modules(ARPACK IMPORTED_TARGET REQUIRED arpack${LIBSUFFIX}${ITF64SUFFIX})" >> CMakeLists.txt echo "pkg_check_modules(PARPACK IMPORTED_TARGET REQUIRED parpack${LIBSUFFIX}${ITF64SUFFIX})" >> 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(dnbdr1_pkg dnband.f dnbdr1.f)" >> CMakeLists.txt +echo "target_include_directories(dnbdr1_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(dnbdr1_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(dnbdr1_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(dnbdr1_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(dnbdr1_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(dnbdr1_pkg PkgConfig::ARPACK)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "add_executable(icb_arpack_c_pkg icb_arpack_c.c)" >> CMakeLists.txt echo "target_include_directories(icb_arpack_c_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt @@ -158,18 +160,18 @@ echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE LAPACK::LAPACK)" echo "target_link_libraries(icb_arpack_cpp_pkg LAPACK::LAPACK)" >> CMakeLists.txt echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt echo "target_link_libraries(icb_arpack_cpp_pkg 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 +echo "" >> CMakeLists.txt +echo "add_executable(pdndrv1_pkg dnband.f pdndrv1.f)" >> CMakeLists.txt +echo "target_include_directories(pdndrv1_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt +echo "target_link_libraries(pdndrv1_pkg BLAS::BLAS)" >> CMakeLists.txt +echo "target_include_directories(pdndrv1_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_link_libraries(pdndrv1_pkg LAPACK::LAPACK)" >> CMakeLists.txt +echo "target_include_directories(pdndrv1_pkg INTERFACE MPI::MPI_Fortran)" >> CMakeLists.txt +echo "target_link_libraries(pdndrv1_pkg MPI::MPI_Fortran)" >> CMakeLists.txt +echo "target_include_directories(pdndrv1_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_link_libraries(pdndrv1_pkg PkgConfig::ARPACK)" >> CMakeLists.txt +echo "target_include_directories(pdndrv1_pkg INTERFACE PkgConfig::PARPACK)" >> CMakeLists.txt +echo "target_link_libraries(pdndrv1_pkg PkgConfig::PARPACK)" >> CMakeLists.txt echo "" >> CMakeLists.txt echo "add_executable(icb_parpack_c_pkg icb_parpack_c.c)" >> CMakeLists.txt echo "target_include_directories(icb_parpack_c_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt @@ -205,6 +207,7 @@ make all VERBOSE=1 || exit 1 export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/tmp/tstCMakeInstall/local/lib" +# The first targets are compiled with *.cmake files generated by cmake. ./dnbdr1 || exit 1 ./icb_arpack_c || exit 1 ./icb_arpack_cpp || exit 1 @@ -213,9 +216,10 @@ mpirun -n 2 ./pdndrv1 || exit 1 mpirun -n 2 ./icb_parpack_c || exit 1 mpirun -n 2 ./icb_parpack_cpp || exit 1 -./dnbdr3 || exit 1 +# The second targets are compiled with *.pc files generated by cmake. +./dnbdr1_pkg || exit 1 ./icb_arpack_c_pkg || exit 1 ./icb_arpack_cpp_pkg || exit 1 -mpirun -n 2 ./pdndrv3 || exit 1 +mpirun -n 2 ./pdndrv1_pkg || exit 1 mpirun -n 2 ./icb_parpack_c_pkg || exit 1 mpirun -n 2 ./icb_parpack_cpp_pkg || exit 1 From c08859052b1e734722a02f0e68251606208fcd8b Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sun, 13 Aug 2023 10:59:53 +0200 Subject: [PATCH 13/13] README: document use of *.pc and *.cmake files. --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 409063a80..51625c3e3 100644 --- a/README.md +++ b/README.md @@ -286,8 +286,17 @@ $ LIBS="-framework Accelerate" FFLAGS="-ff2c -fno-second-underscore" FCFLAGS="-f ## Using arpack-ng from your own codebase -The *.pc and *.cmake files provided by `arpack-ng` are only pointing to arpack libraries. +The `*.pc` and `*.cmake` files provided by `arpack-ng` are only pointing to arpack libraries. If you need other libraries (like MPI), you must add them alongside arpack (see CMake example below). + +Typically, if you need + +- ARPACK: at compile/link time, you'll need to provide BLAS and LAPACK. + +- ARPACK with eigen support (arpackSolver): at compile/link time, you'll need to provide BLAS, LAPACK and Eigen. + +- PARPACK: at compile/link time, you'll need to provide BLAS, LAPACK and MPI. + Examples are provided in `tstCMakeInstall.sh` and `tstAutotoolsInstall.sh` generated after running cmake/configure. ### With autotools