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

Incomplete installation dependencies #64

Closed
xeniorn opened this issue Oct 19, 2024 · 5 comments
Closed

Incomplete installation dependencies #64

xeniorn opened this issue Oct 19, 2024 · 5 comments

Comments

@xeniorn
Copy link

xeniorn commented Oct 19, 2024

Installation instructions should include also the dependencies of the compiled binaries, e.g. DAlphaBall.gcc requires libgfortran.so.5 and others:

ldd DAlphaBall.gcc

DAlphaBall.gcc:
linux-vdso.so.1 (0x00007fff3d9a0000)
libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f92b9909000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92b982a000)
libgfortran.so.5 => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92b9649000)
/lib64/ld-linux-x86-64.so.2 (0x00007f92b998e000)

@martinpacesa
Copy link
Owner

These should install along the with the other packages as dependencies, what setup are you running?

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2024

Just the standard setup as described in your readme, within a docker image:

ARG APP=bindcraft
ARG BUILDPLATFORM=linux/amd64
ARG TARGETARCH=amd64

# cbe cluster 2024-10
ARG CUDA_VERSION="12.2"

# 3.10 because bindcraft uses 3.10
ARG MINICONDA_VERSION="Miniconda3-py310_24.7.1-0-Linux-x86_64"

ARG USER_FOLDER="/pub"
ARG CONDA_INSTALL_PATH="/pub/conda"
ARG CONDA_ENV_NAME="bindcraft_env"

ARG BINDCRAFT_GIT_REPO="https://github.com/martinpacesa/BindCraft"

####################################################################################
FROM --platform=$BUILDPLATFORM debian:stable-slim AS builder

ARG TARGETARCH
ARG APP

RUN dpkg --add-architecture $TARGETARCH \
    && apt-get update \
    && apt-get install -y \
      less wget git \
    && true
      # && rm -rf /var/lib/apt/lists/*

#="/pub/conda"
ARG CONDA_INSTALL_PATH
# ="Miniconda3-py311_24.1.2-0-Linux-x86_64"
ARG MINICONDA_VERSION

RUN wget --quiet \
    https://repo.anaconda.com/miniconda/${MINICONDA_VERSION}.sh \
     \
    && bash ${MINICONDA_VERSION}.sh -bfp ${CONDA_INSTALL_PATH} \
    && rm -f ${MINICONDA_VERSION}.sh 

ENV PATH="${CONDA_INSTALL_PATH}/bin:${PATH}"

ARG BINDCRAFT_GIT_REPO
ARG CUDA_VERSION

WORKDIR /pub
RUN git clone $BINDCRAFT_GIT_REPO
WORKDIR /pub/BindCraft
RUN bash install_bindcraft.sh --pkg_manager 'conda' --cuda $CUDA_VERSION

# => had to add this for the software to work
RUN apt-get install -y libgfortran5

All other deps recognized perfectly fine.

I double checked now and I see that libgfortran5 indeed installed in the conda environment, but I don't see how DAlphaBall.gcc is supposed to find it? Conda env activation does not set LD_LIBRARY_PATH, and DAlphaBall.gcc is an externally provided binary and can't possibly know where the conda env will be located. Maybe I understand something wrong, but it definitely isn't working as-is. If I remove the libgfortran in the system lib folder, it stops working. I see now I can make it work by explicitly setting LD_LIBRARY_PATH to where conda installs it, but that would also require altering the setup file.

(BindCraft) root@e0ba40b47674:/pub# BindCraft/functions/DAlphaBall.gcc
at least one arg is required! surf, surf_vol, surf_vol_deriv, ...

(BindCraft) root@e0ba40b47674:/pub# apt-get remove libgfortran5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libquadmath0
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  libgfortran5
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 2993 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 10776 files and directories currently installed.)
Removing libgfortran5:amd64 (12.2.0-14) ...
Processing triggers for libc-bin (2.36-9+deb12u8) ...

(BindCraft) root@e0ba40b47674:/pub# BindCraft/functions/DAlphaBall.gcc
BindCraft/functions/DAlphaBall.gcc: error while loading shared libraries: libgfortran.so.5: cannot open shared object file: No such file or directory

(BindCraft) root@e0ba40b47674:/pub# export LD_LIBRARY_PATH=/pub/conda/envs/BindCraft/lib
(BindCraft) root@e0ba40b47674:/pub# BindCraft/functions/DAlphaBall.gcc
at least one arg is required! surf, surf_vol, surf_vol_deriv, ...

DAlphaBall.gcc itself looks for the libs only in the standard locations as defined by the operating system, and this very specific path from the machine where it was compiled:

readelf -d BindCraft/functions/DAlphaBall.gcc | grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [/ssoft/spack/syrah/v1/opt/spack/linux-rhel8-x86_64_v2/gcc-8.5.0/gcc-11.3.0-yrewh277xaqlocj7zcuxnv2m4fq4p3tw/lib64]

@martinpacesa
Copy link
Owner

Unfortunately I have no experience with Docker and can't say how such a package will behave there, sorry :-/. In regular installs it does not seem to problem. You can search through the closed issues, there was someone who managed to do a docker install

@xeniorn
Copy link
Author

xeniorn commented Oct 22, 2024

I understand what you mean. It's not a docker thing though in this case, it's just a matter whether libgfortran5 already exists on the host system or not, regardless of whether the system is used directly or via docker.

I double-checked this now on multiple distributions (ubuntu22, debian12, centos7, alpine3.2) - only Debian had libgfortran5 preinstalled. Others gave the same error as in the docker install from debian-slim (which doesn't have it). Most people will I guess simply notice that the library is missing when they try to run, and either install the missing lib or ask their IT to install the lib. Few will actually report it to the github repo, since it's faster to just fix and forget. But it is an undocumented dependency, and anyone starting with a distro without preinstalled libgfortran5 will run into the same error after installing BindCraft according to instructions.

Google colab is based on Ubuntu22, but has a lot of additional things preinstalled, incl. libgfortran5.

My thing is working, I'm just trying to help you make it simpler for all users to install, including the 95% of users who always stay silent. :)

@martinpacesa
Copy link
Owner

I see, thank you for the input! I will test some possibilities for the install of that with conda, as it is currently somewhat shaky :)

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

2 participants