arbor-sim / arbor

The Arbor multi-compartment neural network simulation library.
https://arbor-sim.org
BSD 3-Clause "New" or "Revised" License
108 stars 60 forks source link

Build fails with -DARB_USE_BUNDLED_UNITS=OFF because the install(units) statement is unconditional #2392

Open yurivict opened 3 months ago

yurivict commented 3 months ago

Please allow arbor to cleanly build with an externally installed units library.

thorstenhater commented 3 months ago

Currently I cannot find a Spack or brew package for llnl::units so we rely on the vendored one. That'll change if and when such packages arrive. Does BSD provide such a package?

yurivict commented 3 months ago

Yes, I've added the port for unit yesterday to FreeBSD.

The correct algorithm would be to first look for the installed unit using find_package, use it if it exists, and fall back to the bundled one if not.

thorstenhater commented 3 months ago

Thanks, you are one of the first packagers then do so and I'll happily add the scaffolding!

thorstenhater commented 3 months ago

I don't know if you have the bandwidth, but if you could test with the linked PR, I'd be grateful to see the results.

yurivict commented 3 months ago

There is something missing in the PR, I left the comment there.

thorstenhater commented 2 months ago

Hi @yurivict,

this took I while longer than I expected it to do, but that was due to me going off the rails and retiring our whole cursed sub-module construction. Main now uses CPM --- for better or worse --- and should prefer installed packages over internal ones. Missing packages will be pulled in from external.

See here on how to avoid that: https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#cpm_use_local_packages

I also tweaked the installation of units to install iff units was built along side Arbor.