hexagon logo

Anyone using the new Python modul Adams on Linux ?

... coz I'm getting this when trying to load it in a Linux shell with v2017.2:
 
mdi2017.2 -c python
 Python 2.7.11 (default, Jan 21 2016, 08:37:23)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adams
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/scratch/builds/adams-ADAMS2017.1/obj/prod/release/python/linux64/lib/python2.7/site-packages//mdi/adamspy/Adams.py", line 8, in <module>
 File "/scratch/builds/adams-ADAMS2017.1/obj/prod/release/python/linux64/lib/python2.7/site-packages//mdi/adamspy/Libraries.py", line 22, in <module>
 File "/appl/mdi/2017.2_RH6/python/linux64/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
   return self._dlltype(name)
 File "/appl/mdi/2017.2_RH6/python/linux64/lib/python2.7/ctypes/__init__.py", line 365, in __init__
   self._handle = _dlopen(self._name, mode)
OSError: /appl/mdi/2017.2_RH6/linux64/libamd.so: undefined symbol: file_vi_edit
>>> dir(Adams)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
NameError: name 'Adams' is not defined
 
 
Funnily opening A/Car, using the command window, switching to py and typing "import Adams" worked fine.
 
 
Parents
  • In the past I was using mdi -c python to test stuff locally.
    As I didn't recall having errors, I assumed import aview_main should have worked somehow.
     
    But as I tested it with 2014.0.1 and 2015.1.2, I found Kent is right: It's not working to simply enter "import aview_main".
     
    Seems I had something like this in the code I tested at that time:
    if __name__ != '__main__':
      import aview_main
    else:
      class aview_main:
         def evaluate_exp(exp): print exp; return exp
         def execute_cmd (cmd): print cmd
         evaluate_exp = staticmethod(evaluate_exp)
         execute_cmd = staticmethod(execute_cmd)
     
    Anyway: There are cases where we'd want to run it that way.
    So what about starting the AMD in background without a GUI to make "import Adams" work ?
    In the old C-SDK you did quite exactly the same (i.e. C program could be started standalone and inside the code you could build an ADAMS model and run it)
Reply
  • In the past I was using mdi -c python to test stuff locally.
    As I didn't recall having errors, I assumed import aview_main should have worked somehow.
     
    But as I tested it with 2014.0.1 and 2015.1.2, I found Kent is right: It's not working to simply enter "import aview_main".
     
    Seems I had something like this in the code I tested at that time:
    if __name__ != '__main__':
      import aview_main
    else:
      class aview_main:
         def evaluate_exp(exp): print exp; return exp
         def execute_cmd (cmd): print cmd
         evaluate_exp = staticmethod(evaluate_exp)
         execute_cmd = staticmethod(execute_cmd)
     
    Anyway: There are cases where we'd want to run it that way.
    So what about starting the AMD in background without a GUI to make "import Adams" work ?
    In the old C-SDK you did quite exactly the same (i.e. C program could be started standalone and inside the code you could build an ADAMS model and run it)
Children
No Data