<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello Timur,
<p>The --no-runtime option for mcstas means that the 'standard' library/tools
for Monte Carlo are not embedded in the instrument source code (.c). Anyway,
most of the components require some of the functions there-in. Thus, either
you have to supply equivalents to the definitions listed in mcstas-r.h
(but this is probably not a good solution as it requires a lot of work),
or you have to link the libraries after the creation of the .c. This is
what I explain afterwards.
<br>Thus, the right compilation process would be:
<br>> mcstas -t --no-runtime Laue_diff.instr
<br>> gcc -c mcstas-r.c
<br>The '-c' means 'just build the .o and do not link'. This requires
to have access to mcstas-r.c and .h, either through copies (possibly modified
by you) or links.
<br>If the symbol MCSTAS_VERSION is required, use: cc -c -DMCSTAS_VERSION="External
McStas run-time" mcstas-r.c
<br>Then:
<br>> gcc -o Laue_diff..out mcstas-r.o Laue_diff..c -lm
<br>means, use the external mcstas-r object file, and link it
<p>Good luck, Emmanuel.
<p>Timur Elzhov wrote:
<blockquote TYPE=CITE>Dear McStas experts!
<p>I tried to convert the example instrument file (considered
<br>in the manual) in the C file with '--no-runtime' option:
<p> ~$ mcstas -t --no-runtime Laue_diff.instr
<br> ~$
<p>That's OK. Then, I tried to compile this file (having links
<br>to 'mcstas-r.h' as well as 'mcstas-r.c' in the directory):
<p> ~$ gcc -c Laue_diff.c
<br> Laue_diff.c: In function `mcinit':
<br> Laue_diff.c:613: `mcdotrace' undeclared (first use in this function)
<br> Laue_diff.c:613: (Each undeclared identifier is reported only
once
<br> Laue_diff.c:613: for each function it appears in.)
<br> Laue_diff.c: In function `mcraytrace':
<br> Laue_diff.c:721: `mcdotrace' undeclared (first use in this function)
<p>Where am I wrong? Thank you for any help!
<p>(I use the 1.5 version of McStas)
<p>--
<br>WBR,
<br>Timur V. Elzhov
<p>_______________________________________________
<br>neutron-mc mailing list
<br>neutron-mc@neutron.risoe.dk
<br><a href="http://neutron.risoe.dk/mailman/listinfo/neutron-mc">http://neutron.risoe.dk/mailman/listinfo/neutron-mc</a></blockquote>
<pre>--
What's up Doc ?
--------------------------------------------
Emmanuel FARHI, <A HREF="http://www.ill.fr/tas/people/Farhi.html">http://www.ill.fr/tas/people/Farhi.html</A> \|/ ____ \|/
CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~
6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\
Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 20 76 48 \__U_/</pre>
</html>