OP-DSL / OP2-Common

OP2: open-source framework for the execution of unstructured grid applications on clusters of GPUs or multi-core CPUs
https://op-dsl.github.io
Other
98 stars 46 forks source link

Improve build dependency detection #228

Closed bozbez closed 2 years ago

bozbez commented 2 years ago

This moves the dependency and compiler detection logic to use a persistent configuration file in makefiles/.config.mk that is produced on invocation of make config. All make variables with the CONFIG_ prefix are written to this file, and are loaded back without prefix prior to the build rules. This file stores the variables specifying the compilers, flags and dependencies and allows the user to perform all future builds with the same set of dependencies without needing to set the environment variables. As the config file is itself a plain makefile, it is also viewable and editable in cases where automatic dependency detection fails to produce the desired result. The use of this persistent config file also eliminates the re-compilation of the test executables for every make invocation, reducing build times.

In addition, the output of the dependency test executable compilation is now output to the terminal along with a variety of status messages. This should help the user to diagnose cases where dependencies are not properly detected. The buildable library and app variants are now also printed prior to executing the build.

reguly commented 2 years ago

I pushed in a patch to get pt-scotch 6 working, which used int32_t. Currently this prints lots of scary error messages during the config - should only print if it really did not find it.

bozbez commented 2 years ago

Build errors should now only be output when the dependency is not found. Was a bit awkward to implement since you can't read multi-line strings with Make's $(shell ...) or != but it seems the $(file ...) function can handle this, with the output of the builds now being written to a temporary log.

reguly commented 2 years ago

Looks good, thank you!

On 2022. Apr 5., at 15:23, Joe Kaushal @.***> wrote:

Build errors should now only be output when the dependency is not found. Was a bit awkward to implement since you can't read multi-line strings with Make's $(shell ...) or != but it seems the $(file ...) function can handle this, with the output of the builds now being written to a temporary log.

— Reply to this email directly, view it on GitHub https://github.com/OP-DSL/OP2-Common/pull/228#issuecomment-1088698633, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJWVVKNM4Q6XD3V32QZJF3VDQ5D5ANCNFSM5SPIKOSQ. You are receiving this because you were assigned.