Skip to content

Commit e7cf106

Browse files
authored
Merge pull request opencollab#425 from fghoussen/fix-install
Fix installation tests: compile and run icb_arpack_c.
2 parents c18d153 + c088590 commit e7cf106

12 files changed

+226
-59
lines changed

.github/workflows/jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Update OS
4141
run: sudo apt-get update
4242
- name: Install apt-get dependencies
43-
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake
43+
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake
4444
- name: Run job
4545
run: |
4646
mkdir build
@@ -88,7 +88,7 @@ jobs:
8888
- name: Update OS
8989
run: sudo apt-get update
9090
- name: Install apt-get dependencies
91-
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool
91+
run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool
9292
- name: Run job
9393
run: |
9494
./bootstrap

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ libtool
1717
.deps/
1818
arpack*.pc
1919
parpack*.pc
20-
arpackSolver*.pc
2120
arpackdef.h
2221
arpackicb.h
2322
tstAutotoolsInstall.sh

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ arpack-ng - 3.9.1
1515
* README: Add details on Windows installation.
1616

1717
[ Franck Houssen ]
18+
* [BUG FIX] Fix install: headers in /path/to/local/include/arpack for ICB samples
1819
* [BUG FIX] Fix install: headers in /path/to/local/include/arpack
1920
* arpackmm: allow for using LA/SA magnitudes.
2021
* Rename icbexmm option into eigen option.

CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.5)
22

33
if (NOT DEFINED CMAKE_BUILD_TYPE)
44
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
@@ -831,8 +831,6 @@ string(REPLACE ";" " " PARPACK_PC_LIBS_PRIVATE "${PARPACK_PC_LIBS_PRIVATE}")
831831

832832
configure_file(pkg-config/arpack.pc.in "${PROJECT_BINARY_DIR}/arpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY)
833833
configure_file(pkg-config/parpack.pc.in "${PROJECT_BINARY_DIR}/parpack${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY)
834-
configure_file(pkg-config/arpackSolver.pc.in "${PROJECT_BINARY_DIR}/arpackSolver${LIBSUFFIX}${ITF64SUFFIX}.pc" @ONLY)
835-
836834

837835
install(TARGETS arpack
838836
EXPORT arpackngTargets
@@ -861,7 +859,6 @@ if(ICB)
861859
endif()
862860
if (EIGEN)
863861
install(FILES EXAMPLES/MATRIX_MARKET/arpackSolver.hpp DESTINATION ${ARPACK_INSTALL_INCLUDEDIR})
864-
install(FILES "${PROJECT_BINARY_DIR}/arpackSolver${LIBSUFFIX}${ITF64SUFFIX}.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
865862
endif()
866863
endif()
867864

EXAMPLES/MATRIX_MARKET/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ TESTS = arpackmm.sh issue401.sh issue215.sh
1010

1111
arpackmm_SOURCES = arpackmm.cpp
1212

13+
pkgincludedir = $(includedir)/arpack@ITF64SUFFIX@
1314
if EIGEN
1415
pkginclude_HEADERS = arpackSolver.hpp
1516
endif

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

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727
EXTRA_DIST = README.md PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \
2828
detect_arpack_bug.m4 CMakeLists.txt
2929

30-
pkgconfig_DATA = arpack@LIBSUFFIX@@[email protected] parpack@LIBSUFFIX@@[email protected] arpackSolver@LIBSUFFIX@@[email protected]
30+
pkgconfig_DATA = arpack@LIBSUFFIX@@[email protected] parpack@LIBSUFFIX@@[email protected]
3131

3232
# Due to the LIBSUFFIX/ITF64SUFFIX, configure doesn't automatically clean this file:
33-
DISTCLEANFILES = arpack@LIBSUFFIX@@[email protected] parpack@LIBSUFFIX@@[email protected] arpackSolver@LIBSUFFIX@@[email protected]
33+
DISTCLEANFILES = arpack@LIBSUFFIX@@[email protected] parpack@LIBSUFFIX@@[email protected]

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,19 @@ $ LIBS="-framework Accelerate" FFLAGS="-ff2c -fno-second-underscore" FCFLAGS="-f
286286

287287
## Using arpack-ng from your own codebase
288288

289+
The `*.pc` and `*.cmake` files provided by `arpack-ng` are only pointing to arpack libraries.
290+
If you need other libraries (like MPI), you must add them alongside arpack (see CMake example below).
291+
292+
Typically, if you need
293+
294+
- ARPACK: at compile/link time, you'll need to provide BLAS and LAPACK.
295+
296+
- ARPACK with eigen support (arpackSolver): at compile/link time, you'll need to provide BLAS, LAPACK and Eigen.
297+
298+
- PARPACK: at compile/link time, you'll need to provide BLAS, LAPACK and MPI.
299+
300+
Examples are provided in `tstCMakeInstall.sh` and `tstAutotoolsInstall.sh` generated after running cmake/configure.
301+
289302
### With autotools
290303

291304
First, set `PKG_CONFIG_PATH` to the location in the installation directory where `arpack.pc` lies.
@@ -314,9 +327,12 @@ To use PARPACK in your Cmake builds, use `PARPACK::PARPACK` target:
314327

315328
```cmake
316329
FIND_PACKAGE(arpackng)
330+
FIND_PACKAGE(MPI REQUIRED COMPONENTS Fortran)
317331
ADD_EXECUTABLE(main main.f)
318332
TARGET_INCLUDE_DIRECTORIES(main PUBLIC PARPACK::PARPACK)
319333
TARGET_LINK_LIBRARIES(main PARPACK::PARPACK)
334+
TARGET_INCLUDE_DIRECTORIES(main PUBLIC MPI::MPI_Fortran)
335+
TARGET_LINK_LIBRARIES(main MPI::MPI_Fortran)
320336
```
321337

322338
Note: Make sure to update `CMAKE_MODULE_PATH` env variable (otheriwse, `find_package` won't find arpack-ng cmake file).

0 commit comments

Comments
 (0)