nasa / trick

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

Runtime Errors & Swig Help #1178

Open WillFife opened 3 years ago

WillFife commented 3 years ago

So I have two errors and one question, Ill start with the question:

  1. The latest version of Trick (21 I believe) – does it require a sudo make install after running make when installing Trick? The past versions did but its not on the install guide

My errors:

  1. In order to access the swigged sim objects, I have to first do something like
    import trick
    dynamics = trick.top.dynamics
    vehicle = trick.top.vehicle

This is a manual override to access the top.py file in the zipped trick folder (which is a build artifact)

My setup: macOS Big Sur (llvm=11.0), Trick 21, Trick is using python3

  1. When my sim starts to run, it breaks immediately and I get hit with a
    $ ./S_main_Darwin_20.exe RUN_LLO/input.py
    Process terminated by signal SIGSEGV
    Attempting to generate stack trace... standby.
    (lldb) process attach --pid 13317
spfennell commented 3 years ago

Trick's current master version is 19.4-beta. The latest release is 19.3.0.

Installing Trick has always been optional. Install moves Tricks bin, include, share, and libexec files into your system directories so that it is available systemwide and automatically gets added to your PATH. Personally, I prefer to leave Trick in my user home directory and just add trick/bin to my PATH so that I can access the binaries without the full paths.

Installed versions of trick need to be uninstalled before using a new version of Trick. It is possible that this may be causing some of your bugs if you installed an old version. Go into the trick directory and 'make uninstall'. Then reinstall if you like.

For your sim, make sure that you 'make clean' before calling trick-CP. Also, if there is a 'trick' directory, make sure to remove that before building.

Also, I saw you edited your message and removed it, but I do not believe JEOD is compatible with the latest version of Trick. Contact the JEOD team for more details.

If the problems still persist, please let me know.

spfennell commented 3 years ago

As an additional troubleshooting step, build a small example sim and see if you can access the sim objects from the input file without using 'trick.top'. You can use a sim from the trick_sims directory, or my starter sim here: https://github.com/spfennell/SIM_starter

WillFife commented 3 years ago

@spfennell Thank you for the thorough response. Is the 17 branch the Trick 17 release? And if so, are there any other required dependencies (and their versions) that differ from Trick 19? There isn't a docs folder in the 17 branch

spfennell commented 3 years ago

You will very likely need an older version of llvm if you are on big sur, try llvm 6. Everything else should work the same I think.

Getting older versions of trick to work on new versions of mac is very tricky. I can say that JEOD 4.0 supposedly works with trick 19 if you can get your hands on that, but those efforts are ongoing.

spfennell commented 3 years ago

The fastest way for you to get your sim running is probably to virtualize or containerize the environment it was developed on. Find out what OS, version of trick, and dependencies were used during development and then get that going in VirtualBox or Docker

spfennell commented 3 years ago

I'm going to try to address this compatibility issue, you can follow it here:

https://github.com/nasa/trick/issues/1179

WillFife commented 3 years ago

@spfennell I think I got closer by using llvm7 (llvm6 was not available via homebrew)

Now, when building the sim (running trick-CP) it gets to the verrrrry end then hits me with an error related to the udunits package

Compiling  build/Users/williamfife/Projects/phd/packages/trick/trick_sims/SIM_lander/S_source_py.cpp
Compiling  build/usr/local/include/converter_py.cpp
Compiling  build/usr/local/include/udunits2_py.cpp
Compiling  build/top.cpp
build/usr/local/include/udunits2_py.cpp:6997:12: error: array type 'va_list' (aka '__builtin_va_list') is not assignable
      arg2 = *temp;
      ~~~~ ^
build/usr/local/include/udunits2_py.cpp:6998:32: warning: 'delete' applied to a pointer-to-array type 'va_list *' (aka '__builtin_va_list *') treated as 'delete[]'
      if (SWIG_IsNewObj(res2)) delete temp;
                               ^      ~~~~
                                     []
build/usr/local/include/udunits2_py.cpp:7052:12: error: array type 'va_list' (aka '__builtin_va_list') is not assignable
      arg2 = *temp;
      ~~~~ ^
build/usr/local/include/udunits2_py.cpp:7053:32: warning: 'delete' applied to a pointer-to-array type 'va_list *' (aka '__builtin_va_list *') treated as 'delete[]'
      if (SWIG_IsNewObj(res2)) delete temp;
                               ^      ~~~~
                                     []
2 warnings and 2 errors generated.
make: *** [build/usr/local/include/udunits2_py.o] Error 1
make: *** Waiting for unfinished jobs....

Have you seen this?

WillFife commented 3 years ago

When I say "I think I got closer" I say that because, before using llvm7, I would get a BUNCH of errors related to clang on the Trick build stage that were just bypassed. With llvm7 & Trick 17 I don't get those