[neutron-mc] Problem with `--no-runtime' option
Timur Elzhov
Timur.Elzhov at jinr.ru
Thu Apr 3 15:48:50 CEST 2003
On Thu, Apr 03, 2003 at 03:19:30PM +0200, Emmanuel Farhi wrote:
> 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.
> Thus, the right compilation process would be:
> > mcstas -t --no-runtime Laue_diff.instr
> > gcc -c mcstas-r.c
> 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.
Hmm, let's look at the my text more thoroughly:
TE> ~$ gcc -c Laue_diff.c
^^^^^
I just try to create the *object* file Laue_diff.o only,
*without* linking! The compiler goes through this step
inevitably, right? ;)
Well, we note that mcstas-r.h is in our directory...
Now, let's compile them. gcc fails with errors:
TE> Laue_diff.c: In function `mcinit':
TE> Laue_diff.c:613: `mcdotrace' undeclared (first use in this function)
TE> Laue_diff.c:613: (Each undeclared identifier is reported only once
TE> Laue_diff.c:613: for each function it appears in.)
TE> Laue_diff.c: In function `mcraytrace':
TE> Laue_diff.c:721: `mcdotrace' undeclared (first use in this function)
`-DMCSTAS_VERSION="External McStas run-time"' doesn't help :(
> If the symbol MCSTAS_VERSION is required, use: cc -c
> -DMCSTAS_VERSION="External McStas run-time" mcstas-r.c
> Then:
> > gcc -o Laue_diff.out mcstas-r.o Laue_diff.c -lm
> means, use the external mcstas-r object file, and link it
This produces absolutely the same errors :-(
Where am I wrong, again?
Sorry if I so stupid! ;-)
--
WBR,
Timur.
More information about the mcstas-users
mailing list