Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing radian with mamba , cannot find libffi.so.7 #20

Open
elsherbini opened this issue Sep 21, 2022 · 7 comments
Open

Installing radian with mamba , cannot find libffi.so.7 #20

elsherbini opened this issue Sep 21, 2022 · 7 comments

Comments

@elsherbini
Copy link

Hello, on my academic cluster I installed radian with mamba, but get an error about not finding libffi.so.7 . the conda-forge packages libffi and cffi are installed. Howver, it looks like I have libffi.so.8 not libffi.so.7

Traceback (most recent call last):
  File "/home/je112/miniconda3/bin/radian", line 10, in <module>
    sys.exit(main())
  File "/home/je112/miniconda3/lib/python3.9/site-packages/radian/app.py", line 11, in main
    from rchitect.utils import Rhome, rversion
  File "/home/je112/miniconda3/lib/python3.9/site-packages/rchitect/__init__.py", line 1, in <module>
    from .setup import init, loop
  File "/home/je112/miniconda3/lib/python3.9/site-packages/rchitect/setup.py", line 6, in <module>
    from rchitect._cffi import ffi, lib
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
➜ ls ~/miniconda3/lib/libffi.*                                                                        
/home/je112/miniconda3/lib/libffi.a   /home/je112/miniconda3/lib/libffi.so.8                            
/home/je112/miniconda3/lib/libffi.so  /home/je112/miniconda3/lib/libffi.so.8.1.0 
➜mamba install -c conda-forge radian cffi libffi rchitect

Looking for: ['radian', 'cffi', 'libffi', 'rchitect']

conda-forge/linux-64     Using cache
conda-forge/noarch       Using cache
pkgs/main/linux-64       Using cache
pkgs/main/noarch         Using cache
pkgs/r/linux-64          Using cache
pkgs/r/noarch            Using cache

Pinned packages:
  - python 3.9.*


Transaction

  Prefix: /home/je112/miniconda3

  All requested packages already installed
@elsherbini
Copy link
Author

Manually downgrading to libffi version 3.3 allowed me to launch radian. Not sure if the conda-forge package needs it's dependencies changed, or if rchitect could use the libffi.so.8 API with minimal changes.

@randy3k
Copy link
Owner

randy3k commented Sep 23, 2022

I am not very familiar with conda package. @jdblischak do you have any idea? Do you need to trigger a new build for rchitect?

@jdblischak
Copy link
Contributor

@randy3k Do you know which versions of libffi/cffi are compatible with rchitect/radian? Currently the conda-forge recipe only specifies a minimal version of cffi >=1.10.0. We could specify a min/max for libcffi/cffi if there are known compatibility issues. Though we'll want to be as liberal as possible with the range, in order to not cause conflicts with other dependencies a user may want to install in their conda env.

However, is libffi a build-time dependency for rchitect? Looking at build.py and 0cbc3b6 makes me suspect that it is. If yes, we should specify it in the build dependencies. That would also make rchitect more compatible with the wider conda-forge ecosystem. They pin major dependencies like libffi so that they are compatible across all complied conda-forge packages. libffi is currently pinned to 3.3, and there is an ongoing migration to build packages with 3.4.

@randy3k
Copy link
Owner

randy3k commented Sep 23, 2022

I believe rchitect with work with any recent versions of cffi/libffi. rchitect does require cffi (hence libffi) in build time though.

@jdblischak
Copy link
Contributor

Ok. I think adding libcffi to the build dependencies in the rchitect recipe should be the way to fix this. It should pin libcffi to 3.3 to match the conda-forge pinnings. I might be able to get to this next week, but anyone can feel free to open the PR if they are eager.

@jdblischak
Copy link
Contributor

jdblischak commented Sep 27, 2022

I returned to this today, and I realized my potential solution won't make a difference. libffi 3.4.2 is already being used, as evidenced in the most recent build log on the rchitect feedstock.

Thus I attempted to reproduce the error, and I couldn't. Everything worked fine for me:

mamba create --yes -n test-libffi -c conda-forge radian cffi libffi rchitect r-base
mamba activate test-libffi
mamba list ffi
## # Name                    Version                   Build  Channel
## cffi                      1.15.1          py310h255011f_0    conda-forge
## libffi                    3.4.2                h7f98852_5    conda-forge
mamba list rchitect
## # Name                    Version                   Build  Channel
## rchitect                  0.3.37          py310h5764c6d_0    conda-forge
mamba list radian
## # Name                    Version                   Build  Channel
## radian                    0.6.3              pyhd8ed1ab_0    conda-forge
ls -1 $CONDA_PREFIX/lib/libffi.*
## $CONDA_PREFIX/lib/libffi.a
## $CONDA_PREFIX/lib/libffi.so
## $CONDA_PREFIX/lib/libffi.so.8
## $CONDA_PREFIX/lib/libffi.so.8.1.0
radian --version
## radian version: 0.6.3
## r executable: $CONDA_PREFIX/lib/R/bin/R
## r version: 4.2.1
## python executable: $CONDA_PREFIX/bin/python3.10
## python version: 3.10.6
radian
## R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
## Platform: x86_64-conda-linux-gnu (64-bit)
##
## r$>
##
mamba deactivate
mamba env remove -n test-libffi

After this, I realized that the error message wasn't about the version of libffi. It's about the shared library extension (SHLIB_EXT). The conda env provided libffi.so.8 (SHLIB_EXT=.so.8), but radian looked for libffi.so.7 (SHLIB_EXT=.so.7)

ImportError: libffi.so.7: cannot open shared object file: No such file or directory

Questions for @elsherbini:

  • How are you installing R for use with radian? Is R installed in the conda env? If it's not, maybe that is confusing radian
  • Could you please try running my reprex above on your academic cluster? It installs everything into an environment, so it won't break any of your existing environments

Question for @randy3k:

  • Can you think of any way that radian/rchitect/cffi could be looking for libffi with the wrong SHLIB_EXT?

@jdblischak
Copy link
Contributor

Any update on this? I was able to run radian with libffi 3.4.2. @elsherbini could you provide more information about the failing environment, e.g. conda list, conda info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants