-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add cmake build scheme #3068
base: develop
Are you sure you want to change the base?
Conversation
… options for unit and prob test folders
Sorry closing for now, thought opening up a draft would not turn on the tests |
Reopening to test some jenkins things. Still not ready for review |
…' into feature/cmake-tests
@serban-nicusor-toptal would it be possible to update the cmake version on jenkins to > 3.18? |
Hey @SteveBronder of course! I will have to rebuild the docker image we use and will reply here with the updated tag. We can use this tag in the PR and if all goes well merge it. |
Hey @SteveBronder, |
Thank you!! Taking it for a spin now |
I'm pretty sure we only use opencl on the gpu, but if we run into errors we can install their new opencl setup |
Killed. I think building one large executable is too much for the jenkins computer. Going to switch this up to build several smaller executables |
Summary
This adds a cmake build system for Stan Math. The main features are
FetchContent
module. So users can call the following to include stan math into their library that also uses cmakeFetchContent_Declare( stanmath GIT_REPOSITORY https://github.com/stan-dev/math GIT_TAG develop ) // later for building their executable target_link_libraries(my_ex stanmath::stanmath)
Importantly, this allows stan and cmdstan etc to do the above which is nice.
It seems like this takes much less time to compile per folder. For example the
test/unit/math/mix/fun
tests all compile into one object file which took about 12 minutes on my machine using 24 cores (and at max about 65 gb of memory)The prob tests also work and are broken down by folder
I'd like to make targets for all of
unit
and all ofprob
to put into jenkins.The expression tests are not setup yet but I'll have them done before this pr is merged.
A few other things that need to be done / checked before merge
Tests
I'm not sure how to test the cmake files but am open to suggestions
Release notes
Replace this text with a short note on what will change if this pull request is merged in which case this will be included in the release notes.
Checklist
Copyright holder: Steve Bronder
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
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested