Error while using the opensees.so library in Python

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
SumeetSinha
Posts: 3
Joined: Thu Jun 11, 2020 4:32 pm

Error while using the opensees.so library in Python

Post by SumeetSinha »

Hi,

I successfully compiled opensees and openseespy using the provided makefile under Linux environment. Then, I ran some example problems from the EXAMPLES/ExampleScripts folder with opensees executable and it works fine.

However, when I run the test.py in \OpenSees\SRC\interpreter I get the following error.

Code: Select all

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import opensees as ops
ImportError: /OpenSees/SRC/interpreter/opensees.so: undefined symbol: _ZN11LognormalRVC1EiRK6Vector
Am I missing something regarding the compilation of python library?
Is there any documentation that I could refer to regarding the compilation of the Openseespy module?

Looking forward to your response.

Thanks
Sumeet
SumeetSinha
Posts: 3
Joined: Thu Jun 11, 2020 4:32 pm

Re: Error while using the opensees.so library in Python

Post by SumeetSinha »

Investigating the problem, the error was coming from OpenSeesReliabilityCommands. I did a dirty fix by commenting on all the OpenSeesReliability commands because I didn't need them and consequently removed the

Code: Select all

OpenSeesReliabilityCommands.o
from the compilation (in /SRC/interpreter directory). I was not able to figure out why the undefined reference was coming from them. If you need those commands in python, perhaps you need to figure out the original problem and fix it.

In order to debug the problem, I added the flag

Code: Select all

--no-undefined,
while compiling the libraries (files changed: /SRC/interpreter/Makefile). It basically informs right during the compilation about the undefined references.


In my /makefile.def , I also included the python library

Code: Select all

-lpython3.6m
Hope this helps!

====================================
Sumeet Kumar Sinha
PhD Student, Geotechnical Engineering
Dept of Civil and Env Engineering, UC Davis
sumeetksinha.com
Post Reply