|Re: Long Compilation time- OPC-UA [message #1786065 is a reply to message #1786035]
||Wed, 25 April 2018 06:23
|| Elemer Lelik
Registered: January 2015
without having the code I can only make general remarks.
-first of all, your first call to the compiler is redundant; if you have correctly generated your Makefile,
should be sufficient.
What happens now is that
parses the code and generated the C++ files, then make will call again the compiler , which will reparse the same files again, but will not change the generated C++ files as the input was not changed.
Now this double reparsing will not have a significant effect on the compilation time, however it's redundant.
Please open your Makefile and check all your flags are there; most of the flags can be added when generating the Makefile with makefilegen options, but some need to be added manually.
OK, so let's see how we can improve compilation speed:
- when you call make, the TTCN-3 compiler and later the C++ compiler will work on one file at a a time, which means that in a multicore environment you are using only one core.
You should use make -jn -e.g. make -j 4 -instead, where n is the number of cores you want to involve in the compilation.
to see the difference.
this works nicely as long as the compiler-generated C++ files are roughly of the same size; but it happens sometimes that one is larger than the others, constituting a bottleneck, so all will terminate quickly except this one.
In this case you may want to use the -U n flag of the compiler, which will then force it to generate not one C++ file (one .hh, .cc pair) but n ones ( one .hh and n .cc ones).
makefilegen -f -G -U 8 *.ttcn
will generate a Makefile with -e flag and generated C++ files split into 8
Also, I recommend you to use the gold linker
by adding the below flag in your Makefile:
# Flags for the linker:
LDFLAGS = -fuse-ld=gold
This will speed up linking -which may take up minutes- with no known drawback .
Also you can try to use clang-3.8 instead of gcc, but for this you need a Titan compiled with clang ( see https://www.eclipse.org/forums/index.php/m/1733511/) , so I'd leave this to the end.
If you attach the code, we can also take a look into your project and maybe suggest structural improvements or optimize the compiler.
[Updated on: Wed, 25 April 2018 06:47]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01989 seconds