Python Interface on GMAT R2018a for Linux

MATLAB interface, C API, using plugins, other interfaces

Python Interface on GMAT R2018a for Linux

Postby astrojuanlu » Sun Jul 15, 2018 7:42 pm

I'm trying to make the Python interface of GMAT R2018a work on Linux. This is the message I get when I try to run the console:

Code: Select all
libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
*** Library "../plugins/libPythonInterface" did not open.


I'm specifically using a derivative of Ubuntu Xenial (16.04), which ships Python 3.5. However, this is not important because I don't plan to use the system Python: I prefer to control it using virtual environments or conda environments. With this in mind, I created a conda environment with Python 3.6, but even if `which python` yields a proper Python interpreter at `/home/juanlu/.miniconda36/envs/gmat36/bin/python`, libPythonInterface.so does not seem to find it:

Code: Select all
$ which python
/home/juanlu/.miniconda36/envs/gmat36/bin/python
$ ldd $(which python) | grep python
   libpython3.6m.so.1.0 => /home/juanlu/.miniconda36/envs/gmat36/bin/../lib/libpython3.6m.so.1.0 (0x00007ff081a5e000)
$ ldd ../plugins/libPythonInterface.so | grep python
   libpython3.6m.so.1.0 => not found


Of course, changing LD_LIBRARY_PATH did the trick:

Code: Select all
$ LD_LIBRARY_PATH=/home/juanlu/.miniconda36/envs/gmat36/lib/ ldd ../plugins/libPythonInterface.so | grep python
/bin/bash: /home/juanlu/.miniconda36/envs/gmat36/lib/libtinfo.so.5: no version information available (required by /bin/bash)
   libpython3.6m.so.1.0 => /home/juanlu/.miniconda36/envs/gmat36/lib/libpython3.6m.so.1.0 (0x00007efcdb83a000)


But I would prefer not to touch that, if possible: https://gms.tf/ld_library_path-considered-harmful.html

Is there any other way to tell GMAT where to find Python?

Thanks!
astrojuanlu
 
Posts: 2
Joined: Sun Jul 15, 2018 6:59 pm

Re: Python Interface on GMAT R2018a for Linux

Postby n3rdx » Mon Nov 26, 2018 1:35 pm

You may have already solved this by this time, I just posted a note on my experiences with Python + R2018a + CMAKE (see Compiling forum).

When CMAKE-GUI showed me what it thought it found in parsing my system, after a few tries, and failing with Python interface build - I noticed CMAKE had selected Python 2. Python 3 was already on my system, but python3-dev was not. Fix was to install the development libraries ('sudo apt-get install python3-dev' IIRC) and then all worked well.

Samudra N3RDX
n3rdx
 
Posts: 7
Joined: Mon Jun 19, 2017 2:07 am
Location: Washington, DC


Return to External Interfaces and Plugins

Who is online

Users browsing this forum: No registered users and 1 guest