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
Add cmdstan #15203
Add cmdstan #15203
Conversation
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/cmdstan:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@maresb it looks like tbbmalloc_proxy is compiled, but not installed?
which then results in an overlinking warning |
Can you check that the file is installed properly (copied into the prefix?) |
Should it be copied into $prefix/lib? With the file structure or without? Additionally, do you know why the OSX and Win tests seem to be taking orders of magnitude longer than the linux test? I've been unable to run anything other than the linux test locally, so I'm relying on the CI build |
If you link against it, you should install it (otherwise it's gonna be missing at execution time ) |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/cmdstan:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
recipes/cmdstan/build.sh
Outdated
|
||
make clean-all | ||
|
||
ls $PREFIX/lib | ||
TBB_LIB=$PREFIX/lib make -j8 build | ||
make build -j4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to use -j${CPU_COUNT}
Hi @WardBrian, sorry for the delay. I'm on the road so it's tough for me to give anything more than a reactionary response. These C++ packages are really beyond my realm of expertise so take whatever I say with a grain of salt. The license issues are indeed unfortunate, and I'm not so sure what to do about that. Licenses aside, I think the big potential problems would be if those libraries would somehow lead to conflicts by overwriting existing libraries. Having a quick look at the artifacts, I see that @wolfv and/or @conda-forge/help-c-cpp, any suggestions? |
My understanding of Windows linking issues means the tbb.dll could be a problem for other users. Luckily, tbb just released a new and not-backwards-compatible version which I believe uses a different filename for it's library files, so I think we could set it up so that you cannot install earlier tbbs (that would conflict with this one?). That's an open question I have for those more experienced. Nothing besides TBB ends up in the PATH, so I don't think there are any concerns besides that one |
Re: the license issues - every included package is used within its license and has said license included with it in the subfolder (mainly in stan/lib/stan_math/lib) so I don't think it is a problem per se, we just may need to indicate this somehow in the metadata, and that's what I'm unsure about. |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/cmdstan:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@conda-forge-admin, please ping team |
Hi! This is the friendly automated conda-forge-webservice. I was asked to ping @conda-forge/staged-recipes and so here I am doing that. |
recipes/cmdstan/meta.yaml
Outdated
- {{ compiler('cxx') }} # [not win] | ||
- make # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this in run
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CmdStan is sort of an odd duck - it is a tool for compiling models in the stan language, so it's one part library and one part build script. The actual usage of the tool at runtime requires Make and a c++ toolchain. The docs go into more detail, if you're curious, but essentially a .stan
program is translated into a cpp file, which is then linked with the stan library and compiled to be run. CmdStan handles the first half of this, and provides a build script for the last portion, but it assumes you have a compiler to do so
recipes/cmdstan/meta.yaml
Outdated
build: | ||
- {{ compiler('cxx') }} # [not win] | ||
- make # [not win] | ||
- tbb-devel =2020.2 # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- tbb-devel =2020.2 # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBB has been an issue for us, so we ended up doing a sort of two-pronged approach: On Unix and MacOS, we depend on the conda-shipped TBB to make compilation simpler. On Windows, due to our dependence on mingw64
's gcc
, we have to compile our own tbb, hence this line.
We tried more or less every other combination in the above commits, but sadly this is what we found was required. The heavy use of templating in Stan's c++ code does not work under MSVC, so we need to take this somewhat odd route on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think you just meant that this library is in both build
and host
. My bad, I believe that is unintentional. The above comment can just serve as historical record, then.
recipes/cmdstan/meta.yaml
Outdated
- {{ compiler('cxx') }} # [not win] | ||
- make # [not win] | ||
- tbb-devel =2020.2 # [not win] | ||
- m2w64-toolchain # [win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use {{ compiler("m2w64_cxx") }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/cmdstan:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Thank you for the comments @isuruf! We would appreciate any more review you could offer, or approval if it all looks good |
recipes/cmdstan/build.sh
Outdated
chmod +x "${PREFIX}/bin/cmdstan_model" | ||
|
||
# activate script | ||
echo "export CMDSTAN=${PREFIX}/bin/cmdstan" > "${RECIPE_DIR}/activate.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Activate script should backup any existing CMDSTAN
variable and deactivate should restore the backup. Btw, why is CMDSTAN
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMDSTAN
is used by the Python and R bindings (‘CmdStanPy’ and ‘CmdStanR’) to find CmdStan if it is not installed in the users home directory. We set it here so that this package is plug and play with those bindings, which we believe will be the majority of the install base based on current usage
I will make the change to set a temporary and restore it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMDSTAN
is now stored to CMDSTAN_OLD
by activate, and restored to that value in deactivate
recipes/cmdstan/meta.yaml
Outdated
- m2-sed # [win] | ||
- m2-coreutils # [win] | ||
host: | ||
- tbb-devel =2020.2 # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use the global pining
- tbb-devel =2020.2 # [not win] | |
- tbb-devel # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the global pinning ever change? CmdStan can be compiled with more recent versions of TBB but it requires extra flags set in the make command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll get a PR to cmdstan-feedstock
when it changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I've removed the pinning. Thanks for all the review! Happy to address anything else that stands out still
recipes/cmdstan/meta.yaml
Outdated
run: | ||
- {{ compiler('cxx') }} # [not win] | ||
- make # [not win] | ||
- tbb-devel =2020.2 # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- tbb-devel =2020.2 # [not win] | |
- tbb-devel # [not win] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Please ping when tests are green
@isuruf, thanks for the review, all green! |
Thank you @WardBrian, what an amazing effort! |
Checklist
url
) rather than a repo (e.g.git_url
) is used in your recipe (see here for more details).