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

Compilation AMGCL problem on AMD architectur with scotch library #255

Open pelyakim opened 1 year ago

pelyakim commented 1 year ago

Hello, I try to compile AMGCL with scotch but I have problems with the examples:

 [ 43% ] Linking CXX executable mpi_solver
/lus/home/pelyakime/AMGCL/scotch-v7.0.3/build/install/lib/libptscotch.a(library_dgraph_map.c.o): In function `SCOTCH_st ratDgraphMapBuild':
library_dgraph_map.c:(.text+0x1a3): undefined reference to `_SCOTCHstringSubst'
library_dgraph_map.c:(.text+0x1e1): undefined reference to `_SCOTCHstringSubst'
library_dgraph_map.c:(.text+0x1f3): undefined reference to `_SCOTCHstringSubst'
library_dgraph_map.c:(.text+0x205): undefined reference to `_SCOTCHstringSubst'
library_dgraph_map.c:(.text+0x217): undefined reference to `_SCOTCHstringSubst'
/lus/home/pelyakime/AMGCL/scotch-v7.0.3/build/install/lib/libptscotch.a(library_dgraph_map.c.o):library_dgraph_map.c:(. text+0x229): more undefined references to `_SCOTCHstringSubst' follow
/lus/home/pelyakime/AMGCL/scotch-v7.0.3/build/install/lib/libptscotch.a(library_dgraph_map.c.o): In function `SCOTCH_dg raphMapCompute':

I compiled scotch v7.0.3 and tried also with v7.0.1, I have the impression that the problem comes from scotch. What do you advise me to do? Thanks for your help.

ddemidov commented 1 year ago

I don't have much experience with using scotch library, but this indeed looks like there were some compilation issues with scotch. Scotch is found in amgcl using this file: https://github.com/ddemidov/amgcl/blob/master/cmake/FindScotch.cmake

It should define thse (advanced) cmake variables: Scotch_INCLUDES, Scotch_LIBRARIES, PTScotch_INCLUDES, PTScotch_LIBRARIES. Do you see these in cmake-gui? Do they have reasonable values?

ddemidov commented 1 year ago

If amgcl have troubles finding scotch, you can help it by defining environment variables SCOTCHDIR and PTSCOTCHDIR. These paths should contain scotch.h and ptscotch.h (possibly under scotch/ptcotch subfolders)