Commit Graph

215 Commits

Author SHA1 Message Date
Alex Lin
b60320464a Detect when TRICK_ICG is used in header files and compensate for it. #375
Always differences between clang versions.
2017-01-11 15:59:10 -06:00
Alex Lin
ba47c2048c Detect when TRICK_ICG is used in header files and compensate for it. #375
Created a hook for the clang preprocessor.  The hook does 2 things.  It
keeps track to which header files we have entered and exited.  Second it
searches for the use of TRICK_ICG.  If we find an instance of TRICK_ICG we
mark all of the included files from this point up the chain as requiring
compensation.  To compensate for using TRICK_ICG we write out the older
offset statements to get the location of variables in classes/structures.
2017-01-11 15:02:21 -06:00
Thadeus Fleming
fb1925e0d8 Use std::cerr instead of std::cout for error messages 2016-12-10 11:49:44 -06:00
Michael Vetter
18f0d7e871 Remove trailing whitespaces
Makes it easier to edit the files. So if we press 'end of line' we are
really at the end of line.
2016-11-08 10:25:07 +01:00
Alex Lin
d875f837f2 ICG produces non-compilable io_* code for this weird example #334
When saving the list of namespaces and classes a particular type is contained in
we have to save the class name and any template args it includes separately.  This
allows us to mangle the names easier.  And we now search for type names to see
if they follow this pattern template_name<template_args>::embedded_class.  If
we are using a template embedded class we need to create attributes for the embedded class.
2016-11-02 13:56:40 -05:00
Derek Bankieris
664797e391 Move one-time-use variables into their call site #341 2016-10-31 10:00:48 -05:00
Derek Bankieris
29b0d2d223 Alex doesn't like auto #341
Granted, there are times you shouldn't hide the type.
2016-10-31 09:51:44 -05:00
Derek Bankieris
5898f3fdec Improve loop efficiency #341
Calling getTemplateArgs() every iteration is wasteful. This should
be done once outside of the loop. Even better, use a foreach loop and
get rid of the index varible!
2016-10-31 09:34:24 -05:00
Derek Bankieris
bdcfbb4e3a Restore debug functions #341 2016-10-31 09:10:33 -05:00
Derek Bankieris
ef1405c3be Refactor ICG
Hey buddy. I wanted to tell you this before you heard it from someone
else...

I refactored ICG.

Now, it's gonna look a little scary at first. But I promise you'll like
it when you get used to it. It'll be fine. You can trust me. #341
2016-10-28 14:37:12 -05:00
Alex Lin
ba75f6ff37 ICG does not compile using llvm 3.9 #339
The call getRBraceLoc to find the ending source location of things is gone.  Replaced
it with getting the source range and get the end of that range.  Also the way to
get clang/llvm 3.9 to process c++11 code required some reordering of calls in main as
well as adding some more features to be turned on.
2016-10-28 13:21:21 -05:00
Derek Bankieris
0ba68e40aa Merge branch 'master' of https://github.com/nasa/trick
Conflicts:
	trick_source/codegen/Interface_Code_Gen/main.cpp
