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.
 
 
  • I was trying it. Same results as you:
     
    Python 2.7.11 (default, Jan 21 2016, 09:09: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>
    ImportError: No module named adams
    >>> 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 "/msc/Adams/2017_2/python/linux64/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
       return self._dlltype(name)
     File "/msc/Adams/2017_2/python/linux64/lib/python2.7/ctypes/__init__.py", line 365, in __init__
       self._handle = _dlopen(self._name, mode)
    OSError: /msc/Adams/2017_2/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
     
     
  • Meanwhile MSC confirmed it's not working and they've created the product defect ADMS-43687 Error on loading Adams module in Python shell on RH6 .
     
    But instead of admitting it was a bug the official MSC answer was: "Is not supported in Adams as of now. This could be supported an future version of Adams."
     
    Well it was working in former versions, so why could anyone have the crazy thought it automatically would be required in future versions ? (<- please note the slight trace of irony in this statement)
  • Hmm, it COULD be supported in the future? I guess they don't want to over-commit to such a drastic "enhancement" :P
  • @Martin Kieltsch​, can you tell me in which version, it was working? i was trying on windows several versions, but no luck. thanks
  • Hi All,
    This never 'worked'. Here's why:
    • the 'Adams' module is *new* in v2017 and it is built upon Adams/View libraries and functionality. Because of this it only runs within Adams/View. You can't import import it on the command line in a 'standalone' shell and you never have been able to.
    • Perhaps Martin's comments relate to the old 'ADAMS' module that you could import from anywhere. Note the spelling. It's possible that that didn't have View dependencies and could be imported, but it's not the same thing as the new 'Adams' module that you want to be using.
     
    Regardless of the (blurred) details here: yes: we really want to be able to "import Adams" from both the 'View Python' shell AND the 'standalone Python' shell. But the first iteration of this new module is limited to running only in View (Car, etc.) now. That was a design decision that we had to make. It is not the long-term plan for this, so please excuse the trouble in the meantime and stick to the 'View Python' shell.
     
    One more thing: a future vision that makes a lot of sense is to have a 'View Python' shell that can be directly embedded within an IDE such as PyCharm. That would be the perfect solution, in my opinion. Suggestions for improvement as you use it are appreciated.
     
    Thanks,
    Kent
     
     
  • 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)
  • Hi Martin,
     
    Yah: very much agreed with all that you've said here. You'd think that this would be possible.. Our PD group has heard this request loud & clear; I'm hopeful that we can get it working in a release soon..
    Thanks,
    Kent