Skip to content

Commit 1b525b6

Browse files
committed
Fix installation tests: compile and run icb_arpack_c.
1 parent c18d153 commit 1b525b6

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

ICB/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
22

3+
pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@
34
pkginclude_HEADERS = debug_c.h debug_c.hpp
45
pkginclude_HEADERS += stat_c.h stat_c.hpp
56
pkginclude_HEADERS += arpack.h arpack.hpp

cmake/tstCMakeInstall.sh.in

+24-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export LIBSUFFIX="${1%-*}"
1717
echo "LIBSUFFIX: $LIBSUFFIX"
1818
export ITF64SUFFIX="${1#*-}"
1919
echo "ITF64SUFFIX: $ITF64SUFFIX"
20-
cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" .
20+
cmake -DCMAKE_INSTALL_PREFIX="${TMP_PREFIX}" -DMPI=ON -DICB=ON -DLIBSUFFIX="${LIBSUFFIX}" -DITF64SUFFIX="${ITF64SUFFIX}" .
2121
make all install
2222
tree "${TMP_PREFIX}"
2323

@@ -34,6 +34,8 @@ arpack_cmake_dir="${arpack_cmake_dir%/*}" # Same as dirname
3434
CMAKE_PREFIX_PATH="${arpack_cmake_dir%/*}" # cmake directory
3535

3636
# 4. Create new cmake project, in temporary directory, with files from arpack-ng.
37+
# The first targets are compiled with *.cmake files generated by cmake.
38+
# The second targets are compiled with *.pc files generated by cmake.
3739

3840
mkdir -p tstCMakeInstall
3941
cd tstCMakeInstall
@@ -43,10 +45,11 @@ cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnbdr1.f" .
4345
cp "@PROJECT_SOURCE_DIR@/EXAMPLES/BAND/dnbdr3.f" .
4446
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv1.f" .
4547
cp "@PROJECT_SOURCE_DIR@/PARPACK/EXAMPLES/MPI/pdndrv3.f" .
48+
cp "@PROJECT_SOURCE_DIR@/TESTS/icb_arpack_c.c" .
4649

4750
echo "cmake_minimum_required(VERSION 3.0)" > CMakeLists.txt
4851
echo "" >> CMakeLists.txt
49-
echo "project(tstCMakeInstall Fortran)" >> CMakeLists.txt
52+
echo "project(tstCMakeInstall Fortran C)" >> CMakeLists.txt
5053
echo "" >> CMakeLists.txt
5154
echo "find_package(BLAS REQUIRED)" >> CMakeLists.txt
5255
echo "find_package(LAPACK REQUIRED)" >> CMakeLists.txt
@@ -60,6 +63,14 @@ echo "target_include_directories(dnbdr1 INTERFACE LAPACK::LAPACK)" >> CMake
6063
echo "target_link_libraries(dnbdr1 LAPACK::LAPACK)" >> CMakeLists.txt
6164
echo "target_include_directories(dnbdr1 INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt
6265
echo "target_link_libraries(dnbdr1 ARPACK::ARPACK)" >> CMakeLists.txt
66+
echo "" >> CMakeLists.txt
67+
echo "add_executable(icb_arpack_c icb_arpack_c.c)" >> CMakeLists.txt
68+
echo "target_include_directories(icb_arpack_c INTERFACE BLAS::BLAS)" >> CMakeLists.txt
69+
echo "target_link_libraries(icb_arpack_c BLAS::BLAS)" >> CMakeLists.txt
70+
echo "target_include_directories(icb_arpack_c INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt
71+
echo "target_link_libraries(icb_arpack_c LAPACK::LAPACK)" >> CMakeLists.txt
72+
echo "target_include_directories(icb_arpack_c INTERFACE ARPACK::ARPACK)" >> CMakeLists.txt
73+
echo "target_link_libraries(icb_arpack_c ARPACK::ARPACK)" >> CMakeLists.txt
6374
echo "" >> CMakeLists.txt
6475
echo "add_executable(pdndrv1 dnband.f pdndrv1.f)" >> CMakeLists.txt
6576
echo "target_include_directories(pdndrv1 INTERFACE BLAS::BLAS)" >> CMakeLists.txt
@@ -84,6 +95,14 @@ echo "target_include_directories(dnbdr3 INTERFACE LAPACK::LAPACK)" >> CMake
8495
echo "target_link_libraries(dnbdr3 LAPACK::LAPACK)" >> CMakeLists.txt
8596
echo "target_include_directories(dnbdr3 INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt
8697
echo "target_link_libraries(dnbdr3 PkgConfig::ARPACK)" >> CMakeLists.txt
98+
echo "" >> CMakeLists.txt
99+
echo "add_executable(icb_arpack_c_pkg icb_arpack_c.c)" >> CMakeLists.txt
100+
echo "target_include_directories(icb_arpack_c_pkg INTERFACE BLAS::BLAS)" >> CMakeLists.txt
101+
echo "target_link_libraries(icb_arpack_c_pkg BLAS::BLAS)" >> CMakeLists.txt
102+
echo "target_include_directories(icb_arpack_c_pkg INTERFACE LAPACK::LAPACK)" >> CMakeLists.txt
103+
echo "target_link_libraries(icb_arpack_c_pkg LAPACK::LAPACK)" >> CMakeLists.txt
104+
echo "target_include_directories(icb_arpack_c_pkg INTERFACE PkgConfig::ARPACK)" >> CMakeLists.txt
105+
echo "target_link_libraries(icb_arpack_c_pkg PkgConfig::ARPACK)" >> CMakeLists.txt
87106
echo "" >> CMakeLists.txt
88107
echo "add_executable(pdndrv3 dnband.f pdndrv3.f)" >> CMakeLists.txt
89108
echo "target_include_directories(pdndrv3 INTERFACE BLAS::BLAS)" >> CMakeLists.txt
@@ -106,6 +125,9 @@ cmake .. -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" || exit 1
106125
make all VERBOSE=1 || exit 1
107126