2016-10-21 15:15:41 -05:00
Derek Bankieris
015965abab Renamed most variabes so that they are self-descriptive. Stop using abbreviations! No one can tell what anything is.
Applied a consistent formatting.
Inlined several one-off variables.
2016-10-21 15:06:44 -05:00
Derek Bankieris
108d3d40c5 Added a version of almostRealPath that takes a const std::string& parameter so we don't have to use c_str() everywhere 2016-10-21 15:06:35 -05:00
Derek Bankieris
75c35752d6 Spacing 2016-10-21 15:05:26 -05:00
Alex Lin
a2452aacd0 ICG creates offsetof statements that will not compile when using clang #327
When copying inherited variables to a child class in ICG, the inherited flags
were not being set on the mac.
2016-10-21 13:13:43 -05:00
Alex Lin
f1cbacd646 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
This changes back the default behavior to not use offsetof in io_src code.
Added a flag to ICG, -c or --compat15, to globally generate offsetof statements.
Added an ENV variable that can be used to generate offsetof statements by file or directory.
Added in a warning if classes parsed at ICG time are different in size than at runtime.
2016-10-21 13:13:43 -05:00
Derek Bankieris
bcb421678a Fix spacing. Move declaration of loop variable into loop initializer. Rename stupid 1337 variable. 2016-10-21 10:49:11 -05:00
Derek Bankieris
2279ba8648 Restore print out when compiling io_* files #326 2016-10-21 09:20:50 -05:00
Derek Bankieris
4f49460a6f Clean up io_* code #330 2016-10-20 14:55:00 -05:00
Derek Bankieris
beb93f7e88 Removed useless local alias, eliminating the need to silence set but unused variable warnings #326 2016-10-20 14:55:00 -05:00
Derek Bankieris
2fb06cf133 Got rid of the individual io, py, and model conglomerate objects #326
Link all of the objects as part of the S_MAIN target using the link lists.
Renamed some variables and files to make them more self-descriptive.
2016-10-18 13:06:42 -05:00
Alex Lin
23af89681e ICG creates offsetof statements that will not compile when using clang #327
Added a check that was in 15 that tested the platform we are running on.  If we
are on an mac, we want to skip fully qualifying variable names because it creates
code that doesn't compile under clang.
2016-10-12 13:34:04 -05:00
Derek Bankieris
054245f968 Forgot to remove this debugging print out before the last commit 2016-10-06 14:28:06 -05:00
Derek Bankieris
f161ddb18c Made everything about Trick's build process better 2016-10-06 13:54:06 -05:00
Alex Lin
bbba26e057 Merge branch '17.0' 2016-09-16 09:50:12 -05:00
Alex Lin
00a0e8be44 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Missed some bitfield offset calculations.
2016-09-16 09:46:03 -05:00
Alex Lin
c134ffea8f Merge branch '17.0' 2016-09-16 08:43:47 -05:00
Alex Lin
ae07b26243 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Added back the code that set the offset of variables with the offsetof function. This
code is running by default.  Any code that includes #ifndef TRICK_ICG in
classes/structures will want this on.

Added a flag to ICG that allows us to turn off writing of these lines.  If the flag
is present, ICG may write out io_src code for private/protected variables that it could
not reach if an offsetof function was required.  Code cannot have any #ifndef TRICK_ICG
present in classes/structures for this to work.
2016-09-16 08:39:37 -05:00
Alex Lin
b2432fd269 Trickified Project Libraries #309
We were ignoring classes completely if it was found in to be in an external library
directory.  We need to partially process it so it is included in the ICG generated
class_map file which registers attributes of classes and eventually works it's way
to populating the S_sie file.
2016-09-15 14:48:23 -05:00
Alex Lin
9801e3d210 ICG not setting default checkpointing io correctly. #308
If a checkpoint_io field is found we were or'ing this in to bits already
set by default.  Clear the bits first.
2016-09-14 09:38:28 -05:00
Alex Lin
256c83a876 ICG not setting default checkpointing io correctly. #308
Changed the default io value from 3 which left out checkpointing to 15 which does
include checkpointing.
2016-09-13 16:37:59 -05:00
Alex Lin
919a8e2068 Variable using an enumeration as array index causes infinite loop #299
Once we determine the type of a variable we should stop processing the
AST tree at that point. We do this for record types but not for the
built in types.  Changed the return value of the process builtin
function to false so we stop processing.
2016-09-01 16:06:33 -05:00
Alex Lin
858602fe01 New STL framework doesn't support const #293
So using consts as arguments to STLs causes errors in our io code and SWIG.
Added a check for const template arguments and going to ignore them for
both ICG and what we input to SWIG.
2016-08-25 08:42:43 -05:00
Alex Lin
82049ead95 Add a printout when ICG parses header file with no Trick header comment #281
Added the printout.
2016-08-19 10:04:42 -05:00
Alex Lin
b26fcf2f3b Swap order of libraries during ICG linking. #277
Order swapped.
2016-08-03 09:03:41 -05:00
Alex Lin
89fda63293 Remove doxygen documentation now housed on wiki #189
moved all of the design documentation to the wiki
2016-08-02 17:50:49 -05:00
Alex Lin
ca02209d8f man pages completely out of date #253
Created man pages for each executable we have in bin.  Updated the
couple of man pages we did have in there.  Modified trick-CP
to accept arguments.  Updated the version number reported by ICG
as well.
2016-08-02 09:56:43 -05:00
Alex Lin
f7d1ff6376 ICG fails to compile on Mac when using clang/llvm 3.8.1. #271
Modified the makefile to define LIBCLANG_MAJOR, LIBCLANG_MINOR, and
LIBCLANG_PATCHLEVEL based on the llvm-config executable in the llvm
directory pointed to by the configuration.  These new variable names
are independent of the __clang_major__, etc. variables we were defining
only in Linux.  Using these names, we can reduce the clang version
checks to a single consistent set of version numbers.  We don't have
to deal with the different version numbers assigned by Apple.
2016-07-25 14:57:07 -05:00
Alex Lin
6e5beec9e1 Support clang releases that do not define a patchlevel.
Modified the makefile that creates the __clang_patchlevel__ define to
only create the variable if it is present in the clang version.

