amgcl icon indicating copy to clipboard operation
amgcl copied to clipboard

Boost is unconditional dependency in CMakeLists.txt

Open ilyapopov opened this issue 3 years ago • 1 comments

In CMakeLists, boost is requires dependency:

https://github.com/ddemidov/amgcl/blob/c71ab45f911771c108b1842ea7cd11b62432bbf3/CMakeLists.txt#L31-L35

although amgcl can works fine without boost with AMGCL_NO_BOOST preprocessor macro (without runtime interface).

I can use amgcl by specifying include paths directly, bypassing CMakeLists, but is would be good if amgcl's build system was made more flexible about Boost.

ilyapopov avatar Aug 02 '22 18:08 ilyapopov

AMGCL may be used without boost, but most of the AMGCL examples depend on it, so it is unconditionally searched for in the CMakeLists.txt.

It should be possible to make the dependency optional, so that AMGCL could be configured and installed without boost (and without compiling examples and tests).

ddemidov avatar Aug 03 '22 10:08 ddemidov

With 27ab1a7d4a6c7b0a2aa976c9f5b83bee0e06597c I can configure and use amgcl without Boost. Example of a client project that uses Boost-less amgcl: https://gist.github.com/ddemidov/74655be8a8a57aae861396c5a1a7ba40

ddemidov avatar Aug 14 '22 15:08 ddemidov

And with 6d4db1aeab360c591f70809bbe77d30832287677 you don't have to explicitly define AMGCL_NO_BOOST; the definition is included into amgcl::amgcl target when Boost is not found.

ddemidov avatar Aug 14 '22 15:08 ddemidov

Thank you!

ilyapopov avatar Aug 21 '22 17:08 ilyapopov