conda-forge / mpich-feedstock

A conda-smithy repository for mpich.
BSD 3-Clause "New" or "Revised" License
2 stars 26 forks source link

Undefined reference to GLIBC_2.14 #98

Closed shuds13 closed 3 months ago

shuds13 commented 4 months ago

Solution to issue cannot be found in the documentation.

Issue

With mpich 4.2.2, when using in a new conda environment, including on github actions, an undefined reference to GLIC 2.14 is reported. Even if a more recent version of glibc is present.

I don't know if there is a recommended way to ensure glibc matches in Conda, but this has never been an issue with previous versions (including mpich 4.2.1).

Steps to reproduce:

conda create -n testmpi mpich gcc_linux-64
export PYTHONNOUSERSITE=1
. activate testmpi
mpicc helloworld_mpi.c

... libmpi.so: undefined reference to `memcpy@GLIBC_2.14'

where helloworld_mpi.c is:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char **argv)
{
   int rank;

   MPI_Init(&argc,&argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);

   printf("Hello World from Rank %d\n",rank);

   MPI_Finalize();
}

Note I have conda-forge channel.

conda config --show channels
channels:
  - conda-forge
  - defaults

Installed packages

# packages in environment at /home/shudson/miniconda3/envs/testmpi:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
binutils_impl_linux-64    2.38                 h2a08ee3_1  
binutils_linux-64         2.38.0               hc2dff05_0  
gcc_impl_linux-64         11.2.0               h1234567_1  
gcc_linux-64              11.2.0               h5c386dc_0  
kernel-headers_linux-64   2.6.32              he073ed8_17    conda-forge
ld_impl_linux-64          2.38                 h1181459_1  
libgcc-devel_linux-64     11.2.0               h1234567_1  
libgcc-ng                 14.1.0               h77fa898_0    conda-forge
libgfortran-ng            14.1.0               h69a702a_0    conda-forge
libgfortran5              14.1.0               hc5f4f2c_0    conda-forge
libgomp                   14.1.0               h77fa898_0    conda-forge
libstdcxx-ng              14.1.0               hc0a3c3a_0    conda-forge
mpi                       1.0                       mpich    conda-forge
mpich                     4.2.2              h4a7f18d_100    conda-forge
sysroot_linux-64          2.12                he073ed8_17    conda-forge

Environment info

conda info

     active environment : testmpi
    active env location : /home/shudson/miniconda3/envs/testmpi
            shell level : 1
       user config file : /home/shudson/.condarc
 populated config files : /home/shudson/.condarc
          conda version : 4.10.3
    conda-build version : not installed
         python version : 3.9.5.final.0
       virtual packages : __linux=5.15.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/shudson/miniconda3  (writable)
      conda av data dir : /home/shudson/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/shudson/miniconda3/pkgs
                          /home/shudson/.conda/pkgs
       envs directories : /home/shudson/miniconda3/envs
                          /home/shudson/.conda/envs
               platform : linux-64
             user-agent : conda/4.10.3 requests/2.28.2 CPython/3.9.5 Linux/5.15.0-113-generic ubuntu/20.04.6 glibc/2.31
                UID:GID : 1000:1000
             netrc file : /home/shudson/.netrc
           offline mode : False
dalcinl commented 3 months ago

@shuds13 The problem is the package sysroot_linux-64=2.12, you need a newer version, at least 2.14

@minrk @jakirkham @leofang IIRC, this old sysroot comes from gfotran. Can you please remember me what's the proper recommendation for end users?

shuds13 commented 3 months ago

@dalcinl I updated sysroot_linux-64 on my local machine and this fixed this issue as you say.

However, it is curious that the default set up uses an old version and will probably trip up others. It looks like sysroot_linux-64 gets installed with gcc_linux-64, which as far as I can tell comes from https://github.com/conda-forge/ctng-compiler-activation-feedstock. So perhaps I should raise an issue there.

If anyone, such as those pinged above, has a different recommendation for setting up the compilers in a conda environment, that would be very useful and good to document it here.

shuds13 commented 3 months ago

@dalcinl Not sure quite what their comment here means https://github.com/conda-forge/ctng-compiler-activation-feedstock/issues/123#issuecomment-2219158994

Maybe strong_constrains can be used in the mpich build?

dalcinl commented 3 months ago

@shuds13 We are being told that the issue is fixed. Could you please try again?

shuds13 commented 3 months ago

@dalcinl Yes, it now works! This can be closed. Thanks.