ddemidov / amgcl

C++ library for solving large sparse linear systems with algebraic multigrid method
http://amgcl.readthedocs.org/
MIT License
733 stars 112 forks source link

Compile the amgcl as library in Linux #165

Closed RF3Dcode closed 3 years ago

RF3Dcode commented 4 years ago

Hi, I would like to compile this amgcl as library (*.so) in Linux, and use it for my CFD code to solve large sparse linear system. Tried cmake and make, still does nothing.

Could you please write a short installation on how to compile amgcl and also some examples?

Thanks very much.

ddemidov commented 4 years ago

amgcl is header only. That is, you don't need to compile it into .so to use it; you can just include the headers into your own code.

RF3Dcode commented 4 years ago

Thanks Denis!

So the sparse matrix is stored as CSR in amgcl, and we can solve large sparse linear systems with either OpenMP or MPI, or even hybrid? e.g. use BiCGSTAB.

I will try to solve my Ax=B using this header only library.

best regards

On Tue, 8 Sep 2020 at 20:16, Denis Demidov notifications@github.com wrote:

amgcl is header only. That is, you don't need to compile it into .so to use it; you can just include the headers into your own code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ddemidov/amgcl/issues/165#issuecomment-689050877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ5FV2ADWLSJESVHTSOTXRTSEZYHXANCNFSM4RAJXGSQ .

--

Institut für Verfahrenstechnik Arbeitsgruppe Mehrphasenströmungen Otto-von-Guericke-Universität Magdeburg

Hoher Weg 7 D-06120 Halle (Saale)

Telefon: +49 0176 6425 2227 Telefax: +49 345 55-27586

ddemidov commented 4 years ago

MPI and non-MPI variants have different interfaces, but yes, you can use both kinds. You choose OpenMP, CUDA, OpenCL parallelization by selecting the appropriate backend. See examples in examples folder. Also, here is a simple example of using a BiCGStab solver preconditioned with smoothed aggregation AMG with SPAI0 smoother: https://gist.github.com/ddemidov/8c529aa2f2de75f297f3.

EDIT: I've just updated the gist to be compatible with the latest amgcl.