refs #266
2016-07-06 15:04:15 -05:00
Alex Lin
1731390c98 Switch compilation of ICG from clang++ to g++
Removed the lines that set the compiler to clang++, defaulting
it to g++.  Added lines in the makefile to set __clang_major__,
__clang_minor__, and __clang_patchlevel__.  These are required
to compile several of the files in the ICG directory.

refs #259
2016-06-29 17:33:04 -05:00
Alex Lin
1224c43e7f Set and use LD in our makefiles correctly.
Set LD in our makefiles to the ld executable found by configure.
Changed the final sim link to use TRICK_CPPC as the link command since
it was using the compiler anyways.  Changed the places where we use "ld" to
use LD.

refs #131
2016-06-27 12:48:35 -05:00
Alex Lin
fcb63e0e06 Output "--" if that was specified in the header file.
Used the mods field in the attributes to indicate of "--" was specified in the header file.  We
still save the units as "1" to keep it compatible with udunits.  When outputting the variable
in data recording or variable server we check to see if the mods field for "--" is set.  We
output "--" if the mods field is set.  Also allowed "--" to persist in data products.

refs #254
2016-06-21 16:12:28 -05:00
Alex Lin
c9e3bc77da er7_util header files not being installed
Added a makefile install rule to copy the header files out of
er7_utils to the install directory.  Adjusted ICG to ignore
Trick header files if they are installed.

