Skip to content

Commit

Permalink
Install static devel libs and configure repo
Browse files Browse the repository at this point in the history
  • Loading branch information
makaimann committed Feb 19, 2025
1 parent 420eff0 commit dff2b68
Showing 1 changed file with 50 additions and 13 deletions.
63 changes: 50 additions & 13 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,37 +60,74 @@ jobs:
CIBW_SKIP: "*-win32 *-win_amd64 *-win_arm64 *-musllinux_*"
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BEFORE_ALL_LINUX: |
# First enable the devtoolset properly
# First detect our architecture
ARCH=$(uname -m)
echo "Building for architecture: $ARCH"
# Configure repository based on architecture
if [ "$ARCH" = "x86_64" ]; then
# Standard CentOS vault for x86_64
echo "[base]
name=CentOS-7 - Base
baseurl=http://vault.centos.org/7.9.2009/os/x86_64/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/CentOS-Base.repo
else
# AltArch repository for aarch64
echo "[base]
name=CentOS-7 - Base
baseurl=http://mirror.centos.org/altarch/7/os/aarch64/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/CentOS-Base.repo
fi
# Enable the devtoolset for our modern compiler
source /opt/rh/devtoolset-10/enable
# Install development packages
# Clean and rebuild package cache
yum clean all
yum makecache
# Install all static development packages
yum install -y \
cmake \
gcc \
gcc-c++ \
glibc-devel \
glibc-static \
glibc-static-devel \
gmp-devel \
gmp-static \
java-1.8.0-openjdk-devel \
make \
libstdc++-static \
glibc-static
libstdc++-devel
# Set up architecture-specific library paths
if [ "$ARCH" = "x86_64" ]; then
LIB_DIRS="/lib64:/usr/lib64"
else
LIB_DIRS="/lib64:/usr/lib64:/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu"
fi
# Set up library paths and compiler flags
export LD_LIBRARY_PATH="/lib64:/usr/lib64:$LD_LIBRARY_PATH"
export LIBRARY_PATH="/lib64:/usr/lib64:$LIBRARY_PATH"
# Set up environment with our architecture-specific paths
export LD_LIBRARY_PATH="$LIB_DIRS:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$LIB_DIRS:$LIBRARY_PATH"
export CFLAGS="-fPIC"
export CXXFLAGS="-fPIC"
export LDFLAGS="-L/usr/lib64 -static-libstdc++ -static-libgcc"
# Print diagnostic information
# Print diagnostic information to help with debugging
echo "Architecture: $ARCH"
echo "Library paths: $LIB_DIRS"
echo "Checking for static libraries:"
ls -l /usr/lib64/lib*.a 2>/dev/null || true
if [ "$ARCH" = "aarch64" ]; then
ls -l /usr/lib/aarch64-linux-gnu/lib*.a 2>/dev/null || true
fi
echo "Compiler versions:"
gcc --version
g++ --version
which gcc
which g++
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "LIBRARY_PATH=$LIBRARY_PATH"
ls -l /usr/lib64/libstdc++*
ls -l /usr/lib64/libgcc*
CIBW_BEFORE_ALL_MACOS: |
brew update
brew install gperf ninja
Expand Down

0 comments on commit dff2b68

Please sign in to comment.