<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hy Timur,
<p>I finally realized what you mean. I corrected a few declaration mismatches
that probably date from a long time, and only apply when using the --no-runtime.
<br>For your particular case, you should probably add in mcstas-r.h lines
such as
<blockquote>extern int mcdotrace;</blockquote>
the type of the missing variables to declare is to be found in mcstas-r.c
(and should be preceeded by 'mcstatic' in this latter file).
<p>Emmanuel.
<p>Timur Elzhov wrote:
<blockquote TYPE=CITE>On Thu, Apr 03, 2003 at 03:19:30PM +0200, Emmanuel
Farhi wrote:
<p>> The --no-runtime option for mcstas means that the 'standard'
<br>> library/tools for Monte Carlo are not embedded in the instrument
source
<br>> code (.c). Anyway, most of the components require some of the functions
<br>> there-in. Thus, either you have to supply equivalents to the definitions
<br>> listed in mcstas-r.h (but this is probably not a good solution as
it
<br>> requires a lot of work), or you have to link the libraries after
the
<br>> 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
<br>> have access to mcstas-r.c and .h, either through copies (possibly
<br>> modified by you) or links.
<br>Hmm, let's look at the my text more thoroughly:
<br> TE> ~$ gcc -c Laue_diff.c
<br>
^^^^^
<br>I just try to create the *object* file Laue_diff.o only,
<br>*without* linking! The compiler goes through this step
<br>inevitably, right? ;)
<p>Well, we note that mcstas-r.h is in our directory...
<p>Now, let's compile them. gcc fails with errors:
<br> TE> Laue_diff.c: In function `mcinit':
<br> TE> Laue_diff.c:613: `mcdotrace' undeclared (first
use in this function)
<br> TE> Laue_diff.c:613: (Each undeclared identifier
is reported only once
<br> TE> Laue_diff.c:613: for each function it appears
in.)
<br> TE> Laue_diff.c: In function `mcraytrace':
<br> TE> Laue_diff.c:721: `mcdotrace' undeclared (first
use in this function)
<p>`-DMCSTAS_VERSION="External McStas run-time"' doesn't help :(
<p>> If the symbol MCSTAS_VERSION is required, use: cc -c
<br>> -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
<br>This produces absolutely the same errors :-(
<p>Where am I wrong, again?
<br>Sorry if I so stupid! ;-)
<p>--
<br>WBR,
<br>Timur.
<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>