Skip to content

Commit a0ee974

Browse files
committed
README: document use of *.pc and *.cmake files.
1 parent 4bd39d7 commit a0ee974

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ $ 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+
Examples are provided in `tstCMakeInstall.sh` and `tstAutotoolsInstall.sh` generated after running cmake/configure.
292+
289293
### With autotools
290294

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

315319
```cmake
316320
FIND_PACKAGE(arpackng)
321+
FIND_PACKAGE(MPI REQUIRED COMPONENTS Fortran)
317322
ADD_EXECUTABLE(main main.f)
318323
TARGET_INCLUDE_DIRECTORIES(main PUBLIC PARPACK::PARPACK)
319324
TARGET_LINK_LIBRARIES(main PARPACK::PARPACK)
325+
TARGET_INCLUDE_DIRECTORIES(main PUBLIC MPI::MPI_Fortran)
326+
TARGET_LINK_LIBRARIES(main MPI::MPI_Fortran)
320327
```
321328

322329
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)