refs #246
2016-06-20 13:40:45 -05:00
John M. Penn
af8548ce6a Exclude /sw (Fink directories from being processed by ICG. Refs#248 2016-06-10 14:52:19 -05:00
Alex Lin
1615e0f13b ICG should ignore FILE * variables
In ICG if we encounter a FILE * variable, we ignore it setting the IO specification to 0.

refs #244
2016-06-02 08:50:18 -05:00
Alex Lin
3e82f79f28 Use udunits package for units conversions.
FieldDescription.cpp is missing and include for stack.  Strange it compiles
on most platforms.

refs #231
2016-05-18 08:26:14 -05:00
Alex Lin
929372e863 Use udunits package for units conversions
Created a UDUNITS_LDFLAGS to store an link library path and -luduints2.

refs #231
2016-05-11 14:43:53 -05:00
Alex Lin
01fd86a513 Use udunits package for units conversions
Needed to add UDUNITS_INCLUDES to the ICG makefile and remove
the hardcoded udunits include path

refs #231
2016-05-11 11:27:39 -05:00
Alex Lin
26cb44e946 Use udunits package for units conversions
So our unit tests did their job, they pointed to quite a few errors.
Fixed them all on my platform (CentOS 7).

refs #231
2016-05-11 09:01:54 -05:00
Alex Lin
d72aa59fdd Use udunits package for units conversions
Converted data products to use udunits.

refs #231
2016-05-10 14:45:31 -05:00
Alex Lin
6defa99b34 Use udunits package for units conversions
Changed the include for udunits to #include <udunits2.h> to work
on all platforms.  Added the include directory /usr/include/udunits2
for Linux.

refs #231
2016-05-09 10:23:19 -05:00
Alex Lin
684f0e6bdc Use udunits package for units conversions
Initial checkin of using udunits for measurement units conversions.  Replaced
our conversion code in ICG and swig code to use udunits.

Also added code to convert unit symbols that we used in Trick that are different
names in udunits.

Added a sim_object that will eventually allow users to specify a custom
set of files to read units information.

refs #231
2016-05-05 14:49:49 -05:00
Alex Lin
9e743ffa92 Invoking trick-ICG without any arguments results in a Segmentation fault
ICG dies on a strdup if the the input file is empty.  Added a check for
an empty input file name.  We exit with an error message if there is
no input file given.

refs #229
2016-04-27 11:24:03 -05:00
Alex Lin
2381c487d1 Build fails on Ubuntu 16.04
clang changed a call in 3.8.0 from uppercase to lowercase.  I changed
pp.getBuiltinInfo().InitializeBuiltins to pp.getBuiltinInfo().initializeBuiltins

refs #174
2016-04-18 15:22:52 -05:00
Alex Lin
d6e01ee1c4 Ignore privacy
We need to exclude STL or other template io_src code being created with they use
a protected/private enumerations, just like classes.  Also remove a check for
a static bitfield, because you can't have a static bitfield.

refs #218
2016-04-15 15:01:14 -05:00
Alex Lin
3ae6fc50e1 Ignore privacy
I moved the item size into the attribute structure itself.  When moving this, I did not follow
what was written before.  The difference caused problems.  Fixed it so the size
written now matches what was written before.

refs #218
2016-04-14 09:22:23 -05:00
Alex Lin
54591ec005 Ignore privacy
Found some of those uncommon cases like inheriting from templates which contain
private embedded classes.

refs #218
2016-04-13 16:07:16 -05:00
Alex Lin
6ea18b425d Ignore privacy
Removed an #if 0 section of code.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
f63f44d876 Ignore privacy
Changed the storage of offsets from bytes to bits to better handle bitfields.
Added code to track classes that are defined within other classes and are
private/protected.  These classes cannot be used in templates because our
io_src code declares variables outside of the class that would try and use
these private/protected variables.  When a template is found to use a
private/protected class it is skipped.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
314e962edf Ignore privacy
Removed the requirement of passing flags throughout ICG indicating if we are
in an inherited class or not.  Removed the init_attr friends throughout
Trick core headers.
2016-04-13 16:07:15 -05:00
Alex Lin
34090169fb Ignore privacy
Adjusted code to ignore processing templates in files with ICG:(No).  This
was not being honoroed before.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
4dad11bf45 Ignore privacy
Moved field offset calculations for inherited classes to when the inherited
classes are processed.  This removes the need to have to remember if fields
were inherited or not, the offset already reflects the correct offset.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
7dcc65d0bd Ignore privacy
Mostly working.  This removes the use of offsetof from all I/O code.  This was
the only reason we needed friends.  In it's place we put the offset value that
clang has calculated for the field.  Still need to work on virtually inherited
classes and confirm bitfields.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
fb7432d096 Add direct STL checkpointing
Modified ICG to save the non-canonical name for STLs.  This is typically more readable
because it is shorter.  Added code to the variable server to filter out requests accessing
STLs, because those accesses will not currently work.

refs #206
2016-04-04 15:07:57 -05:00
Alex Lin
0b7e3e2dc9 STLs may be in std::__cxx11 namespace
When we parse header files and find std::basic_string we change that to std::string.
Added a check for std::__cxx11::basic_string to do the same.  We also carry a
list of STL names, added std::__cxx11::[template_name] to the list of possilbe STL
names we are searching for.

refs #214
2016-04-01 21:35:53 -04:00
Alex Lin
94febe62f2 Add direct STL checkpointing
Added the templates required for maps, multimaps, and pairs.

refs #206
2016-03-30 16:57:45 -05:00
Alex Lin
f7c74d7872 Add direct STL checkpointing
Removed saving the namespace of a variable it is in the std namespace.
Added a check for STLs residing in std::__1 as they do on Macs.

refs #206
2016-03-29 11:01:03 -05:00
Alex Lin
46aec08b80 Add direct STL checkpointing
Initial checkin of STL checkpointing.  This checkin only covers the sequential
STLs, vector, list, deque, set, and multiset.  This checkin does include the
changes in Trick header files to include/exclude our STLs properly to make a
restartable checkpoint.

refs #206
2016-03-29 09:26:49 -05:00
Alex Lin
7bbaac1223 ATTRIBUTES for a member whose type is a typedef of a template are wrong
Maybe this is the last time we visit this issue, probably not.  We were not
processing typedefs of templates correctly... I found a way to process
all templates whether they are the actual template, or a typedef of a template,
through the same code.  They were separate before.  Fixing this issue has
reduced the overall line count in FieldVisitor. That leads me to believe
we're on the right track.

refs #203
2016-03-21 15:18:53 -05:00
Alex Lin
683763680b ATTRIBUTES for a member whose type is typedef'd in a template are wrong
Forgot I was experimenting with a short name... undid that.

refs #200
2016-03-16 13:55:38 -05:00
Alex Lin
ce3ae67633 ATTRIBUTES for a member whose type is typedef'd in a template are wrong
I found that in ICG I have access to the canonical type of a variable which
in most cases is the type I should process.  Doing this eliminates the
need for some of the code that resolved typedefs because the canonical type
has already done that.

refs #200
2016-03-16 13:24:59 -05:00
Alex Lin
1754995396 ATTRIBUTES for classes with non-locally typedef'd members is wrong
Interesting case.  I found that we should process the canonical type names where
we were not before.  This resolves all typedefs and should be be more
accurate in the future.  When we process the canonical type we need to ignore
the processing of the non-canonical type.  We set a flag after
the canonical type is processed to ignore any type that is processed after.

refs #198
2016-03-10 10:42:59 -06:00
Alex Lin
6eef449a1c Don't process header files installed by Homebrew
Added /usr/local/Cellar to ICG's list of system header locations.

refs #181
2016-02-11 09:33:53 -06:00
Alex Lin
447585ad16 ICG processing files it is supposed to skip
We pull file names out of the clang infrastructure to match where
classes are defined.  We use the file name to pull comments and find
and process Trick header comments.  Up to now clang gave us the realpath
of files and when we looked up comments we already had the realpath and
everything worked.  In clang 3.6 in some places we are not getting the
realpath anymore which confuses ICG.  Added code to get the realpath of
any file name we use throughout the code.

refs #167
2016-02-04 15:43:14 -06:00
Alex Lin
71dab9ed45 Introduce Open Dynamics Engine examples
I want Trick to parse and understand ODE header files.  The ODE header files
include some typedef constructs ICG was skipping.  Added code to handle the
typedefs we did not handle before.  Also made a small change the way
TRICK_ICG_EXCLDUE and TRICK_EXCLUDE are used so that they support excluding
individual files as well as directories.
2016-01-29 09:27:41 -06:00
Alex Lin
a08b313457 configure script does not check for clang/llvm
Use the clang executable we find in the configure script for building ICG.

refs #130
2016-01-13 09:22:46 -06:00
Derek Bankieris
2f5c219f98 Add file name to error messages about invalid @trick_parse argument. 2015-10-21 11:23:02 -05:00
Alex Lin
952b899093 ICG doesn't handle inherited template classes correctly
When a template is in a namespace the type that is marked for the node containing
the full definition of the type is elaborated.  We need to go into
the elaborated name and get the underlying type.  Added code to do this
and tests to see if the type we are checking is itself a template or the
elaborated type is a template.  Sorry, this probably only makes sense to me.

refs #124
2015-09-18 13:18:05 -05:00
Alex Lin
57c76041f5 Get the value of a variable not parsed by SWIG in python
Wrote a python routine called get_value_by_ref_name that takes
a variable name string as an argument.  The string is passed to
ref_attributes to find the address and returns a REF2 structure.  The REF2
structure is passed to ref_to_value and the type and value of the variable
is returned in a structure.  We call vval_<type> to extract the raw value
from the structure and return that to python space.

Made a couple of other bug fixes in the FieldVisior and cpp input file
example found while investigating this issue.

refs #123
2015-09-18 09:03:24 -05:00
Alex Lin
94a99fb9ea Support new Trick comment tags
Changed parenthesis to curly brace... er I mean curly bracket.  Well too late, in
the code I called it curly brace. It's these "{}". Oh well.  Also found that the
dependency_only headers were not actually reading the dependencies.  Added the list
of dependency only files to the list of files to get dependencies from.

refs #114
2015-09-14 11:26:09 -05:00
Alex Lin
9b381f2edc Support new Trick comment tags
Added new doxygen style tags for truning on/off Trick attributes processing,
comment processing, and library dependencies.  Here are the tags we recognize

(@|\)trick_parse(everything|attributes|dependencies_only)
(@|\)trick_exclude_typename(class_name)
(@|\)trick_link_dependency(link_name)

refs #114
2015-09-10 14:50:22 -05:00
Alex Lin
f4e0ce32b0 Can't compile ICG with --std=c++11
Removed the --std=c++11 flag.

refs #94
2015-07-29 09:50:53 -05:00
Alex Lin
a5929dbe6c Move search for library dependencies to make_makefile
Moved the search for all library dependencies into make_makefile.
Made a couple of minor clean up edits as well.

refs #92
2015-07-24 16:16:22 -05:00
Alex Lin
fc9c604056 Split CP up into components that can be called individually
Renamed some output file to make it more obvious what produced them.

refs #86
2015-07-23 10:30:55 -05:00
Alex Lin
90c85c73fc Trick should not modify TRICK_CFLAGS and TRICK_CXXFLAGS
Created TRICK_SYSTEM_CFLAGS, TRICK_SYSTEM_CXXFLAGS, and TRICK_SYSTEM_SFLAGS
that Trick uses to add the Trick system includes, defines and other
compilation flags.  TRICK_CFLAGS and TRICK_CXXFLAGS are now in
full control of the user.

refs #90
2015-07-22 14:20:36 -05:00
Alex Lin
d744eba557 Split CP up into components that can be called individually
Added a new TRICK_EXT_LIB_DIRS variable that allows users to
tell Trick about external libraries, rather than trying to
use TRICK_EXCLUDE. Added back getting multiple library dependency
sections from source files.

refs #86
2015-07-22 10:54:00 -05:00
Alex Lin
d72555f3cc Split CP up into components that can be called individually
After about 6 unsuccessful builds I decided to run the unit tests
before checking in these files.  I fixed the integrator unit
test that was failing from a previous issue along with problems
with the sims.

refs #86
2015-07-21 15:10:40 -05:00
Alex Lin
63179b2fa3 Split CP up into components that can be called individually
Empty header files may need build directory created for lib_deps file.
Error message in make_makefile_src was not showing file name.

refs #86
2015-07-21 14:41:30 -05:00
Alex Lin
e438d83f2d Split CP up into components that can be called individually
Needed to add library dependencies from header files that don't have
classes/enums.  These files are the empty_io header files in ICG.

refs #86
2015-07-21 14:15:16 -05:00
Alex Lin
deac866379 Split CP up into components that can be called individually
Found some more dead code to delete.  Added a couple of progress
printouts.

refs #86
2015-07-21 09:55:53 -05:00
Alex Lin
d7b386227a Split CP up into components that can be called individually
Fixed some library dependency bugs.  JEOD test sims compile now.

refs #86
2015-07-21 08:52:00 -05:00
Alex Lin
dfa961808b Split CP up into components that can be called individually
First tests are working.  Changing a source file and header works
as before.  Adding library dependencies in either of these files
causes the makefile pieces to be redone.  Only tested in the ball
sim so far.

refs #86
2015-07-20 16:22:34 -05:00
Alex Lin
e1c1bbaccf Split CP up into components that can be called individually
Initial rough checkin that partially works for the ball sim.

refs #86
2015-07-16 15:36:36 -05:00
Alex Lin
b660aa371e Create a separate directory for simulation compiliation.
Made adjustments to accomodate differences in arguments to perform
partial linking on the Mac.

refs #80
2015-07-08 11:25:59 -05:00
Alex Lin
5848d80bc4 Create a separate directory for simulation compiliation.
Made some adjustments for sims larger than the ball sim.
Make some changes to handle library packages such as JEOD.  Also
removed some dead code.
2015-07-08 10:33:56 -05:00
Alex Lin
5a77824638 Create a separate directory for simulation compilation.
Functioning build directory on Linux.  Everything is going into the build directory.
All files for all steps use the full path.  this change removes the need for us to
call depend_objs to fix makefile dependencies.  Changed the makefile rules to use
more pattern rules reducing the size of make_makefile.pm and the makefile too.
Changed the output of make to show short commands for each compile line.  Setting
the variable TRICK_VERBOSE_BUILD in the environement, command line, or in S_overrides.mk
will change the output to the full printout.

refs #80
2015-07-07 14:42:58 -05:00
Alex Lin
469be90e32 Create a separate direcotry for simulation compilation.
Moved most generated files into the build directory.  All object code,
io_src realated files, and swig related files are now in build.

Realized that ICG should be creating the makefile for the io_src
code.  ICG knows which files it created.

refs #80
2015-07-02 10:09:31 -05:00
Alex Lin
cf3738d3fd Memory Manager tests trying to write io_src files in sim_services/include
Added 2 flags to trick-ICG. "-o" will specify an output directory.  Added this
option to the calls to trick-ICG for the Memory Manager tests.  Also added
a "-m" option to create the map files ICG creates for sims.  The memory manager
tests do not need these maps so we don't include the option.  Added the -m option
to the sim makefile and the master makefile so we do create the map when compile
Trick core and sims.

refs #72
2015-06-24 17:49:14 -05:00
Alex Lin
76756d450a Make Trick Mac Homebrew friendly
Copy and paste error of CXXFLAGS instead of CLANGLIBS.

refs #66
2015-06-17 10:32:20 -05:00
Alex Lin
80091454ce Make Trick Mac Homebrew friendly
Added /usr/local to the list of search directories in the configure script
for the motif header files.  Added -lc++abi to the list of link libraries.

refs #66
2015-06-17 09:00:18 -05:00
Alex Lin
3577e72bce trick-ICG fails when using clang < 3.4
The clang path created uses the patchlevel which prior to 3.4 was not used by
clang.  This resulted in a bad being created and eventually an llvm assertion
error.  Added a compiler ifdef so that the patchlevel is not used before 3.4

refs #65
2015-06-15 11:38:21 -05:00
Alex Lin
8193b5de7b Standardize directory names
Tried using clang/llvm from ubuntu distribution.  Needed to change the include directory for compiling ICG. Also found that
the clang include files can be in a linked directory.  Used realpath to make sure we have the absolute path.

refs #63
2015-06-12 16:59:00 -05:00
Alex Lin
eed8837478 Standardize directory names
RedHat systems use a libexec directory, MacOSX and Ubuntu use lib.  Changed our scripts and makefiles to handle both.

refs #63
2015-06-12 15:24:36 -05:00
Alex Lin
77510d0ccd Standardize directory names
Found that on the Mac ICG was ignoring all of header files comments in ${TRICK_HOME}/include because it had the relative directory "include" listed as a system path.  Comments were only processed if it wasn't in a system directory.  Changed the check to use our function that checks to see if a header is in user or Trick code, basically the same check, but it only uses full paths and doesn't get confused with "include".

refs #63
2015-06-10 14:19:00 -05:00
Alex Lin
ccbc52cdcc Standardize directory names
On some systems llvm-config includes -ledit as a system library to link with. Our application doesn't need -ledit and sometimes that library is not installed.  I filtered out that library in the makefile.

refs #63
2015-06-09 08:44:44 -05:00
Alex Lin
c5d0b2a872 /usr/lib64/llvm/clang/3.4.2 not found
Modified the makefile for ICG to be able to use clang from yum, fink, and manual installs.  Removed the requirement for copying the clang friendly header files into Trick.  However Trick will be expecting the clang header files to be in it's search path.

refs #40
2015-06-09 08:44:44 -05:00
Alex Lin
60e3983344 Standardize directory names
Moved the io_src code created by sim_services to sim_servivces/include.  Also found some makefiles that needed to be changed to refer to the makefiles in their new locations.

refs #63
2015-06-09 08:44:44 -05:00
Alex Lin
19025d77ad Standardize directory names
Reorganized.  Created a new top level include directory that will hold all of Trick's header files. Moved all of the Trick headers to this directory.  Created a libexec directory that holds all of the executables that users don't need to execute directly.  Changed all of the executables remaining in bin to start with "trick-".  In the sim_services directories changed all source files to find the Trick headers in their new location.  Since all of the include files are gone in sim_services, removed the src directories as well, moving all of the source files up a level.  Moved the makefiles, docs, man, and other architecture independent files into a top level share directory.  Renamed lib_${TRICK_HOST_CPU} to lib64 or lib depending on the platform we're currently on.

refs #63
2015-06-09 08:44:42 -05:00
Alex Lin
94b2a4eff0 Checkpoints cannot handle overloaded names
I think I ran into this before.  The offsetof calls that use
fully qualified fields in classes is not compilable using clang
on the Mac.  So I've decided to only conditionally compile this
code for non Apple platforms.  So this fix will work in Linux,
but not on Macs.  We'll have to revisit this and see if we
can make it work for both.

refers to #31
2015-03-25 17:15:42 -05:00
Alex Lin
3e0abdddc5 Checkpoints cannot handle overloaded names
When a field is processed in a class it is added to a list.  This list
will contain the fields from base classes the current class inherits
from.  We check the list of fields we inherited, if we find that the
current field overloads the name of an inherited field we adjust the
inherited field's name to be shown as the fully qualified name in io_src
code.

Fixes #31
2015-03-25 15:58:33 -05:00
Alex Lin
ea085eb9ee Fixes io_src code for typedef structures.
Found that my check for embedded classes was also catching some typedef structures.
This was causing some io_src code not to be generated.  Changed the test so that
we can differentiate between embedded classes and the typedefs.

This change fixes #10 and fixes #23.
2015-03-24 11:01:31 -05:00
Alex Lin
14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00
Alex Lin
aecc0504fa Changed the calling argument to setASTConsumer.
The calling argument to setASTConsumer changed between clang 3.5
and 3.6.  Changed the code to create a std::unique_ptr that the
call now requires and call setASTConsumer with the unique pointer.

Fixes #15
2015-02-10 18:47:17 -06:00
Alex Lin
f0c594f841 Initial commit of everything. 2015-02-26 09:02:31 -06:00