Changed computers and getting two errors during compile to cmdStan from Matlab:
Error using StanModel/compile (line 908)
error: half args and returns was enabled in PCH file but is currently disabled
error: PCH file was compiled for the target ‘arm64-apple-macosx11.0.0’ but the current translation
unit is being compiled for target ‘x86_64-apple-macosx11.0.0’
I’m guessing the second error is due to trying to migrate the Matlab version to the new computer and hope I’ll be able to solve it with a fresh install.
I’m puzzled by the first one. I don’t know what half args and returns are in this context and not sure how to enable them. I presume this error is related Xcode, but not sure.
If possible, add also code to simulate data or attach a (subset of) the dataset you work with.
Please provide this additional information in addition to your question:
Operating System:
CmdStan Version:
Compiler/Toolkit:
Don’t forget to add relevant tags to your topic (top right of this form) especially for application area. Delete this text before posting your topic. Thx!
Looks like I’m running into a serious issues here. Reinstalling Matlab files did not fix anything. In fact, since there is practically no installation (just a download of scripts), I realize now it was silly to expect it would fix anything.
I tried rebuilding the CmdStan (both 2.24.1 and 2.26.0 versions), but to no avail.
The build seems to work, but generates 10 warnings:
ld: warning: cannot export hidden symbol typeinfo for tbb::tbb_exception from task_group_context.o
ld: warning: cannot export hidden symbol typeinfo name for tbb::tbb_exception from task_group_context.o
ld: warning: cannot export hidden symbol typeinfo name for tbb::empty_task from arena.o
ld: warning: cannot export hidden symbol typeinfo for tbb::empty_task from arena.o
ld: warning: cannot export hidden symbol typeinfo name for tbb::empty_task from scheduler.o
ld: warning: cannot export hidden symbol typeinfo name for tbb::tbb_exception from scheduler.o
ld: warning: cannot export hidden symbol typeinfo for tbb::empty_task from scheduler.o
ld: warning: cannot export hidden symbol typeinfo for tbb::tbb_exception from scheduler.o
I wonder if the CmdStan has been tested on the Apple M1 chip. I’m getting a sense that this problem might be related to the new laptop not having an Intel chip anymore.
@maydin could you be a bit more specific about how you built CmdStan in Xcode? I’m running into the same errors you’ve posted here but I don’t understand what that means.
Hi @dstauffer11 I’ve also been hitting the issue for CmdStan 2-28-2:
Error when compiling SampleModel m1.2s:
error: half args and returns was enabled in PCH file but is currently disabled
error: PCH file was compiled for the target 'arm64-apple-macosx12.0.0' but the current translation unit is being compiled for target 'x86_64-apple-macosx12.0.0'
2 errors generated.
make: *** [/var/folders/l7/pr04h0650q5dvqttnvs8s2c00000gn/T/jl_6nsXSj/m1.2s] Error 1
``` compiling CmdStan "as usual" and then calling it from a Rosetta based application.
When you say "I think I got this to work", you mean the Xcode project solves the problem just for Rosetta apps or for both cases (arm-based apps as well)?
Thanks for your help!
A few more observations, also in response to above link. Building and compiling cmdstan “as usual” works fine on M1. The problem occurs if you call it from an app running under Rosetta.
Note for JuliaStan users: Choose the arm version of Julia-1.7-rc3 and it all works fine. Julia-1.6.4 has no arm version, that’s where the problem will show up. To build cmdstan-2.28.2 I use:
I was getting this error when calling from JuliaStan, that’s what building from Xcode fixed. It sounds like there’s an easier way using the arm version of Julia, thanks for posting.