Skip to content

Commit c46da4f

Browse files
committed
Fix installation tests: compile and run icb_arpack_cpp.
1 parent 1b525b6 commit c46da4f

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

cmake/tstCMakeInstall.sh.in

+20-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnbdr3.f" .
4646
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv1.f" .
4747
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv3.f" .
4848
cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" .
49+
cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_cpp.cpp" .
4950

5051
echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt
5152
echo "" >> CMakeLists.txt
52-
echo "project(tstCMakeInstall Fortran C)" >> CMakeLists.txt
53+
echo "project(tstCMakeInstall Fortran C CXX)" >> CMakeLists.txt
5354
echo "" >> CMakeLists.txt
5455
echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt
5556
echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt
@@ -71,6 +72,14 @@ echo "target_include_directories(icb_arpack_c INTERFACE LAPACK::LAPACK)" >> CMak
7172
echo "target_link_libraries(icb_arpack_c LAPACK::LAPACK)" >> CMakeLists.txt
7273
echo "target_include_directories(icb_arpack_c INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt
7374
echo "target_link_libraries(icb_arpack_c ARPACK::ARPACK)" >> CMakeLists.txt
75+
echo "" >> CMakeLists.txt
76+
echo "add_executable(icb_arpack_cpp icb_arpack_cpp.cpp)" >> CMakeLists.txt
77+
echo "target_include_directories(icb_arpack_cpp INTERFACE BLAS::BLAS)" >> CMakeLists.txt
78+
echo "target_link_libraries(icb_arpack_cpp BLAS::BLAS)" >> CMakeLists.txt
79+
echo "target_include_directories(icb_arpack_cpp INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt
80+
echo "target_link_libraries(icb_arpack_cpp LAPACK::LAPACK)" >> CMakeLists.txt
81+
echo "target_include_directories(icb_arpack_cpp INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt
82+
echo "target_link_libraries(icb_arpack_cpp ARPACK::ARPACK)" >> CMakeLists.txt
7483
echo "" >> CMakeLists.txt
7584
echo "add_executable(pdndrv1 dnband.f pdndrv1.f)" >> CMakeLists.txt
7685
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)"
103112
echo "target_link_libraries(icb_arpack_c_pkg LAPACK::LAPACK)" >> CMakeLists.txt
104113
echo "target_include_directories(icb_arpack_c_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt
105114
echo "target_link_libraries(icb_arpack_c_pkg PkgConfig::ARPACK)" >> CMakeLists.txt
115+
echo "" >> CMakeLists.txt
116+
echo "add_executable(icb_arpack_cpp_pkg icb_arpack_cpp.cpp)" >> CMakeLists.txt
117+
echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt
118+
echo "target_link_libraries(icb_arpack_cpp_pkg BLAS::BLAS)" >> CMakeLists.txt
119+
echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt
120+
echo "target_link_libraries(icb_arpack_cpp_pkg LAPACK::LAPACK)" >> CMakeLists.txt
121+
echo "target_include_directories(icb_arpack_cpp_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt
122+
echo "target_link_libraries(icb_arpack_cpp_pkg PkgConfig::ARPACK)" >> CMakeLists.txt
106123
echo "" >> CMakeLists.txt
107124
echo "add_executable(pdndrv3 dnband.f pdndrv3.f)" >> CMakeLists.txt
108125
echo "target_include_directories(pdndrv3 INTERFACE BLAS::BLAS)" >> CMakeLists.txt
@@ -126,8 +143,10 @@ make all VERBOSE=1 || exit 1
126143

127144
./dnbdr1 || exit 1
128145
./icb_arpack_c || exit 1
146+
./icb_arpack_cpp || exit 1
129147
mpirun -n 2 ./pdndrv1 || exit 1
130148

131149
./dnbdr3 || exit 1
132150
./icb_arpack_c_pkg || exit 1
151+
./icb_arpack_cpp_pkg || exit 1
133152
mpirun -n 2 ./pdndrv3 || exit 1

pkg-config/tstAutotoolsInstall.sh.in

+9-1
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ cp "${PROJECT_SOURCE_DIR}/EXAMPLES/BAND/dnbdr1.f" .
4343
cp "${PROJECT_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/pdndrv1.f" .
4444
cp -fr "${PROJECT_SOURCE_DIR}/m4" .
4545
cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" .
46+
cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_cpp.cpp" .
4647

4748
echo "AC_PREREQ([2.68]) " > configure.ac
4849
echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac
4950
echo "AM_INIT_AUTOMAKE([foreign]) " >> configure.ac
5051
echo "AC_CONFIG_MACRO_DIR([m4]) " >> configure.ac
5152
echo " " >> configure.ac
5253
echo "AC_PROG_FC " >> configure.ac
54+
echo "AC_PROG_CC " >> configure.ac
55+
echo "AC_PROG_CXX " >> configure.ac
5356
echo "AC_PROG_MKDIR_P " >> configure.ac
5457
echo "AC_PROG_MAKE_SET " >> configure.ac
5558
echo "PKG_PROG_PKG_CONFIG " >> configure.ac
@@ -83,7 +86,7 @@ echo "ACLOCAL_AMFLAGS = -I m4
8386
echo " " >> Makefile.am
8487
echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am
8588
echo " " >> Makefile.am
86-
echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c " >> Makefile.am
89+
echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c icb_arpack_cpp " >> Makefile.am
8790
echo " " >> Makefile.am
8891
echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am
8992
echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am
@@ -96,6 +99,10 @@ echo "
9699
echo "icb_arpack_c_SOURCES = icb_arpack_c.c " >> Makefile.am
97100
echo "icb_arpack_c_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am
98101
echo "icb_arpack_c_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am
102+
echo " " >> Makefile.am
103+
echo "icb_arpack_cpp_SOURCES = icb_arpack_cpp.cpp " >> Makefile.am
104+
echo "icb_arpack_cpp_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am
105+
echo "icb_arpack_cpp_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am
99106

100107
# 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work.
101108

@@ -106,4 +113,5 @@ make all || exit 1
106113

107114
./dnbdr1 || exit 1
108115
./icb_arpack_c || exit 1
116+
./icb_arpack_cpp || exit 1
109117
mpirun -n 2 ./pdndrv1 || exit 1

0 commit comments

Comments
 (0)