Skip to content

Commit

Permalink
Merge pull request #425 from fghoussen/fix-install
Browse files Browse the repository at this point in the history
Fix installation tests: compile and run icb_arpack_c.
  • Loading branch information
fghoussen committed Aug 14, 2023
2 parents c18d153 + c088590 commit e7cf106
Show file tree
Hide file tree
Showing 12 changed files with 226 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ libtool
.deps/
arpack*.pc
parpack*.pc
arpackSolver*.pc
arpackdef.h
arpackicb.h
tstAutotoolsInstall.sh
Expand Down
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions EXAMPLES/MATRIX_MARKET/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ICB/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ $ 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).

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
First, set `PKG_CONFIG_PATH` to the location in the installation directory where `arpack.pc` lies.
Expand Down Expand Up @@ -314,9 +327,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).
Expand Down
Loading

0 comments on commit e7cf106

Please sign in to comment.