nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
26 stars 14 forks source link

Can't compile sims after Trick update with "write template directive before template instance (#1679)" pull request #1697

Closed dandexter closed 2 months ago

dandexter commented 2 months ago

The latest Trick with the pull request "write template directive before template instance (#1679)" results in swig file errors and now I can't compile any of my simulations.

For example, when I compile the TrickHLA/sims/SpaceFOM/SIM_sine simulation I get this error:

build/Users/ddexter/projects/TrickHLA/include/TrickHLA/Object_py.i:21: Error: Missing #endif for conditional starting here
build/Users/ddexter/projects/TrickHLA/include/TrickHLA/Interaction_py.i:20: Error: Missing #endif for conditional starting here
build/Users/ddexter/projects/TrickHLA/include/TrickHLA/Object_py.i:21: Error: Missing #endif for conditional starting here
make: *** [build/Users/ddexter/projects/TrickHLA/include/SpaceFOM/ExecutionControl_py.cpp] Error 1
make: *** Waiting for unfinished jobs....
make: *** [build/Users/ddexter/projects/TrickHLA/include/SpaceFOM/ExecutionConfiguration_py.cpp] Error 1
make: *** wait: No child processes.  Stop.

The Object_py.i file generated with Trick with the pull request is missing the following few lines for the Attribute class (diff Object_py.i. PR1679_Object_py.i):

< namespace TrickHLA{
< 
< class Attribute;
< } 
< #endif 
< 

Object_py.i code segment from Trick that does compile the simulation.

#ifdef SWIG
%import "build/Users/ddexter/projects/TrickHLA/include/TrickHLA/Attribute_py.i"
#else
namespace TrickHLA{

class Attribute;
} 
#endif

namespace TrickHLA{

class Manager;
class Federate;
class Conditional;
class Packing;
class OwnershipHandler;
class ObjectDeleted;
class LagCompensation;

Object_py.i code segment from Trick with Pull Request 1679 that does Not compile the simulation. It is missing the "class Attribute" section.

#ifdef SWIG
%import "build/Users/ddexter/projects/TrickHLA/include/TrickHLA/Attribute_py.i"
#else
namespace TrickHLA{

class Manager;
class Federate;
class Conditional;
class Packing;
class OwnershipHandler;
class ObjectDeleted;
class LagCompensation;

I am using this swig version:

% swig -version

SWIG Version 4.2.1

Compiled with clang++ [x86_64-apple-darwin22.6.0]

Configured options: +pcre
hchen99 commented 2 months ago

Please try PR#1696 to see if your problem is fixed

dandexter commented 2 months ago

I ended up having to clone the repo pointed to in PR#1696 and I was able to compile my simulations using it. However, I don't think this is a valid test unless PR#1696 is based off the latest Trick master branch and included the code from PR#1679 that is causing the issue.

What is the git command to merge the pull request against my clone of the Trick master branch?

hchen99 commented 2 months ago

PR#1696 does include the code from PR#1679. PR#1696 only does't have is a minor documentation update comparing with the master. Any PR#1696 was really for fixing a typo in PR#1679

dandexter commented 2 months ago

That's good news then and it appears PR#1696 fixed the issue I was seeing.

hchen99 commented 2 months ago

Thanks for confirming.

sharmeye commented 2 months ago

These changes have been merged into master, so please confirm that the issue is resolved in the latest master commit.

dandexter commented 2 months ago

That fixed it. Thanks.