Skip to content

Add cmake as the default for building stan math's tests - #3463

Open
SteveBronder wants to merge 4 commits into
developfrom
cmake-math
Open

SteveBronder wants to merge 4 commits into
developfrom
cmake-math

Conversation

@SteveBronder

Copy link
Copy Markdown
Collaborator

Summary

This is my new take on having a cmake scheme. It imports a lot of what I did in #3068. This is the nth time we have attempted to make a cmake scheme for our build setup, but this time, I feel good about it! I've made many smaller PRs to try to get the math library ready for this, so now instead of 100k+ changes we have about 1K+ changes.

Since this is rather new for stan developers the readme.md has a big intro for how to use the new cmake backend. After a few releases I will put that in the normal docs page. But while we are moving to using this new tool I think it is better we are very verbose in showing people how to use it.

Tests

./runTests.py and jenkins now use the cmake backend.

The cmake creates folder level test executables and individual test executables.

The folder level tests are much faster to compile now. For example the test/unit/math/mix/fun tests all compile into one object file which took about 30 minutes on my machine using 24 cores (and at max about 65 gb of memory). On develop these take about an hour and a half on my machine.

Side Effects

Yes. I mean this is a pretty big change.

One really nice change is that we have precompiled headers with this. That should speed up test compilation. In another PR I am planning to do some tricks with the distribution tests which should speed compilation for those by a good bit.

Release notes

Add cmake as the build backend

Checklist

  • Copyright holder: Simons Foundation

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

Import and modernize the CMake setup for current vendored dependencies. Use CMake by default in runTests.py, group directory tests into executables, reuse per-source objects and PCH, and cap build parallelism at six jobs.

Migrate Jenkins test stages, document the workflow, and ignore CMake build trees. Fix shared test helper linkage, Eigen fixture initialization, and the Bernoulli GLM invalid-label fixture; suppress GCC column-tracking notes.

Validation: 21 runner, selection, and CMake build regression checks passed. Previously validated reverse and primitive function groups, generated probability and expression tests, and object reuse across test selections.
@SteveBronder

Copy link
Copy Markdown
Collaborator Author

Note this is not ready for a review yet. I think once all of the jenkins passes it will be good to look at

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants