How to disable c++ optimizations using cpp_options #716
Replies: 3 comments 8 replies
-
I think both should work because all of them are piped to subprocess and finally to commandline as a text. cmdstanpy/cmdstanpy/compilation.py Line 334 in 535c4e6 |
Beta Was this translation helpful? Give feedback.
-
@justindomke: This can be a win if you're evaluating really simple models, but keep in mind that the speed difference once compiled between -O3 and -O0 is about a factor of 10 last time I checked. Allowing inputs like But I'm very confused because class CompilerOptions:
"""
User-specified flags for stanc and C++ compiler.
Attributes:
stanc_options - stanc compiler flags, options
cpp_options - makefile options (NAME=value)
user_header - path to a user .hpp file to include during compilation
"""
def __init__(
self,
*,
stanc_options: Optional[Dict[str, Any]] = None,
cpp_options: Optional[Dict[str, Any]] = None,
user_header: OptionalPath = None,
) -> None:
...
self._cpp_options = cpp_options if cpp_options is not None else {} |
Beta Was this translation helpful? Give feedback.
-
@justindomke I think the cmdstan makefiles have something wrong with them re: The easiest fix seems to be using the variable |
Beta Was this translation helpful? Give feedback.
-
Hello! For the sake of speeding up compilation during testing, I'd like to disable all C++ optimization. I think that the
cpp_options
flag forCmdStanModel
is the way to do this, but I'm not sure about the correct syntax. Should I usecpp_options={'O':0}
orcpp_options={'O',"0"}
, or something else? Using nonsense options doesn't seem to trigger an error so it's hard to be confident if the choice is having any effect...Beta Was this translation helpful? Give feedback.
All reactions