Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GLIBC dependency issue
#1
Question 
I am trying to use the open source toolkit, "Aequitas" (https://github.com/dssg/aequitas). One of the functions from the package has a GLIBC-2.29 dependency that my Posit environment won't support (RHEL 8 can only support up to 2.28 (https://access.redhat.com/solutions/38634)). Error follows:

Error:
OSError: /lib64/libm.so.6: version 'GLIBC_2.29' not found (required)'
I installed one of the gcc-toolset packages (gcc-toolset-9) available for RHEL 8 to attempt to access a more recent version of GLIBC and was able to download the tar.gz file and create a glibc-2.29/build folder. I have tried a few ways to link it but keep running into errors. Can anyone advise on code that can run in python to use the glibc-2.29 from the toolset for the necessary package? Code for installing a GCC toolset to download, build, and use glibc 2.29 locally follows:

! yum install gcc-toolset-9
import os
import subprocess
import sys

# Define paths
glibc_version = '2.29'
glibc_tarball_url = f'http://ftp.gnu.org/gnu/libc/glibc-{glibc_version}.tar.gz'
glibc_src_dir = f'glibc-{glibc_version}'
build_dir = f'{glibc_src_dir}/build'
install_dir = os.path.expanduser(f'~/glibc-{glibc_version}-install')

# Function to run shell commands
def run_command(command, cwd=None, check=True):
    print(f"Running command: {command}")
    result = subprocess.run(command, shell=True, cwd=cwd, check=check, text=True, capture_output=True)
    print(result.stdout)
    if result.stderr:
        print(f"Error: {result.stderr}", file=sys.stderr)
    return result

# Create a working directory
print(f"Creating working directory...")
run_command(f'mkdir -p ~/glibc-{glibc_version}', check=False)
# Download the glibc source code
print(f"Downloading glibc {glibc_version}...")
run_command(f'wget {glibc_tarball_url}', cwd=os.path.expanduser(f'~/glibc-{glibc_version}'), check=True)

# Extract the source code
print(f"Extracting glibc {glibc_version}...")
run_command(f'tar -xzf glibc-{glibc_version}.tar.gz', cwd=os.path.expanduser(f'~/glibc-{glibc_version}'), check=True)
# Create a build directory
print(f"Creating build directory...")
run_command(f'mkdir -p {build_dir}', cwd=os.path.expanduser(f'~/glibc-{glibc_version}'), check=True)

# Configure the build
print(f"Configuring the build...")
run_command(f'../configure --prefix={install_dir}', cwd=build_dir, check=True)
Reply
#2
(Jul-29-2024, 06:21 PM)mackins Wrote: was able to download the tar.gz file and create a glibc-2.29/build folder
You created a build folder but at some point you must invoke make in order to build the libraries. This thread may help you compile glibc.

Obviously, you need the libm.so.6 library, I suppose this library is contained into the glibc that you will compile.

I'm not sure this will help you because I suspect that your Python interpreter is linked against your system's libm library which is not the glibc-2.29 one and you can't change that unless you build Python itself against your new glibc.
« We can solve any problem by introducing an extra level of indirection »
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [solved] What is the best/pytonic way to import with dependency ? SpongeB0B 2 1,463 Jul-09-2023, 05:05 AM
Last Post: SpongeB0B
  Request Dependency warning thetechnodino 0 1,534 Dec-20-2022, 02:12 AM
Last Post: thetechnodino
  Circular import dependency hobbyist 9 5,513 Feb-23-2021, 11:57 AM
Last Post: Gribouillis
  Poetry Dependency general Help felipesodre 0 1,876 Jan-14-2021, 07:46 PM
Last Post: felipesodre
  Installing nltk dependency Eshwar 0 2,514 Aug-30-2020, 06:10 PM
Last Post: Eshwar
  How do I change wx version dependency? belfacode 0 1,955 May-17-2020, 09:18 AM
Last Post: belfacode
  Module Dependency installation error draems 10 12,496 Feb-12-2017, 08:18 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020