Skip to content

Commit

Permalink
Fix installation tests: compile and run icb_arpack_cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
fghoussen committed Aug 12, 2023
1 parent 1b525b6 commit c46da4f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
21 changes: 20 additions & 1 deletion cmake/tstCMakeInstall.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
10 changes: 9 additions & 1 deletion pkg-config/tstAutotoolsInstall.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ 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
echo "AM_INIT_AUTOMAKE([foreign]) " >> configure.ac
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
Expand Down Expand Up @@ -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
Expand All @@ -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.

Expand All @@ -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

0 comments on commit c46da4f

Please sign in to comment.