zhuminjie / OpenSeesPy

OpenSeesPy versions, doc, and pip
Other
177 stars 66 forks source link

Fail to import OpenSeesPy on Linux due to glibc version #108

Closed cedavidyang closed 1 year ago

cedavidyang commented 1 year ago

Hi everyone. Thanks for all the suggestions in a closed thread: "Failed to import openseespy #37". However, I'm encountering the same issue when trying to use openseespy on Linux machines. I tried both virtualenv pip and conda pip installs. Both can successfully install the package:

image

However, I can't import the package. The error message is as follows:

Python version: 3.8.10 (virtualenv) or 3.7.1 (conda) Error received:

image

Looking at the following error message,

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /u/yang26/.conda/envs/Research/lib/python3.7/site-packages/openseespylinux/lib/libstdc++.so.6)

This seems to be due to missing a compatible glibc version (2.33). Indeed, I can check my glibc version by using

/lib/x86_64-linux-gnu/libc.so.6

which indicates my glibc version is 2.31. This may explain why I was able to install and import the package successfully on Windows and Mac.

Since I don't have the sudo privilege of the server. it is difficult to upgrade glibc. Also, I'm afraid the upgrade may break other things. I wonder if the developers can help build openseespylinux with a lower version of glibc for linux compatibility. Just to clarify, my Linux system (Ubuntu 20.04 LTS) is not horribly old. I think this issue may be prevalent considering there may be a lot of CentOS or RedHat users, who may have an even older glibc version.

Hope the long message makes sense. Thanks!

zhuminjie commented 1 year ago

Hi, we compile the openseespy package on Centos 7 so most of Linux of users should be able to run.

I see the glibc requirement is from libstdc++. Maybe a version of stdc++ is get copied somewhere in the compilation process. We will look into it further.

cedavidyang commented 1 year ago

Thanks @zhuminjie for the hint. I managed to make it work by replacing the libstdc++ file (/lib/x86_64-linux-gnu/libstdc++.so.6) with my system libstdc++ file (I created a symbolic link to the system lib file, but I guess directly copying the system lib file to the openseespy folder might work as well).

Look forward to the official fix to this issue.

zhuminjie commented 1 year ago

It should be fixed now.