Commit Graph

213 Commits

Author SHA1 Message Date
Hong Chen
5a5379b975
Added _swig_setattr_nondynamic_instance_variable function call back for struct and moved it to right after struct declaration instead of at the end of the swig interface file. (#1795) 2024-10-15 10:41:17 -05:00
Pherring04
a9aa7088ad
SWIG 4 Template Directive Changes (#1741)
* Updated convert_swig to account for template directive changes in SWIG 4

* Fixed merge issues

* Merge cleanup
2024-07-23 11:45:37 -05:00
Pherring04
7b4253d703
Added swig support for templates with array parameters (#1742)
* Added support for templates with array parameters

* Added test case for array templates
2024-07-16 10:44:04 -05:00
Keith Vetter
f2e93ac490
Fix for assigning to non-existent variables (#1708) (#1718)
* Fix for assigning to non-existent variables (#1708)

This fix modifies Trick's convert_swig script.  It
adds a directive to not accept dynamic attributes.
The directive will ensure that modelers do not
assign to non-existent parameter in their input files.

The prior fix (issues #1288 and/or #1603) did not
cover C structures, so this commit is really an
addendum to that fix.  With this commit, the convert_swig
script will generate a non-dynamic directive foreach
class and structure.

This fix also stops generating swig interface code
for typedef structure definitions since swig only
produces an interface to the actual typedef name.
For example, with this typedef:

typedef struct StructureName {
   double  main_engine_thrust;  /* N Thrust of main engine */
   struct StructureName* next;  /* ** Next pointer */
} TypeDefName;

swig creates an interface for "TypeDefName", and not
"StructureName", so there is no need for Trick to
produce anything in regards "StructureName".

* Fix for issue with classes defined in ifndef SWIG block

convert_swig takes in the raw header and does no preprocessing,
so blocks of c/c++ header code which are meant to be skipped
by Swig are processed by convert_swig.  This causes an issue
with the generated python code that try to access classes
that are ifndef SWIGed out.

To fix this, check for class existence in the generated python
code e.g:

if 'MomMom' in globals():
    MomMom.__setattr__ = _swig_setattr_nondynamic_instance_variable(object.__setattr__)

* Fix for assignment to swig_double and swig_int primitives

The previous commit(s) on this branch fixed bad assignments
like (misspell position an attribute of BSTATE_IN):
ball.state.input.positiaaaan = 4.0

This commit fixes bad assignments to leaf/primitive attributes
like (try to add attribute to primitive/leaf double type):

ball.state.input.position.fred = 4.0

* Moved _swig_setattr_nondynamic_instance_variable to right after each class in process_class and removed duplicate _swig_setattr_nondynamic_instance_variable blocks for classes that are not in a namespace.

* Add the call for __setattr__ for class templates.

---------

Co-authored-by: Hong Chen <hong.chen-1@nasa.gov>
2024-07-16 10:34:02 -05:00
Thomas Brain
873e4e203d
Fix bug dereferencing namespaces in convert_swig (#1696) 2024-04-23 10:49:39 -05:00
Thomas Brain
f8a079ec71
write template directive before template instance (#1679)
* Rework swig template declarations to be written before used in the containing class so that private methods are honored

* Fix SIM_test_ip for swig 4.2.0 and implemented review suggestions

* Additional review comment fixes

---------

Co-authored-by: Thomas Brain <thomas.a.brain@nasa.gov>
2024-04-18 13:47:06 -05:00
Hong Chen
72e82e1566
1652 add trickified to default sie generation (#1680)
* Add trickeifed classes.resource to sie generation after cp.

* Go through all trickified classes.resource files if available and don't die on any if not found.
2024-03-27 15:29:01 -05:00
Hong Chen
079a4d2aff
Add trickeifed classes.resource to sie generation after cp. (#1674) 2024-03-26 11:23:03 -05:00
Alex Lin
1b86331577 Trick Fails to Compile Sims with enum classes #1611
convert_swig did not previously understand the "enum class".  Made a regular
expression to catch it.  We don't have to do anything special with it for
convert_swig, the matched contents are written to the output file as is.
2023-11-08 10:37:23 -06:00
Alex Lin
763b52fd10
AttributeError not being raised in SWIG 4 when making an improper assignment in input processor #1288 (#1603)
In convert_swig added a line to override the __setattr__ function. This makes
the new SWIG behave like older SWIG versions. the _swig_setattr_nondynamic_instance_variable
function is provided by SWIG and is similar to what our version of _swig_setattr_nondynamic
above is. If later we need to override _swig_setattr_nondynamic_instance_variable it can
be done the same way as before.
2023-10-31 10:13:27 -05:00
Jacqueline Deans
2e0e580c98
Add make spotless target to get rid of config info, patch together various other spots missed by clean (#1515) 2023-06-13 09:50:19 -05:00
Jacqueline Deans
02a1f95121
Allow integ_loop, logging, data_record to be reordered (#1472) 2023-03-10 10:20:33 -06:00
Jacqueline Deans
19016b4817
job_class_order no longer accidentally disables some system job classes (#1465) 2023-03-07 08:43:39 -06:00
Jacqueline Deans
8821bac18a
Handle empty PYTHON_MODULE in header comment (#1432) 2023-01-23 08:50:13 -06:00
Alex Lin
496de8c7a9
Disambiguate python use #1250 (#1251)
* Disambiguate python use #1250

Changed all calls to /usr/bin/python to /usr/bin/env python3.  Removed execute permissions on a lot of files that are not executable.

closes #1250
2022-03-22 15:15:40 -05:00
Scott Fennell
64725f8f1c
add workaround for legacy code (bsaf) on modern mac with java 17 (#1211) 2022-01-06 16:28:07 -06:00
Scott Fennell
d6bdd35f5e
separate perl generated top level objects from icg generated class information #1127 (#1161)
closes #1127 
Co-authored-by: Fennell, Scott P 263712616 <scott.p.fennell@nasa.gov>
2021-06-14 13:50:32 -05:00
Derek Bankieris
9b7e18af15 Create link_list files for Trickification
ICG and make_makefile_swig create py_link_list and io_link_list files
listing the files to be linked during sim builds. Trickified projects
require slightly altered lists.

Fixes #1155
2021-06-02 13:56:21 -05:00
Derek Bankieris
2c06ae6eaf Rename SIM_*/trick to SIM_*/.trick
Hide the non-zipped Python modules to indicate to users that changing
them will have no effect on the sim.

Refs #1144
2021-05-19 17:33:13 -05:00
Derek Bankieris
8d314fa1b1 Zip SWIG-generated python modules
Closes #1144
2021-05-19 17:23:33 -05:00
Scott Fennell
540eebe368
#1098 fix instantiation perl bug in sie_concat (#1100)
Co-authored-by: Fennell, Scott P 263712616 <scott.p.fennell@nasa.gov>
2021-01-27 17:05:28 -06:00
Scott Fennell
7277b16017
#1063 move sim service xml file (#1069)
Co-authored-by: Fennell, Scott P 263712616 <scott.p.fennell@nasa.gov>
2020-10-23 15:45:32 -05:00
Derek Bankieris
1e8228e344 Use -isystem for Trick and Python headers
Closes #1067
2020-10-23 08:28:01 -05:00
Scott Fennell
5bb32279b5
1053, 1009, 1054 cmake update (#1055)
* #1053 #1009 cmake configure correct clang libs

* #1054 fix sie-rework to be compatible with CMake build

closes #1053  closes #1009  closes #1054
2020-09-13 18:38:35 -05:00
Scott Fennell
f825dc00fc
Merge test branch into master (#1047)
* #1041 filter -W workaround for ICG linking to LLVM 10 libclang-cpp.so (#1044)

* 1043 drg checkpoint memory leak (#1045)

* #1043 drg fix drg checkpoint memory leak

* 947 sie generation rework (#1046)

generate  S_sie.resource at during build instead of runtime
2020-09-01 15:55:19 -05:00
Keith Vetter
cef656e80b
Fix TRICK_HOST_CPU gcc version for Ubuntu 18.04+ (#1024) (#1026)
In later versions of gcc, gcc -dumpversion only shows the major version. You have to use gcc -dumpfullversion instead. This was first seen from a Trick user who is running on Ubuntu 18.04.
2020-08-16 18:46:17 -05:00
Derek Bankieris
ab2cfe1a34 Silence SWIG warning 315
Nothing known about identifier

Closes #1025
2020-08-11 14:34:54 -05:00
Scott Fennell
3615fa47b5
Iss #1012 (#1013)
* add -Wno-maybe-initialized GCC flag to makefile_swig closes #1012

* install diffutils on centos 8 image
2020-06-30 14:13:43 -05:00
Derek Bankieris
023b626fc4 Fully qualify TRICK_SWIG_TEMPLATE identifiers
Closes #1003
2020-06-03 11:18:25 -05:00
Derek Bankieris
0a5a202053 Fix template regex in convert_swig
Fixes #999
2020-05-15 15:12:17 -05:00
Scott Fennell
3587c0419c #951 fix macOS dock icon 2020-02-12 15:46:55 -06:00
Scott Fennell
4f5ce7e4a1
Maven, offline mode, and --enable-mongoose (#939)
closes #938 
closes #941 
closes #943
2020-02-05 14:31:58 -06:00
Scott Fennell
909d8991f1
#926 https instead of http for java downloads (#927)
closes #926
2020-01-15 12:01:56 -06:00
Derek Bankieris
5a7ec20606 Support default member initializer for templates
Closes #918
2019-12-11 14:19:10 -06:00
Alex Lin
ce0cdc9636
Cmake merge (#901)
* Merging changes from cmake branch to master

* Fixing includes for renamed header files

* still need build rule

* Adding warning for swig code for gcc8+

* Adding CMakeLists.txt for data products

* Cmake merge #901

Making adjustments to get cmake working on the Mac (Mojave)

* Cmake merge #901

Changing string append to list append
2019-11-19 09:01:16 -06:00
Scott Fennell
29e047f7a7 remove dependency on JUnitXMLFormatter 2019-11-12 08:47:16 -06:00
Derek Bankieris
af0520d604 Download JARs in parallel
The reason for .NOTPARALLEL was to prevent mixing of the download
progress messages, so use the -s and -S curl options to silence output,
except for errors.
2019-10-31 12:27:29 -05:00
Alex Lin
34833be0de
configure script fails in RHEL/CentOS 8 #887 (#888)
If we can't find python in the configure script then search for
python3.  If python3 is found use python3-config to get the
include directories and libraries.  Call python scripts using the
PYTHON environment variable.
2019-10-21 13:29:26 -05:00
Derek Bankieris
1f33406c95 Don't trace TRICK_EXT_LIB_DIRS lib deps in CP
Refs #871
2019-10-07 14:12:06 -05:00
Derek Bankieris
2d88126639 Fix VERBOSE=1 in verbose_build.pm
How I hate you, Perl.

Fixes #873
2019-09-27 15:58:56 -05:00
Derek Bankieris
894c531541 Skip paths in TRICK_EXT_LIB_DIRS in get_lib_deps
Closes #871
2019-09-27 10:42:03 -05:00
Alex Lin
f117839d2f Add support for Mac's removal of /usr/include #810
Add line to ignore all files from /usr/local/include explicitly while
creating makefile for swig processing.
2019-07-10 08:27:13 -05:00
Scott Fennell
82bae3b0d0 #836 remove all S_default.dat stuff 2019-07-09 15:58:26 -05:00
Derek Bankieris
67decaed24 Add support for -isystem
Closes #407
2019-06-20 10:12:33 -05:00
Derek Bankieris
6c9326f760 Add makefile function for target-specific variable
Closes #672
2019-06-19 15:57:26 -05:00
dbankieris
053bcfe0b2
Merge pull request #825 from nasa/824
Fix TRICK_VER in make_makefile_swig
2019-06-19 15:32:19 -05:00
Alex Lin
b778e16bc1 Deprecate TRICK_CPPC in trick-gte #826
Added a new hash of deprecated values into trick-gte.  If a deprecated
value is requested, a warning message is printed with the value.  If
all of the values are printed, the deprecated values are printed in
their own section.
2019-06-19 13:55:45 -05:00
Derek Bankieris
6bb061738e Fix TRICK_VER in make_makefile_swig
Fixes #824
2019-06-19 13:32:52 -05:00
Alex Lin
04d50df7cd
TRICK_HOST_CPU incorrect with gcc 7 #598 (#816)
Changed the regular expression that grabs the gcc version to accept
either 1 digit or 2.
2019-06-18 11:00:21 -05:00
Alex Lin
497f11f132
Make TRICK_CXX variable to specify c++ compiler #767 (#815)
Changed all references of TRICK_CPPC to TRICK_CXX.  Added a
warning message that TRICK_CPPC has been deprecated.
2019-06-18 11:00:08 -05:00