conda-forge / casadi-feedstock

A conda-smithy repository for casadi.
BSD 3-Clause "New" or "Revised" License
8 stars 12 forks source link

Symbol `_ZN6casadi14OracleCallbackC1Ev` is missing #123

Closed FabioBergonti closed 2 months ago

FabioBergonti commented 2 months ago

Solution to issue cannot be found in the documentation.

Issue

Similar to https://github.com/conda-forge/casadi-feedstock/issues/121, but a new symbol is missing _ZN6casadi14OracleCallbackC1Ev. Here is the error

fbergonti@IITICUBLAP279:~/fatrop_demo (master)$ /home/fbergonti/miniforge3/envs/test_casadi/bin/python /home/fbergonti/fatrop_demo/after.py
CasADi - 2024-09-11 11:45:41 WARNING(".../casadi/core/casadi_os.cpp:166: Assertion "handle!=nullptr" failed:
PluginInterface::load_plugin: Cannot load shared library 'libcasadi_nlpsol_fatrop.so': 
   (
    Searched directories: 1. casadipath from GlobalOptions
                          2. CASADIPATH env var
                          3. PATH env var (Windows)
                          4. LD_LIBRARY_PATH env var (Linux)
                          5. DYLD_LIBRARY_PATH env var (osx)
    A library may be 'not found' even if the file exists:
          * library is not compatible (different compiler/bitness)
          * the dependencies are not found
   )
  Tried '/home/fbergonti/code/robotology-superbuild_conda/build/install/lib/python3.12/site-packages/casadi' :
    Error code: /home/fbergonti/code/robotology-superbuild_conda/build/install/lib/python3.12/site-packages/casadi/libcasadi_nlpsol_fatrop.so: cannot open shared object file: No such file or directory
  Tried '' :
    Error code: /home/fbergonti/miniforge3/envs/test_casadi/bin/../lib/libcasadi_nlpsol_fatrop.so: undefined symbol: _ZN6casadi14OracleCallbackC1Ev
  Tried '.' :
    Error code: ./libcasadi_nlpsol_fatrop.so: cannot open shared object file: No such file or directory") [.../casadi/core/plugin_interface.hpp:142]
Traceback (most recent call last):
  File "/home/fbergonti/fatrop_demo/after.py", line 121, in <module>
    sol = opti.solve()
          ^^^^^^^^^^^^
  File "/home/fbergonti/code/robotology-superbuild_conda/build/install/lib/python3.12/site-packages/casadi/casadi.py", line 23104, in solve
    return _casadi.Opti_solve(self, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error in Opti::solve [OptiNode] at .../casadi/core/optistack.cpp:157:
.../casadi/core/plugin_interface.hpp:292: Plugin 'fatrop' is not found.

Installed packages

# packages in environment at /home/fbergonti/miniforge3/envs/test_casadi:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
_x86_64-microarch-level   4                     2_icelake    conda-forge
ampl-mp                   3.1.0             h2cc385e_1006    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
casadi                    3.6.6           py312h0385bb2_0    conda-forge
eigen                     3.4.0                h00ab1b0_0    conda-forge
icu                       75.1                 he02047a_0    conda-forge
ipopt                     3.14.16              h3a0b567_5    conda-forge
ld_impl_linux-64          2.40                 hf3520f5_7    conda-forge
libblas                   3.9.0           23_linux64_openblas    conda-forge
libblasfeo                0.1.3              had105d5_303    conda-forge
libcblas                  3.9.0           23_linux64_openblas    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libexpat                  2.6.3                h5888daf_0    conda-forge
libfatrop                 0.0.3                h5888daf_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.1.0               h77fa898_1    conda-forge
libgcc-ng                 14.1.0               h69a702a_1    conda-forge
libgfortran               14.1.0               h69a702a_1    conda-forge
libgfortran-ng            14.1.0               h69a702a_1    conda-forge
libgfortran5              14.1.0               hc5f4f2c_1    conda-forge
libgomp                   14.1.0               h77fa898_1    conda-forge
libhwloc                  2.11.1          default_hecaa2ac_1000    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
liblapack                 3.9.0           23_linux64_openblas    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.27          pthreads_hac2b453_1    conda-forge
libosqp                   0.6.3                h59595ed_0    conda-forge
libqdldl                  0.1.5                h27087fc_1    conda-forge
libscotch                 7.0.4                h2fe6a88_5    conda-forge
libspral                  2024.05.08           h831f25b_3    conda-forge
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libstdcxx                 14.1.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.1.0               h4852527_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               he7c6b58_4    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
metis                     5.1.0             h59595ed_1007    conda-forge
mumps-include             5.7.3                ha770c72_3    conda-forge
mumps-seq                 5.7.3                h96124f5_3    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
numpy                     2.1.1           py312h58c1407_0    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
proxsuite                 0.6.7           py312h68727a3_1    conda-forge
python                    3.12.5          h2ad013b_0_cpython    conda-forge
python_abi                3.12                    5_cp312    conda-forge
readline                  8.2                  h8228510_1    conda-forge
scipy                     1.14.1          py312h7d485d2_0    conda-forge
setuptools                73.0.1             pyhd8ed1ab_0    conda-forge
simde                     0.8.2                h84d6215_0    conda-forge
tinyxml2                  10.0.0               h59595ed_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
unixodbc                  2.3.12               h661eb56_0    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.3.1                h4ab18f5_1    conda-forge

Environment info

active environment : test_casadi
    active env location : /home/fbergonti/miniforge3/envs/test_casadi
            shell level : 1
       user config file : /home/fbergonti/.condarc
 populated config files : /home/fbergonti/miniforge3/.condarc
                          /home/fbergonti/.condarc
          conda version : 24.5.0
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=icelake
                          __conda=24.5.0=0
                          __cuda=12.5=0
                          __glibc=2.35=0
                          __linux=5.15.153.1=0
                          __unix=0=0
       base environment : /home/fbergonti/miniforge3  (writable)
      conda av data dir : /home/fbergonti/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/fbergonti/miniforge3/pkgs
                          /home/fbergonti/.conda/pkgs
       envs directories : /home/fbergonti/miniforge3/envs
                          /home/fbergonti/.conda/envs
               platform : linux-64
             user-agent : conda/24.5.0 requests/2.31.0 CPython/3.10.14 Linux/5.15.153.1-microsoft-standard-WSL2 ubuntu/22.04.3 glibc/2.35 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
traversaro commented 2 months ago

How did you triggered the error? With the same code?

FabioBergonti commented 2 months ago

How did you triggered the error? With the same code?

Yes!

traversaro commented 2 months ago

How did you triggered the error? With the same code?

Yes!

Ok, I did something wrong in my tests then, better to add the same test in CI.

traversaro commented 2 months ago

The strange thing is that in this case the error seems to be that a casadi symbol is missing, after demangling (https://demangler.com/) the error:

casadi::OracleCallback::OracleCallback()
traversaro commented 2 months ago

I just tested:

conda create -n casadi casadi
wget https://raw.githubusercontent.com/jgillis/fatrop_demo/master/after.py
conda activate casadi
python after.py

and it works fine, this is the conda list:

(casadi) traversaro@IITBMP014LW012:~/test$ conda list
# packages in environment at /home/traversaro/miniforge3/envs/casadi:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
_x86_64-microarch-level   3                     2_skylake    conda-forge
ampl-mp                   3.1.0             h2cc385e_1006    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
casadi                    3.6.6           py312h0385bb2_0    conda-forge
eigen                     3.4.0                h00ab1b0_0    conda-forge
icu                       75.1                 he02047a_0    conda-forge
ipopt                     3.14.16              h3a0b567_5    conda-forge
ld_impl_linux-64          2.40                 hf3520f5_7    conda-forge
libblas                   3.9.0           23_linux64_openblas    conda-forge
libblasfeo                0.1.3              had105d5_303    conda-forge
libcblas                  3.9.0           23_linux64_openblas    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libexpat                  2.6.3                h5888daf_0    conda-forge
libfatrop                 0.0.3                h5888daf_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.1.0               h77fa898_1    conda-forge
libgcc-ng                 14.1.0               h69a702a_1    conda-forge
libgfortran               14.1.0               h69a702a_1    conda-forge
libgfortran-ng            14.1.0               h69a702a_1    conda-forge
libgfortran5              14.1.0               hc5f4f2c_1    conda-forge
libgomp                   14.1.0               h77fa898_1    conda-forge
libhwloc                  2.11.1          default_hecaa2ac_1000    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
liblapack                 3.9.0           23_linux64_openblas    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.27          pthreads_hac2b453_1    conda-forge
libosqp                   0.6.3                h59595ed_0    conda-forge
libqdldl                  0.1.5                h27087fc_1    conda-forge
libscotch                 7.0.4                h2fe6a88_5    conda-forge
libspral                  2024.05.08           h831f25b_3    conda-forge
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libstdcxx                 14.1.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.1.0               h4852527_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               he7c6b58_4    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
metis                     5.1.0             h59595ed_1007    conda-forge
mumps-include             5.7.3                ha770c72_3    conda-forge
mumps-seq                 5.7.3                h96124f5_3    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
numpy                     2.1.1           py312h58c1407_0    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
proxsuite                 0.6.7           py312h68727a3_1    conda-forge
python                    3.12.5          h2ad013b_0_cpython    conda-forge
python_abi                3.12                    5_cp312    conda-forge
readline                  8.2                  h8228510_1    conda-forge
scipy                     1.14.1          py312h7d485d2_0    conda-forge
setuptools                73.0.1             pyhd8ed1ab_0    conda-forge
simde                     0.8.2                h84d6215_0    conda-forge
tinyxml2                  10.0.0               h59595ed_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
unixodbc                  2.3.12               h661eb56_0    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.3.1                h4ab18f5_1    conda-forge
traversaro commented 2 months ago

Are you sure that you do not have any other casadi (pip, robotology-superbuild) around that is loaded instead of the conda-forge's casadi?

FabioBergonti commented 2 months ago

I tested it again in a clean environment, and it worked. Sorry for the noise :) Closing

traversaro commented 2 months ago

No problem, this is not the first time I experienced environment cross-talking in Visual Studio Code.