Commit Graph

182 Commits

Author SHA1 Message Date
Scott Fennell
d42f75c507
Merge pull request #640 from nasa/swig-flags
#618 add TRICK_SWIG_FLAGS, TRICK_SYSTEM_SWIG_FLAGS, TRICK_SWIG_CFLAGS, TRICK_SYSTEM_SWIG_CFLAGS...
2018-07-09 10:45:39 -05:00
Scott Fennell
bf7ce2db3c #618 revert/remove TRICK_SYSTEM_SWIG_FLAGS. Wiki and trickify.mk update still required 2018-06-29 11:06:50 -05:00
anon
ef634c9f48 #618 add TRICK_SWIG_FLAGS, TRICK_SYSTEM_SWIG_FLAGS, TRICK_SWIG_CFLAGS, TRICK_SYSTEM_SWIG_CFLAGS. *_FLAGS are swig options, *_CFLAGS are g++ compiler options for swig objects. TRICK_SYSTEM_* options should not be changed by trick users 2018-06-27 13:58:44 -05:00
Derek Bankieris
e14e6bc1ec Fix make_makefile_src on CentOS 6
Closes #632
2018-06-21 11:40:00 -05:00
Derek Bankieris
3172be86b1 Fix special treatment of "src" AGAIN
Great feature. Really, I love it.

Refs #627
2018-06-11 13:10:36 -05:00
Derek Bankieris
a0faa289df Restore support for "batch compiling"
In LIBRARY DEPENDENCIES, any file ending in ".a" will cause all
files in that directory and any contained "src" directory to be
compiled. What a terrible "feature".

Refs #627
2018-06-11 13:10:36 -05:00
Derek Bankieris
98b621fd6e In "src", look for makefile_overrides one level up
I don't like this "feature", but it's baggage we're stuck with for now.

Refs #626
2018-06-11 13:10:36 -05:00
Derek Bankieris
334273fa81 Make everything about make_makefile_src better
Fixes #626 #627
2018-06-11 13:10:36 -05:00
Derek Bankieris
ea0878af26 Fix "objects:" in makefile_overrides
Fixes #626
2018-06-11 13:10:36 -05:00
abrogley
1015f6ec90 Retry curl operations to avoid transient failures. (#622) 2018-05-30 16:29:57 -05:00
Derek Bankieris
b6f06e01c1 Ignore unordered_map in convert_swig
Fixes #620
2018-05-16 14:20:25 -05:00
Scott Fennell
ba2df0757e #604 #490 add java.se.ee to application at runtime. (#605) 2018-04-23 17:10:49 -05:00
Alex Lin
8938c3b7b2 Clang no longer supports -Wno-unused-but-set-variable #600
Removed the compile time flag.
2018-04-12 08:41:25 -05:00
Scott Fennell
86eb23c7de #521 added unit tests to build and 3rd party XML formatter that does not rely on ant 2018-03-14 10:29:44 -05:00
Alex Lin
8be09638e7 make_makefile_swig sometimes goes into infinite loop #561
Found a similar loop in make_makefile_src that can go into an infinite loop.
2018-02-09 10:14:49 -06:00
Alex Lin
3ac538775b make_makefile_swig sometimes goes into infinite loop #561
Added a check to see if array has elements before we shift an empty array.
2018-02-09 09:38:58 -06:00
Derek Bankieris
4b2f6e660f Support use of MAKEFILE_LIST in makefile_overrides
Refs #544
2018-02-07 09:11:24 -06:00
Derek Bankieris
58103ff889 Purge empty/whitespace before calling abs_path
Fixes #542
2018-01-11 13:54:38 -06:00
Alex Lin
c694700148 Add environment variable to ignore types from ICG processing #535
Added a new environment variable TRICK_ICG_IGNORE_TYPES.  Class/struct/enum
types found in this semicolon delimited list will not have attributes written
out.
2017-12-19 10:02:41 -06:00
Derek Bankieris
da7a79e897 Invoke qualified lookup of add_job in SimObjects
Fixes #532
2017-12-13 07:58:20 -06:00
Alex Lin
5285f1a72e Symbolic links rise again #530
Found more places where symbolic links cause havoc.  Also added back a #define
that was removed in parameter_types.h and added back the messaging routines to
the list swig processes.
2017-12-12 10:17:24 -06:00
Derek Bankieris
29bd27e931 Restore (module="sim_services") to Trick %imports
Fixes #510
2017-11-03 10:22:38 -05:00
Thadeus Fleming
143d0f2c41 Make object .d files order-only prerequisites
This will ensure objects are rebuilt only due to a missing dependency
file, not a newer one.

Fixes #501.
2017-11-02 12:34:48 -05:00
Thadeus Fleming
b3f03e3fc4 Improve handling of sim object member initializers
Rather than just searching for the first pair of curly braces to find a
sim object's constructor, parse any member initializer list that is
present. Fixes #443.
2017-10-16 15:22:19 -05:00
Alex Lin
de012dde71 Feature request: Support checkpointing and logging of std::array #480
Added std::array as an STL type Trick recognizes.  We can now create io code
that can save and restore std::arrays like std::vectors and other similar
types. Like other STL types, an std::array cannot be logged or viewed in
trick-tv.
2017-09-27 16:01:52 -05:00
Alex Lin
86007c70cd convert_swig mishandles struct templates #468
The new regular expression added a pair of parentheses without the "?:"
substring to ignore the match.  I added the "?:"
2017-08-21 14:07:31 -05:00
David Hammen
8a42a9adcd Fixes #468 2017-08-09 09:14:35 -05:00
Christopher LaChance
7ef539f331 Replaced smartmatch operator with string equality operation. 2017-08-01 15:33:23 -05:00
Derek Bankieris
0bb5995397 Standardize missing S_define include error message
trick_print is not flexible enough for the kind of formatting I want to
do, so I added a new function, trick_formatted_print, that takes
alternating control sequences and strings to allow any kind of
formatting in the console. Like trick_print, it also prints to a file
with the control sequences removed.

Refs #436
2017-05-24 13:10:21 -05:00
Derek Bankieris
56bdafc68b Correct file extension regex in make_makefile_swig
Refs #426
2017-05-23 10:43:54 -05:00
Derek Bankieris
e25a1b6a1f Skip unsupported extensions in make_makefile_swig
There were a lot of places we would need to perform this check,
so just remove them from the list of files to process from the start.
Remove dead code. Refactor.
Refs #426
2017-05-17 14:22:20 -05:00
Derek Bankieris
d417b1bdf1 Ignore unsupported extension in make_makefile_swig
Refs #426
2017-05-16 15:31:07 -05:00
Alex Lin
a11e51cce7 Sim build doesn't stop on error #421
When I added the "tee" commands to split off command outputs to
a file and the screen, I forgot that the exit status of the make commands
takes the exit status of "tee" which does not ususally have an error and
masks any error in the actual compilation.  I added an exit ${PIPESTATUS[0]}
which returns the exit status of the compilation.
2017-05-15 13:36:06 -05:00
Alex Lin
b2ebe157ed Lost the MAKE_out file when we updated simulation makefiles #412
Added echos to all compile commands to append to MAKE_out.  tee'd
the output of the compile command so that it will go to both the MAKE_out
file and the screen.
2017-04-18 10:26:58 -05:00
Derek Bankieris
3affc2080e convert_swig: don't skip EXT_LIB paths for %import
When converting #include to %import statements, we should only skip
paths on TRICK_EXCLUDE and TRICK_SWIG_EXCLUDE, not TRICK_EXT_LIB_DIRS.

Refs #392
2017-04-04 09:25:35 -05:00
Derek Bankieris
a749118ce7 Remove -I$(<D) from Makefile_src rules
Refs #408
2017-03-31 09:24:39 -05:00
Derek Bankieris
2db341cff8 Revert (almost all of) 2e4c3286
Sadly, we cannot yet require SWIG 2.0.

Refs #400
2017-03-28 15:59:08 -05:00
Derek Bankieris
b53c52ac33 Separate ICG & SWIG exclusion constructs
Refs #392
2017-03-27 15:19:43 -05:00
Derek Bankieris
73cbbd96cd Refactor ICG to report skipped files consistently
Refs #394
2017-03-15 15:53:56 -05:00
Derek Bankieris
2e4c3286a3 Automatically generate dependencies with SWIG
Like gcc, swig supports all those -M options. Use them to automatically
manage *_py.cpp dependencies.
Add dependency generation to trickify.mk as well.
2017-03-14 13:38:09 -05:00
Derek Bankieris
e39d57461c Remove unused variables in make_makefile_src
Refs #360
2017-03-14 08:45:41 -05:00
Alex Lin
7c78187abf Using ccache seems to work but prints warnings #390
Found a place in the makefile where TRICK_CC was not being set correctly.
Also found a case in gte.pm where we are not handling ccache properly.
2017-03-13 15:11:57 -05:00
Alex Lin
85f2435af7 S_overrides.mk is included twice when building #360
All .i files for SWIG must be created before SWIG is run.  Added an
order only rule to make sure this happens.
2017-02-28 14:15:34 -06:00
Derek Bankieris
9974e7698d Use -Wno-unused-parameter when compiling SWIG code
Refs #360
2017-02-27 08:56:09 -06:00
Derek Bankieris
ca4dce3582 Fix newline spacing & restore MODEL_OBJECTS header
Refs #360
2017-02-24 09:09:31 -06:00
Alex Lin
b2f8c9894e S_overrides.mk is included twice when building #360
Moving targets to the more correct makefile like defining S_MAIN should
be in make_makefile_src.  Moved the makefile_overrides rules read from
directories into their own makefile.
2017-02-24 08:44:34 -06:00
Derek Bankieris
738959eba1 Add missing prerequisites on dependency files
Refs #360
2017-02-23 16:02:32 -06:00
Alex Lin
31f0ea95ad S_overrides.mk is included twice when building #360
Moved some rules from trick-CP to convert_swig.  Using alternative pattern
rules in Makefile_src I believe is faster.
2017-02-23 14:05:38 -06:00
Derek Bankieris
e6ad95f493 Grand Make Dependency Graph, part 1
Refs #360
2017-02-23 13:26:28 -06:00
Alex Lin
02617bf7da S_overrides.mk is included twice when building #360
Changed some order only dependencies to actual dependencies.  Added a
check in make_makefile_src for new files that should trigger recreating
Makefile_src.
2017-02-22 08:44:12 -06:00
Alex Lin
337139cacb S_overrides.mk is included twice when building #360
A different approach.  Instead of trying to limit the number of times
S_overrides.mk is included, combine the makefiles so only one
call to make is made.
2017-02-09 09:46:58 -06:00
Derek Bankieris
29bdbee8fa Revert 150ea9f
We've agreed that the long-term solution is to refactor the makefiles so
we don't use recursive make. Until then, continue double including
S_overrides.mk so that the $(S_MAIN) target is available in
S_overrides.mk. Resolve #360 by having Trickified libraries use
target-specific variables (ironically, on $(S_MAIN)) to avoid
duplication of the -whole-archive option.
2017-02-06 15:25:18 -06:00
Derek Bankieris
4146b440b8 Make trick (Python package) a namespace package
Namespace packages are a mechanism for splitting a single Python
package across multiple directories on disk. With the addition of
$(TRICK_HOME)/pymods/trick, there now exists a package named 'trick' at
$(TRICK_HOME)/pymods and in each SIM_* directory. This change allows sims
to import modules from both locations.

Refs #365
2017-01-20 10:30:21 -06:00
Alex Lin
c796522d92 Check link dependencies against exclude flags #351
Added the directories in TRICK_EXT_LIB_DIRS to the directories in
TRICK_EXCLUDE to exclude all source files that are to be built
in libraries.
2017-01-12 14:33:39 -06:00
Alex Lin
0140b0b966 Add ability to use doxygen style library dependencies in S_define file. #373
Added a regular expression to collect the library dependencies in the S_define
file.
2017-01-10 08:09:19 -06:00
Derek Bankieris
7a08829d3d Introduce makefile variable TRICK_SYSTEM_LDFLAGS
Like other TRICK_SYSTEM variables, users should not modify this.

This renders TRICK_LDFLAGS and TRICK_USER_LINK_LIBS redundant. While we
would like to eventually remove TRICK_USER_LINK_LIBS, it's not likely to
ever actually happen.

Refs #369
2016-12-14 12:36:21 -06:00
Derek Bankieris
150ea9f094 Remove double include of S_overrides.mk
Refs #360
2016-12-07 14:19:52 -06:00
Derek Bankieris
c1af5ba0e2 Correct class declaration regex
The pattern looking for inheritance should be optional #332
2016-10-26 08:51:04 -05:00
Derek Bankieris
b9ede7432a Correct class declaration regex #332 2016-10-25 15:36:45 -05:00
Derek Bankieris
055a7337e4 Match entire class declaration at once
The previous commit fixed the original issue, but matched templated
classes incorrectly. This should handle all cases. #332
2016-10-25 12:51:51 -05:00
Derek Bankieris
73816bbd9a Corrected regex to match classes that don't inherit #332 2016-10-25 12:36:18 -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
f5e223cee9 Standardize output format #326 2016-10-21 10:06:23 -05:00
Derek Bankieris
dae2b0e1c3 Corrected SWIG ignore warning number #326 2016-10-19 14:48:28 -05:00
Derek Bankieris
4db4427f5d Ignore SWIG nested class warnings #326 2016-10-19 14:42:50 -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
Derek Bankieris
51c544a5d7 Replaced the per directory, per extension bookkeeping with pattern rules and a single list of model object files (#326).
Also, I went ahead and removed lex and yacc support since it didn't fit with the new approach and hasn't worked for over a year (#102).
2016-10-13 13:30:41 -05:00
Derek Bankieris
f3fc813234 Narrowed the scope of a static pattern rule 2016-10-12 13:57:43 -05:00
Derek Bankieris
4eafabe1f1 Fix support for source file extension .c++ #326 2016-10-12 13:55:51 -05:00
Derek Bankieris
86ee472a84 More build output format normalization #326 2016-10-12 10:52:31 -05:00
Derek Bankieris
efb20e7d5f Prepend the execution of S_MAIN with ./ #326 2016-10-11 13:25:07 -05:00
Derek Bankieris
abc7072918 Return the rediculous "feature" of automagically including -I$(PWD)/../include in the compiler flags 2016-10-06 15:37:43 -05:00
Derek Bankieris
47c8c2efb9 Removed dead code 2016-10-06 15:04:16 -05:00
Derek Bankieris
f161ddb18c Made everything about Trick's build process better 2016-10-06 13:54:06 -05:00
Alex Lin
2eadf217a9 c preprocessor statements don't work in Trick header blocks in header files #317
Copied the block of code that sends header file comments through the preprocessor from
15.x to trunk.  This block was left out and is now used by both headers and source files.
2016-09-26 08:35:26 -05:00
Derek Bankieris
ba59606b1d Added TRICK_PYTHON_PATH environment variable #313 2016-09-16 09:20:11 -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
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
ae9555b4a6 convert_swig puts double double quotes at end of full path includes
When extracting include files full path file names fall through all
of the logic that strips quotes off of the path.  This leads to double
double quotes in the output.  Added an else statement that catches
all other include files and strips the quotes off of pathnames.

refs #267
2016-07-07 13:41:54 -05:00
Alex Lin
4ab584ed55 Support using Python 3
Fixed the configure script to allow the user to specify using a python3
interpreter.  Had to change the the way to load the swig generated python modules.
Also had to change code dealing with python strings, oct, long, and
boolean operations.

refs #258
2016-06-28 13:44:21 -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
Derek Bankieris
14d4c94b2e refs #256 Pass -Djava.net.preferIPv4Stack=true when launching Java GUIs to eliminate socket error. 2016-06-22 12:33:29 -05:00
Alex Lin
fb4601734f Need to include SimTime.hh for ICG and swig processing.
Added the sim time header files to files_to_ICG.hh and sim_services.i so it will be processed.

refs #247
2016-06-15 16:11:09 -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
fb8a5f1d1d Perl warning about unescaped left curly bracket
Found the unescaped "{" and put a blashslash in front of them.

refs #213
2016-04-01 21:30:50 -04:00
Alex Lin
b5b6dbe0bb Compiling with gcc 4.9 sometimes requires cstddef
It's the generated swig code that is missing cstddef.  Added some
includes to get cstdef in the swig code.

refs #212
2016-04-01 17:05:24 -05:00
Alex Lin
c57c10edcd Add direct STL checkpointing
Made adjustments to template default arguments to avoid clang compiler
errors.  Also added an irnore warning during python glue code compilation

refs #206
2016-03-29 09:59:49 -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
2ca4b72cee Trick model files found in external libraries are not being included correctly
Found that the list of swig files we should expect from external libraries
was incorrectly cleared before it was being used.  This still allows the
sim to compile, but no information about the models in the library are
available in the input file.

refs #179
2016-02-09 11:13:09 -06:00
Alex Lin
2b30a92342 Trick parsing comments improperly
When I split the comment remover into 2 regular expressions I reversed
the order removing C style comments before c++.  This caused this error
where a /* in a C++ comment made Trick look for the end of the C style
comment and it may never find the end.

refs #178
2016-02-05 11:19:53 -06:00
Alex Lin
8529bd8648 make_makefile_swig writing duplicate rules
Used a hash instead of an array to store the names of files that
we need to process.  This eliminates duplicates.

refs #175
2016-02-04 15:48:29 -06:00
Alex Lin
fa29891ded Introduce Open Dynamics Engine examples
Changed the regular expressions that removes comments in convert_swig to
try and handle C style comments found in multiline #define statements.

Also added a TRICK_ICG_NOCOMMENT line to SIM_ode to stop ICG from
trying to process non-Trick comments in the ODE directory.

refs #172
2016-01-29 09:43:43 -06:00
Alex Lin
bc9ef8c54b Library dependencies with full path not found
When I merged the sections of code that look for library dependencies I left out
the section that searches for dependencies that have a full path.  I added
that back in.

refs #170
2016-01-26 15:25:26 -06:00
Alex Lin
63f193441c typedef of const structures not understood by SWIG
I kind of took the easy way out on this one, I remove any
structure definitions that matches the pattern
typedef const struct A {...} constA ; out of out of
convert_swig before they get to SWIG.

refs #169
2016-01-26 15:23:08 -06:00
Alex Lin
9daa108950 Bad permissions on files copied to the SIM directory
Changed the commands to force the copy files in the the SIM directory
from "cp" to "cp -f".   Added a rule in Makefile.sim to properly
call the configuration processor if the build directory is missing.
Also added a loop to filter the files found to be in an external
library.  Those files need to be tested to see if they include ICG: (No)

refs #156
2015-12-15 15:05:13 -06:00
Alex Lin
8b6a4efbad library dependencies are lost
Removed a double dot ".." I introduced into file names.
2015-09-29 09:27:11 -05:00
Alex Lin
ffe32e3c99 makefile has multiple rules to create directory
If a directory has more than one language the rule to create the object
directory is written twice.  Added a check to see if we've written
the rule for each object code directory, if we have already written
the rule then don't write it again.

refs #127
2015-09-24 13:58:21 -05:00
Alex Lin
a1bf1c31d4 convert_swig does not find header file correctly if there is a comment on the same line
Added a line to remove trailing spaces after removing the quotes and comments from
included files.

refs #129
2015-09-24 09:28:36 -05:00
Alex Lin
f5b30a4841 library dependencies are lost
Fixed the problem where library dependencies for header and source files are
saved to the same file and half are lost.  Did this by not removing the
suffix when creating the library dependency file name.

refs #128
2015-09-24 09:25:16 -05:00
Alex Lin
cab267c6c4 parse_s_define does not handle comments on a class definition line
Added a regular expression to remove all comments from class defnition lines.

refs #126
2015-09-22 09:17:36 -05:00