Closed MilanKlausz closed 6 years ago
Hi @MilanKlausz,
It looks to me like the macOS linker doesn't like the --rpath= in the CFLAGS. (According to https://stackoverflow.com/questions/26472590/ld-unknown-option-rpath-libs-linking-error-while-building-openframework it looks like it needs -rpath, instead)
The extra
CFLAGS= -Wl,--rpath=NCrystalLink/lib -LNCrystalLink/lib -lNCrystal -INCrystalLink/include
looks like they are being picked up from the NCrystal_sample.comp code.
So without having access to your instrumentfile etc., I would guess you can edit NCrystal_sample.comp and change the
DEPENDENCYline to read
CFLAGS= -Wl,-rpath,NCrystalLink/lib -LNCrystalLink/lib -lNCrystal -INCrystalLink/include
Hope this helps - otherwise please include a zip file with your instr code etc. and I shall have a closer look.
Peter
Oups, this should have been in the https://github.com/mctools/ncrystal/issues tracker (my bad, I sent Milan the wrong link). Milan can you open it there instead with the same text?
And thanks Peter for the suggestion, I'll see if the suggestion works across platforms and possibly release a new NCrystal version.
I have defined a McStas issue (https://github.com/McStasMcXtrace/McCode/issues/589) so that we remember to try out NCrystal "from our side" as well, plus consider if we should include a snapshot with our next release(s)
Just made a quick test here, things work for me with
DEPENDENCY "-Wl,-rpath,NCrystalLink/lib -LNCrystalLink/lib -lNCrystal -INCrystalLink/include"in the component code.
Suggestion:
Could ncrystal_preparemcstasdir put an os-tailored copy of NCrystal_sample.comp in . rather than a link?
Hi Peter,
Of course, as a last resort it can do something like that. My gut feeling though is that figuring out a more "universal" line working ~everywhere would end up giving us less hassle. To be investigated.
-rpath,NCrystalLink/lib
solved the problem. Thank you!
From now this is officially the best supported software(combination) I've ever used :)
Great Milan :-)
The official fix is in NCrystal 0.9.4, let me know if works for you.
I get the following error message when I try to run a McStas simulation with an NCrystal_sample component in the instrument file:
I've installed NCrystal 0.9.2 using the Source code (tar.gz) without any trouble, following the instructions in the INSTALL file (cmake, make install, setup.sh). It passes the test ("Tests completed succesfully"), and I can visualize data using the command-line. The problem comes when I want to use it with McStas. I've made the links using the _ncrystalpreparemcstasdir command in the folder where I'm calling mcstas, and after that I can even compile an instrument file using the mcstas command without any error. I get the error only when I launch a simulation with the mcrun or mcdisplay-webgl commands. I get the same result with NCrystal 0.9.1 too.
Other environment info: macOS High Sierra (Version 10.13) McStas version 2.4.1 (Jun. 26, 2017) cmake version 3.9.4 gcc (GCC) 6.0.0 20151213 (experimental)
The full text that I get: