Improve compile time configuration
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 839
- Forks
- 220
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 14
Description
Description
We are having an increasing number of optional features in Stan-math. At the moment these are OpenCL, MPI and threading. Moreover, there are sometimes choices to make at compile time which should be kept optional rather than hard-coded in the code.
Right now we basically configure these compile time things using our makefiles in make/local. Unfortunately this is also somewhat inconsistent for the different features. While for MPI we define a makefile variable STAN_MPI=true we have simple defines for the others (ok, there is a reason for this which is that MPI needs more bells and whistles to go live as I recall).
Example
We should have better ways to control compile time options. Many other projects define config headers. Boost has this and sundials has it as well. Given how Stan-math grows we should probably have a similar facility.
Oftentimes these config.hpp files have defaults which work in many cases, but sometimes these files are generated from tools like cmake or automake which adapt the config file to the available things on the target system.
Expected Output
Better and more flexible way of setting compile time options. We should also rethink how much we want to control by makefiles vs the config.hpp (or whatever we come up with).
Current Version:
v2.20.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current compile-time settings in make/local, especially the differing configuration for OpenCL, MPI, and threading. Compare the proposed config.hpp approach with the existing makefile controls and determine how defaults and target-specific options should work. Done means the project has a better, consistent, and flexible way to set compile-time options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100