Fix header and pkg-config file installation (#426)
- Don’t install pkg-config files for unbuilt libraries
The autotools build is configured to skip entire directories depending on the configuration. Each directory’s Makefile is responsible for installing what it needs, and moving the .pc files to the toplevel broke that.
In the pkg-config files, leave ${includedir} unmodified from how configure defines it.
- Install arpackicb.h only when ICB is ON.
Co-authored-by: Franck HOUSSEN fghoussen@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
arpack-ng
ARPACK-NG is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems. | mandatory dependencies | optional dependencies | category | |————————|—————————|—————| | BLAS, LAPACK | MPI, Eigen3, Boost.Python | LinearAlgebra |
About the project
This project started as a joint project between Debian, Octave and Scilab in order to provide a common and maintained version of arpack. This is now a community project maintained by a few volunteers. Indeed, no single release has been published by Rice university for the last few years and since many software (Octave, Scilab, R, Matlab…) forked it and implemented their own modifications, arpack-ng aims to tackle this by providing a common repository, maintained versions with a testsuite.
arpack-ngis replacing arpack almost everywhere.Important Features
arpackmm: utility to test arpack with matrix market files. Note: to run this utility, you need the eigen library (to handle RCI).Documentation
Within DOCUMENTS directory there are three files for templates on how to invoke the computational modes of ARPACK.
Also look in the README.MD file for explanations concerning the other documents.
ILP64 support
About ILP64 support:
ILP64withLP64. If you compilearpack-ngwithILP64(resp.LP64) support, you MUST insure your BLAS/LAPACK is compliant withILP64(resp.LP64).INTERFACE64at configure time.arpack-ng:arpack-ngusingSYMBOLSUFFIX:FFLAGS used byarpack-ng(built fromSYMBOLSUFFIX- reported in configure log) must redirect the usual symbols to the non-usual ones exported by the ILP64 BLAS/LAPACK libraries: this check is the responsability of the user.Note for F77/F90 developers:
ILP64support must include"arpackicb.h".i_int(defined inarpackicb.h) instead ofc_int.i_intstands for ISO_C_BINDING integer: it’s#definedtoc_intorc_int64_taccording to the architecture.Note for C/C++ developers:
ILP64support must include"arpackdef.h".a_int(defined inarpackdef.h) instead ofint. Here,a_intstands for “architecture int”: it’s#definedtointorint64_taccording to the architecture.Example: to test arpack with sequential
ILP64MKL assuming you use gnu compilersISO_C_BINDING support
About ISO_C_BINDING support:
arpack.h/hpp,parpack.h/hppand friends../TESTSand./PARPACK/TESTS/MPI.ISO_C_BINDING is a feature of modern Fortran meant to handle safely interoperability between Fortran and C (in practice, no more need to use ugly tricks to link F77 functions to C code using “underscored” symbols). Basically, ISO_C_BINDING make sure all fortran variables are typed (which may not always be the case when using
implicitkeyword in fortran): this way, C compilers can link properly. For more information on ISO_C_BINDING, you can checkout the following links:Using ICB is seamless:
arpack-ngwith ISO_C_BINDING: you’ll get both old-fashion fortran symbols and new ISO_C_BINDING symbols available for linking.#include "arpack.h"in your C code.Example: to test arpack with ISO_C_BINDING
Eigen support
arpack-ngprovides C++ eigensolver based on both ISO_C_BINDING andeigen.Check out
./EXAMPLES/MATRIX_MARKET/READMEfor more details.Example: to test arpack with
eigenPython support
pyarpack: python support based onBoost.Python.Numpyexposing C++ API.pyarpackexposes in python thearpack-ngC++ eigensolver (based oneigen).Check out
./EXAMPLES/PYARPACK/READMEfor more details.Example: to test arpack with python3
📁 Directory structure
You have successfully unbundled ARPACK-NG` and are now in the ARPACK-NG directory that was created for you.
The directory SRC contains the top level routines including the highest level reverse communication interface routines
ssaupd,dsaupd: symmetric single and double precisionsnaupd,dnaupd: non-symmetric single and double precisioncnaupd,znaupd: complex non-symmetric single and double precision/DOCUMENTSdirectory.The directory
PARPACKcontains the Parallel ARPACK routines.Example driver programs that illustrate all the computational modes, data types and precisions may be found in the EXAMPLES directory. Upon executing the
ls EXAMPLEScommand you should see the following directoriesInstall 🚀
Getting arpack-ng
Unlike ARPACK, ARPACK-NG is providing autotools and cmake based build system. In addition,
ARPACK-NGalso provides ISO_C_BINDING support, which enables to call fortran subroutines natively from C or C++.First, obtain the source code 📥 from github:
If you prefer the ssh to obtain the source code, then use:
Using autotools
In the source directory, use the following commands to configure, build and install
arpack-ng.Congratulations 🎉, you have installed
arpacklib using autotools (caution: you needsudoto install in your system).The above-mentioned process will build everything including the examples and parallel support using MPI.
Using cmake
You can install
ARPACK-NGby using cmake. If you do not have cmake, then please download the binary frompipusing:After installing cmake, follow the instruction given below.
Caution: Make sure you are in source directory of ARPACK-NG.
✨ Congratulations, you have installed
arpacklib using cmake (caution: you needsudoto install in your system).The above-mentioned process will build everything including the examples and parallel support using MPI.
Customize build / install
You can also customize the installation of
arpackusing the autotools.To customize the install directories:
To enable ILP64 support:
To enable ISO_C_BINDING support:
You can customize the build by declaring the cmake options during configuration.
To customize the install directories:
To enable ILP64 support:
To enable ISO_C_BINDING support:
Supported Operating Systems:
Linux support
arpack-ngruns on debian-based distros.Mac OS support
On mac OS, with GNU compilers, you may need to customize options:
Windows support
arpack-ngcan be installed on Windows as a MinGW-w64 package via various distribution, for example through MSYS2 withpacman -S mingw-w64-x86_64-arpack. It can also be built and installed through vcpkg withvcpkg install arpack-ng.Using arpack-ng from your own codebase
The
*.pcand*.cmakefiles provided byarpack-ngare 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.shandtstAutotoolsInstall.shgenerated after running cmake/configure.With autotools
First, set
PKG_CONFIG_PATHto the location in the installation directory wherearpack.pclies.Then, insert the following lines in your
configure.ac:Note: make sure you have installed
pkg-config.With CMake
You can use arpack in your CMake builds by using
ARPACK::ARPACKtarget. For example,To use PARPACK in your Cmake builds, use
PARPACK::PARPACKtarget:Note: Make sure to update
CMAKE_MODULE_PATHenv variable (otherwise,find_packagewon’t find arpack-ng cmake file).FAQ
Where can I find ARPACK user’s guide?
http://li.mit.edu/Archive/Activities/Archive/CourseWork/Ju_Li/MITCourses/18.335/Doc/ARPACK/Lehoucq97.pdf
Calling arpack’s aupd methods returns
info = -9 - Starting vector is zero.: why?Residuals are null. Try to set
residto small values (like epsilon machine magnitude) but not exactly zero. Residualsresid = A*v - lamdba*vtarget exactly the zero vector. Whenresidis close enough to zero, the iterative procedure stops.Say I have an estimate of an eigen value, how to give this information to arpack?
You need to shift of an amount of about this estimate of
lambda. GrepbackTransforminarpackSolver.hppto see an example. For more information, checkout “NUMERICAL METHODS FOR LARGE EIGENVALUE PROBLEMS” by Yousef Saad: https://www-users.cse.umn.edu/~saad/eig_book_2ndEd.pdf (paragraph 4.1.2. and section 4.1.).Say I have an estimate of an eigen vector, how to give this information to arpack?
You need to copy this eigen vector estimate in
v(notresid) and setinfoto 1 before calling aupd methods. Thevvector targets a non-null vector such thatresid = 0, that is, such thatA*v = lambda*v.Using PARPACK, I get incorrect eigen values.
Make sure each MPI processor handles a subpart of the eigen system (matrices) only. ARPACK handles and solves the whole eigen problem (matrices) at once. PARPACK doesn’t: each MPI processor must handle and solve a subpart of the eigen system (matrices) only (independently from the other processors). See examples for Fortran in folder
PARPACK/EXAMPLES/MPI, and for C/C++ examples inPARPACK/TESTS/MPI/icb_parpack_c.candPARPACK/TESTS/MPI/icb_parpack_cpp.cppUsing MKL (also known as Intel oneAPI or oneMKL) instead of BLAS / LAPACK
How to use arpack-ng with Intel MKL:
PKG_CONFIG_PATH) or cmake options (BLA_VENDOR=Intel10_64lpfor lp64,BLA_VENDOR=Intel10_64ilpfor ilp64).make VERBOSE=1) in the very end that the compile/link options used by the compiler/linker are exactly what Intel libraries expect.Good luck and enjoy 🎊