108127
./dnbdr1 || exit 1
128+
./icb_arpack_c || exit 1
109129
mpirun -n 2 ./pdndrv1 || exit 1
130+
110131
./dnbdr3 || exit 1
132+
./icb_arpack_c_pkg || exit 1
111133
mpirun -n 2 ./pdndrv3 || exit 1

pkg-config/tstAutotoolsInstall.sh.in

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -eu
22
# Testing that PKG_CHECK_MODULES works.
3-
# Note: this script must not be added to the test suite as it will change cmake options.
3+
# Note: this script must not be added to the test suite as it will change configure options.
44

55
echo "***************************************************************************************"
66

@@ -10,8 +10,8 @@ export TMP_DIR="/tmp/tstAutotoolsInstall"
1010
rm -fr "${TMP_DIR}" # Make sure we restart from scratch.
1111
mkdir -p "${TMP_DIR}"
1212

13-
# 2. Rerun cmake with prefix, install arpack-ng.
14-
# Note: this script must not be added to the test suite as it will change cmake options.
13+
# 2. Rerun autotools with prefix, install arpack-ng.
14+
# Note: this script must not be added to the test suite as it will change configure options.
1515

1616
make clean
1717
make distclean
@@ -22,7 +22,7 @@ export LIBSUFFIX="${1%-*}"
2222
echo "LIBSUFFIX: $LIBSUFFIX"
2323
export ITF64SUFFIX="${1#*-}"
2424
echo "ITF64SUFFIX: $ITF64SUFFIX"
25-
LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi
25+
LIBSUFFIX="${LIBSUFFIX}" ITF64SUFFIX="${ITF64SUFFIX}" ./configure --prefix="${TMP_PREFIX}" --enable-mpi --enable-icb
2626
make all install
2727
tree "${TMP_PREFIX}"
2828

@@ -33,7 +33,7 @@ export PKG_CONFIG_PATH="$(find ${TMP_PREFIX} -name arpack${LIBSUFFIX}${ITF64SUFF
3333
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH%/*}" # Same as dirname.
3434
echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
3535

36-
# 4. Create new cmake project, in temporary directory, with files from arpack-ng.
36+
# 4. Create new autotools project, in temporary directory, with files from arpack-ng.
3737

3838
mkdir -p tstAutotoolsInstall
3939
cd tstAutotoolsInstall
@@ -42,6 +42,7 @@ cp "${PROJECT_SOURCE_DIR}/EXAMPLES/BAND/dnband.f" .
4242
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" .
45+
cp "${PROJECT_SOURCE_DIR}/TESTS/icb_arpack_c.c" .
4546

4647
echo "AC_PREREQ([2.68]) " > configure.ac
4748
echo "AC_INIT([tstAutotoolsInstall], 1.0) " >> configure.ac
@@ -82,7 +83,7 @@ echo "ACLOCAL_AMFLAGS = -I m4
8283
echo " " >> Makefile.am
8384
echo "EXTRA_DIST = debug.h stat.h " >> Makefile.am
8485
echo " " >> Makefile.am
85-
echo "bin_PROGRAMS = dnbdr1 pdndrv1 " >> Makefile.am
86+
echo "bin_PROGRAMS = dnbdr1 pdndrv1 icb_arpack_c " >> Makefile.am
8687
echo " " >> Makefile.am
8788
echo "dnbdr1_SOURCES = dnbdr1.f dnband.f " >> Makefile.am
8889
echo "dnbdr1_FFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am
@@ -91,13 +92,18 @@ echo "
9192
echo "pdndrv1_SOURCES = pdndrv1.f dnband.f " >> Makefile.am
9293
echo "pdndrv1_FFLAGS = \$(PARPACK_CFLAGS) \$(ARPACK_CFLAGS) " >> Makefile.am
9394
echo "pdndrv1_LDADD = \$(PARPACK_LIBS) \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) \$(MPI_Fortran_LIBS)" >> Makefile.am
95+
echo " " >> Makefile.am
96+
echo "icb_arpack_c_SOURCES = icb_arpack_c.c " >> Makefile.am
97+
echo "icb_arpack_c_CPPFLAGS = \$(ARPACK_CFLAGS) " >> Makefile.am
98+
echo "icb_arpack_c_LDADD = \$(ARPACK_LIBS) \$(LAPACK_LIBS) \$(BLAS_LIBS) " >> Makefile.am
9499

95-
# 5. Build and test this new project with cmake: for this to be possible, PKG_CHECK_MODULES must work.
100+
# 5. Build and test this new project with configure: for this to be possible, PKG_CHECK_MODULES must work.
96101

97102
autoreconf --force --verbose --install
98103

99-
./configure
100-
make all
104+
./configure || exit 1
105+
make all || exit 1
101106

102-
./dnbdr1
103-
mpirun -n 2 ./pdndrv1
107+
./dnbdr1 || exit 1
108+
./icb_arpack_c || exit 1
109+
mpirun -n 2 ./pdndrv1 || exit 1

0 commit comments

Comments
 (0)