-
Hello, I am Quentin, french student doing an internship at DTU Risoe with @nicriz as supervisor. We are using McStas with Union components and NCrystal library in order to simulate an extraction system of a CANS. We want to investigate the impact of Nanodiamonds coating on the extraction efficiency so we are using the SANSND_plugin. We did a fresh installation on my wsl environment of McStas 2.7.1 and NCrystal 3.0.0. We then interface on McStasScript for the instrument definition and we linked McStas and NCrystal using We are not sure of the cause of this issue since there wasn't an older version on the computer. We noticed that the error can come from the NCrystal_sample.comp: Any idea of what could be the cause and how to fix it? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
So likely you are having a mixup between the (older) NCrystal version shipped with McStas and the new NCrystal version you have installed yourself. To begin with, you should check with A likely cause of your issue is that you did not inject the newer NCrystal version properly in your paths. One way to do that is to source the |
Beta Was this translation helpful? Give feedback.
-
Hmm... I assume you got an |
Beta Was this translation helpful? Give feedback.
-
Hmm... I suspect the issue might be related to the invocation from McStasScript then. Perhaps @mads-bertelsen has an idea of what to do? I think he was working with a custom NCrystal installation via McStasScript recently. |
Beta Was this translation helpful? Give feedback.
-
As an aside: @mads-bertelsen do you also have a check like:
in the Union-NCrystal process? It seems like it might be worth the trouble to put in if not. |
Beta Was this translation helpful? Give feedback.
-
Changing the dependency line in the NCrystal_process.comp to DEPENDENCY "-Wl,-rpath,NCrystalLink/lib -LNCrystalLink/lib -lNCrystal -INCrystalLink/include" solved the problem for us. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
UPDATE Nov 2022: Starting with McStas v3.2, this should hopefully be a non-issue. All McStas components using NCrystal will at that point always query the Keeping the previous answer here, since it will be a while before everyone use McStas v3.2: For the benefit of people coming here looking for a solution, here is a summary of the situation and solution arising from discussions in other comments and private email: NCrystal is used in two places in McStas, from the NCrystal_sample.comp and in the Union process NCrystal_process.comp. Both needs to include header files from NCrystal and to link against the NCrystal library in order to work, and for that reason they include a DEPENDENCY statement inside with appropriate flags for the build system. Since McStas ships a version of NCrystal, the shipped NCrystal_sample.comp and NCrystal_process.comp components both point towards that version. When using a custom (and usually newer) installation of NCrystal with a given version of McStas, one is instructed to run the command
Thus, any attempts at using the NCrystal_sample component will pick up NCrystal_sample.comp from the working directory, and via the DEPENDENCY line above and the created NCrystalLink subdirectory, get redirected to the intended custom installation of NCrystal. Unfortunately this does not fix the NCrystal_process.comp which probably is an oversight, so for using NCrystal inside the McStas-Union geometry system, one must fix this up by hand. One way to do this is to find the NCrystal_process.comp file in the McStas installation and create a copy of it in the working directory. Inside that copy one must then replace the DEPENDENCY statement with the line above. Additionally of course, one must still run |
Beta Was this translation helpful? Give feedback.
UPDATE Nov 2022: Starting with McStas v3.2, this should hopefully be a non-issue. All McStas components using NCrystal will at that point always query the
ncrystal-config
script to get appropriate build flags. So runningwhich ncrystal-config
(orncrystal-config -s
) in the terminal, should immediately show which NCrystal installation will be used in McStas components.Keeping the previous answer here, since it will be a while before everyone use McStas v3.2:
For the benefit of people coming here looking for a solution, here is a summary of the situation and solution arising from discussions in other comments and private email:
NCrystal is used in two places in McStas, from the NCrystal_sa…