UTNAK / kepler16b-using-imce-vocabulary

Forked from a demo project for the openCAESAR platform
http://opencaesar.github.io/kepler16b-example/
0 stars 0 forks source link

@UTNAK Python section of codespace is not working. #18

Closed UTNAK closed 1 month ago

UTNAK commented 1 month ago
          @UTNAK Python section of codespace is not working.

Getting an OSError after running Quarto notebook to calculate delta v section

Originally posted by @pogi7 in https://github.com/UTNAK/kepler16b-using-imce-vocabulary/pull/12#pullrequestreview-2066763868

UTNAK commented 1 month ago

This is due to the load of

from poliastro.twobody import Orbit

in src/analysis/analysisOrbit.py

I found that the this code works in python at terminal. In quarto notebook, this doesn't work

Problem:

from poliastro.twobody import Orbit

This command returns error regarding to libstdc++.so.6

Traceback (most recent call last):
  File "/opt/conda/envs/py39/lib/python3.9/site-packages/llvmlite/binding/ffi.py", line 136, in __getattr__
    return self._fntab[name]
KeyError: 'LLVMPY_AddSymbol'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/py39/lib/python3.9/site-packages/llvmlite/binding/ffi.py", line 117, in _load_lib
    self._lib_handle = ctypes.CDLL(str(lib_path))
  File "/opt/conda/envs/py39/lib/python3.9/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /opt/conda/envs/py39/lib/python3.9/site-packages/llvmlite/binding/libllvmlite.so)

Where is libstdc++.so.6?

This command at terminal shows the list of "libstdc++.so"

find / -name "libstdc++.so*"

I found there is so many "libstdc++.so" files.

(py39) @UTNAK ➜ /workspaces/kepler16b-using-imce-vocabulary (feat/6-prototype-for-integration-of-orbital-analysis) $ find / -name "libstdc++.so.6"
find: ‘/etc/ssl/private’: Permission denied
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
find: ‘/proc/tty/driver’: Permission denied
find: ‘/proc/1/task/1/fd’: Permission denied
find: ‘/proc/1/task/1/fdinfo’: Permission denied
find: ‘/proc/1/task/1/ns’: Permission denied
find: ‘/proc/1/fd’: Permission denied
find: ‘/proc/1/map_files’: Permission denied
find: ‘/proc/1/fdinfo’: Permission denied
find: ‘/proc/1/ns’: Permission denied
find: ‘/proc/323/task/323/fd’: Permission denied
find: ‘/proc/323/task/323/fdinfo’: Permission denied
find: ‘/proc/323/task/323/ns’: Permission denied
find: ‘/proc/323/fd’: Permission denied
find: ‘/proc/323/map_files’: Permission denied
find: ‘/proc/323/fdinfo’: Permission denied
find: ‘/proc/323/ns’: Permission denied
find: ‘/proc/1226/task/1226/fd’: Permission denied
find: ‘/proc/1226/task/1226/fdinfo’: Permission denied
find: ‘/proc/1226/task/1226/ns’: Permission denied
find: ‘/proc/1226/fd’: Permission denied
find: ‘/proc/1226/map_files’: Permission denied
find: ‘/proc/1226/fdinfo’: Permission denied
find: ‘/proc/1226/ns’: Permission denied
find: ‘/proc/23234/task/23234/fd’: Permission denied
find: ‘/proc/23234/task/23234/fdinfo’: Permission denied
find: ‘/proc/23234/task/23234/ns’: Permission denied
find: ‘/proc/23234/fd’: Permission denied
find: ‘/proc/23234/map_files’: Permission denied
find: ‘/proc/23234/fdinfo’: Permission denied
find: ‘/proc/23234/ns’: Permission denied
/opt/conda/lib/libstdc++.so.6
/opt/conda/envs/py39/lib/libstdc++.so.6
/opt/conda/pkgs/libstdcxx-ng-13.2.0-hc0a3c3a_7/lib/libstdc++.so.6
find: ‘/var/lib/apt/lists/partial’: Permission denied
find: ‘/var/cache/ldconfig’: Permission denied
find: ‘/var/cache/apt/archives/partial’: Permission denied
find: ‘/root’: Permission denied
/workspaces/.codespaces/shared/editors/jetbrains/pycharm-2023.1.1/plugins/remote-dev-server/selfcontained/lib/libstdc++.so.6
/workspaces/.codespaces/shared/editors/jetbrains/JetBrainsRider-2023.1/plugins/remote-dev-server/selfcontained/lib/libstdc++.so.6
/workspaces/.codespaces/shared/editors/jetbrains/RubyMine-2023.1.1/plugins/remote-dev-server/selfcontained/lib/libstdc++.so.6
/workspaces/.codespaces/shared/editors/jetbrains/idea-IU-231.8770.65/plugins/remote-dev-server/selfcontained/lib/libstdc++.so.6

In Quarto + reticulate package, "/usr/lib/x86_64-linux-gnu/libstdc++.so.6:" is used because the error logs said "OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found " "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" doesn't contain GLIBCXX_3.4.29 as shown in below.

@UTNAK ➜ /workspaces/kepler16b-using-imce-vocabulary (feat/6-prototype-for-integration-of-orbital-analysis) $ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28

In python interpreter at conda environment, it seems conda uses "/opt/conda/envs/py39/lib/libstdc++.so.6" However, "/opt/conda/envs/py39/lib/libstdc++.so.6" contains "GLIBCXX_3.4.29" and after.

(py39) @UTNAK ➜ /workspaces/kepler16b-using-imce-vocabulary (feat/6-prototype-for-integration-of-orbital-analysis) $ strings /opt/conda/envs/py39/lib/libstdc++.so.6 | grep GLIBCXX_3.4
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_3.4.29
GLIBCXX_3.4.30
GLIBCXX_3.4.31
GLIBCXX_3.4.32

Solution

Below commands enable updating the libstdc++.so.6 for quarto + reticulate I think this is not recommended because this manually copy a libstdc++.so.6 file.

cd /opt/conda/envs/py39/lib/
sudo cp libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6