diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f6481292 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +cuda-old.sh +defaults-cms.sh +defaults-x86_64.sh +rocm.sh +sbsa.sh +pypi/__pycache__/packages.cpython-39.pyc +defaults-cms.sh +pypi/__pycache__/packages.cpython-39.pyc diff --git a/abseil-cpp.sh b/abseil-cpp.sh new file mode 100644 index 00000000..47de548b --- /dev/null +++ b/abseil-cpp.sh @@ -0,0 +1,20 @@ +package: abseil-cpp +version: "%(tag_basename)s" +tag: "20220623.1" +source: https://github.com/abseil/abseil-cpp +requires: +- gcc +- CMake +- gmake +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +cmake -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ + -DCMAKE_CXX_STANDARD=$CXXSTD \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release + +make ${JOBS+-j $JOBS} +make install \ No newline at end of file diff --git a/bz2lib.sh b/bz2lib.sh new file mode 100644 index 00000000..0831b515 --- /dev/null +++ b/bz2lib.sh @@ -0,0 +1,60 @@ +package: bz2lib +version: "%(tag_basename)s" +tag: bzip2-1.0.6 +requires: + - gcc +source: https://github.com/libarchive/bzip2 +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ +if [[ ${ARCHITECTURE:0:3} == "osx" ]]; then + sed -e 's/ -shared/ -dynamiclib/' \ + -e 's/ -Wl,-soname -Wl,[^ ]*//' \ + -e 's/libbz2\.so/libbz2.dylib/g' \ + < Makefile-libbz2_so > Makefile-libbz2_dylib + MAKEFILE="Makefile-libbz2_dylib" + soname="dylib" +else + MAKEFILE="Makefile-libbz2_so" + soname="so" +fi + +make -j"${MAKEJOBS:-1}" -f "$MAKEFILE" + +ls -l | grep libbz2 || : + +version=$(echo $PKG_VERSION | cut -d'-' -f2) + +mkdir -p "$INSTALLROOT"/{bin,lib,include} + +if [[ -f "libbz2.${soname}.${version}" ]]; then + cp "libbz2.${soname}.${version}" "${INSTALLROOT}/lib/" +else + ls -la libbz2.* || : + exit 1 +fi + +cd "${INSTALLROOT}/lib" +ln -sf "libbz2.${soname}.${version}" "libbz2.${soname}" +two_digit_version=$(echo "${version}" | cut -d. -f1,2) +ln -sf "libbz2.${soname}.${version}" "libbz2.${soname}.${two_digit_version}" +one_digit_version=$(echo "${version}" | cut -d. -f1) +ln -sf "libbz2.${soname}.${version}" "libbz2.${soname}.${one_digit_version}" +cd "$BUILDDIR" + +if [[ -f "bzlib.h" ]]; then + cp bzlib.h "${INSTALLROOT}/include/" +else + exit 1 +fi + +for binary in bzip2 bunzip2 bzcat bzdiff bzgrep bzmore; do + if [[ -f "$binary" ]]; then + cp "$binary" "${INSTALLROOT}/bin/" + fi +done +cd "${INSTALLROOT}/bin" +[[ -f "bzdiff" ]] && ln -sf bzdiff bzcmp +[[ -f "bzgrep" ]] && ln -sf bzgrep bzegrep +[[ -f "bzgrep" ]] && ln -sf bzgrep bzfgrep +[[ -f "bzmore" ]] && ln -sf bzmore bzless +cd "$BUILDDIR" diff --git a/cmake.sh b/cmake.sh new file mode 100644 index 00000000..48048ceb --- /dev/null +++ b/cmake.sh @@ -0,0 +1,51 @@ +package: CMake +version: "%(tag_basename)s" +tag: "v3.31.7" +source: https://github.com/Kitware/CMake +requires: + - gcc + - bz2lib + - expat + - zlib + - curl +build_requires: + - gmake +--- +#!/bin/bash -e +SONAME=so +case $ARCHITECTURE in + osx*) SONAME=dylib ;; +esac + +cat > build-flags.cmake <<- EOF + # Disable Java capabilities; we don't need it and on OS X might miss + # required /System/Library/Frameworks/JavaVM.framework/Headers/jni.h. + SET(JNI_H FALSE CACHE BOOL "" FORCE) + SET(Java_JAVA_EXECUTABLE FALSE CACHE BOOL "" FORCE) + SET(Java_JAVAC_EXECUTABLE FALSE CACHE BOOL "" FORCE) + + # SL6 with GCC 4.6.1 and LTO requires -ltinfo with -lcurses for link + # to succeed, but cmake is not smart enough to find it. We don't + # really need ccmake anyway, so just disable it. + SET(BUILD_CursesDialog FALSE CACHE BOOL "" FORCE) + + # Use system libraries, not cmake bundled ones. + SET(CMAKE_USE_OPENSSL TRUE CACHE BOOL "" FORCE) + SET(CMAKE_USE_SYSTEM_LIBRARY_CURL TRUE CACHE BOOL "" FORCE) + SET(CMAKE_USE_SYSTEM_LIBRARY_ZLIB TRUE CACHE BOOL "" FORCE) + SET(CMAKE_USE_SYSTEM_LIBRARY_BZIP2 TRUE CACHE BOOL "" FORCE) + SET(CMAKE_USE_SYSTEM_LIBRARY_EXPAT TRUE CACHE BOOL "" FORCE) +EOF + +rsync -a --chmod=ugo=rwX --delete --exclude '**/.git' --delete-excluded $SOURCEDIR/ ./ + +export CMAKE_PREFIX_PATH=$CURL_ROOT:$ZLIB_ROOT:$EXPAT_ROOT:$BZ2LIB_ROOT + +./bootstrap --prefix=$INSTALLROOT \ + ${ZLIB_ROOT:+--no-system-zlib} \ + ${CURL_ROOT:+--no-system-curl} \ + ${EXPAT_ROOT:+--no-system-expat} \ + --init=build-flags.cmake \ + ${JOBS:+--parallel=$JOBS} +make ${JOBS+-j $JOBS} +make install/strip \ No newline at end of file diff --git a/cuda-aarch64.sh b/cuda-aarch64.sh new file mode 100644 index 00000000..1e0473c8 --- /dev/null +++ b/cuda-aarch64.sh @@ -0,0 +1,90 @@ +package: cuda-aarch64 +version: "12.9.0" +variables: + driversversion: 575.51.03 +sources: + - https://developer.download.nvidia.com/compute/cuda/%(version)s/local_installers/cuda_%(version)s_%(driversversion)s_linux_sbsa.run +--- +ARCH=${PKGNAME#*-} +CUDADRIVER_VERSION="%(driversversion)s" +cp "$SOURCEDIR/${SOURCE0}" "$BUILDDIR/" + +chmod +x cuda_"$PKGVERSION"_"$CUDADRIVER_VERSION"_linux_sbsa.run + +mkdir -p $BUILDDIR/{build,tmp} + +CUDA_INSTALL_CMD="/bin/sh cuda_${PKGVERSION}_${CUDADRIVER_VERSION}_linux_sbsa.run \ + --silent \ + --override \ + --tmpdir=${BUILDDIR}/tmp \ + --installpath=${BUILDDIR}/build\ + --toolkit \ + --keep" + +$CUDA_INSTALL_CMD + +mkdir -p $INSTALLROOT/{include,lib64} + +mv $BUILDDIR/build/lib64/libcudadevrt.a $INSTALLROOT/lib64/ +mv $BUILDDIR/build/lib64/libcudart_static.a $INSTALLROOT/lib64/ +rm -f $BUILDDIR/build/lib64/lib*.a + +rm -rf $BUILDDIR/build/lib64/stubs/ + +rm -f $BUILDDIR/build/lib64/libOpenCL.* + +chmod a+x $BUILDDIR/build/lib64/*.so +mv $BUILDDIR/build/lib64/* $INSTALLROOT/lib64/ + +chmod a-x $BUILDDIR/build/include/*.h* +mv $BUILDDIR/build/include/* $INSTALLROOT/include/ + +chmod a+x $BUILDDIR/build/extras/CUPTI/lib64/*.so* +mv $BUILDDIR/build/extras/CUPTI/lib64/*.so* $INSTALLROOT/lib64/ +mv $BUILDDIR/build/extras/CUPTI/include/*.h $INSTALLROOT/include/ + +rm -f $BUILDDIR/build/bin/computeprof +rm -f $BUILDDIR/build/bin/cuda-uninstaller +rm -f $BUILDDIR/build/bin/ncu* +rm -f $BUILDDIR/build/bin/nsight* +rm -f $BUILDDIR/build/bin/nsys* +rm -f $BUILDDIR/build/bin/nvvp +mv $BUILDDIR/build/bin $INSTALLROOT/ + +mv $BUILDDIR/build/share/ $INSTALLROOT/ +mv $INSTALLROOT/bin/cuda-gdb $INSTALLROOT/bin/cuda-gdb.real +cat > $INSTALLROOT/bin/cuda-gdb << @EOF +#! /bin/bash +export PYTHONHOME=$PYTHON_ROOT +exec $INSTALLROOT/bin/cuda-gdb.real "\$@" +@EOF +chmod a+x $INSTALLROOT/bin/cuda-gdb + +mv $BUILDDIR/build/compute-sanitizer $INSTALLROOT/ +rm -f $INSTALLROOT/bin/compute-sanitizer +ln -s ../compute-sanitizer/compute-sanitizer $INSTALLROOT/bin/compute-sanitizer +mv $BUILDDIR/build/nvvm $INSTALLROOT/ +/bin/sh $BUILDDIR/pkg/builds/NVIDIA-Linux-${ARCH}-$CUDADRIVER_VERSION.run --silent --extract-only --tmpdir $BUILDDIR/tmp --target $BUILDDIR/build/drivers + +mkdir -p $INSTALLROOT/drivers +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/drivers/libcuda.so +cp -p $BUILDDIR/build/drivers/libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcudadebugger.so.1 +ln -sf libcudadebugger.so.1 $INSTALLROOT/drivers/libcudadebugger.so +cp -p $BUILDDIR/build/drivers/libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so.1 +ln -sf libnvidia-ptxjitcompiler.so.1 $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so +cp -p $BUILDDIR/build/drivers/libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-nvvm.so.4 +ln -sf libnvidia-nvvm.so.4 $INSTALLROOT/drivers/libnvidia-nvvm.so +cp -p $BUILDDIR/build/drivers/nvidia-smi $INSTALLROOT/drivers/ + +mkdir -p $INSTALLROOT/lib64/stubs +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/lib64/stubs/libcuda.so +cp -p $BUILDDIR/build/drivers/libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libnvidia-ml.so.1 +ln -sf libnvidia-ml.so.1 $INSTALLROOT/lib64/stubs/libnvidia-ml.so \ No newline at end of file diff --git a/cuda-x86_64.sh b/cuda-x86_64.sh new file mode 100644 index 00000000..0b895dc1 --- /dev/null +++ b/cuda-x86_64.sh @@ -0,0 +1,94 @@ +package: cuda-x86_64 +version: "12.9.0" +variables: + driversversion: 575.51.03 +sources: + - https://developer.download.nvidia.com/compute/cuda/%(version)s/local_installers/cuda_%(version)s_%(driversversion)s_linux.run +env: + CUDAROOT: "$CUDA_X86_64_ROOT" +--- +echo "%(driversversion)s" +CUDADRIVER_VERSION="%(driversversion)s" +ARCH=${PKGNAME#*-} +cp "$SOURCEDIR/${SOURCE0}" "$BUILDDIR/" + +chmod +x cuda_"$PKGVERSION"_"$CUDADRIVER_VERSION"_linux.run + +mkdir -p $BUILDDIR/{build,tmp} + +CUDA_INSTALL_CMD="/bin/sh cuda_${PKGVERSION}_${CUDADRIVER_VERSION}_linux.run \ + --silent \ + --override \ + --tmpdir=${BUILDDIR}/tmp \ + --installpath=${BUILDDIR}/build\ + --toolkit \ + --keep" + +$CUDA_INSTALL_CMD + +mkdir -p $INSTALLROOT/{include,lib64} + +mv $BUILDDIR/build/lib64/libcudadevrt.a $INSTALLROOT/lib64/ +mv $BUILDDIR/build/lib64/libcudart_static.a $INSTALLROOT/lib64/ +rm -f $BUILDDIR/build/lib64/lib*.a + +rm -rf $BUILDDIR/build/lib64/stubs/ + +rm -f $BUILDDIR/build/lib64/libOpenCL.* + +chmod a+x $BUILDDIR/build/lib64/*.so +mv $BUILDDIR/build/lib64/* $INSTALLROOT/lib64/ + +chmod a-x $BUILDDIR/build/include/*.h* +mv $BUILDDIR/build/include/* $INSTALLROOT/include/ + +chmod a+x $BUILDDIR/build/extras/CUPTI/lib64/*.so* +mv $BUILDDIR/build/extras/CUPTI/lib64/*.so* $INSTALLROOT/lib64/ +mv $BUILDDIR/build/extras/CUPTI/include/*.h $INSTALLROOT/include/ + +rm -f $BUILDDIR/build/bin/computeprof +rm -f $BUILDDIR/build/bin/cuda-uninstaller +rm -f $BUILDDIR/build/bin/ncu* +rm -f $BUILDDIR/build/bin/nsight* +rm -f $BUILDDIR/build/bin/nsys* +rm -f $BUILDDIR/build/bin/nvvp +mv $BUILDDIR/build/bin $INSTALLROOT/ + +mv $BUILDDIR/build/share/ $INSTALLROOT/ +mv $INSTALLROOT/bin/cuda-gdb $INSTALLROOT/bin/cuda-gdb.real +cat > $INSTALLROOT/bin/cuda-gdb << @EOF +#! /bin/bash +export PYTHONHOME=$PYTHON_ROOT +exec $INSTALLROOT/bin/cuda-gdb.real "\$@" +@EOF +chmod a+x $INSTALLROOT/bin/cuda-gdb + +mv $BUILDDIR/build/compute-sanitizer $INSTALLROOT/ +rm -f $INSTALLROOT/bin/compute-sanitizer +ln -s ../compute-sanitizer/compute-sanitizer $INSTALLROOT/bin/compute-sanitizer + +mv $BUILDDIR/build/nvvm $INSTALLROOT/ +/bin/sh $BUILDDIR/pkg/builds/NVIDIA-Linux-${ARCH}-$CUDADRIVER_VERSION.run --silent --extract-only --tmpdir $BUILDDIR/tmp --target $BUILDDIR/build/drivers + +mkdir -p $INSTALLROOT/drivers +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/drivers/libcuda.so +cp -p $BUILDDIR/build/drivers/libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcudadebugger.so.1 +ln -sf libcudadebugger.so.1 $INSTALLROOT/drivers/libcudadebugger.so +cp -p $BUILDDIR/build/drivers/libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so.1 +ln -sf libnvidia-ptxjitcompiler.so.1 $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so +cp -p $BUILDDIR/build/drivers/libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-nvvm.so.4 +ln -sf libnvidia-nvvm.so.4 $INSTALLROOT/drivers/libnvidia-nvvm.so +cp -p $BUILDDIR/build/drivers/nvidia-smi $INSTALLROOT/drivers/ + +mkdir -p $INSTALLROOT/lib64/stubs +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/lib64/stubs/libcuda.so +cp -p $BUILDDIR/build/drivers/libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libnvidia-ml.so.1 +ln -sf libnvidia-ml.so.1 $INSTALLROOT/lib64/stubs/libnvidia-ml.so \ No newline at end of file diff --git a/cuda.sh b/cuda.sh new file mode 100644 index 00000000..9b65e39e --- /dev/null +++ b/cuda.sh @@ -0,0 +1,96 @@ +package: cuda +version: "12.9.0" +variables: + driversversion: 575.51.03 + aarch64_src: "linux-sbsa" + x86_64_src: "linux" + selected_src: "%%(%(platform_machine)s_src)s" +sources: + - https://developer.download.nvidia.com/compute/cuda/%(version)s/local_installers/cuda_%(version)s_%(driversversion)s_%(selected_src)s.run +requires: + - Python + - gcc +--- +ARCH=$(uname -m) +CUDADRIVER_VERSION="%(driversversion)s" +cp "$SOURCEDIR/${SOURCE0}" "$BUILDDIR/" + +chmod +x cuda_"$PKGVERSION"_"$CUDADRIVER_VERSION"_linux*.run + +mkdir -p $BUILDDIR/{build,tmp} + +CUDA_INSTALL_CMD=(/bin/sh cuda_${PKGVERSION}_${CUDADRIVER_VERSION}_linux*.run \ + --silent \ + --override \ + --tmpdir="${BUILDDIR}/tmp" \ + --installpath="${BUILDDIR}/build" \ + --toolkit \ + --keep) + +"${CUDA_INSTALL_CMD[@]}" + +mkdir -p $INSTALLROOT/{include,lib64} + +mv $BUILDDIR/build/lib64/libcudadevrt.a $INSTALLROOT/lib64/ +mv $BUILDDIR/build/lib64/libcudart_static.a $INSTALLROOT/lib64/ +rm -f $BUILDDIR/build/lib64/lib*.a + +rm -rf $BUILDDIR/build/lib64/stubs/ + +rm -f $BUILDDIR/build/lib64/libOpenCL.* + +chmod a+x $BUILDDIR/build/lib64/*.so +mv $BUILDDIR/build/lib64/* $INSTALLROOT/lib64/ + +chmod a-x $BUILDDIR/build/include/*.h* +mv $BUILDDIR/build/include/* $INSTALLROOT/include/ + +chmod a+x $BUILDDIR/build/extras/CUPTI/lib64/*.so* +mv $BUILDDIR/build/extras/CUPTI/lib64/*.so* $INSTALLROOT/lib64/ +mv $BUILDDIR/build/extras/CUPTI/include/*.h $INSTALLROOT/include/ + +rm -f $BUILDDIR/build/bin/computeprof +rm -f $BUILDDIR/build/bin/cuda-uninstaller +rm -f $BUILDDIR/build/bin/ncu* +rm -f $BUILDDIR/build/bin/nsight* +rm -f $BUILDDIR/build/bin/nsys* +rm -f $BUILDDIR/build/bin/nvvp +mv $BUILDDIR/build/bin $INSTALLROOT/ + +mv $BUILDDIR/build/share/ $INSTALLROOT/ +mv $INSTALLROOT/bin/cuda-gdb $INSTALLROOT/bin/cuda-gdb.real +cat > $INSTALLROOT/bin/cuda-gdb << @EOF +#! /bin/bash +export PYTHONHOME=$PYTHON_ROOT +exec $INSTALLROOT/bin/cuda-gdb.real "\$@" +@EOF +chmod a+x $INSTALLROOT/bin/cuda-gdb + +mv $BUILDDIR/build/compute-sanitizer $INSTALLROOT/ +rm -f $INSTALLROOT/bin/compute-sanitizer +ln -s ../compute-sanitizer/compute-sanitizer $INSTALLROOT/bin/compute-sanitizer +mv $BUILDDIR/build/nvvm $INSTALLROOT/ +/bin/sh $BUILDDIR/pkg/builds/NVIDIA-Linux-${ARCH}-$CUDADRIVER_VERSION.run --silent --extract-only --tmpdir $BUILDDIR/tmp --target $BUILDDIR/build/drivers + +mkdir -p $INSTALLROOT/drivers +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/drivers/libcuda.so +cp -p $BUILDDIR/build/drivers/libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libcudadebugger.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libcudadebugger.so.1 +ln -sf libcudadebugger.so.1 $INSTALLROOT/drivers/libcudadebugger.so +cp -p $BUILDDIR/build/drivers/libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-ptxjitcompiler.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so.1 +ln -sf libnvidia-ptxjitcompiler.so.1 $INSTALLROOT/drivers/libnvidia-ptxjitcompiler.so +cp -p $BUILDDIR/build/drivers/libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/ +ln -sf libnvidia-nvvm.so.$CUDADRIVER_VERSION $INSTALLROOT/drivers/libnvidia-nvvm.so.4 +ln -sf libnvidia-nvvm.so.4 $INSTALLROOT/drivers/libnvidia-nvvm.so +cp -p $BUILDDIR/build/drivers/nvidia-smi $INSTALLROOT/drivers/ + +mkdir -p $INSTALLROOT/lib64/stubs +cp -p $BUILDDIR/build/drivers/libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libcuda.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libcuda.so.1 +ln -sf libcuda.so.1 $INSTALLROOT/lib64/stubs/libcuda.so +cp -p $BUILDDIR/build/drivers/libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/ +ln -sf libnvidia-ml.so.$CUDADRIVER_VERSION $INSTALLROOT/lib64/stubs/libnvidia-ml.so.1 +ln -sf libnvidia-ml.so.1 $INSTALLROOT/lib64/stubs/libnvidia-ml.so diff --git a/cudnn.sh b/cudnn.sh new file mode 100644 index 00000000..310db114 --- /dev/null +++ b/cudnn.sh @@ -0,0 +1,18 @@ +package: cudnn +version: "9.9.0.52" +requires: +- cuda +variables: + cudaversion: "12" + aarch64_src: "linux-sbsa" + x86_64_src: "linux-x86_64" + selected_src: "%%(%(platform_machine)s_src)s" +sources: +- https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/%(selected_src)s/cudnn-%(selected_src)s-%(version)s_cuda%(cudaversion)s-archive.tar.xz +--- +tar -xJf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +mv $BUILDDIR/lib $INSTALLROOT/lib64 +mv $BUILDDIR/* $INSTALLROOT/ \ No newline at end of file diff --git a/curl.sh b/curl.sh new file mode 100644 index 00000000..b9658435 --- /dev/null +++ b/curl.sh @@ -0,0 +1,35 @@ +package: curl +version: "7.79.0" +tag: curl-7_79_0 +source: https://github.com/curl/curl.git +requires: + - zlib +--- +set -x +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +if [[ "$OSTYPE" == "darwin"* ]]; then + KERBEROS_ROOT=/usr/heimdal + OS_TYPE="darwin" +else + KERBEROS_ROOT=/usr + OS_TYPE="linux" +fi + +./buildconf + +./configure \ + --prefix="$INSTALLROOT" \ + --disable-silent-rules \ + --disable-static \ + --without-libidn \ + --without-zstd \ + --disable-ldap \ + --with-zlib="$ZLIB_ROOT" \ + --without-nss \ + --without-libssh2 \ + --with-gssapi="$KERBEROS_ROOT" \ + --with-openssl + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/davix.sh b/davix.sh new file mode 100644 index 00000000..c274a263 --- /dev/null +++ b/davix.sh @@ -0,0 +1,37 @@ +package: davix +version: "%(tag_basename)s" +tag: R_0_8_9 +source: https://github.com/cern-fts/davix +build_requires: + - CMake +requires: + - gcc + - libxml2 + - libuuid + - curl + - Python +--- +cd $SOURCEDIR +git submodule update --recursive --init +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ +cd $BUILDDIR + +soext="so" +if [[ "$(uname -s)" == "Darwin" ]]; then + soext="dylib" +fi + + +rm -rf ../build; mkdir ../build; cd ../build + +cmake ../davix \ + -DRAPIDJSON_HAS_STDSTRING=1 \ + -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ + -DEMBEDDED_LIBCURL=FALSE \ + -DDAVIX_TESTS=FALSE \ + -DUUID_LIBRARY="${LIBUUID_ROOT}/lib64/libuuid.${soext}" \ + -DCMAKE_PREFIX_PATH="${LIBXML2_ROOT};${LIBUUID_ROOT};${CURL_ROOT}" \ + +make VERBOSE=1 ${JOBS:+-j$JOBS} +cd ../build +make install \ No newline at end of file diff --git a/db6.sh b/db6.sh new file mode 100644 index 00000000..2d37265a --- /dev/null +++ b/db6.sh @@ -0,0 +1,23 @@ +package: db6 +version: "%(tag_basename)s" +tag: 6.2.32 +requires: + - gcc +sources: +- http://cmsrep.cern.ch/cmssw/download/db-%(tag_basename)s.tar.gz +--- +CMS_BITS_MARCH=$(gcc -dumpmachine) + +tar -xzf "$SOURCEDIR"/*.tar.gz -C "$BUILDDIR" + +cd $BUILDDIR/db-* + +./dist/configure \ + --prefix="$INSTALLROOT" \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + --disable-java \ + --disable-tcl \ + --disable-static + +make ${JOBS+-j $JOBS} +make install diff --git a/dcap.sh b/dcap.sh new file mode 100644 index 00000000..b8c116e1 --- /dev/null +++ b/dcap.sh @@ -0,0 +1,29 @@ +package: dcap +version: "%(tag_basename)s" +tag: cms/2.47.12 +source: https://github.com/cms-externals/dcap +requires: +- zlib +- gcc +- gmake +--- +set -e +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ +if [ -f src/Makefile.am ]; then + perl -p -i.bak -e 's|^library_includedir.*|library_includedir=\$(includedir)|' src/Makefile.am + echo "Patched src/Makefile.am" + diff src/Makefile.am.bak src/Makefile.am || true +else + echo "Warning: src/Makefile.am not found" +fi +mkdir -p config +aclocal -I config +autoheader +libtoolize --automake +automake --add-missing --copy --foreign +autoconf +./configure --prefix "$INSTALLROOT" \ + CFLAGS="-I${ZLIB_ROOT}/include -Wno-implicit-function-declaration" \ + LDFLAGS="-L${ZLIB_ROOT}/lib" +make -C src ${JOBS:+-j$JOBS} +make -C src install \ No newline at end of file diff --git a/defaults-cms.sh b/defaults-cms.sh new file mode 100644 index 00000000..4becfb7e --- /dev/null +++ b/defaults-cms.sh @@ -0,0 +1,33 @@ +package: defaults-cms +version: v1 +env: + CFLAGS: -fPIC -O2 + CMAKE_BUILD_TYPE: RELWITHDEBINFO + CXXFLAGS: -fPIC -O2 -std=c++20 + CXXSTD: '20' + ENABLE_VMC: 'ON' + GEANT4_BUILD_MULTITHREADED: 'OFF' + MACOSX_DEPLOYMENT_TARGET: '14.0' +disable: + - rocm + - cuda +overrides: + AliPhysics: + version: '%(commit_hash)s_O2' + AliRoot: + version: '%(commit_hash)s_O2' + requires: + - ROOT + - DPMJET + - fastjet:(?!.*ppc64) + - GEANT3 + - GEANT4_VMC + - Vc + - ZeroMQ + - JAliEn-ROOT + cgal: + version: 4.12.2 +--- +# This file is included in any build recipe and it's only used to set +# environment variables. Which file to actually include can be defined by the +# "--defaults" option of alibuild. diff --git a/defaults-o2.sh b/defaults-o2.sh new file mode 100644 index 00000000..97d36818 --- /dev/null +++ b/defaults-o2.sh @@ -0,0 +1,40 @@ +package: defaults-o2 +version: v1 +env: + CFLAGS: -fPIC -O2 + CMAKE_BUILD_TYPE: RELWITHDEBINFO + CXXFLAGS: -fPIC -O2 -std=c++20 + CXXSTD: '20' + ENABLE_VMC: 'ON' + GEANT4_BUILD_MULTITHREADED: 'OFF' + MACOSX_DEPLOYMENT_TARGET: '14.0' + LLVM_BUILD_TYPE: "Release" + ARCH : "$ARCH" + without_rocm: "yes" + without_cuda: "" + cuda_gcc_support: "true" + +disable: + - mesos + - MySQL +overrides: + AliPhysics: + version: '%(commit_hash)s_O2' + AliRoot: + version: '%(commit_hash)s_O2' + requires: + - ROOT + - DPMJET + - fastjet:(?!.*ppc64) + - GEANT3 + - GEANT4_VMC + - Vc + - ZeroMQ + - JAliEn-ROOT + cgal: + version: 4.12.2 +--- +ARCH = uname -m +# This file is included in any build recipe and it's only used to set +# environment variables. Which file to actually include can be defined by the +# "--defaults" option of alibuild. diff --git a/eigen.sh b/eigen.sh new file mode 100644 index 00000000..904928f4 --- /dev/null +++ b/eigen.sh @@ -0,0 +1,16 @@ +package: eigen +version: "%(tag_basename)s" +tag: cms/master/3bb6a48d8c171cf20b5f8e48bfb4e424fbd4f79e +source: https://github.com/cms-externals/eigen-git-mirror +build_requires: +- CMake +- gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$PKGNAME-$PKGVERSION"/ + +cmake $PKGNAME-$PKGVERSION \ + -DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \ + -DBUILD_TESTING=OFF \ + -DCMAKE_CXX_STANDARD=20 + +make install diff --git a/expat.sh b/expat.sh new file mode 100644 index 00000000..ca580e84 --- /dev/null +++ b/expat.sh @@ -0,0 +1,45 @@ +package: expat +version: "%(tag_basename)s" +tag: R_2_4_8 +requires: + - gcc +source: https://github.com/libexpat/libexpat +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" +TMPDIR="$BUILDDIR/expat/conftools" +rm -f "$TMPDIR"/config.{sub,guess} +curl -L -k -s -o "$TMPDIR"/config.guess "$CONFIG_GUESS_URL" +curl -L -k -s -o "$TMPDIR"/config.sub "$CONFIG_SUB_URL" +ls -l "$TMPDIR"/config.* + +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi + +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/conftools/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/conftools/*"); do + echo " 📝 Replacing: $CONFIG_SUB_FILE" + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + + +cd "$PKGNAME" +./buildconf.sh +./configure --prefix="$INSTALLROOT" +make ${JOBS+-j $JOBS} + +make install + diff --git a/fftw3.sh b/fftw3.sh new file mode 100644 index 00000000..a426e39e --- /dev/null +++ b/fftw3.sh @@ -0,0 +1,22 @@ +package: FFTW3 +version: "%(tag_basename)s" +tag: v3.3.9 +source: https://github.com/alisw/fftw3 +build_requires: + - CMake + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +CONFIG_ARGS="--enable-maintainer-mode --with-pic --enable-shared --enable-threads --disable-fortran + --disable-dependency-tracking --disable-mpi --disable-openmp --disable-doc + --prefix=${INSTALLROOT}" + +if [ "$(uname -m)" = "x86_64" ]; then + CONFIG_ARGS="${CONFIG_ARGS} --enable-sse2" +fi + +sh bootstrap.sh +./configure ${CONFIG_ARGS} +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/fmt.sh b/fmt.sh new file mode 100644 index 00000000..e6220a61 --- /dev/null +++ b/fmt.sh @@ -0,0 +1,35 @@ +package: fmt +version: "10.2.1" +tag: 10.2.1 +source: https://github.com/fmtlib/fmt/ +build_requires: +- CMake +- gmake +requires: +- gcc +--- +#mkdir -p $BUILDDIR/src +#rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR/src" + +if [ -z "${arch_build_flags:-}" ]; then + case "$(uname -m)" in + ppc64le) arch_build_flags="-mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512" ;; + aarch64) arch_build_flags="-march=armv8-a -mno-outline-atomics" ;; + x86_64) arch_build_flags="" ;; + *) arch_build_flags="" ;; + esac +fi + +CMAKE_ARGS=( + -DCMAKE_INSTALL_PREFIX=$INSTALLROOT + -DCMAKE_INSTALL_LIBDIR=lib + -DBUILD_SHARED_LIBS=TRUE +) + +if [[ -n "${arch_build_flags}" ]]; then + CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=${arch_build_flags}") +fi + +cmake "${CMAKE_ARGS[@]}" "$SOURCEDIR" +make ${JOBS:+-j$JOBS} +make install diff --git a/freetype.sh b/freetype.sh new file mode 100644 index 00000000..c33abb26 --- /dev/null +++ b/freetype.sh @@ -0,0 +1,22 @@ +package: FreeType +version: v2.10.0 +tag: VER-2-10-0 +source: https://github.com/freetype/freetype +requires: + - gcc + - bz2lib + - zlib + - libpng +--- +rsync -a --chmod=ug=rwX --exclude='**/.git' --delete --delete-excluded "$SOURCEDIR/" ./ +type libtoolize && export LIBTOOLIZE=libtoolize +type glibtoolize && export LIBTOOLIZE=glibtoolize +sh autogen.sh +./configure --prefix="$INSTALLROOT" \ + ${BZ2LIB_ROOT:+--with-bzip2="$BZ2ZLIB_ROOT"} \ + ${ZLIB_ROOT:+--with-zlib="$ZLIB_ROOT"} \ + ${LIBPNG_ROOT:+--with-png="$LIBPNG_ROOT"} \ + --with-harfbuzz=no + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/fxdiv.sh b/fxdiv.sh new file mode 100644 index 00000000..ca42114e --- /dev/null +++ b/fxdiv.sh @@ -0,0 +1,15 @@ +package: fxdiv +version: "%(tag_basename)s" +tag: b408327ac2a15ec3e43352421954f5b1967701d1 +sources: + - https://github.com/Maratyszcza/FXdiv/archive/%(tag_basename)s.tar.gz +requires: + - gcc +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +mkdir -p $INSTALLROOT/include +cp -a include/fxdiv.h $INSTALLROOT/include/ + diff --git a/gcc-prerequisites.sh b/gcc-prerequisites.sh new file mode 100644 index 00000000..f686ea60 --- /dev/null +++ b/gcc-prerequisites.sh @@ -0,0 +1,182 @@ +package: gcc-prerequisites +version: "1.0" +variables: + gmpVersion: "6.3.0" + mpfrVersion: "4.2.1" + mpcVersion: "1.3.1" + islVersion: "0.27" + zlibVersion: "1.2.13" + zstdVersion: "1.5.4" + bisonVersion: "3.8.2" + binutilsVersion: "2.43.1" + elfutilsVersion: "0.192" + m4Version: "1.4.19" + flexVersion: "2.6.4" +sources: + - https://gmplib.org/download/gmp/gmp-%(gmpVersion)s.tar.bz2 + - http://www.mpfr.org/mpfr-%(mpfrVersion)s/mpfr-%(mpfrVersion)s.tar.bz2 + - https://ftp.gnu.org/gnu/mpc/mpc-%(mpcVersion)s.tar.gz + - https://libisl.sourceforge.io/isl-%(islVersion)s.tar.bz2 + - http://ftp.gnu.org/gnu/bison/bison-%(bisonVersion)s.tar.gz + - https://sourceware.org/pub/binutils/releases/binutils-%(binutilsVersion)s.tar.bz2 + - https://sourceware.org/pub/elfutils/%(elfutilsVersion)s/elfutils-%(elfutilsVersion)s.tar.bz2 + - http://ftp.gnu.org/gnu/m4/m4-%(m4Version)s.tar.gz + - https://github.com/westes/flex/releases/download/v%(flexVersion)s/flex-%(flexVersion)s.tar.gz + - https://zlib.net/fossils/zlib-%(zlibVersion)s.tar.gz + - https://github.com/facebook/zstd/releases/download/v%(zstdVersion)s/zstd-%(zstdVersion)s.tar.gz + - https://github.com/gcc-mirror/gcc/commit/0a1d2ea57722c248777e1130de076e28c443ff8b.diff + - https://github.com/gcc-mirror/gcc/commit/77d01927bd7c989d431035251a5c196fe39bcec9.diff +patches: + - gcc-flex-disable-doc.patch + - gcc-flex-nonfull-path-m4.patch +--- +for f in "$SOURCEDIR"/*; do + case "$f" in + *.diff|*.patch) cp -- "$f" "$BUILDDIR";; + *.tar.gz|*.tgz) tar -xzf "$f" -C "$BUILDDIR";; + *.tar.bz2) tar -xjf "$f" -C "$BUILDDIR";; + *.tar.xz) tar -xJf "$f" -C "$BUILDDIR";; + *.tar) tar -xf "$f" -C "$BUILDDIR";; + esac +done +cp $PATCH0 $PATCH1 flex-*/ +cd flex-* +patch -p1 < $PATCH0 +patch -p1 < $PATCH1 + +cd $BUILDDIR + +OS="$(uname)" +ARCH="$(uname -m)" +if [ "$OS" = "Darwin" ]; then + export CC="clang" + export CXX="clang++" + export CPP="clang -E" + export CXXCPP="clang++ -E" + export ADDITIONAL_LANGUAGES=",objc,obj-c++" + export CONF_GCC_OS_SPEC="" +else + export CC="gcc" + export CXX="c++" + export CPP="cpp" + export CXXCPP="c++ -E" + export CONF_GCC_OS_SPEC="" +fi + +CC="$CC -fPIC" +CXX="$CXX -fPIC" + +mkdir -p ${INSTALLROOT}/tmp/sw +export PATH=${INSTALLROOT}/tmp/sw/bin:$PATH + +cd zlib* +CONF_FLAGS="-fPIC -O3 -DUSE_MMAP -DUNALIGNED_OK -D_LARGEFILE64_SOURCE=1" +if [ "$ARCH" = "x86_64" ]; then + CONF_FLAGS+=" -msse3" +fi +CFLAGS="$CONF_FLAGS" ./configure --static --prefix="${INSTALLROOT}/tmp/sw" +make ${JOBS+-j $JOBS} +make install +cd .. + +CXXFLAGS="-O2" +CFLAGS="-O2" +CMS_BITS_MARCH=$(gcc -dumpmachine) +echo $CMS_BITS_MARCH +if [ "$OS" = "Linux" ]; then + #Configure flags + CONF_BINUTILS_OPTS="--enable-ld=default --enable-lto --enable-plugins --enable-threads" + CONF_GCC_WITH_LTO="--enable-ld=default --enable-lto" + CONF_BINUTILS_OPTS+=" --enable-gold=yes" + CONF_GCC_WITH_LTO+=" --enable-gold=yes" + + make -C zstd-*/lib ${JOBS:+-j "$JOBS"} \ + install-static install-includes \ + prefix="${INSTALLROOT}/tmp/sw" \ + CPPFLAGS="-fPIC" CFLAGS="-fPIC" + + cd m4-*/ + ./configure --prefix="${INSTALLROOT}/tmp/sw" \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" + make ${JOBS:+-j "$JOBS"} && echo " make m4 OK" + make install && echo " install m4 OK" + + cd ../bison-*/ + ./configure --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + --prefix="${INSTALLROOT}/tmp/sw" \ + CC="${CC}" + make ${JOBS:+-j "$JOBS"} && echo " make bison OK" + make install && echo " install bison OK" + + cd ../flex-*/ + ./configure --disable-nls --prefix="${INSTALLROOT}/tmp/sw" \ + --enable-static --disable-shared \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" CXX="${CXX}" + make ${JOBS:+-j "$JOBS"} && echo " make flex OK" + make install && echo " install flex OK" + + cd ../elfutils-*/ + ./configure --disable-static --with-zlib --without-bzlib --without-lzma \ + --disable-libdebuginfod --enable-libdebuginfod=dummy --disable-debuginfod \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" --program-prefix='eu-' \ + --disable-silent-rules --prefix="${INSTALLROOT}" \ + CC="gcc" \ +# CFLAGS="-O2 -Wno-maybe-uninitialized" \ + CPPFLAGS="-I${INSTALLROOT}/tmp/sw/include" \ + LDFLAGS="-L${INSTALLROOT}/tmp/sw/lib" + make ${JOBS:+-j "$JOBS"} && echo " make elfutils OK" + make install && echo " install elfutils OK" + + if [ "$ARCH" = "ppc64le" ]; then + echo "DETected ppc64le: enabling SPU and powerpc targets" + CONF_BINUTILS_OPTS+=" --enable-targets=spu --enable-targets=powerpc-linux" + fi + + cd ../binutils-*/ + ./configure --disable-static --prefix="${INSTALLROOT}" \ + ${CONF_BINUTILS_OPTS} \ + --disable-werror --enable-deterministic-archives \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" --disable-nls \ + --with-system-zlib --enable-64-bit-bfd \ + CC="$CC" CXX="$CXX" CPP="$CPP" CXXCPP="$CXXCPP" \ + CFLAGS="-I${INSTALLROOT}/include -I${INSTALLROOT}/tmp/sw/include" \ + CXXFLAGS="-I${INSTALLROOT}/include -I${INSTALLROOT}/tmp/sw/include" \ + LDFLAGS="-L${INSTALLROOT}/lib -L${INSTALLROOT}/tmp/sw/lib" + + make ${JOBS:+-j "$JOBS"} && echo " make binutils OK" + + find . -name Makefile \ + -exec perl -p -i -e 's|LN = ln|LN = cp -p|;s|ln ([^-])|cp -p $1|g' {} \; + make install && echo " install binutils OK" +fi +echo Done + +cd ../gmp-*/ +./configure --disable-static --prefix="${INSTALLROOT}" --enable-shared --disable-static --enable-cxx \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" CXX="${CXX}" CPP="${CPP}" CXXCPP="${CXXCPP}" +make ${JOBS+-j $JOBS} +make install + +cd ../mpfr-*/ +./configure --disable-static --prefix="${INSTALLROOT}" --with-gmp="${INSTALLROOT}" \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" CXX="${CXX}" CPP="${CPP}" CXXCPP="${CXXCPP}" +make ${JOBS+-j $JOBS} +make install + +cd ../mpc-*/ +./configure --disable-static --prefix="${INSTALLROOT}" --with-gmp="${INSTALLROOT}" --with-mpfr="${INSTALLROOT}" \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" CXX="${CXX}" CPP="${CPP}" CXXCPP="${CXXCPP}" +make ${JOBS+-j $JOBS} +make install + +cd ../isl-*/ +./configure --disable-static --with-gmp-prefix="${INSTALLROOT}" --prefix="${INSTALLROOT}" \ + --build="$CMS_BITS_MARCH" --host="$CMS_BITS_MARCH" \ + CC="${CC}" CXX="${CXX}" CPP="${CPP}" CXXCPP="${CXXCPP}" +make ${JOBS+-j $JOBS} +make install diff --git a/gcc.sh b/gcc.sh new file mode 100644 index 00000000..a1752e0c --- /dev/null +++ b/gcc.sh @@ -0,0 +1,159 @@ +package: gcc +version: "14.3.1" +tag: e02b12e7248f8209ebad35d6df214d3421ed8020 +variables: + gccTag: "e02b12e7248f8209ebad35d6df214d3421ed8020" + gccBranch: "releases/gcc-14" +sources: + - https://github.com/gcc-mirror/gcc/archive/%(gccTag)s.tar.gz + - https://github.com/gcc-mirror/gcc/commit/0a1d2ea57722c248777e1130de076e28c443ff8b.diff + - https://github.com/gcc-mirror/gcc/commit/77d01927bd7c989d431035251a5c196fe39bcec9.diff +patches: + - 0a1d2ea57722c248777e1130de076e28c443ff8b.diff + - 77d01927bd7c989d431035251a5c196fe39bcec9.diff +requires: + - gcc-prerequisites +--- +for f in "$SOURCEDIR"/*; do + case "$f" in + *.diff|*.patch) cp -- "$f" "$BUILDDIR";; + *.tar.gz|*.tgz) tar -xzf "$f" -C "$BUILDDIR";; + *.tar.bz2) tar -xjf "$f" -C "$BUILDDIR";; + *.tar.xz) tar -xJf "$f" -C "$BUILDDIR";; + *.tar) tar -xf "$f" -C "$BUILDDIR";; + esac +done + +cp $PATCH0 $PATCH1 gcc-*/ +cd gcc-* +patch -p1 < $PATCH0 +patch -p1 < $PATCH1 +cd $BUILDDIR +<<'DISABLE' +cat << \EOF > ${PKGNAME}-req +#!/bin/sh +%{__find_requires} $* | \ +sed -e '/GLIBC_PRIVATE/d' +EOF +%global __find_requires %{_builddir}/%{moduleName}/%{name}-req +chmod +x %{__find_requires} +DISABLE +OS="$(uname)" +ARCH="$(uname -m)" + +patch_gcc_cms() { + cd gcc-* + # Only on 64-bit Linux + if [[ "$OS" == "Linux" ]] && [[ "$ARCH" == "x86_64" ]]; then + cat <<\EOF_CONFIG_GCC >> gcc/config.gcc +# CMS patch to include gcc/config/i386/cms.h when building gcc +tm_file="$tm_file i386/cms.h" +EOF_CONFIG_GCC + + cat <<\EOF_CMS_H > gcc/config/i386/cms.h +#undef LINK_SPEC +#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \ + %{shared:-shared} \ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \ + %{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \ + %{static:-static}} -z common-page-size=4096 -z max-page-size=4096" +EOF_CMS_H + fi + + # Always include the general CMS header + cat <<\EOF_CONFIG_GCC >> gcc/config.gcc +# CMS patch to include gcc/config/general-cms.h when building gcc +tm_file="$tm_file general-cms.h" +EOF_CONFIG_GCC + + cat <<\EOF_CMS_H > gcc/config/general-cms.h +#undef CC1PLUS_SPEC +#define CC1PLUS_SPEC "-fabi-version=0" +EOF_CMS_H +cd .. +} + +if [ "$OS" = "Darwin"]; then + export CC="clang" + export CXX="clang++" + export CPP="clang -E" + export CXXCPP="clang++ -E" + export ADDITIONAL_LANGUAGES=",objc,obj-c++" + export CONF_GCC_OS_SPEC="" +else + export CC="gcc" + export CXX="c++" + export CPP="cpp" + export CXXCPP="c++ -E" + export CONF_GCC_OS_SPEC="" +fi + +CXXFLAGS="-O2" +CFLAGS="-O2" +CC="$CC -fPIC" +CXX="$CXX -fPIC" +OLD="$(sed 's|.*/sw/||' <<< "$GCC_PREREQUISITES_ROOT")" +NEW="$(sed 's|.*/INSTALLROOT/[^/]*/||' <<< "$INSTALLROOT")" +rsync -a ${GCC_PREREQUISITES_ROOT}/ ${INSTALLROOT}/ +rm -rf ${INSTALLROOT}/etc/profile.d/dependencies-setup.*sh ${INSTALLROOT}/etc/profile.d/init.*sh + +sed -i -e "s|${OLD}|${NEW}|g" \ + ${INSTALLROOT}/etc/profile.d/debuginfod.*sh \ + ${INSTALLROOT}/share/fish/vendor_conf.d/debuginfod.fish \ + ${INSTALLROOT}/bin/eu-make-debug-archive + +find "${INSTALLROOT}"/*/lib/ldscripts -type f -exec \ + sed -i -e "s|${OLD}|${NEW}|g" {} + + +export PATH="${INSTALLROOT}/tmp/sw/bin:${PATH}" + +CONF_GCC_ARCH_SPEC="--enable-frame-pointer" + +if [ "$ARCH" = "x86_64" ]; then + if [ $(grep -oE '[0-9]+' /etc/redhat-release 2>/dev/null | head -1 || echo 0) -gt 9 ]; then + CONF_GCC_ARCH_SPEC="$CONF_GCC_ARCH_SPEC --with-arch=x86-64-v3" + fi +fi + +if [ "$ARCH" = "aarch64" ]; then + CONF_GCC_ARCH_SPEC="$CONF_GCC_ARCH_SPEC \ + --enable-threads=posix --enable-initfini-array --disable-libmpx" +fi + +if [ "$ARCH" = "ppc64le" ]; then + CONF_GCC_ARCH_SPEC="$CONF_GCC_ARCH_SPEC \ + --enable-threads=posix --enable-initfini-array \ + --enable-targets=powerpcle-linux --enable-secureplt --with-long-double-128 \ + --with-cpu=power8 --with-tune=power8 --disable-libmpx" +fi + +ls -l + +cd gcc-* +rm gcc/DEV-PHASE +touch gcc/DEV-PHASE +mkdir -p obj +cd obj + +export LD_LIBRARY_PATH=$INSTALLROOT/lib64:$INSTALLROOT/lib:$LD_LIBRARY_PATH + +../configure --prefix=$INSTALLROOT --disable-multilib --disable-nls --disable-dssi \ + --enable-languages=c,c++,fortran$ADDITIONAL_LANGUAGES --enable-gnu-indirect-function \ + --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object \ + --enable-plugin --with-linker-hash-style=gnu --enable-linker-build-id \ + $CONF_GCC_OS_SPEC $CONF_GCC_WITH_LTO --with-gmp=$INSTALLROOT --with-mpfr=$INSTALLROOT --enable-bootstrap \ + --with-mpc=$INSTALLROOT --with-isl=$INSTALLROOT --enable-checking=release \ + --build="$MARCH" --host="$MARCH" $CONF_GCC_ARCH_SPEC \ + --enable-shared --disable-libgcj \ + --with-zstd=$INSTALLROOT/tmp/sw \ + CC="$CC" CXX="$CXX" CPP="$CPP" CXXCPP="$CXXCPP" \ + CFLAGS="-I$INSTALLROOT/tmp/sw/include" CXXFLAGS="-I$INSTALLROOT/tmp/sw/include" LDFLAGS="-L$INSTALLROOT/tmp/sw/lib" + +make ${JOBS:+-j "$JOBS"} profiledbootstrap + +cd $BUILDDIR/gcc-*/obj && make install +ln -s gcc $INSTALLROOT/bin/cc +find $INSTALLROOT/lib $INSTALLROOT/lib64 -name '*.la' -exec rm -f {} \; || true diff --git a/gdbm.sh b/gdbm.sh new file mode 100644 index 00000000..559d9150 --- /dev/null +++ b/gdbm.sh @@ -0,0 +1,53 @@ +package: gdbm +version: "%(tag_basename)s" +tag: "1.10" +build_requires: + - gmake +requires: + - gcc +sources: +- http://ftp.gnu.org/gnu/gdbm/gdbm-%(tag_basename)s.tar.gz +--- +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" + +tar -xzf "$SOURCEDIR"/*.tar.gz -C "$BUILDDIR" + +TMPDIR=$(echo $BUILDDIR/gdbm-*/build-aux) + +rm -f $TMPDIR/config.{sub,guess} + +curl -L -k -s -o "$TMPDIR/config.guess" "$CONFIG_GUESS_URL" + +curl -L -k -s -o "$TMPDIR/config.sub" "$CONFIG_SUB_URL" + +ls -l "$TMPDIR"/config.* + +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/build-aux/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/build-aux/*"); do + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + +cd $BUILDDIR/gdbm-* +./configure \ + --enable-libgdbm-compat \ + --prefix="$INSTALLROOT" \ + --disable-dependency-tracking \ + --disable-nls \ + --disable-rpath + +make ${JOBS+-j $JOBS} +make install diff --git a/gdrcopy.sh b/gdrcopy.sh new file mode 100644 index 00000000..6d4222e8 --- /dev/null +++ b/gdrcopy.sh @@ -0,0 +1,11 @@ +package: gdrcopy +version: "%(tag_basename)s" +tag: v2.4.4 +source: https://github.com/NVIDIA/gdrcopy +requires: + - cuda + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ +make ${JOBS:+-j$JOBS} prefix=$INSTALLROOT libdir=$INSTALLROOT/lib64 CUDA=$CUDA_ROOT lib +make ${JOBS:+-j$JOBS} prefix=$INSTALLROOT libdir=$INSTALLROOT/lib64 CUDA=$CUDA_ROOT lib_install \ No newline at end of file diff --git a/giflib.sh b/giflib.sh new file mode 100644 index 00000000..47544fb0 --- /dev/null +++ b/giflib.sh @@ -0,0 +1,14 @@ +package: giflib +version: "5.2.1" +sources: + - https://sourceforge.net/projects/giflib/files/giflib-%(version)s.tar.gz +requires: + - gcc +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +echo "all:" > doc/Makefile +make all ${JOBS:+-j$JOBS} LIBVER=$PKGVERSION LIBMAJOR=5 PREFIX=$INSTALLROOT +make LIBVER=${PKGVERSION} LIBMAJOR=5 PREFIX=$INSTALLROOT install \ No newline at end of file diff --git a/gmake.sh b/gmake.sh new file mode 100644 index 00000000..9d3ca403 --- /dev/null +++ b/gmake.sh @@ -0,0 +1,14 @@ +package: gmake +version: "%(tag_basename)s" +tag: "4.3" +sources: + - ftp://ftp.gnu.org/gnu/make/make-%(tag_basename)s.tar.gz +--- +tar -xzf "$SOURCEDIR"/*.tar.gz -C "$BUILDDIR" +cd $BUILDDIR/make-* +./configure --prefix=$INSTALLROOT +make ${JOBS+-j $JOBS} +make install +rm -rf $INSTALLROOT/{man,info} +cd $INSTALLROOT/bin +ln -sf make gmake diff --git a/gsl.sh b/gsl.sh new file mode 100644 index 00000000..e1c06c7e --- /dev/null +++ b/gsl.sh @@ -0,0 +1,51 @@ +package: GSL +version: "%(tag_basename)s" +tag: "v2.6.0" +source: https://github.com/ampl/gsl +requires: + - gcc + - OpenBLAS +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" + +TMPDIR="$BUILDDIR/tmp" +mkdir -p "$TMPDIR" + +rm -f "$TMPDIR"/config.{sub,guess} + +curl -L -k -s -o "$TMPDIR"/config.guess "$CONFIG_GUESS_URL" + +curl -L -k -s -o "$TMPDIR"/config.sub "$CONFIG_SUB_URL" + +ls -l "$TMPDIR"/config.* + +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/tmp/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/tmp/*"); do + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + +CFLAGS="-O2" ./configure --prefix=${INSTALLROOT} --with-pic + +make ${JOBS:+-j$JOBS} +make install + +rm -rf ${INSTALLROOT}/lib/pkgconfig +rm -fv $INSTALLROOT/lib/*.la +mkdir ${INSTALLROOT}/cblas +mv ${INSTALLROOT}/lib/libgslcblas* ${INSTALLROOT}/cblas/ \ No newline at end of file diff --git a/hwloc.sh b/hwloc.sh new file mode 100644 index 00000000..e96965a2 --- /dev/null +++ b/hwloc.sh @@ -0,0 +1,46 @@ +package: hwloc +version: "%(tag_basename)s" +tag: hwloc-2.12.0 +source: https://github.com/open-mpi/hwloc +requires: + - gcc + - libpciaccess + - libxml2 + - numactl +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +sh autogen.sh + +./configure \ + --prefix ${INSTALLROOT} \ + --enable-shared \ + --disable-static \ + --disable-dependency-tracking \ + --enable-cpuid \ + --enable-libxml2 \ + --disable-cairo \ + --disable-doxygen \ + --disable-opencl \ + --with-pic \ + --with-gnu-ld \ + --without-x \ + HWLOC_PCIACCESS_CFLAGS="-I$LIBPCIACCESS_ROOT/include" \ + HWLOC_PCIACCESS_LIBS="-L$LIBPCIACCESS_ROOT/lib -lpciaccess" \ + HWLOC_LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2" \ + HWLOC_LIBXML2_LIBS="-L$LIBXML2_ROOT/lib -lxml2" \ + HWLOC_NUMA_CFLAGS="-I$NUMACTL_ROOT/include" \ + HWLOC_NUMA_LIBS="-L$NUMACTL_ROOT/lib -lnuma" + +make ${JOBS:+-j$JOBS} +make install + +# remove the libtool library files +rm -f $INSTALLROOT/lib/lib*.la +rm -f $INSTALLROOT/lib/hwloc/*.la + +# remove unnecessary or unwanted files +rm -rf $INSTALLROOT/sbin +rm -rf $INSTALLROOT/share/doc +rm -rf $INSTALLROOT/share/hwloc +rm -f $INSTALLROOT/share/man/man1/hwloc-dump-hwdata.1 \ No newline at end of file diff --git a/isal.sh b/isal.sh new file mode 100644 index 00000000..0e8a2b39 --- /dev/null +++ b/isal.sh @@ -0,0 +1,16 @@ +package: isal +version: "%(tag_basename)s" +tag: v2.30.0 +source: https://github.com/intel/isa-l +build_requires: + - nasm +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh +./configure --prefix=$INSTALLROOT --with-pic + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/libfabric.sh b/libfabric.sh new file mode 100644 index 00000000..861f2b72 --- /dev/null +++ b/libfabric.sh @@ -0,0 +1,102 @@ +package: libfabric +version: "2.1.0" +tag: v2.1.0 +source: https://github.com/ofiwg/libfabric +requires: + - curl + - numactl + - rdma-core + - xpmem + - cuda + - gdrcopy + - gcc +--- + +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh + +# Configuration arguments array +configure_args=() + +# Basic configuration options +configure_args+=( + "--prefix=${INSTALLROOT}" + "--disable-dependency-tracking" + "--disable-debug" + "--disable-profile" + "--disable-asan" + "--disable-lsan" + "--disable-tsan" + "--disable-ubsan" + "--enable-shared" + "--disable-static" + "--enable-shm" + "--enable-sm2" + "--enable-xpmem=${XPMEM_ROOT}" + "--disable-sockets" + "--enable-tcp" + "--enable-udp" + "--enable-verbs=${RDMA_CORE_ROOT}" + "--disable-opx" + "--disable-psm2" + "--disable-psm3" + "--disable-usnic" + "--disable-efa" + "--disable-cxi" + "--disable-mrail" + "--disable-lpp" + "--disable-ucx" + "--enable-rxm" + "--enable-lnx" +) + +# CUDA configuration +if [[ -z "${without_cuda}" ]]; then + # CUDA enabled (default) + configure_args+=( + "--enable-cuda-dlopen" + "--enable-gdrcopy-dlopen" + "--with-cuda=${CUDA_ROOT}" + "--with-gdrcopy=${GDRCOPY_ROOT}" + ) +else + # CUDA disabled + configure_args+=( + "--disable-cuda-dlopen" + "--disable-gdrcopy-dlopen" + "--without-cuda" + "--without-gdrcopy" + ) +fi + +# ROCm configuration +if [[ -z "${without_rocm}" ]]; then + # ROCm enabled (default) + configure_args+=( + "--enable-rocr-dlopen" + "--with-rocr=${ROCM_ROOT}" + ) +else + # ROCm disabled + configure_args+=( + "--disable-rocr-dlopen" + "--without-rocr" + ) +fi + +# Additional configuration options +configure_args+=( + "--disable-ze-dlopen" + "--without-ze" + "--with-pic" + "--with-dlopen" + "--with-gnu-ld" + "--with-curl=DIR" + "--with-numa=${NUMACTL_ROOT}" +) + +./configure "${configure_args[@]}" + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/libffi.sh b/libffi.sh new file mode 100644 index 00000000..d648bd07 --- /dev/null +++ b/libffi.sh @@ -0,0 +1,21 @@ +package: libffi +version: "%(tag_basename)s" +tag: v3.4.2 +requires: + - gcc +source: https://github.com/libffi/libffi +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' \ + "$SOURCEDIR"/ "$BUILDDIR"/ +autoreconf -fiv +./configure \ + --prefix="$INSTALLROOT" \ + --enable-portable-binary \ + --disable-dependency-tracking \ + --disable-static \ + --disable-docs +make $MAKEPROCESSES +make $MAKEPROCESSES install + +rm -rf "${INSTALLROOT}/lib" +rm -rf ${INSTALLROOT}/lib64/*.la \ No newline at end of file diff --git a/libjpeg-turbo.sh b/libjpeg-turbo.sh new file mode 100644 index 00000000..0185a507 --- /dev/null +++ b/libjpeg-turbo.sh @@ -0,0 +1,47 @@ +package: libjpeg-turbo +version: "%(tag_basename)s" +tag: 2.0.2 +source: https://github.com/libjpeg-turbo/libjpeg-turbo +requires: + - gcc + - nasm + - CMake +--- +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" + +TMPDIR="$BUILDDIR/tmp" +mkdir -p "$TMPDIR" + +rm -f "$TMPDIR"/config.{sub,guess} + +curl -L -k -s -o "$TMPDIR"/config.guess "$CONFIG_GUESS_URL" + +curl -L -k -s -o "$TMPDIR"/config.sub "$CONFIG_SUB_URL" + +ls -l "$TMPDIR"/config.* + +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/tmp/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/tmp/*"); do + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +cmake -DCMAKE_ASM_NASM_COMPILER=${NASM_ROOT}/bin/nasm -DCMAKE_INSTALL_PREFIX=${INSTALLROOT} -DENABLE_SHARED=TRUE -DENABLE_STATIC=FALSE -DWITH_JPEG8=TRUE + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/libpciaccess.sh b/libpciaccess.sh new file mode 100644 index 00000000..9267a4f2 --- /dev/null +++ b/libpciaccess.sh @@ -0,0 +1,23 @@ +package: libpciaccess +version: "%(tag_basename)s" +tag: libpciaccess_0.16 +sources: +- http://deb.debian.org/debian/pool/main/libp/libpciaccess/%(tag_basename)s.orig.tar.gz +requires: + - zlib + - gcc +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +./configure \ + --prefix ${INSTALLROOT} \ + --disable-dependency-tracking \ + --enable-shared \ + --disable-static \ + --with-pic \ + --with-gnu-ld \ + --with-zlib \ + CPPFLAGS="-I$ZLIB_ROOT/include" \ + LDFLAGS="-L$ZLIB_ROOT/lib" \ No newline at end of file diff --git a/libpng.sh b/libpng.sh new file mode 100644 index 00000000..b1713c90 --- /dev/null +++ b/libpng.sh @@ -0,0 +1,22 @@ +package: libpng +version: "%(tag_basename)s" +tag: cms/v1.6.37 +requires: + - gcc + - zlib +build_requires: + - CMake +source: https://github.com/cms-externals/libpng +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +autoreconf -fiv + +./configure \ + --prefix="$INSTALLROOT" \ + --disable-silent-rules \ + CPPFLAGS="-I${ZLIB_ROOT}/include" \ + LDFLAGS="-L${ZLIB_ROOT}/lib" + +make ${JOBS:+-j $JOBS} +make install \ No newline at end of file diff --git a/libtiff.sh b/libtiff.sh new file mode 100644 index 00000000..50b2b5f7 --- /dev/null +++ b/libtiff.sh @@ -0,0 +1,62 @@ +package: libtiff +version: "%(tag_basename)s" +tag: v4.0.10 +source: https://github.com/libsdl-org/libtiff +requires: + - libjpeg-turbo + - zlib + - xz + - zstd + - gcc + --- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" + +TMPDIR="$BUILDDIR/tmp" +mkdir -p "$TMPDIR" + +rm -f "$TMPDIR"/config.{sub,guess} + +curl -L -k -s -o "$TMPDIR"/config.guess "$CONFIG_GUESS_URL" + +curl -L -k -s -o "$TMPDIR"/config.sub "$CONFIG_SUB_URL" + +ls -l "$TMPDIR"/config.* + +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/tmp/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/tmp/*"); do + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + +sh autogen.sh + + +./configure --prefix=${INSTALLROOT} --disable-static \ + --with-zstd-lib-dir=${ZSTD_ROOT}/lib \ + --with-zstd-include-dir=${ZSTD_ROOT}/include \ + --with-lzma-lib-dir=${XZ_ROOT}/lib \ + --with-lzma-include-dir=${XZ_ROOT}/include \ + --with-zlib-lib-dir=${ZLIB_ROOT}/lib \ + --with-zlib-include-dir=${ZLIB_ROOT}/include \ + --with-jpeg-lib-dir=${LIBJPEG_TURBO_ROOT}/lib64 \ + --with-jpeg-include-dir=${LIBJPEG_TURBO_ROOT}/include \ + --disable-dependency-tracking \ + --without-x + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/libuuid.sh b/libuuid.sh new file mode 100644 index 00000000..9ab0ae8a --- /dev/null +++ b/libuuid.sh @@ -0,0 +1,57 @@ +package: libuuid +version: "%(tag_basename)s" +tag: "2.34" +sources: +- http://www.kernel.org/pub/linux/utils/util-linux/v%(tag_basename)s/util-linux-%(tag_basename)s.tar.gz +requires: + - gcc +--- +tar -xzf "$SOURCEDIR"/*.tar.gz -C "$BUILDDIR" +cd $BUILDDIR/util-linux-* +export CFLAGS="-Wno-error=implicit-function-declaration" + +./configure \ + $([ $(uname) == Darwin ] && echo --disable-shared) \ + --libdir=$INSTALLROOT/lib64 \ + --prefix=$INSTALLROOT \ + --disable-silent-rules \ + --disable-tls \ + --disable-rpath \ + --disable-libblkid \ + --disable-libmount \ + --disable-mount \ + --disable-losetup \ + --disable-fsck \ + --disable-partx \ + --disable-mountpoint \ + --disable-fallocate \ + --disable-unshare \ + --disable-eject \ + --disable-agetty \ + --disable-cramfs \ + --disable-wdctl \ + --disable-switch_root \ + --disable-pivot_root \ + --disable-kill \ + --disable-utmpdump \ + --disable-rename \ + --disable-login \ + --disable-sulogin \ + --disable-su \ + --disable-schedutils \ + --disable-wall \ + --disable-makeinstall-setuid \ + --without-ncurses \ + --enable-libuuid + +make ${JOBS+-j $JOBS} + +mkdir -p $INSTALLROOT/lib64 +cp -p $BUILDDIR/util-linux-*/.libs/libuuid.a* $INSTALLROOT/lib64 + +if [ "$(uname -s)" = "Linux" ]; then + cp -p $BUILDDIR/util-linux-*/.libs/libuuid.so* $INSTALLROOT/lib64 +fi + +mkdir -p $INSTALLROOT/include +make install-uuidincHEADERS diff --git a/libxml2.sh b/libxml2.sh new file mode 100644 index 00000000..6fa8eb3b --- /dev/null +++ b/libxml2.sh @@ -0,0 +1,21 @@ +package: libxml2 +version: "%(tag_basename)s" +tag: v2.9.10 +build_requires: + - zlib + - gcc + - xz +source: https://gitlab.gnome.org/GNOME/libxml2 +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh + +./configure --disable-static --prefix=$INSTALLROOT \ + --with-zlib="${ZLIB_ROOT}" \ + --with-lzma="${XZ_ROOT}" --without-python + +make ${JOBS:+-j$JOBS} +make install +rm -rf ${INSTALLROOT}/lib/pkgconfig +rm -rf ${INSTALLROOT}/lib/*.{l,}a \ No newline at end of file diff --git a/lz4.sh b/lz4.sh new file mode 100644 index 00000000..9c9d5027 --- /dev/null +++ b/lz4.sh @@ -0,0 +1,12 @@ +package: lz4 +version: "%(tag_basename)s" +tag: v1.9.2 +source: https://github.com/lz4/lz4 +build_requires: + - gcc + - CMake +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +make ${JOBS:+-j$JOBS} +make install PREFIX=$INSTALLROOT \ No newline at end of file diff --git a/nasm.sh b/nasm.sh new file mode 100644 index 00000000..dd8e1c58 --- /dev/null +++ b/nasm.sh @@ -0,0 +1,16 @@ +package: nasm +version: "%(tag_basename)s" +tag: 2.14.02 +sources: +- https://www.nasm.us/pub/nasm/releasebuilds/%(tag_basename)s/nasm-%(tag_basename)s.tar.gz +requires: + - gcc +--- +tar -xzf "$SOURCEDIR"/*.tar.gz \ + --strip-components=1 \ + -C "$BUILDDIR" + +./configure --prefix="$INSTALLROOT" + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/ninja.sh b/ninja.sh new file mode 100644 index 00000000..8158cd40 --- /dev/null +++ b/ninja.sh @@ -0,0 +1,15 @@ +package: ninja +version: "%(tag_basename)s" +tag: v1.11.1 +source: https://github.com/ninja-build/ninja +build_requires: + - re2c + - Python +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ +python3 ./configure.py --bootstrap + +mkdir -p "$INSTALLROOT/bin" +cp ninja $INSTALLROOT/bin \ No newline at end of file diff --git a/numactl.sh b/numactl.sh new file mode 100644 index 00000000..b6062580 --- /dev/null +++ b/numactl.sh @@ -0,0 +1,22 @@ +package: numactl +version: "%(tag_basename)s" +tag: v2.0.14 +source: https://github.com/numactl/numactl +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh +./configure \ + --prefix=$INSTALLROOT \ + --enable-shared \ + --disable-static \ + --disable-dependency-tracking \ + --with-pic \ + --with-gnu-ld + +make ${JOBS+-j $JOBS} +make install + +rm -rf $INSTALLROOT/lib/pkgconfig \ No newline at end of file diff --git a/openblas.sh b/openblas.sh new file mode 100644 index 00000000..9329bda1 --- /dev/null +++ b/openblas.sh @@ -0,0 +1,50 @@ +package: OpenBLAS +version: "%(tag_basename)s" +tag: v0.3.27 +source: https://github.com/OpenMathLib/OpenBLAS +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +default_microarch_name=x86-64-v3 +ARCH="$(uname -m)" + +if [ "$ARCH" = "x86_64" ]; then + XTARGETS="sse3=CORE2" +fi + +for t in nehalem sandybridge haswell ; do + XTARGETS="${XTARGETS} $t=$(echo $t | tr 'a-z' 'A-Z')" +done + +XTARGETS="${XTARGETS} skylake-avx512=SKYLAKEX" +XTARGETS="${XTARGETS} x86-64-v2=NEHALEM" +XTARGETS="${XTARGETS} x86-64-v3=HASWELL" +XTARGETS="${XTARGETS} x86-64-v4=SKYLAKEX" + +STARGET=$(echo "x86-64-v3" | sed 's|^-m||;s|^arch=||') +TARGET_ARCH=$(echo ${XTARGETS} | tr ' ' '\n' | grep "^${STARGET}=" | sed "s|^${STARGET}=||") + +if [ "${TARGET_ARCH}" = "" ] ; then + echo "ERROR: Unable to match OpenBlas build target '${STARGET}'. Available build targets are" + echo "${XTARGETS}" | tr ' ' '\n' | sed 's|=.*||' + echo "Please use one of the supported targets or add support for ${STARGET}" + exit 1 +fi + +if [ "$ARCH" = "x86_64" ]; then + make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 TARGET=${TARGET_ARCH} +fi + +if [ "$ARCH" = "aarch64" ]; then + make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 TARGET=ARMV8 CFLAGS="-march=armv8-a -mno-outline-atomics" +fi + +if [ "$ARCH" = "ppc64le" ]; then + make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 TARGET=POWER8 CFLAGS="-mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512" +fi + +if [ "$ARCH" = "riscv64" ]; then + make FC=gfortran BINARY=64 NUM_THREADS=256 DYNAMIC_ARCH=0 TARGET=RISCV64_GENERIC shared +fi + +make PREFIX=$INSTALLROOT install \ No newline at end of file diff --git a/openmpi.sh b/openmpi.sh new file mode 100644 index 00000000..bad49619 --- /dev/null +++ b/openmpi.sh @@ -0,0 +1,52 @@ +package: openmpi +version: "%(tag_basename)s" +tag: e6d2cb856f3fc649aa01bd5b688a003b3b33db7d +requires: + - gcc + - libfabric + - hwloc + - rdma-core + - xpmem + - ucx +sources: + - https://github.com/open-mpi/ompi/archive/%(tag_basename)s.tar.gz +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +CONFIGURE_OPTS="\ + --prefix=$INSTALLROOT \ + --disable-dependency-tracking \ + --enable-ipv6 \ + --enable-mpi-cxx \ + --enable-shared \ + --disable-static \ + --enable-cxx-exceptions \ + --disable-mpi-java \ + --enable-openib-rdmacm-ibaddr \ + --with-zlib=$ZLIB_ROOT \ + --with-hwloc=$HWLOC_ROOT \ + --with-ofi=$LIBFABRIC_ROOT \ + --without-portals4 \ + --without-psm \ + --without-psm2 \ + --with-verbs=$RDMA_CORE_ROOT \ + --without-mxm \ + --with-ucx=$UCX_ROOT \ + --with-cma \ + --without-knem \ + --with-xpmem=$XPMEM_ROOT \ + --without-x \ + --with-pic \ + --with-gnu-ld \ + --with-pmix=internal" + +[ -z "$without_cuda" ] && CONFIGURE_OPTS+=" --with-cuda=$CUDA_ROOT" +AUTOMAKE_JOBS=${JOBS:+-j$JOBS} ./autogen.pl +unset HWLOC_VERSION +./configure $CONFIGURE_OPTS +make ${JOBS:+-j$JOBS} +make install + +find $INSTALLROOT/lib/ -name '*.la' -delete \ No newline at end of file diff --git a/patches/0a1d2ea57722c248777e1130de076e28c443ff8b.diff b/patches/0a1d2ea57722c248777e1130de076e28c443ff8b.diff new file mode 100644 index 00000000..2abb5261 --- /dev/null +++ b/patches/0a1d2ea57722c248777e1130de076e28c443ff8b.diff @@ -0,0 +1,195 @@ +diff --git a/gcc/testsuite/g++.dg/lto/pr118817_0.C b/gcc/testsuite/g++.dg/lto/pr118817_0.C +new file mode 100644 +index 0000000000000..ae65f34504e89 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/lto/pr118817_0.C +@@ -0,0 +1,17 @@ ++// { dg-lto-do link } ++// { dg-lto-options { { -O3 -fPIC -flto -shared -std=c++20 -Wall } } } ++// { dg-require-effective-target fpic } ++// { dg-require-effective-target shared } ++ ++#include ++#include ++#include ++ ++int func() ++{ ++ auto strVec = std::make_unique>(); ++ strVec->emplace_back("One"); ++ strVec->emplace_back("Two"); ++ strVec->emplace_back("Three"); ++ return 0; ++} +diff --git a/gcc/tree-ssa-pre.cc b/gcc/tree-ssa-pre.cc +index 735893bb191e1..ecf45d29e7696 100644 +--- a/gcc/tree-ssa-pre.cc ++++ b/gcc/tree-ssa-pre.cc +@@ -1185,41 +1185,6 @@ get_or_alloc_expr_for_constant (tree constant) + return newexpr; + } + +-/* Return the folded version of T if T, when folded, is a gimple +- min_invariant or an SSA name. Otherwise, return T. */ +- +-static pre_expr +-fully_constant_expression (pre_expr e) +-{ +- switch (e->kind) +- { +- case CONSTANT: +- return e; +- case NARY: +- { +- vn_nary_op_t nary = PRE_EXPR_NARY (e); +- tree res = vn_nary_simplify (nary); +- if (!res) +- return e; +- if (is_gimple_min_invariant (res)) +- return get_or_alloc_expr_for_constant (res); +- if (TREE_CODE (res) == SSA_NAME) +- return get_or_alloc_expr_for_name (res); +- return e; +- } +- case REFERENCE: +- { +- vn_reference_t ref = PRE_EXPR_REFERENCE (e); +- tree folded; +- if ((folded = fully_constant_vn_reference_p (ref))) +- return get_or_alloc_expr_for_constant (folded); +- return e; +- } +- default: +- return e; +- } +-} +- + /* Translate the VUSE backwards through phi nodes in E->dest, so that + it has the value it would have in E->src. Set *SAME_VALID to true + in case the new vuse doesn't change the value id of the OPERANDS. */ +@@ -1443,57 +1408,55 @@ phi_translate_1 (bitmap_set_t dest, + } + if (changed) + { +- pre_expr constant; + unsigned int new_val_id; + +- PRE_EXPR_NARY (expr) = newnary; +- constant = fully_constant_expression (expr); +- PRE_EXPR_NARY (expr) = nary; +- if (constant != expr) ++ /* Try to simplify the new NARY. */ ++ tree res = vn_nary_simplify (newnary); ++ if (res) + { ++ if (is_gimple_min_invariant (res)) ++ return get_or_alloc_expr_for_constant (res); ++ + /* For non-CONSTANTs we have to make sure we can eventually + insert the expression. Which means we need to have a + leader for it. */ +- if (constant->kind != CONSTANT) ++ gcc_assert (TREE_CODE (res) == SSA_NAME); ++ ++ /* Do not allow simplifications to non-constants over ++ backedges as this will likely result in a loop PHI node ++ to be inserted and increased register pressure. ++ See PR77498 - this avoids doing predcoms work in ++ a less efficient way. */ ++ if (e->flags & EDGE_DFS_BACK) ++ ; ++ else + { +- /* Do not allow simplifications to non-constants over +- backedges as this will likely result in a loop PHI node +- to be inserted and increased register pressure. +- See PR77498 - this avoids doing predcoms work in +- a less efficient way. */ +- if (e->flags & EDGE_DFS_BACK) +- ; +- else ++ unsigned value_id = VN_INFO (res)->value_id; ++ /* We want a leader in ANTIC_OUT or AVAIL_OUT here. ++ dest has what we computed into ANTIC_OUT sofar ++ so pick from that - since topological sorting ++ by sorted_array_from_bitmap_set isn't perfect ++ we may lose some cases here. */ ++ pre_expr constant = find_leader_in_sets (value_id, dest, ++ AVAIL_OUT (pred)); ++ if (constant) + { +- unsigned value_id = get_expr_value_id (constant); +- /* We want a leader in ANTIC_OUT or AVAIL_OUT here. +- dest has what we computed into ANTIC_OUT sofar +- so pick from that - since topological sorting +- by sorted_array_from_bitmap_set isn't perfect +- we may lose some cases here. */ +- constant = find_leader_in_sets (value_id, dest, +- AVAIL_OUT (pred)); +- if (constant) ++ if (dump_file && (dump_flags & TDF_DETAILS)) + { +- if (dump_file && (dump_flags & TDF_DETAILS)) +- { +- fprintf (dump_file, "simplifying "); +- print_pre_expr (dump_file, expr); +- fprintf (dump_file, " translated %d -> %d to ", +- phiblock->index, pred->index); +- PRE_EXPR_NARY (expr) = newnary; +- print_pre_expr (dump_file, expr); +- PRE_EXPR_NARY (expr) = nary; +- fprintf (dump_file, " to "); +- print_pre_expr (dump_file, constant); +- fprintf (dump_file, "\n"); +- } +- return constant; ++ fprintf (dump_file, "simplifying "); ++ print_pre_expr (dump_file, expr); ++ fprintf (dump_file, " translated %d -> %d to ", ++ phiblock->index, pred->index); ++ PRE_EXPR_NARY (expr) = newnary; ++ print_pre_expr (dump_file, expr); ++ PRE_EXPR_NARY (expr) = nary; ++ fprintf (dump_file, " to "); ++ print_pre_expr (dump_file, constant); ++ fprintf (dump_file, "\n"); + } ++ return constant; + } + } +- else +- return constant; + } + + tree result = vn_nary_op_lookup_pieces (newnary->length, +diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc +index 6d0202ad43690..06f6b0ccd7240 100644 +--- a/gcc/tree-ssa-sccvn.cc ++++ b/gcc/tree-ssa-sccvn.cc +@@ -2598,7 +2598,8 @@ vn_nary_build_or_lookup (gimple_match_op *res_op) + } + + /* Try to simplify the expression RCODE OPS... of type TYPE and return +- its value if present. */ ++ its value if present. Update NARY with a simplified expression if ++ it fits. */ + + tree + vn_nary_simplify (vn_nary_op_t nary) +@@ -2608,7 +2609,15 @@ vn_nary_simplify (vn_nary_op_t nary) + gimple_match_op op (gimple_match_cond::UNCOND, nary->opcode, + nary->type, nary->length); + memcpy (op.ops, nary->op, sizeof (tree) * nary->length); +- return vn_nary_build_or_lookup_1 (&op, false, true); ++ tree res = vn_nary_build_or_lookup_1 (&op, false, true); ++ if (op.code.is_tree_code () && op.num_ops <= nary->length) ++ { ++ nary->opcode = (tree_code) op.code; ++ nary->length = op.num_ops; ++ for (unsigned i = 0; i < op.num_ops; ++i) ++ nary->op[i] = op.ops[i]; ++ } ++ return res; + } + + /* Elimination engine. */ diff --git a/patches/77d01927bd7c989d431035251a5c196fe39bcec9.diff b/patches/77d01927bd7c989d431035251a5c196fe39bcec9.diff new file mode 100644 index 00000000..d20c590e --- /dev/null +++ b/patches/77d01927bd7c989d431035251a5c196fe39bcec9.diff @@ -0,0 +1,45 @@ +diff --git a/gcc/testsuite/gcc.dg/pr118817.c b/gcc/testsuite/gcc.dg/pr118817.c +new file mode 100644 +index 0000000000000..6cfb424dbf4f4 +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/pr118817.c +@@ -0,0 +1,14 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef int v4si __attribute__((vector_size (sizeof(int) * 4))); ++ ++v4si x; ++ ++void foo (int flag) ++{ ++ v4si tem = (v4si) { 0, 0, 0, 0 }; ++ if (flag) ++ tem = (v4si) { flag }; ++ x = __builtin_shufflevector (tem, tem, 0, 0, 0, 0); ++} +diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc +index 06f6b0ccd7240..8bb45780a9814 100644 +--- a/gcc/tree-ssa-sccvn.cc ++++ b/gcc/tree-ssa-sccvn.cc +@@ -2604,13 +2604,18 @@ vn_nary_build_or_lookup (gimple_match_op *res_op) + tree + vn_nary_simplify (vn_nary_op_t nary) + { +- if (nary->length > gimple_match_op::MAX_NUM_OPS) ++ if (nary->length > gimple_match_op::MAX_NUM_OPS ++ /* For CONSTRUCTOR the vn_nary_op_t and gimple_match_op representation ++ does not match. */ ++ || nary->opcode == CONSTRUCTOR) + return NULL_TREE; + gimple_match_op op (gimple_match_cond::UNCOND, nary->opcode, + nary->type, nary->length); + memcpy (op.ops, nary->op, sizeof (tree) * nary->length); + tree res = vn_nary_build_or_lookup_1 (&op, false, true); +- if (op.code.is_tree_code () && op.num_ops <= nary->length) ++ if (op.code.is_tree_code () ++ && op.num_ops <= nary->length ++ && (tree_code) op.code != CONSTRUCTOR) + { + nary->opcode = (tree_code) op.code; + nary->length = op.num_ops; diff --git a/patches/Pygments-cpp-extension-fix.patch b/patches/Pygments-cpp-extension-fix.patch new file mode 100644 index 00000000..2e5dc5ac --- /dev/null +++ b/patches/Pygments-cpp-extension-fix.patch @@ -0,0 +1,13 @@ +diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py +index 577d664..d7e6474 100644 +--- a/pygments/lexers/_mapping.py ++++ b/pygments/lexers/_mapping.py +@@ -97,7 +97,7 @@ LEXERS = { + 'ComponentPascalLexer': ('pygments.lexers.oberon', 'Component Pascal', ('componentpascal', 'cp'), ('*.cp', '*.cps'), ('text/x-component-pascal',)), + 'CoqLexer': ('pygments.lexers.theorem', 'Coq', ('coq',), ('*.v',), ('text/x-coq',)), + 'CplintLexer': ('pygments.lexers.cplint', 'cplint', ('cplint',), ('*.ecl', '*.prolog', '*.pro', '*.pl', '*.P', '*.lpad', '*.cpl'), ('text/x-cplint',)), +- 'CppLexer': ('pygments.lexers.c_cpp', 'C++', ('cpp', 'c++'), ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx', '*.C', '*.H', '*.cp', '*.CPP', '*.tpp'), ('text/x-c++hdr', 'text/x-c++src')), ++ 'CppLexer': ('pygments.lexers.c_cpp', 'C++', ('cpp', 'c++'), ('*.icc', '*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx', '*.C', '*.H', '*.cp', '*.CPP', '*.tpp'), ('text/x-c++hdr', 'text/x-c++src')), + 'CppObjdumpLexer': ('pygments.lexers.asm', 'cpp-objdump', ('cpp-objdump', 'c++-objdumb', 'cxx-objdump'), ('*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump'), ('text/x-cpp-objdump',)), + 'CrmshLexer': ('pygments.lexers.dsls', 'Crmsh', ('crmsh', 'pcmk'), ('*.crmsh', '*.pcmk'), ()), + 'CrocLexer': ('pygments.lexers.d', 'Croc', ('croc',), ('*.croc',), ('text/x-crocsrc',)), \ No newline at end of file diff --git a/patches/gcc-flex-disable-doc.patch b/patches/gcc-flex-disable-doc.patch new file mode 100644 index 00000000..9b77ea6e --- /dev/null +++ b/patches/gcc-flex-disable-doc.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.in b/Makefile.in +index 8c41885..7c2eb0d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -450,7 +450,6 @@ EXTRA_DIST = \ + + SUBDIRS = \ + src \ +- doc \ + examples \ + po \ + tests \ diff --git a/patches/gcc-flex-nonfull-path-m4.patch b/patches/gcc-flex-nonfull-path-m4.patch new file mode 100644 index 00000000..2c8d6f20 --- /dev/null +++ b/patches/gcc-flex-nonfull-path-m4.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 18a304f..fad064e 100755 +--- a/configure ++++ b/configure +@@ -18920,7 +18920,7 @@ fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_M4" >&5 + $as_echo "$ac_cv_path_M4" >&6; } +-M4=$ac_cv_path_M4 ++M4=`basename $ac_cv_path_M4` + + + cat >>confdefs.h <<_ACEOF diff --git a/patches/protobuf-non-virtual-dtor.patch b/patches/protobuf-non-virtual-dtor.patch new file mode 100644 index 00000000..b8a34e27 --- /dev/null +++ b/patches/protobuf-non-virtual-dtor.patch @@ -0,0 +1,13 @@ +diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h +index 287d58f..c243e4a 100644 +--- a/src/google/protobuf/map_field.h ++++ b/src/google/protobuf/map_field.h +@@ -306,7 +306,7 @@ class PROTOBUF_EXPORT MapFieldBase : public MapFieldBaseForParse { + + protected: + // "protected" stops users from deleting a `MapFieldBase *` +- ~MapFieldBase(); ++ virtual ~MapFieldBase(); + + struct VTable : MapFieldBaseForParse::VTable { + bool (*lookup_map_value)(const MapFieldBase& map, const MapKey& map_key, \ No newline at end of file diff --git a/patches/protobuf_text_format.patch b/patches/protobuf_text_format.patch new file mode 100644 index 00000000..bebf7006 --- /dev/null +++ b/patches/protobuf_text_format.patch @@ -0,0 +1,15 @@ +diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py +index a6d8bcf64..24da4cac5 100644 +--- a/python/google/protobuf/text_format.py ++++ b/python/google/protobuf/text_format.py +@@ -470,9 +470,7 @@ class _Printer(object): + entry_submsg = value.GetEntryClass()(key=key, value=value[key]) + self.PrintField(field, entry_submsg) + elif field.label == descriptor.FieldDescriptor.LABEL_REPEATED: +- if (self.use_short_repeated_primitives +- and field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_MESSAGE +- and field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_STRING): ++ if self.use_short_repeated_primitives: + self._PrintShortRepeatedPrimitivesValue(field, value) + else: + for element in value: diff --git a/patches/pybind11-array-bound.patch b/patches/pybind11-array-bound.patch new file mode 100644 index 00000000..402e4104 --- /dev/null +++ b/patches/pybind11-array-bound.patch @@ -0,0 +1,22 @@ +diff --git a/pybind11/include/pybind11/pybind11.h b/pybind11/include/pybind11/pybind11.h +index 1806583e6b..e56e2a0589 100644 +--- a/pybind11/include/pybind11/pybind11.h ++++ b/pybind11/include/pybind11/pybind11.h +@@ -1380,7 +1380,17 @@ class generic_type : public object { + } else { + internals.registered_types_cpp[tindex] = tinfo; + } ++ ++ PYBIND11_WARNING_PUSH ++#if defined(__GNUC__) && __GNUC__ >= 12 ++ // When using GCC 12 these warnings are disabled as they trigger ++ // false positive warnings. Discussed here: ++ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115824. ++ PYBIND11_WARNING_DISABLE_GCC("-Warray-bounds") ++ PYBIND11_WARNING_DISABLE_GCC("-Wstringop-overread") ++#endif + internals.registered_types_py[(PyTypeObject *) m_ptr] = {tinfo}; ++ PYBIND11_WARNING_POP + }); + + if (rec.bases.size() > 1 || rec.multiple_inheritance) { \ No newline at end of file diff --git a/patches/pytorch-missing-braces.patch b/patches/pytorch-missing-braces.patch new file mode 100644 index 00000000..40648dd8 --- /dev/null +++ b/patches/pytorch-missing-braces.patch @@ -0,0 +1,97 @@ +diff --git a/torch/csrc/profiler/events.h b/torch/csrc/profiler/events.h +index 78bac1fea19..f08683223f0 100644 +--- a/torch/csrc/profiler/events.h ++++ b/torch/csrc/profiler/events.h +@@ -11,7 +11,7 @@ namespace torch::profiler { + using perf_counters_t = std::vector; + + /* Standard list of performance events independent of hardware or backend */ +-constexpr std::array ProfilerPerfEvents = { ++constexpr std::array ProfilerPerfEvents = {{ + /* + * Number of Processing Elelement (PE) cycles between two points of interest + * in time. This should correlate positively with wall-time. Measured in +@@ -25,5 +25,5 @@ constexpr std::array ProfilerPerfEvents = { + * (i.e. work). Across repeat executions, the number of instructions should + * be more or less invariant. Measured in uint64_t. PE can be non cpu. + */ +- "instructions"}; ++ "instructions"}}; + } // namespace torch::profiler +diff --git a/c10/util/typeid.h b/c10/util/typeid.h +index 2c6ac38882f..d165059a956 100644 +--- a/c10/util/typeid.h ++++ b/c10/util/typeid.h +@@ -303,12 +303,12 @@ class _Uninitialized final {}; + // + + // item sizes for TypeMeta::itemsize() fast path +-static constexpr std::array scalarTypeItemSizes = { ++static constexpr std::array scalarTypeItemSizes = {{ + #define SCALAR_TYPE_SIZE(T, name) sizeof(T), + AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(SCALAR_TYPE_SIZE) + #undef SCALAR_TYPE_SIZE + 0, // Undefined +-}; ++}}; + + /** + * TypeMeta is a thin class that allows us to store the type of a container such +--- a/c10/util/order_preserving_flat_hash_map.h ++++ b/c10/util/order_preserving_flat_hash_map.h +@@ -177,11 +177,11 @@ struct sherwood_v3_entry { + }; + + inline int8_t log2(uint64_t value) { +- static constexpr std::array table = { ++ static constexpr std::array table = {{ + 63, 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, + 61, 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, + 62, 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, +- 56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5}; ++ 56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5}}; + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; +--- a/torch/csrc/jit/runtime/operator.h ++++ b/torch/csrc/jit/runtime/operator.h +@@ -35,8 +35,8 @@ using ::c10::Symbol; + using OperationCreator = Operation (*)(const Node*); + + namespace { +-const std::array kJitOnlyOperatorTags = { +- at::Tag::pt2_compliant_tag}; ++const std::array kJitOnlyOperatorTags = {{ ++ at::Tag::pt2_compliant_tag}}; + } + + /* + + +--- a/torch/csrc/profiler/orchestration/observer.h 2025-02-13 15:02:54.200761353 +0100 ++++ b/torch/csrc/profiler/orchestration/observer.h 2025-02-13 15:03:09.951674440 +0100 +@@ -23,7 +23,7 @@ + const std::array< + std::string, + static_cast(ActivityType::NUM_KINETO_ACTIVITIES)> +- ActivityTypeNames = {"CPU", "XPU", "CUDA", "MTIA", "PrivateUse1"}; ++ ActivityTypeNames = {{"CPU", "XPU", "CUDA", "MTIA", "PrivateUse1"}}; + return ActivityTypeNames[static_cast(t)]; + } + +--- a/aten/src/ATen/Context.h 2025-02-13 15:04:06.599361881 +0100 ++++ b/aten/src/ATen/Context.h 2025-02-13 15:04:40.724173592 +0100 +@@ -388,11 +388,11 @@ + bool _deterministic_algorithms = false; + bool _deterministic_algorithms_warn_only = false; + bool _deterministic_fill_uninitialized_memory = true; +- std::array sdp_priority_order = { ++ std::array sdp_priority_order = {{ + at::SDPBackend::flash_attention, + at::SDPBackend::efficient_attention, + at::SDPBackend::math, +- at::SDPBackend::cudnn_attention}; ++ at::SDPBackend::cudnn_attention}}; + bool enabled_flashSDP = true; + bool enabled_mem_efficientSDP = true; + bool enabled_mathSDP = true; diff --git a/patches/pytorch-system-fmt.patch b/patches/pytorch-system-fmt.patch new file mode 100644 index 00000000..176b7c1b --- /dev/null +++ b/patches/pytorch-system-fmt.patch @@ -0,0 +1,59 @@ +diff --git a/c10/CMakeLists.txt b/c10/CMakeLists.txt +index 82eb9690383..2f40c80a66e 100644 +--- a/c10/CMakeLists.txt ++++ b/c10/CMakeLists.txt +@@ -94,6 +94,7 @@ if(NOT BUILD_LIBTORCHLESS) + if(C10_USE_GLOG) + target_link_libraries(c10 PUBLIC glog::glog) + endif() ++ find_package(fmt REQUIRED) + target_link_libraries(c10 PRIVATE fmt::fmt-header-only) + target_link_libraries(c10 PRIVATE nlohmann) + + if(C10_USE_NUMA) +diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt +index 74d0d557190..ff3e94b1c4b 100644 +--- a/caffe2/CMakeLists.txt ++++ b/caffe2/CMakeLists.txt +@@ -1363,6 +1363,8 @@ if($ENV{TH_BINARY_BUILD}) + endif() + endif() + ++find_package(fmt REQUIRED) ++ + target_link_libraries(torch_cpu PUBLIC c10) + target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS}) + target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS}) +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index c3abce52e4c..5e89d3eb43a 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -1832,9 +1832,13 @@ endif() + # + # End ATen checks + # +-set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +-set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) +-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) ++find_package(FMT) ++if(FMT_FOUND) ++ message(STATUS "Found system FMT at " ${FMT_INCLUDE_DIR}) ++else() ++ message(STATUS "Did not find system FMT. Using third party subdirectory.") ++ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) ++endif() + + # Disable compiler feature checks for `fmt`. + # +@@ -1843,10 +1847,8 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) + # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know + # `fmt` is compatible with a superset of the compilers that PyTorch is, it + # shouldn't be too bad to just disable the checks. +-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "") + + list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only) +-set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) + + # ---[ Kineto + # edge profiler depends on KinetoProfiler but it only does cpu + diff --git a/patches/xgboost-arm-and-ppc.patch b/patches/xgboost-arm-and-ppc.patch new file mode 100644 index 00000000..90e669e1 --- /dev/null +++ b/patches/xgboost-arm-and-ppc.patch @@ -0,0 +1,18 @@ +--- a/src/common/hist_util.cc ++++ b/src/common/hist_util.cc +@@ -12,14 +12,7 @@ + #include "column_matrix.h" + #include "quantile.h" + +-#if defined(XGBOOST_MM_PREFETCH_PRESENT) +- #include +- #define PREFETCH_READ_T0(addr) _mm_prefetch(reinterpret_cast(addr), _MM_HINT_T0) +-#elif defined(XGBOOST_BUILTIN_PREFETCH_PRESENT) +- #define PREFETCH_READ_T0(addr) __builtin_prefetch(reinterpret_cast(addr), 0, 3) +-#else // no SW pre-fetching available; PREFETCH_READ_T0 is no-op +- #define PREFETCH_READ_T0(addr) do {} while (0) +-#endif // defined(XGBOOST_MM_PREFETCH_PRESENT) ++#define PREFETCH_READ_T0(addr) do {} while (0) + + namespace xgboost { + namespace common { \ No newline at end of file diff --git a/pcre2.sh b/pcre2.sh new file mode 100644 index 00000000..3898bd58 --- /dev/null +++ b/pcre2.sh @@ -0,0 +1,23 @@ +package: pcre2 +version: "%(tag_basename)s" +tag: pcre2-10.36 +source: https://github.com/PCRE2Project/pcre2 +requires: + - bz2lib + - zlib + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +sh autogen.sh + +./configure \ + --enable-unicode-properties \ + --enable-pcregrep-libz \ + --enable-pcregrep-libbz2 \ + --prefix=${INSTALLROOT} \ + CPPFLAGS="-I${BZ2LIB_ROOT}/include -I${ZLIB_ROOT}/include" \ + LDFLAGS="-L${BZ2LIB_ROOT}/lib -L${ZLIB_ROOT}/lib" + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/pip.sh b/pip.sh new file mode 100644 index 00000000..ae05a051 --- /dev/null +++ b/pip.sh @@ -0,0 +1,25 @@ +package: pip +version: "%(tag_basename)s" +tag: 25.1.1 +sources: +- https://raw.githubusercontent.com/pypa/get-pip/refs/tags/%(version)s/public/get-pip.py +requires: + - Python + - setuptools +prepend_path: + PYTHON3PATH: "%(root_dir)s/${PYTHON3_LIB_SITE_PACKAGES}" +--- +python3 $SOURCEDIR/get-pip.py \ + --no-setuptools \ + --no-wheel \ + pip==${PKGVERSION} \ + --prefix="$INSTALLROOT" + +for py in $(grep -RlI -m1 '^#\!.*python' ${INSTALLROOT}/${PYTHON3_LIB_SITE_PACKAGES} | grep -v '\.pyc$') ; do + lnum=$(grep -n -m1 '^#\!.*python' $py | sed 's|:.*||') + sed -i -e "${lnum}c#!/usr/bin/env python3" $py +done + +rm -f ${INSTALLROOT}/bin/pip +perl -p -i -e "s|^#!.*python.*|#!/usr/bin/env python3|" ${INSTALLROOT}/bin/pip3* +perl -p -i -e "s| ${WORK_DIR}/.*/python3 | python3 |" ${INSTALLROOT}/bin/pip3* \ No newline at end of file diff --git a/protobuf.sh b/protobuf.sh new file mode 100644 index 00000000..37090d5e --- /dev/null +++ b/protobuf.sh @@ -0,0 +1,45 @@ +package: protobuf +version: "%(tag_basename)s" +tag: v3.19.1 +sources: +- https://github.com/protocolbuffers/protobuf/archive/refs/tags/%(tag_basename)s.tar.gz +requires: +- gcc +- zlib +build_requires: +- CMake +- ninja +patches: +- protobuf_text_format.patch +- protobuf-non-virtual-dtor.patch +--- +rsync -a --chmod=ug=rwX --delete \ + --include='*/' \ + --include='*.patch' \ + --exclude='*' \ + "$SOURCEDIR"/ "$BUILDDIR"/ + +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +patch -p1 <$PATCH0 +#patch -p1 <$PATCH1 + +./autogen.sh +cd cmake +cmake -G Ninja \ + -DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_BUILD_SHARED_LIBS=ON \ + -Dutf8_range_ENABLE_INSTALL=ON \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_CXX_FLAGS="-I${ZLIB_ROOT}/include" \ + -DCMAKE_C_FLAGS="-I${ZLIB_ROOT}/include" \ + -DCMAKE_SHARED_LINKER_FLAGS="-L${ZLIB_ROOT}/lib" \ + -DCMAKE_PREFIX_PATH="${ZLIB_ROOT}" + +ninja -v ${JOBS+-j $JOBS} install +rm -rf $INSTALLROOT/lib/pkgconfig \ No newline at end of file diff --git a/psimd.sh b/psimd.sh new file mode 100644 index 00000000..716746b2 --- /dev/null +++ b/psimd.sh @@ -0,0 +1,19 @@ +package: psimd +version: "v1" +tag: 072586a71b55b7f8c584153d223e95687148a900 +sources: +- https://github.com/Maratyszcza/psimd/archive/%(tag_basename)s.tar.gz +build_requires: +- gmake +- CMake +requires: +- gcc +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +cmake -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ + -DCMAKE_BUILD_TYPE=$LLVM_BUILD_TYPE + +make install diff --git a/py-PyYAML.file b/py-PyYAML.file new file mode 100644 index 00000000..cbeb85ca --- /dev/null +++ b/py-PyYAML.file @@ -0,0 +1,4 @@ +package: py-PyYAML +sources: +- https://pypi.io/packages/source/p/pyyaml/pyyaml-%(version)s.tar.gz +--- \ No newline at end of file diff --git a/pypi/__pycache__/packages.cpython-36.pyc b/pypi/__pycache__/packages.cpython-36.pyc new file mode 100644 index 00000000..6347f72c Binary files /dev/null and b/pypi/__pycache__/packages.cpython-36.pyc differ diff --git a/pypi/__pycache__/packages.cpython-39.pyc b/pypi/__pycache__/packages.cpython-39.pyc new file mode 100644 index 00000000..e3994112 Binary files /dev/null and b/pypi/__pycache__/packages.cpython-39.pyc differ diff --git a/pypi/build-with-pip.file b/pypi/build-with-pip.file new file mode 100644 index 00000000..1647d698 --- /dev/null +++ b/pypi/build-with-pip.file @@ -0,0 +1,86 @@ +function runIt(){ + if [[ -v $1 ]]; then + eval "${!1}" + elif declare -F "$1" > /dev/null; then + $1 + fi +} + +function isDefined(){ + if [[ ! -v $1 ]]; then declare -F "$1"; fi +} +function chkDefined(){ + if ! isDefined $1 ; then eval "$1=\"$2\"" ; fi +} + +[ "${Pypi_name}" != "" ] || Pypi_name=$(echo ${PKGNAME} | cut -f2-10 -d-) +chkDefined PipUnpackCommand "tar -xzf ${SOURCEDIR}/${SOURCE0}" +chkDefined PipPackageNameCommand "pip3 show ${Pypi_name} --disable-pip-version-check | grep '^Name:' | sed 's|^Name: *||;s| ||g'" +chkDefined PipDepsPost "xargs --no-run-if-empty echo" +chkDefined PipDepsMatch "grep \\\"^\\\${PKG_NAME} *${PKGVERSION} *requires \\\" | sed 's|,.*||;s|.* |py-|'" +chkDefined PipDepsCommand "pip3 check --disable-pip-version-check" +chkDefined PipInstallCommand "pip3 install --no-clean --no-deps --no-index --no-build-isolation --no-cache-dir --disable-pip-version-check --user -v ${PipInstallOptions} ${PipBuildOptions} \\\${PYPI_SRC}" + +runIt PipPrePrep +rm -rf cmsdist-patch-${PKGNAME} +mkdir cmsdist-patch-${PKGNAME} +pushd cmsdist-patch-${PKGNAME} + runIt PipUnpackCommand + pip_package_dirname=$(ls -d *) + PYPI_SRC="${BUILDDIR}"/${pip_package_dirname} + mv ${pip_package_dirname} "${PYPI_SRC}" +popd +rm -rf cmsdist-patch-${PKGNAME} + +pushd $PYPI_SRC + if [ "${PATCH_COUNT}" -gt 0 ] ; then + for (( num=0; num<${PATCH_COUNT}; num++ )) ; do + patch_name="PATCH${num}" + echo "Applying patch ${!patch_name}" + patch --verbose -p1 < $SOURCEDIR/${!patch_name} + done + fi + runIt PipPatchSource +popd +runIt PipPostPrep + + +export PYTHONUSERBASE="$INSTALLROOT" +export TMPDIR="$BUILDDIR/bits-tmp" +mkdir -p $TMPDIR +unset PIP_ROOT +pip3 list --disable-pip-version-check +runIt PipPreBuildPy +runIt PipInstallCommand +PKG_NAME=$(runIt PipPackageNameCommand) +[ "${PKG_NAME}" = "" ] && exit 1 +pip3 check --disable-pip-version-check || true +runIt PipDepsCommand | runIt PipDepsMatch || true +DEPS=$(runIt PipDepsCommand | runIt PipDepsMatch | runIt PipDepsPost | tr '\n' ' ') || true +if [ "$DEPS" != "" ] ; then + echo "ERROR: Missing dependencies for ${PKGNAME} (python3) found: $DEPS" + exit 1 +fi +runIt relocatePy3SitePackages +runIt PipPostBuildPy + +if [ -d "${INSTALLROOT}/bin" ] ; then + for py in $(grep -Rl -m1 '^#\!.*python' "${INSTALLROOT}/bin") ; do + lnum=$(grep -n -m1 '^#\!.*python' $py | sed 's|:.*||') + sed -i -e "${lnum}c#!/usr/bin/env python3" $py + done +fi +runIt PipPostBuild +if [ -d "${INSTALLROOT}"/bin ] ; then + for s in $(grep -IRHl '^#!.*' "${INSTALLROOT}"/bin) ; do + perl -p -i -e "s|^#!.*python.*|#!/usr/bin/env python3|;s| ${WORK_DIR}/.*python3 | python3 |" $s + done +fi +[ "${RelocatePython}" = "" ] || perl -p -i -e "s|^#!.*python.*|#!/usr/bin/env python3|;s| %{cmsroot}/.*python3 | python3 |" ${RelocatePython} + +#Install Section +runIt PipPreInstall +[ ! -d "${INSTALLROOT}"/bin/__pycache__ ] || rm -rf "${INSTALLROOT}"/bin/__pycache__ +chmod -R a+r "${INSTALLROOT}" +find "${INSTALLROOT}" -type d -print | xargs chmod 0755 +runIt PipPostInstall diff --git a/pypi/package.py b/pypi/package.py new file mode 100755 index 00000000..d50d1cae --- /dev/null +++ b/pypi/package.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +from os.path import exists, dirname, join +from bits_helpers.utilities import yamlLoad, yamlDump +import sys + +dir=dirname(sys.argv[0]) +build_requires = ["Python", "setuptools", "pip"] +if not sys.argv[1] in ["py-wheel", "py-flit-core"]: + build_requires.append("py-wheel") +prepend_path = {"PYTHON3PATH": ["%(root_dir)s/${PYTHON3_LIB_SITE_PACKAGES}"]} +pypi_name=sys.argv[1][3:] +variables = { + "pypi_source_name": pypi_name.replace("-","_"), + "pypi_name": pypi_name} + +sources = ["https://pypi.io/packages/source/%s/%s/%%(pypi_source_name)s-%%(version)s.tar.gz" % (pypi_name[0], pypi_name)] +recipe = "" +header = "" +override_file = join (dir, "%s.file" % sys.argv[1]) +if exists(override_file): + with open(override_file) as ref: + header,recipe = ref.read().split("---", 1) +header = "package: %s\nversion: \"%s\"\n%s" % (sys.argv[1], sys.argv[2], header.strip()) +spec = yamlLoad(header.strip()) +var = spec.get("variables", {}) +for k, v in var.items(): + variables[k] = v +spec["variables"] = variables +if not "sources" in spec: + spec["sources"] = sources +if "build_requires" in spec: + spec["build_requires"].extend(build_requires) +else: + spec["build_requires"] = build_requires +prepath = spec.get("prepend_path", {}) +if prepath: + for k, v in prepath.items(): + if k in prepend_path: + if isinstance(v,str): + prepend_path[k].append(v) + else: + prepend_path[k].extend(v) + else: + prepend_path[k] = v +spec["prepend_path"] = prepend_path +print(yamlDump(spec).strip()) +print('---') +print("export Pypi_name=\"%s\"" % variables["pypi_name"]) +if recipe.strip(): + print(recipe.strip()) + +build_tmpl = join(dir, "build-with-pip.file") +with open(build_tmpl) as ref: + print(ref.read()) diff --git a/pypi/packages.py b/pypi/packages.py new file mode 100644 index 00000000..7144fe8d --- /dev/null +++ b/pypi/packages.py @@ -0,0 +1,33 @@ +def getPackages(virtual_packages, configDir, *args): + from re import match + from os.path import dirname,join, exists + import os, sys, platform + pkg_dir = dirname(__file__) + req = join(pkg_dir,'requirements.txt') + if not exists(req): return + extra_match = {} + extra_match['platform_machine'] = platform.machine() + extra_match['sys_platform'] = sys.platform + extra_match['os_name'] = os.name + #extra_match['cmsos_name'] = args[0].options.architecture.split("_")[0] + for line in [ l.strip().replace(' ','') for l in open(req).readlines()]: + if line.startswith('#'):continue + if not '==' in line: continue + items = line.strip().split(';') + (pkg, ver) = items[0].strip().split('==',1) + py_pkg = "py-%s" % pkg + pkg_name = py_pkg.lower() + if pkg_name in virtual_packages: continue + matched=True + for item in items[1:]: + m = match("^("+"|".join(list(extra_match.keys()))+")(==|!=)'([^']+)'$", item) + if m: + if m.group(2)=='==' and not match(m.group(3),extra_match[m.group(1)]): matched=False + if m.group(2)=='!=' and match(m.group(3),extra_match[m.group(1)]): matched=False + if matched: + virtual_packages[pkg_name]={ + "version": ver, + "pkgdir" : configDir, + "command" : 'PYTHONPATH=%s %s/package.py "%s" "%s" "py3"' % (dirname(sys.argv[0]), pkg_dir, py_pkg, ver), + } + return diff --git a/pypi/py-Bottleneck.file b/pypi/py-Bottleneck.file new file mode 100644 index 00000000..0eb03b6c --- /dev/null +++ b/pypi/py-Bottleneck.file @@ -0,0 +1,7 @@ +package: py-Bottleneck +requires: +- py-numpy +- py-versioneer +sources: +- https://pypi.io/packages/source/b/bottleneck/bottleneck-%(version)s.tar.gz +--- \ No newline at end of file diff --git a/pypi/py-GitPython.file b/pypi/py-GitPython.file new file mode 100644 index 00000000..f96a2f8b --- /dev/null +++ b/pypi/py-GitPython.file @@ -0,0 +1,7 @@ +package: py-GitPython +requires: +- py-gitdb +- py-typing-extensions +sources: +- https://pypi.io/packages/source/g/gitpython/gitpython-%(version)s.tar.gz +--- \ No newline at end of file diff --git a/pypi/py-Jinja2.file b/pypi/py-Jinja2.file new file mode 100644 index 00000000..3d5bb91e --- /dev/null +++ b/pypi/py-Jinja2.file @@ -0,0 +1,6 @@ +package: py-Jinja2 +requires: +- py-MarkupSafe +sources: +- https://pypi.io/packages/source/j/jinja2/jinja2-%(version)s.tar.gz +--- diff --git a/pypi/py-MarkupSafe.file b/pypi/py-MarkupSafe.file new file mode 100644 index 00000000..7ac1b760 --- /dev/null +++ b/pypi/py-MarkupSafe.file @@ -0,0 +1,4 @@ +package: py-MarkupSafe +sources: +- https://pypi.io/packages/source/m/markupsafe/markupsafe-%(version)s.tar.gz +--- \ No newline at end of file diff --git a/pypi/py-PyNaCl.file b/pypi/py-PyNaCl.file new file mode 100644 index 00000000..db039552 --- /dev/null +++ b/pypi/py-PyNaCl.file @@ -0,0 +1,4 @@ +package: py-PyNaCl +requires: +- py-cffi +--- \ No newline at end of file diff --git a/pypi/py-PyYAML.file b/pypi/py-PyYAML.file new file mode 100644 index 00000000..a1b932b3 --- /dev/null +++ b/pypi/py-PyYAML.file @@ -0,0 +1,4 @@ +package: py-PyYAML +sources: +- https://pypi.io/packages/source/p/pyyaml/pyyaml-%(version)s.tar.gz +--- diff --git a/pypi/py-Pygments.file b/pypi/py-Pygments.file new file mode 100644 index 00000000..3f560433 --- /dev/null +++ b/pypi/py-Pygments.file @@ -0,0 +1,8 @@ +requires: +- py-hatchling +patches: +- Pygments-cpp-extension-fix.patch +sources: +- https://pypi.io/packages/source/p/pygments/pygments-%(version)s.tar.gz +--- +PipPostBuild="mv $INSTALLROOT/bin/pygmentize $INSTALLROOT/bin/pygmentize3" \ No newline at end of file diff --git a/pypi/py-absl-py.file b/pypi/py-absl-py.file new file mode 100644 index 00000000..cb59a298 --- /dev/null +++ b/pypi/py-absl-py.file @@ -0,0 +1,3 @@ +requires: +- py-hatchling +--- \ No newline at end of file diff --git a/pypi/py-aiohappyeyeballs.file b/pypi/py-aiohappyeyeballs.file new file mode 100644 index 00000000..caa7a7d0 --- /dev/null +++ b/pypi/py-aiohappyeyeballs.file @@ -0,0 +1,3 @@ +build_requires: +- py-poetry-core +--- \ No newline at end of file diff --git a/pypi/py-aiohttp.file b/pypi/py-aiohttp.file new file mode 100644 index 00000000..204eef8b --- /dev/null +++ b/pypi/py-aiohttp.file @@ -0,0 +1,13 @@ +package: py-aiohttp +requires: +- py-attrs +- py-chardet +- py-multidict +- py-yarl +- py-async-timeout +- py-typing-extensions +- py-aiosignal +- py-charset-normalizer +- py-frozenlist +- py-aiohappyeyeballs +--- diff --git a/pypi/py-aiosignal.file b/pypi/py-aiosignal.file new file mode 100644 index 00000000..2ac77b5b --- /dev/null +++ b/pypi/py-aiosignal.file @@ -0,0 +1,4 @@ +requires: +- setuptools +- py-frozenlist +--- \ No newline at end of file diff --git a/pypi/py-aiosqlite.file b/pypi/py-aiosqlite.file new file mode 100644 index 00000000..6395b7c2 --- /dev/null +++ b/pypi/py-aiosqlite.file @@ -0,0 +1,4 @@ +requires: +- py-typing-extensions +- py-flit-core +--- \ No newline at end of file diff --git a/pypi/py-annotated-types.file b/pypi/py-annotated-types.file new file mode 100644 index 00000000..81ca9fde --- /dev/null +++ b/pypi/py-annotated-types.file @@ -0,0 +1,3 @@ +build_requires: +- py-hatchling +--- \ No newline at end of file diff --git a/pypi/py-async-timeout.file b/pypi/py-async-timeout.file new file mode 100644 index 00000000..b7c0647a --- /dev/null +++ b/pypi/py-async-timeout.file @@ -0,0 +1,3 @@ +requires: +- py-typing-extensions +--- \ No newline at end of file diff --git a/pypi/py-attrs.file b/pypi/py-attrs.file new file mode 100644 index 00000000..7beb68a3 --- /dev/null +++ b/pypi/py-attrs.file @@ -0,0 +1,5 @@ +package: py-attrs +requires: +- py-hatchling +- py-hatch-fancy-pypi-readme +--- \ No newline at end of file diff --git a/pypi/py-beniget.file b/pypi/py-beniget.file new file mode 100644 index 00000000..a913a6f7 --- /dev/null +++ b/pypi/py-beniget.file @@ -0,0 +1,4 @@ +package: py-beniget +requires: +- py-gast +--- \ No newline at end of file diff --git a/pypi/py-cffi.file b/pypi/py-cffi.file new file mode 100644 index 00000000..5c5a9c01 --- /dev/null +++ b/pypi/py-cffi.file @@ -0,0 +1,6 @@ +package: py-cffi +requires: + - libffi + - py-pycparser +--- +PipPatchSource="sed -i -e \"s|/usr/include/ffi|${LIBFFI_ROOT}/include|\" setup.py" diff --git a/pypi/py-cython.file b/pypi/py-cython.file new file mode 100644 index 00000000..b8acccb5 --- /dev/null +++ b/pypi/py-cython.file @@ -0,0 +1,2 @@ +package: py-cython +--- diff --git a/pypi/py-exceptiongroup.file b/pypi/py-exceptiongroup.file new file mode 100644 index 00000000..1e247086 --- /dev/null +++ b/pypi/py-exceptiongroup.file @@ -0,0 +1,3 @@ +build_requires: +- py-flit-scm +--- \ No newline at end of file diff --git a/pypi/py-expandvars.file b/pypi/py-expandvars.file new file mode 100644 index 00000000..1f39e7a0 --- /dev/null +++ b/pypi/py-expandvars.file @@ -0,0 +1,3 @@ +build_requires: +- py-hatchling +--- \ No newline at end of file diff --git a/pypi/py-flit-scm.file b/pypi/py-flit-scm.file new file mode 100644 index 00000000..89306c2a --- /dev/null +++ b/pypi/py-flit-scm.file @@ -0,0 +1,5 @@ +requires: +- py-flit-core +- py-setuptools-scm +- py-tomli +--- \ No newline at end of file diff --git a/pypi/py-frozenlist.file b/pypi/py-frozenlist.file new file mode 100644 index 00000000..faf1a74e --- /dev/null +++ b/pypi/py-frozenlist.file @@ -0,0 +1,5 @@ +requires: +- py-expandvars +- py-tomli +- py-cython +--- \ No newline at end of file diff --git a/pypi/py-hatch-fancy-pypi-readme.file b/pypi/py-hatch-fancy-pypi-readme.file new file mode 100644 index 00000000..c85ad92c --- /dev/null +++ b/pypi/py-hatch-fancy-pypi-readme.file @@ -0,0 +1,4 @@ +package: py-hatch-fancy-pypi-readme +build_requires: +- py-hatchling +--- \ No newline at end of file diff --git a/pypi/py-hatchling.file b/pypi/py-hatchling.file new file mode 100644 index 00000000..25acde6d --- /dev/null +++ b/pypi/py-hatchling.file @@ -0,0 +1,10 @@ +package: py-hatchling +requires: +- py-pathspec +- py-tomli +- py-pluggy +- py-editables +- py-trove-classifiers +- py-calver +- py-packaging +--- diff --git a/pypi/py-idna.file b/pypi/py-idna.file new file mode 100644 index 00000000..678b6e4f --- /dev/null +++ b/pypi/py-idna.file @@ -0,0 +1,3 @@ +build_requires: + - py-flit-core +--- diff --git a/pypi/py-importlib-metadata.file b/pypi/py-importlib-metadata.file new file mode 100644 index 00000000..1bfe1ea1 --- /dev/null +++ b/pypi/py-importlib-metadata.file @@ -0,0 +1,6 @@ +package: py-importlib-metadata +requires: +- py-contextlib2 +- py-pathlib2 +- py-zipp +--- \ No newline at end of file diff --git a/pypi/py-meson-python.file b/pypi/py-meson-python.file new file mode 100644 index 00000000..8fc8dace --- /dev/null +++ b/pypi/py-meson-python.file @@ -0,0 +1,7 @@ +requires: + - py-meson + - py-pyproject-metadata + - py-tomli + - py-typing-extensions + - ninja +--- diff --git a/pypi/py-multidict.file b/pypi/py-multidict.file new file mode 100644 index 00000000..b7c0647a --- /dev/null +++ b/pypi/py-multidict.file @@ -0,0 +1,3 @@ +requires: +- py-typing-extensions +--- \ No newline at end of file diff --git a/pypi/py-numpy.file b/pypi/py-numpy.file new file mode 100644 index 00000000..1476c435 --- /dev/null +++ b/pypi/py-numpy.file @@ -0,0 +1,35 @@ +package: py-numpy +build_requires: + - py-meson-python +requires: + - py-cython + - zlib + - OpenBLAS +sources: + - https://github.com/numpy/numpy/releases/download/v%(version)s/numpy-%(version)s.tar.gz + --- +PipInstallOptions="$PWD/numpy-*" + +PipPatchSource="cat > site.cfg <> "$INSTALLROOT/.provides" + echo "python3dist(scipy) = ${PKGVERSION}" >> "$INSTALLROOT/.provides" + export __find_provides=true +fi + + diff --git a/pypi/py-setuptools-scm.file b/pypi/py-setuptools-scm.file new file mode 100644 index 00000000..389e2fa3 --- /dev/null +++ b/pypi/py-setuptools-scm.file @@ -0,0 +1,6 @@ +requires: +- py-tomli +- py-packaging +- py-typing-extensions +- py-importlib-metadata +--- \ No newline at end of file diff --git a/pypi/py-sympy.file b/pypi/py-sympy.file new file mode 100644 index 00000000..6d8b2b3d --- /dev/null +++ b/pypi/py-sympy.file @@ -0,0 +1,3 @@ +requires: + - py-mpmath +--- diff --git a/pypi/py-tomli.file b/pypi/py-tomli.file new file mode 100644 index 00000000..678b6e4f --- /dev/null +++ b/pypi/py-tomli.file @@ -0,0 +1,3 @@ +build_requires: + - py-flit-core +--- diff --git a/pypi/py-typing-extensions.file b/pypi/py-typing-extensions.file new file mode 100644 index 00000000..afdf302c --- /dev/null +++ b/pypi/py-typing-extensions.file @@ -0,0 +1,3 @@ +requires: + - py-flit-core +--- \ No newline at end of file diff --git a/pypi/py-versioneer b/pypi/py-versioneer new file mode 100644 index 00000000..f48926d9 --- /dev/null +++ b/pypi/py-versioneer @@ -0,0 +1,4 @@ +package: py-versioneer +requires: +- py-tomli +--- \ No newline at end of file diff --git a/pypi/py-wheel.file b/pypi/py-wheel.file new file mode 100644 index 00000000..678b6e4f --- /dev/null +++ b/pypi/py-wheel.file @@ -0,0 +1,3 @@ +build_requires: + - py-flit-core +--- diff --git a/pypi/py-xgboost.file b/pypi/py-xgboost.file new file mode 100644 index 00000000..3b281238 --- /dev/null +++ b/pypi/py-xgboost.file @@ -0,0 +1,14 @@ +requires: +- py-scipy +- xgboost +--- +PipPatchSource=' +sed -i -e "s|^\( *\)outfiles *= *super().install()|\1return super().install()|" setup.py && \ +sed -i -e "s|\('use-system-libxgboost': *\)0)|\11)|" setup.py +' + +PipPostInstall=' +mkdir -p "$INSTALLROOT/${PYTHON3_LIB_SITE_PACKAGES}/xgboost/lib" && \ +cd "$INSTALLROOT/${PYTHON3_LIB_SITE_PACKAGES}/xgboost/lib" && \ +ln -s "$INSTALLROOT/xgboost/${XGBOOST_VERSION}/lib64/libxgboost.so" . +' \ No newline at end of file diff --git a/pypi/py-yarl.file b/pypi/py-yarl.file new file mode 100644 index 00000000..41886344 --- /dev/null +++ b/pypi/py-yarl.file @@ -0,0 +1,9 @@ +package: py-yarl +requires: +- py-multidict +- py-idna +- py-tomli +- py-expandvars +- py-cython +- py-propcache +--- \ No newline at end of file diff --git a/pypi/py-zipp.file b/pypi/py-zipp.file new file mode 100644 index 00000000..e99eefb3 --- /dev/null +++ b/pypi/py-zipp.file @@ -0,0 +1,4 @@ +requires: +- py-more-itertools +- py-contextlib2 +--- \ No newline at end of file diff --git a/pypi/requirements.txt b/pypi/requirements.txt new file mode 100644 index 00000000..49ea7a29 --- /dev/null +++ b/pypi/requirements.txt @@ -0,0 +1,434 @@ +############################################################################# +#List of pip based packages. One package per line +#This now only support python3 +############################################################################# +#Use update_requirements.py script to auto-update versions. First package after +#line which starts with "#NO_AUTO_UPDATE:" will not be automatically updated e.g +##NO_AUTO_UPDATE: Force use version 1.2.3 +#package_name==1.2.3 +#In this case pip package package_name version will not be automatically updated. +############################################################################# +#To customize a package build e.g. providing extra Requirements, build, install +#flags or patching, please use package_name.file +############################################################################# +absl-py==2.3.0 +aiohappyeyeballs==2.6.1 +aiohttp==3.12.12 +aiosqlite==0.21.0 +aiosignal==1.3.2 +annotated-types==0.7.0 +anyio==4.9.0 +appdirs==1.4.4 +argon2-cffi==25.1.0 +argon2-cffi-bindings==21.2.0 +argparse==1.4.0 +arrow==1.3.0 +asn1crypto==1.5.1 +astor==0.8.1 +astroid==3.3.10 +asttokens==3.0.0 +astunparse==1.6.3 +async-lru==2.0.5 +async-timeout==5.0.1 +atomicwrites==1.4.1 +attrs==25.3.0 +autopep8==2.3.2 +avro==1.12.0 +awkward==2.8.3 +awkward-cpp==46 +# No 'release' versions exist +awkward-pandas==2023.8.0 +babel==2.17.0 +backcall==0.2.0 +backports-entry-points-selectable==1.3.0 +backports-tarfile==1.2.0 +beautifulsoup4==4.13.4 +beniget==0.4.2.post1 +bleach==6.2.0 +# NO_AUTO_UPDATE: version >= 2.6.0 needs Python 3.10 +blosc2==2.5.1 +bokeh==3.7.3 +boost-histogram==1.5.2 +bottle==0.13.3 +Bottleneck==1.5.0 +build==1.2.2.post1 +cachecontrol==0.14.3 +cachetools==6.0.0 +cachy==0.3.0 +calver==2025.4.17 +charset-normalizer==3.4.2 +chug==0.2.0.dev0 +cleo==2.1.0 +# NO_AUTO_UPDATE: version >= 8.2.0 needs Python 3.10 +click==8.1.8 +clikit==0.6.2 +cmsml==0.2.7 +#NO_AUTO_UPDATE: Not in PyPi +cms-tfaot==1.0.1 +contourpy==1.2.1 +correctionlib==2.7.0 +cramjam==2.10.0 +crashtest==0.4.1 +certifi==2025.4.26 +cffi==1.17.1 +chardet==5.2.0 +cloudpickle==3.1.1 +colorama==0.4.6 +comm==0.2.2 +commonmark==0.9.1 +conan==2.17.0 +contextlib2==21.6.0 +contextvars==2.4 +coverage==7.9.1 +cppy==1.3.1 +cryptography==45.0.4 +cx-Oracle==8.3.0 +cycler==0.12.1 +# xxNO_AUTO_UPDATE: numpy 1.24.3 doesn't support cython 3.x +cython==3.1.2 +# NO_AUTO_UPDATE:2: version >= 2024.8.1 requires Python 3.10+ +dask==2024.8.0 +dask-awkward==2025.5.0 +decorator==5.2.1 +debugpy==1.8.14 +defusedxml==0.7.1 +deprecation==2.1.0 +deprecated==1.2.18 +dill==0.4.0 +distlib==0.3.9 +distro==1.9.0 +docopt==0.6.2 +docutils==0.21.2 +dulwich==0.22.8 +editables==0.5 +entrypoints==0.4 +execnet==2.1.1 +executing==2.2.0 +exceptiongroup==1.3.0 +expandvars==1.0.0 +fasteners==0.19 +fastjsonschema==2.21.1 +filelock==3.18.0 +fire==0.7.0 +findpython==0.6.3 +flit==3.12.0 +flit-core==3.12.0 +flit-scm==1.7.0 +flake8==7.2.0 +flatbuffers==25.2.10 +flawfinder==2.0.19 +fonttools==4.58.3 +frozenlist==1.7.0 +fsspec==2025.5.1 +funcsigs==1.0.2 +future==1.0.0 +gast==0.6.0 +gitdb==4.0.12 +GitPython==3.1.44 +google-auth==2.40.3 +google-auth-oauthlib==1.2.2 +google-pasta==0.2.0 +# NO_AUTO_UPDATE:2: update together with TF +grpcio==1.60.1 +grpcio-tools==1.60.1 +h11==0.16.0 +hatch-fancy-pypi-readme==25.1.0 +hatch-jupyter-builder==0.9.1 +hatch-nodejs-version==0.3.2 +hatch-vcs==0.5.0 +hatchling==1.27.0 +h5py==3.13.0 +hepdata-lib==0.18.0 +hepdata-validator==0.3.6 +hist==2.8.1 +histoprint==2.6.0 +histogrammar==1.1.0 +html5lib==1.1 +httpcore==1.0.9 +httpx==0.28.1 +idna==3.10 +immutables==0.21 +importlib-metadata==8.7.0 +importlib-resources==6.5.2 +iniconfig==2.1.0 +installer==0.7.0 +ipaddress==1.0.23 +ipykernel==6.29.5 +ipython_genutils==0.2.0 +# NO_AUTO_UPDATE: version >= 8.20.0 requires Python 3.10 +ipython==8.18.1 +ipywidgets==8.1.7 +isort==6.0.1 +jaraco-classes==3.4.0 +jaraco-functools==4.1.0 +jaraco-context==6.0.1 +# NO_AUTO_UPDATE:2: version >= 0.4.31 requires Python 3.10+ +jax==0.4.30 +jaxlib==0.4.30 +jedi==0.19.2 +jeepney==0.9.0 +Jinja2==3.1.6 +jinja2-time==0.2.0 +joblib==1.5.1 +json5==0.12.0 +jsonpickle==4.1.1 +jsonschema==4.24.0 +jsonschema-specifications==2025.4.1 +jupyter-client==8.6.3 +jupyter-console==6.6.3 +jupyter-core==5.8.1 +jupyter-events==0.12.0 +jupyter-packaging==0.12.3 +# NO_AUTO_UPDATE: cyclic dependency, see https://github.com/jupyterlab/jupyterlab_pygments/issues/23 +jupyterlab-pygments==0.2.2 +jupyter-lsp==2.2.5 +jupyter-server==2.16.0 +jupyterlab-server==2.27.3 +jupyter-server-mathjax==0.2.6 +jupyter-server-terminals==0.5.3 +jupyterlab==4.4.3 +jupyterlab-widgets==3.0.15 +#NO_AUTO_UPDATE: needs newer TF +keras==2.11.0 +keras-applications==1.0.8 +keras-preprocessing==1.1.2 +keras2onnx==1.7.0 +keyring==25.6.0 +# NO_AUTO_UPDATE: version >= 1.4.8 requires Python 3.10+ +kiwisolver==1.4.7 +law==0.1.20 +lazy-object-proxy==1.11.0 +lizard==1.17.31 +#llvmlite==v0.41.0dev0 +locket==1.0.0 +lockfile==0.12.2 +luigi==3.6.0 +lxml==5.4.0 +lz4==4.4.4 +make==0.1.6.post2 +Mako==1.3.10 +Markdown==3.8 +markdown-it-py==3.0.0 +MarkupSafe==3.0.2 +# NO_AUTO_UPDATE: version >= 3.10.0 requires Python 3.10+ +matplotlib==3.9.4 +matplotlib-inline==0.1.7 +maturin==1.8.7 +mccabe==0.7.0 +mdurl==0.1.2 +meson==1.8.2 +meson-python==0.18.0 +mistune==3.1.3 +ml_dtypes==0.5.1 +mock==5.2.0 +more-itertools==10.7.0 +mpld3==0.5.10 +mplhep==0.3.59 +mplhep-data==0.0.4 +mpmath==1.3.0 +msgpack==1.1.1 +multidict==6.4.4 +nbclassic==1.3.1 +nbclient==0.10.2 +nbconvert==7.16.6 +nbformat==5.10.4 +ndindex==1.10.0 +nest-asyncio==1.6.0 +# NO_AUTO_UPDATE: version >= 3.3 requires Python 3.10+ +networkx==3.2.1 +neurolab==0.3.5 +node-semver==0.9.0 +notebook==7.4.3 +notebook-shim==0.2.4 +nvidia-ml-py==12.575.51 +# numba==0.56.4 +# NO_AUTO_UPDATE: version >= 2.11.0 requires Python 3.10+ +numexpr==2.10.2 +# setuptools version <64 is needed by numpy: https://github.com/pypa/setuptools/issues/3549 +# NO_AUTO_UPDATE: update together with tensorflow +numpy==1.26.4 +# NO_AUTO_UPDATE:1 +onnx==1.17.0 +onnxmltools==1.14.0 +onnxconverter-common==1.14.0 +oauthlib==3.2.2 +opt-einsum==3.4.0 +overrides==7.7.0 +pkginfo==1.12.1.2 +packaging==25.0 +pandas==2.3.0 +pandocfilters==1.5.1 +parsimonious==0.10.0 +parso==0.8.4 +partd==1.4.2 +pastel==0.2.1 +patch-ng==1.18.1 +pathlib2==2.3.7.post1 +pathspec==0.12.1 +pbr==6.1.1 +pbs-installer==2025.6.12 +pdm-backend==2.4.4 +pexpect==4.9.0 +pickleshare==0.7.5 +pillow==11.2.1 +pkgconfig==1.5.5 +plac==1.4.5 +platformdirs==4.3.8 +pluginbase==1.0.1 +pluggy==1.6.0 +ply==3.11 +poetry==2.1.3 +poetry-core==2.1.3 +poetry-plugin-export==1.9.0 +prettytable==3.16.0 +prometheus-client==0.22.1 +prompt_toolkit==3.0.51 +propcache==0.3.2 +#NO_AUTO_UPDATE:1: Update together with Tensorflow +protobuf==4.21.9 +prwlock==0.4.1 +psutil==7.0.0 +ptyprocess==0.7.0 +pure-eval==0.2.3 +py-cpuinfo==9.0.0 +pyasn1-modules==0.4.2 +pyasn1==0.6.1 +pybind11==2.13.6 +pybrain==0.3.3 +pycodestyle==2.13.0 +pycparser==2.22 +pycuda==2025.1.1 +pycurl==7.45.6 +#NO_AUTO_UPDATE: version >= 2.35 requires new version of pydantic which does not use validate_core_schema +pydantic-core==2.34.1 +pydot==4.0.0 +pyflakes==3.3.2 +Pygments==2.19.1 +PyJWT==2.10.1 +pylint==3.3.7 +pymongo==4.13.1 +pyparsing==3.2.3 +pyproject-hooks==1.2.0 +pyproject-metadata==0.9.1 +pyrsistent==0.20.0 +pydantic==2.11.7 +pygithub==2.6.1 +pylev==1.4.0 +PyNaCl==1.5.0 +pysocks==1.7.1 +pysqlite3==0.5.4 +pytest==8.4.0 +pytest-cov==6.2.1 +pytest-runner==6.0.1 +pytest-xdist==3.7.0 +python-daemon==3.0.1 +python-dateutil==2.9.0.post0 +python-json-logger==3.3.0 +python-ldap==3.4.4 +python-rapidjson==1.20 +pythran==0.18.0 +pytoml==0.1.21 +pytools==2024.1.14 +pytz==2025.2 +PyYAML==6.0.2 +pyzmq==27.0.0 +rapidfuzz==3.13.0 +referencing==0.36.2 +regex==2024.11.6 +repoze-lru==0.7 +rep==0.6.6 +requests==2.32.4 +requests-toolbelt==1.0.0 +requests-oauthlib==2.0.0 +requests-unixsocket==0.4.1 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +rich==14.0.0 +rootpy==1.0.1 +rpds-py==0.25.1 +rsa==4.9.1 +scandir==1.10.0 +schema==0.7.7 +scikit-build==0.18.1 +scikit-build-core==0.11.4 +#NO_AUTO_UPDATE: Version >= 1.7.0 requires Python >=3.10 +scikit-learn==1.6.1 +scinum==2.2.0 +#NO_AUTO_UPDATE: Version >= 1.40 requires Python >=3.10 +scipy==1.13.1 +secretstorage==3.3.3 +semantic-version==2.10.0 +threadpoolctl==3.6.0 +seaborn==0.13.2 +Send2Trash==1.8.3 +setuptools-rust==1.11.1 +setuptools-scm==8.3.1 +shellingham==1.5.4 +simplegeneric==0.8.1 +singledispatch==4.1.2 +six==1.17.0 +skl2onnx==1.19.1 +smmap==5.0.2 +sniffio==1.3.1 +soupsieve==2.7 +#NO_AUTO_UPDATE:1: Need to update our patches, hold for now +sqlalchemy==1.3.24 +stack-data==0.6.3 +stevedore==5.4.1 +subprocess32==3.5.4 +sympy==1.14.0 +# NO_AUTO_UPDATE: Needs newer blosc2 +tables==3.9.2 +tabulate==0.9.0 +tenacity==9.1.2 +#NO_AUTO_UPDATE:1: Force to use tensorflow 2.6.4; this should match the version in tensorflow-sources.spec +tensorflow==2.12.0 +tensorboard==2.19.0 +tensorflow-io-gcs-filesystem==0.37.1 +tensorflow-estimator==2.15.0 +tensorboard-data-server==0.7.2 +tensorboard-plugin-wit==1.8.1 +termcolor==3.1.0 +terminado==0.18.1 +testpath==0.6.0 +#NO_AUTO_UPDATE: Below is a dummy test package to show how to use custom download command to download a package source. +test-download==7.44.1 +tinycss2==1.4.0 +toml==0.10.2 +tomli==2.2.1 +tomli-w==1.2.0 +tomlkit==0.13.3 +toolz==1.0.0 +tornado==6.5.1 +tqdm==4.67.1 +traitlets==5.14.3 +trove-classifiers==2025.5.9.12 +typed-ast==1.5.5 +types-python-dateutil==2.9.0.20250516 +typing-extensions==4.14.0 +typing-inspection==0.4.1 +tzdata==2025.2 +uhi==0.5.0 +uncertainties==3.2.3 +uproot==5.6.2 +urllib3==2.5.0 +vector==1.6.2 +versioneer==0.29 +virtualenv-clone==0.5.7 +virtualenv==20.31.2 +virtualenvwrapper==6.1.1 +wcwidth==0.2.13 +webencodings==0.5.1 +websocket-client==1.8.0 +Werkzeug==3.1.3 +#NO_AUTO_UPDATE:1: you need wheel to build wheel +wheel==0.45.0 +widgetsnbextension==4.0.14 +#NO_AUTO_UPDATE: wrapt >=1.15.0 breaks tensorflow saved model, https://github.com/GrahamDumpleton/wrapt/issues/231 +wrapt==1.14.1 +#NO_AUTO_UPDATE: New versions require nvidia-nccl-cu12, which is a binary .whl package +xgboost==1.7.5 +xxhash==3.5.0 +yarl==1.20.1 +zipp==3.23.0 +iminuit==2.31.1 diff --git a/python.sh b/python.sh new file mode 100644 index 00000000..34fd4d45 --- /dev/null +++ b/python.sh @@ -0,0 +1,86 @@ +package: Python +version: "%(tag_basename)s" +tag: v3.9.14 +source: https://github.com/python/cpython +requires: + - expat + - bz2lib + - db6 + - gdbm + - libffi + - zlib + - sqlite + - xz + - libuuid + - gcc +env: + PYTHON3_LIB_SITE_PACKAGES: lib/python$(echo $PYTHON_VERSION | cut -d. -f1,2 | sed 's|^v||')/site-packages +--- +if [[ ! -d "$SOURCEDIR" ]]; then + exit 1 +fi + +if ! rsync -a --chmod=ug=rwX --delete --exclude '**/.git' \ + --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/; then + exit 1 +fi + +if ! mkdir -p "${INSTALLROOT}"/{include,lib,bin}; then + exit 1 +fi + +LDFLAGS="" +CPPFLAGS="" +for d in ${EXPAT_ROOT} ${BZ2LIB_ROOT} ${DB6_ROOT} ${GDBM_ROOT} ${LIBFFI_ROOT} ${ZLIB_ROOT} ${SQLITE_ROOT} ${XZ_ROOT} ${LIBUUID_ROOT}; do + if [[ -n "$d" ]]; then + if [[ -e "$d/lib" ]]; then + LDFLAGS="$LDFLAGS -L$d/lib" + fi + if [[ -e "$d/lib64" ]]; then + LDFLAGS="$LDFLAGS -L$d/lib64" + fi + if [[ -e "$d/include" ]]; then + CPPFLAGS="$CPPFLAGS -I$d/include" + fi + fi +done + +mkdir -p "$BUILDDIR/tmp" + +./configure \ + --prefix="${INSTALLROOT}" \ + --enable-shared \ + --enable-ipv6 \ + --with-system-ffi \ + --without-ensurepip \ + --with-system-expat \ + LDFLAGS="$LDFLAGS" \ + CPPFLAGS="$CPPFLAGS" + +make ${JOBS+-j $JOBS} +make install + +pythonv=$(echo ${PKGVERSION} | sed 's|^v||' | cut -d. -f 1,2) +python_major=$(echo ${pythonv} | cut -d. -f 1) + +sed -i -e "s|^#!.*python${pythonv} *$|#!/usr/bin/env python${python_major}|" ${INSTALLROOT}/bin/* ${INSTALLROOT}/lib/python${pythonv}/*.py +sed -i -e "s|^#!/.*|#!/usr/bin/env python${pythonv}m|" ${INSTALLROOT}/lib/python${pythonv}/config-*/python-config.py +sed -i -e "s|^#! */usr/local/bin/python|#!/usr/bin/env python|" ${INSTALLROOT}/lib/python${pythonv}/cgi.py + +# is executable, but does not start with she-bang so not valid +# executable; this avoids problems with rpm 4.8+ find-requires +#find ${INSTALLROOT} -name '*.py' -perm +0111 | while read f; do +# if head -n1 $f | grep -q '"'; then chmod -x $f; else :; fi +#done + +# Remove .pyo files +find ${INSTALLROOT} -name '*.pyo' -exec rm {} \; + +# Remove documentation, examples and test files. +rm -rf ${INSTALLROOT}/share ${INSTALLROOT}/lib/python${pythonv}/test ${INSTALLROOT}/lib/python${pythonv}/distutils/tests ${INSTALLROOT}/lib/python${pythonv}/lib2to3/tests + +echo "from os import environ" > ${INSTALLROOT}/lib/python${pythonv}/sitecustomize.py +echo "if 'PYTHON3PATH' in environ:" >> ${INSTALLROOT}/lib/python${pythonv}/sitecustomize.py +echo " import os,site" >> ${INSTALLROOT}/lib/python${pythonv}/sitecustomize.py +echo " for p in environ['PYTHON3PATH'].split(os.pathsep):">> ${INSTALLROOT}/lib/python${pythonv}/sitecustomize.py +echo " site.addsitedir(p)">> ${INSTALLROOT}/lib/python${pythonv}/sitecustomize.py diff --git a/pytorch.sh b/pytorch.sh new file mode 100644 index 00000000..26cf2131 --- /dev/null +++ b/pytorch.sh @@ -0,0 +1,121 @@ +package: pytorch +version: "v%(tag_basename)s" +tag: "2.6.0" +sources: +- git+https://github.com/pytorch/pytorch?obj=main/v2.6.0&export=pytorch-2.6.0&submodules=1&output=/pytorch-2.6.0.tgz +- https://raw.githubusercontent.com/cms-sw/cmsdist/refs/heads/IB/CMSSW_15_1_X/g14/FindEigen3.cmake.file +- https://raw.githubusercontent.com/cms-sw/cmsdist/refs/heads/IB/CMSSW_15_1_X/g14/FindFMT.cmake.file +- https://raw.githubusercontent.com/cms-sw/cmsdist/refs/heads/IB/CMSSW_15_1_X/g14/scram-tools.file/tools/eigen/env.sh +patches: +- pytorch-missing-braces.patch +- pytorch-system-fmt.patch +build_requires: +- CMake +- ninja +requires: +- cuda +- cudnn +- gcc +- eigen +- fxdiv +- numactl +- openmpi +- protobuf +- psimd +- Python +- py-PyYAML +- OpenBLAS +- zlib +- fmt +- py-pybind11 +- py-typing-extensions +--- +mkdir -p $BUILDDIR/$PKGNAME-$PKGVERSION/ +pushd $BUILDDIR/$PKGNAME-$PKGVERSION/ + +tar -xzf "$SOURCEDIR"/$SOURCE0 \ + --strip-components=1 \ + -C "$BUILDDIR/$PKGNAME-$PKGVERSION" + +cp "$SOURCEDIR/FindEigen3.cmake.file" "$BUILDDIR/$PKGNAME-$PKGVERSION/cmake/Modules/FindEigen3.cmake" +#cp "$SOURCEDIR/FindFMT.cmake.file" "$BUILDDIR/$PKGNAME-$PKGVERSION/cmake/Modules/FindFMT.cmake" +cp "$SOURCEDIR"/env.sh "$BUILDDIR/$PKGNAME-$PKGVERSION"/ + +patch -p1 < $SOURCEDIR/$PATCH0 +patch -p1 < $SOURCEDIR/$PATCH1 +popd + +rm -rf build; mkdir build; cd build + +#source env.sh +USE_CUDA=OFF + +if [ -z "${WITHOUT_CUDA}" ]; then + if [ "${cuda_gcc_support}" = "true" ]; then + USE_CUDA=ON + fi +fi + +cmake_args=( + $BUILDDIR/$PKGNAME-$PKGVERSION + -G Ninja + -Wno-dev + -L + -DCMAKE_INSTALL_PREFIX="$INSTALLROOT" + -DCMAKE_INSTALL_LIBDIR=lib + -DBUILD_TEST=OFF + -DBUILD_BINARY=OFF + -DBUILD_PYTHON=OFF + -DUSE_CUSPARSELT=OFF + -DUSE_CUDSS=OFF + -DUSE_NCCL=OFF + -DUSE_ROCM=OFF + -DUSE_XPU=OFF + -DUSE_FBGEMM=OFF + -DUSE_KINETO=OFF + -DUSE_MAGMA=OFF + -DUSE_MPS=OFF + -DUSE_NNPACK=OFF + -DUSE_NUMA=ON + -DUSE_ROOT_DIR="$NUMACTL_ROOT" + -DUSE_NUMPY=OFF + -DUSE_OPENMP=ON + -DUSE_QNNPACK=OFF + -DUSE_PYTORCH_QNNPACK=OFF + -DUSE_VALGRIND=OFF + -DUSE_XNNPACK=OFF + -DUSE_MKLDNN=OFF + -DUSE_DISTRIBUTED=OFF + -DUSE_MPI=ON + -DUSE_GLOO=OFF + -DUSE_TENSORPIPE=OFF + -DONNX_ML=ON + -DBLAS=OpenBLAS + -DBUILD_CUSTOM_PROTOBUF=OFF + -DUSE_SYSTEM_EIGEN_INSTALL=ON + -DUSE_SYSTEM_PSIMD=ON + -DUSE_SYSTEM_FXDIV=ON + -DUSE_SYSTEM_PYBIND11=ON + -DUSE_SYSTEM_BENCHMARK=OFF + -DPYTHON_EXECUTABLE=${PYTHON_ROOT}/bin/python3 + -DCMAKE_PREFIX_PATH="${EIGEN_ROOT};${FXDIV_ROOT};${NUMACTL_ROOT};${OPENMPI_ROOT};${PROTOBUF_ROOT};${PSIMD_ROOT};${PYTHON_ROOT};${PY_PYYAML_ROOT};${OPENBLAS_ROOT};${ZLIB_ROOT};${FMT_ROOT};${PY_PYBIND11_ROOT};${PY_TYPING_EXTENSIONS_ROOT}" + -DCMAKE_FIND_DEBUG_MODE=ON +) + +if [ -z "${WITHOUT_CUDA}" ]; then + cmake_args+=( + -DUSE_CUDA=${USE_CUDA} + -DTORCH_CUDA_ARCH_LIST="6.0 7.0 7.5 8.0 8.9 9.0+PTX" + -Dnvtx3_dir=${CUDA_ROOT}/include + -DUSE_CUDNN=${USE_CUDA} + -DCUDNN_ROOT=${CUDNN_ROOT} + ) +else + cmake_args+=( + -DUSE_CUDA=OFF + -DUSE_CUDNN=OFF + ) +fi + +cmake "${cmake_args[@]}" +ninja -v ${JOBS:+-j$JOBS} install diff --git a/rdma-core.sh b/rdma-core.sh new file mode 100644 index 00000000..35f4a6d9 --- /dev/null +++ b/rdma-core.sh @@ -0,0 +1,36 @@ +package: rdma-core +version: "%(tag_basename)s" +tag: v57.0 +source: https://github.com/linux-rdma/rdma-core +build_requires: + - CMake + - ninja +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$PKGNAME-$PKGVERSION"/ + +cmake $PKGNAME-$PKGVERSION \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \ + -DCMAKE_INSTALL_RUNDIR=/var/run \ + -DENABLE_RESOLVE_NEIGH=FALSE \ + -DENABLE_STATIC=FALSE \ + -DNO_MAN_PAGES=TRUE \ + +cmake -L . + +ninja -v ${JOBS:+-j$JOBS} +ninja install + +rm -rf $INSTALLROOT/lib64/pkgconfig +rm -rf $INSTALLROOT/etc/infiniband-diags +rm -rf $INSTALLROOT/etc/init.d +rm -rf $INSTALLROOT/etc/modprobe.d +rm -rf $INSTALLROOT/etc/rdma +rm -rf $INSTALLROOT/lib +rm -rf $INSTALLROOT/libexec +rm -rf $INSTALLROOT/sbin +rm -rf $INSTALLROOT/share/perl5 + +sed -e's#driver \(\w\+\)#driver $INSTALLROOT/lib64/libibverbs/lib\1#' -i $INSTALLROOT/etc/libibverbs.d/* \ No newline at end of file diff --git a/re2c.sh b/re2c.sh new file mode 100644 index 00000000..07d88173 --- /dev/null +++ b/re2c.sh @@ -0,0 +1,13 @@ +package: re2c +version: "%(tag_basename)s" +tag: 1.0.1 +source: https://github.com/skvadrik/re2c +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ +cd $PKGNAME +autoreconf -i -W all +./configure --prefix="$INSTALLROOT" +make ${JOBS+-j $JOBS} +make install \ No newline at end of file diff --git a/root.sh b/root.sh new file mode 100644 index 00000000..53f8819a --- /dev/null +++ b/root.sh @@ -0,0 +1,233 @@ +package: ROOT +version: "v1" +tag: cms/v6-36-00-patches/1715228c2c +source: https://github.com/cms-sw/root +build_requires: +- CMake +- ninja +requires: +- gcc +- GSL +- libjpeg-turbo +- libpng +- libtiff +- giflib +- pcre2 +- Python +- FFTW3 +- xz +- XRootD +- libxml2 +- zlib +- davix +- TBB +- OpenBLAS +- py-numpy +- lz4 +- FreeType +- zstd +- dcap +- cuda +--- +case "$(uname)" in +Darwin) + soext="dylib" + ;; +*) + soext="so" + ;; +esac +PKGBUILDDIR="$BUILDDIR/$PKGNAME-$PKGVERSION" + +mkdir -p "$PKGBUILDDIR" +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$PKGBUILDDIR"/ +curl -L -k -s -o "$PKGBUILDDIR/graf2d/asimage/src/libAfterImage/config.sub" http://cmsrep.cern.ch/cmssw/download/config/config.sub +curl -L -k -s -o "$PKGBUILDDIR/graf2d/asimage/src/libAfterImage/config.guess" http://cmsrep.cern.ch/cmssw/download/config/config.guess +chmod +x $PKGBUILDDIR/graf2d/asimage/src/libAfterImage/config.{sub,guess} + +export CFLAGS=-D__ROOFIT_NOBANNER +export CXXFLAGS=-D__ROOFIT_NOBANNER + +if [ -z "${arch_build_flags:-}" ]; then + case "$(uname -m)" in + ppc64le) arch_build_flags="-mcpu=power8 -mtune=power8 --param=l1-cache-size=64 --param=l1-cache-line-size=128 --param=l2-cache-size=512" ;; + aarch64) arch_build_flags="-march=armv8-a -mno-outline-atomics" ;; + x86_64) arch_build_flags="" ;; + *) arch_build_flags="" ;; + esac +fi + +if [ -n "${arch_build_flags:-}" ]; then + export CFLAGS="${CFLAGS} ${arch_build_flags}" + export CXXFLAGS="${CXXFLAGS} ${arch_build_flags}" +fi + +# Set OS-specific flags +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m) + +# Build CMake command +cmake_args=( + "../$PKGNAME/$PKGNAME-$PKGVERSION" + -G Ninja + -DCMAKE_BUILD_TYPE="${cmake_build_type}" + -DLLVM_BUILD_TYPE="${LLVM_BUILD_TYPE}" + -DCMAKE_INSTALL_PREFIX="$INSTALLROOT" + -DCMAKE_C_COMPILER=gcc + -DCMAKE_CXX_COMPILER=g++ + -DCMAKE_Fortran_COMPILER=gfortran + -DCMAKE_LINKER=ld + -DCMAKE_VERBOSE_MAKEFILE=TRUE + -Droot7=ON + -Dfail-on-missing=ON + -Dgnuinstall=OFF + -Droofit=ON + -Dvdt=OFF + -Dhdfs=OFF + -Dqt=OFF + -Dtmva=ON + -DPython3_EXECUTABLE="${PYTHON_ROOT}/bin/python3.9" + -Dqtgsi=OFF + -Dpgsql=OFF + -Dsqlite=OFF + -Dmysql=OFF + -Doracle=OFF + -Dldap=OFF + -Dkrb5=OFF + -Dftgl=OFF + -Dfftw3=ON + -Dtbb=ON + -Dimt=ON + -DFFTW_INCLUDE_DIR="${FFTW3_ROOT}/include" + -DFFTW_LIBRARY="${FFTW3_ROOT}/lib/libfftw3.${soext}" + -Dmathmore=ON + -Dexplicitlink=ON + -Dbuiltin_tbb=OFF + -Dbuiltin_pcre=OFF + -Dbuiltin_freetype=OFF + -Dbuiltin_zlib=OFF + -Dbuiltin_lzma=OFF + -Dbuiltin_gsl=OFF + -Dbuiltin_glew=ON + -Dbuiltin_ftgl=ON + -Dbuiltin_gl2ps=ON + -Dbuiltin_xxhash=ON + -Dbuiltin_nlohmannjson=ON + -Darrow=OFF + -DGSL_ROOT_DIR="${GSL_ROOT}" + -DGSL_CBLAS_LIBRARY="${OPENBLAS_ROOT}/lib/libopenblas.${soext}" + -DGSL_CBLAS_LIBRARY_DEBUG="${OPENBLAS_ROOT}/lib/libopenblas.${soext}" + -DCMAKE_CXX_STANDARD=20 + -Dssl=ON + -Dpyroot=ON + -Dxrootd=ON + -Dbuiltin_xrootd=OFF + -DXROOTD_INCLUDE_DIR="${XROOTD_ROOT}/include/xrootd" + -DXROOTD_ROOT_DIR="${XROOTD_ROOT}" + -DCMAKE_C_FLAGS="-D__ROOFIT_NOBANNER" + -DCMAKE_CXX_FLAGS="-D__ROOFIT_NOBANNER" + -Dgviz=OFF + -Dbonjour=OFF + -Dodbc=OFF + -Dpythia6=OFF + -Dpythia8=OFF + -Dfitsio=OFF + -Dgfal=OFF + -Dchirp=OFF + -Dsrp=OFF + -Ddavix=ON + -Dglite=OFF + -Dsapdb=OFF + -Dalien=OFF + -Dmonalisa=OFF + -DJPEG_INCLUDE_DIR="${LIBJPEG_TURBO_ROOT}/include" + -DJPEG_LIBRARY="${LIBJPEG_TURBO_ROOT}/lib64/libjpeg.${soext}" + -DPNG_INCLUDE_DIRS="${LIBPNG_ROOT}/include" + -DPNG_LIBRARY="${LIBPNG_ROOT}/lib/libpng.${soext}" + -Dastiff=ON + -DTIFF_INCLUDE_DIR="${LIBTIFF_ROOT}/include" + -DTIFF_LIBRARY="${LIBTIFF_ROOT}/lib/libtiff.${soext}" + -DLIBLZMA_INCLUDE_DIR="${XZ_ROOT}/include" + -DLIBLZMA_LIBRARY="${XZ_ROOT}/lib/liblzma.${soext}" + -DLZ4_INCLUDE_DIR="${LZ4_ROOT}/include" + -DLZ4_LIBRARY="${LZ4_ROOT}/lib/liblz4.${soext}" + -DZLIB_ROOT="${ZLIB_ROOT}" + -DZLIB_INCLUDE_DIR="${ZLIB_ROOT}/include" + -DZSTD_ROOT="${ZSTD_ROOT}" + -DCMAKE_PREFIX_PATH="${LZ4_ROOT};${GSL_ROOT};${XZ_ROOT};${GIFLIB_ROOT};${FREETYPE_ROOT};${PYTHON3_ROOT};${LIBPNG_ROOT};${PCRE2_ROOT};${TBB_ROOT};${OPENBLAS_ROOT};${DAVIX_ROOT};${LIBXML2_ROOT};${ZSTD_ROOT}" +) + +# Add OS-specific options +if [ "$OS" = "linux" ]; then + cmake_args+=( + -Drfio=OFF + -Dcastor=OFF + -Ddcache=ON + -DDCAP_INCLUDE_DIR="${DCAP_ROOT}/include" + -DDCAP_DIR="${DCAP_ROOT}" + ) +elif [ "$OS" = "darwin" ]; then + cmake_args+=( + -Dcocoa=OFF + -Dx11=ON + -Dcastor=OFF + -Drfio=OFF + -Ddcache=OFF + ) +fi + +# Execute cmake +cmake "${cmake_args[@]}" + +for d in ${EXPAT_ROOT} ${BZ2LIB_ROOT} ${DB6_ROOT} ${GDBM_ROOT} ${LIBFFI_ROOT} ${ZLIB_ROOT} ${SQLITE_ROOT} ${XZ_ROOT} ${LIBUUID_ROOT}; do + if [[ -n "$d" ]]; then + if [[ -e "$d/lib" ]]; then + LDFLAGS="$LDFLAGS -L$d/lib" + fi + if [[ -e "$d/lib64" ]]; then + LDFLAGS="$LDFLAGS -L$d/lib64" + fi + if [[ -e "$d/include" ]]; then + CPPFLAGS="$CPPFLAGS -I$d/include" + fi + fi +done + +for d in \ + ${GSL_ROOT} \ + ${LIBJPEG_TURBO_ROOT} \ + ${LIBPNG_ROOT} \ + ${LIBTIFF_ROOT} \ + ${GIFLIB_ROOT} \ + ${PCRE2_ROOT} \ + ${PYTHON_ROOT} \ + ${FFTW3_ROOT} \ + ${XZ_ROOT} \ + ${XROOTD_ROOT} \ + ${LIBXML2_ROOT} \ + ${ZLIB_ROOT} \ + ${DAVIX_ROOT} \ + ${TBB_ROOT} \ + ${OPENBLAS_ROOT} \ + ${PY_NUMPY_ROOT} \ + ${LZ4_ROOT} \ + ${FREETYPE_ROOT} \ + ${ZSTD_ROOT} \ + ${DCAP_ROOT}; do + + if [ -d "${d}/include" ]; then + ROOT_INCLUDE_PATH="${d}/include${ROOT_INCLUDE_PATH:+:${ROOT_INCLUDE_PATH}}" + fi +done + +export ROOT_INCLUDE_PATH +export ROOTSYS=$INSTALLROOT +ninja -v ${JOBS:+-j$JOBS} install + +find $INSTALLROOT -type f -name '*.py' | xargs chmod -x +grep -rlI '#!.*python' $INSTALLROOT | xargs chmod +x +for p in $(grep -rlI -m1 '^#\!.*python' $INSTALLROOT/bin $INSTALLROOT/etc); do + lnum=$(grep -n -m1 '^#\!.*python' $p | sed 's|:.*||') + sed -i -e "${lnum}c#!/usr/bin/env python3" $p +done + diff --git a/setuptools.sh b/setuptools.sh new file mode 100644 index 00000000..4a7150b3 --- /dev/null +++ b/setuptools.sh @@ -0,0 +1,15 @@ +package: setuptools +version: "80.9.0" +sources: + - https://pypi.io/packages/source/s/setuptools/setuptools-%(version)s.tar.gz +requires: + - Python +prepend_path: + PYTHON3PATH: "%(root_dir)s/${PYTHON3_LIB_SITE_PACKAGES}" +--- +tar -xzf ${SOURCEDIR}/${SOURCE0} +cd setuptools-${PKGVERSION} +python3 setup.py build +python3 setup.py egg_info +python3 setup.py install --single-version-externally-managed \ + --record=/dev/null --skip-build --prefix="$INSTALLROOT" \ No newline at end of file diff --git a/sources/FindEigen3.cmake.file b/sources/FindEigen3.cmake.file new file mode 100644 index 00000000..c7e1da8e --- /dev/null +++ b/sources/FindEigen3.cmake.file @@ -0,0 +1,84 @@ +# - Try to find Eigen3 lib +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen3 3.1.2) +# to require version 3.1.2 or newer of Eigen3. +# +# Once done this will define +# +# EIGEN3_FOUND - system has eigen lib with correct version +# EIGEN3_INCLUDE_DIR - the eigen include directory +# EIGEN3_VERSION - eigen version + +# Copyright (c) 2006, 2007 Montel Laurent, +# Copyright (c) 2008, 2009 Gael Guennebaud, +# Copyright (c) 2009 Benoit Jacob +# Redistribution and use is allowed according to the terms of the 2-clause BSD license. +# +# Modified by Andreas Schuh to add Eigen3_DIR/EIGEN3_DIR to the PATHS of +# the find_path command (instead of HINGS). Use further PATH_SUFFIXES. +# Also, removed the separate branches for whether or not EIGEN3_INCLUDE_DIR +# is set already. The find_path command will not repeat the search in +# this case anyway. + +if(NOT Eigen3_FIND_VERSION) + if(NOT Eigen3_FIND_VERSION_MAJOR) + set(Eigen3_FIND_VERSION_MAJOR 2) + endif(NOT Eigen3_FIND_VERSION_MAJOR) + if(NOT Eigen3_FIND_VERSION_MINOR) + set(Eigen3_FIND_VERSION_MINOR 91) + endif(NOT Eigen3_FIND_VERSION_MINOR) + if(NOT Eigen3_FIND_VERSION_PATCH) + set(Eigen3_FIND_VERSION_PATCH 0) + endif(NOT Eigen3_FIND_VERSION_PATCH) + + set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") +endif(NOT Eigen3_FIND_VERSION) + +macro(_eigen3_check_version) + file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") + set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") + set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") + set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) + if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK FALSE) + else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK TRUE) + endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + + if(NOT EIGEN3_VERSION_OK) + message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " + "but at least version ${Eigen3_FIND_VERSION} is required") + endif(NOT EIGEN3_VERSION_OK) +endmacro(_eigen3_check_version) + +find_path(EIGEN3_INCLUDE_DIR + NAMES + signature_of_eigen3_matrix_library + PATHS + ${Eigen3_DIR} + ${EIGEN3_DIR} + ${CMAKE_INSTALL_PREFIX} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES + include + include/eigen3 + include/eigen + eigen3 + eigen +) + +if (EIGEN3_INCLUDE_DIR) + _eigen3_check_version() +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + +mark_as_advanced(EIGEN3_INCLUDE_DIR) \ No newline at end of file diff --git a/sqlite.sh b/sqlite.sh new file mode 100644 index 00000000..d3a58c6a --- /dev/null +++ b/sqlite.sh @@ -0,0 +1,60 @@ +package: sqlite +version: "%(tag_basename)s" +tag: version-3.36.0 +source: https://github.com/sqlite/sqlite +requires: + - zlib + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' \ + --delete-excluded "$SOURCEDIR"/ "$BUILDDIR"/ + +CMS_BITS_MARCH=$(gcc -dumpmachine) + +CONFIG_BASE_URL="http://cmsrep.cern.ch/cmssw/download/config" +CONFIG_GUESS_URL="${CONFIG_BASE_URL}/config.guess" +CONFIG_SUB_URL="${CONFIG_BASE_URL}/config.sub" + +TMPDIR="$BUILDDIR/tmp" +mkdir -p "$TMPDIR" + +rm -f "$TMPDIR"/config.{sub,guess} + +curl -L -k -s -o "$TMPDIR"/config.guess "$CONFIG_GUESS_URL" + +curl -L -k -s -o "$TMPDIR"/config.sub "$CONFIG_SUB_URL" + +ls -l "$TMPDIR"/config.* + +# Verify files were downloaded successfully +if [[ -f "$TMPDIR/config.guess" && -f "$TMPDIR/config.sub" ]]; then + ls -la "$TMPDIR"/config.{guess,sub} +else + exit 1 +fi + +for CONFIG_GUESS_FILE in $(find "$BUILDDIR" -name 'config.guess' -not -path "*/tmp/*"); do + rm -f "$CONFIG_GUESS_FILE" || { echo "❌ Failed to remove $CONFIG_GUESS_FILE"; exit 1; } + cp "$TMPDIR/config.guess" "$CONFIG_GUESS_FILE" || { echo "❌ Failed to copy config.guess to $CONFIG_GUESS_FILE"; exit 1; } + chmod +x "$CONFIG_GUESS_FILE" || { echo "❌ Failed to chmod $CONFIG_GUESS_FILE"; exit 1; } +done + +for CONFIG_SUB_FILE in $(find "$BUILDDIR" -name 'config.sub' -not -path "*/tmp/*"); do + rm -f "$CONFIG_SUB_FILE" || { echo "❌ Failed to remove $CONFIG_SUB_FILE"; exit 1; } + cp "$TMPDIR/config.sub" "$CONFIG_SUB_FILE" || { echo "❌ Failed to copy config.sub to $CONFIG_SUB_FILE"; exit 1; } + chmod +x "$CONFIG_SUB_FILE" || { echo "❌ Failed to chmod $CONFIG_SUB_FILE"; exit 1; } +done + +export CFLAGS="-I${ZLIB_ROOT}/include" +export LDFLAGS="-L${ZLIB_ROOT}/lib" +cd "$BUILDDIR" +../sqlite/configure \ + --build="$CMS_BITS_MARCH" \ + --prefix="${INSTALLROOT}" \ + --disable-static \ + --disable-dependency-tracking \ + --disable-tcl + +make ${JOBS+-j $JOBS} +make install +rm -rf $INSTALLROOT/lib/pkgconfig diff --git a/tbb.sh b/tbb.sh new file mode 100644 index 00000000..057970d8 --- /dev/null +++ b/tbb.sh @@ -0,0 +1,23 @@ +package: TBB +version: "%(tag_basename)s" +tag: v2022.0.0 +source: https://github.com/uxlfoundation/oneTBB +requires: + - gcc + - CMake + - hwloc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_CXX_FLAGS="-Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=address -Wno-error=uninitialized -Wno-error=stringop-overflow" \ + -DCMAKE_INSTALL_PREFIX=${INSTALLROOT} \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DHWLOC_ROOT=$HWLOC_ROOT \ + -DHWLOC_INCLUDE_DIR=$HWLOC_ROOT/include \ + -DHWLOC_LIBRARY=$HWLOC_ROOT/lib/libhwloc.so \ + -DTBB_CPF=ON \ + -DTBB_TEST=OFF + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/ucx.sh b/ucx.sh new file mode 100644 index 00000000..38275eba --- /dev/null +++ b/ucx.sh @@ -0,0 +1,79 @@ +package: ucx +version: "1.18.1" +tag: v1.18.1 +source: https://github.com/openucx/ucx +requires: + - gcc + - numactl + - rdma-core + - xpmem + - cuda + - gdrcopy +--- +export without_rocm="yes" + +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh + +CONFIGURE_OPTS="\ + --prefix=$INSTALLROOT \ + --disable-dependency-tracking \ + --enable-openmp \ + --enable-shared \ + --disable-static \ + --enable-ucg \ + --disable-doxygen-doc \ + --disable-doxygen-man \ + --disable-doxygen-html \ + --enable-compiler-opt \ + --enable-cma \ + --enable-mt \ + --with-pic \ + --with-gnu-ld \ + --with-avx \ + --with-sse41 \ + --with-sse42 \ + --without-go \ + --without-java" + +# Conditionally enable CUDA +if [ -z "$without_cuda" ]; then + CONFIGURE_OPTS+=" --with-cuda=$CUDA_ROOT" + CONFIGURE_OPTS+=" --with-gdrcopy=$GDRCOPY_ROOT" +else + CONFIGURE_OPTS+=" --without-cuda" + CONFIGURE_OPTS+=" --without-gdrcopy" +fi + +# Conditionally enable ROCM +if [ -z "$without_rocm" ]; then + CONFIGURE_OPTS+=" --with-rocm=$ROCM_ROOT" +else + CONFIGURE_OPTS+=" --without-rocm" +fi + +CONFIGURE_OPTS+=" \ + --with-verbs=$RDMA_CORE_ROOT \ + --with-rc \ + --with-ud \ + --with-dc \ + --with-mlx5-dv \ + --with-ib-hw-tm \ + --with-dm \ + --with-rdmacm=$RDMA_CORE_ROOT \ + --without-knem \ + --with-xpmem=$XPMEM_ROOT \ + --without-ugni" + +export CPPFLAGS="-I$NUMACTL_ROOT/include" +export LDFLAGS="-L$NUMACTL_ROOT/lib" + +./configure $CONFIGURE_OPTS +make ${JOBS:+-j$JOBS} +make install + +rm -rf $INSTALLROOT/lib/pkgconfig +rm -f $INSTALLROOT/lib/lib*.la +rm -f $INSTALLROOT/lib/ucx/lib*.la +rm -rf $INSTALLROOT/share/ucx/examples \ No newline at end of file diff --git a/xgboost.sh b/xgboost.sh new file mode 100644 index 00000000..19bf0708 --- /dev/null +++ b/xgboost.sh @@ -0,0 +1,32 @@ +package: xgboost +version: "%(tag_basename)s" +tag: 1.7.5 +sources: +- https://github.com/dmlc/xgboost/releases/download/v%(tag_basename)s/xgboost.tar.gz +build_requires: +- CMake +patches: +- xgboost-arm-and-ppc.patch +--- +ARCH="$(uname -m)" +mkdir -p $BUILDDIR/$PKGNAME-$PKGVERSION +tar -xzf "$SOURCEDIR"/$SOURCE0 \ + --strip-components=1 \ + -C "$BUILDDIR/$PKGNAME-$PKGVERSION" + + +pushd "$BUILDDIR/$PKGNAME-$PKGVERSION" +if [[ "$ARCH" == "x86_64" && -f "$SOURCEDIR/$PATCH0" ]]; then + patch -p1 < "$SOURCEDIR/$PATCH0" +fi +popd + +CMAKE_ARGS=( + -DCMAKE_INSTALL_PREFIX=$INSTALLROOT + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_CUDA=OFF +) + +cmake "${CMAKE_ARGS[@]}" "$BUILDDIR/$PKGNAME-$PKGVERSION" +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/xpmem.sh b/xpmem.sh new file mode 100644 index 00000000..fef95079 --- /dev/null +++ b/xpmem.sh @@ -0,0 +1,29 @@ +package: xpmem +version: "v2.6.3" +tag: 61c39efdea943ac863037d7e35b236145904e64d +sources: + - https://github.com/hpc/xpmem/archive/%(tag_basename)s.tar.gz +requires: + - gcc +--- +tar -xzf "$SOURCEDIR/${SOURCE0}" \ + --strip-components=1 \ + -C "$BUILDDIR" + +sh autogen.sh +ls -l +./configure \ + --prefix=$INSTALLROOT \ + --enable-shared \ + --disable-static \ + --disable-dependency-tracking \ + --disable-kernel-module \ + --with-pic \ + --with-gnu-ld + +make ${JOBS:+-j$JOBS} +make install + +rm -rf $INSTALLROOT/etc +rm -f $INSTALLROOT/lib/lib*.la +rm -rf $INSTALLROOT/lib/pkgconfig diff --git a/xrootd.sh b/xrootd.sh new file mode 100644 index 00000000..f795ecee --- /dev/null +++ b/xrootd.sh @@ -0,0 +1,53 @@ +package: XRootD +version: "%(tag_basename)s" +tag: "v5.7.2" +source: https://github.com/xrootd/xrootd +requires: + - zlib + - libuuid + - curl + - davix + - Python + - setuptools + - libxml2 + - isal + - pip + - gcc +build_requires: + - CMake + - gmake + - pip +--- +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +SOEXT="so" +if [[ "$OS" == "darwin" ]]; then + SOEXT="dylib" +fi + +sed -i \ + -e 's|^ *check_cxx_symbol_exists("uuid_generate_random" "uuid/uuid.h" _have_libuuid.*$|set(_have_libuuid TRUE)|' \ + $SOURCEDIR/cmake/Findlibuuid.cmake + +unset PIP_ROOT +#SKIP_PIP_INSTALL=1 +cmake "$SOURCEDIR" \ + -DCMAKE_INSTALL_PREFIX=${INSTALLROOT} \ + -DCMAKE_BUILD_TYPE=Release \ + -DFORCE_ENABLED=ON \ + -DENABLE_FUSE=FALSE \ + -DENABLE_VOMS=FALSE \ + -DXRDCL_ONLY=TRUE \ + -DENABLE_KRB5=TRUE \ + -DENABLE_READLINE=TRUE \ + -DCMAKE_SKIP_RPATH=TRUE \ + -DENABLE_PYTHON=TRUE \ + -DENABLE_HTTP=TRUE \ + -DENABLE_XRDEC=TRUE \ + -DXRD_PYTHON_REQ_VERSION=3 \ + -DPIP_OPTIONS="--verbose" \ + -DCMAKE_CXX_FLAGS="-I${LIBUUID_ROOT}/include" \ + -DCMAKE_SHARED_LINKER_FLAGS="-L${LIBUUID_ROOT}/lib64" \ + -DCMAKE_PREFIX_PATH="$CURL_ROOT;$ZLIB_ROOT;$EXPAT_ROOT;$BZ2LIB_ROOT;$DAVIX_ROOT;$PIP_ROOT" + +make ${JOBS+-j $JOBS} +make install \ No newline at end of file diff --git a/xz.sh b/xz.sh new file mode 100644 index 00000000..08cabb75 --- /dev/null +++ b/xz.sh @@ -0,0 +1,29 @@ +package: xz +version: "%(tag_basename)s" +tag: v5.2.5 +requires: + - gcc +source: https://github.com/tukaani-project/xz +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' --delete-excluded \ + "$SOURCEDIR"/ "$BUILDDIR"/ + +./autogen.sh --no-po4a + +./configure \ + CFLAGS='-fPIC -Ofast' \ + --prefix="$INSTALLROOT" \ + --disable-static \ + --disable-nls \ + --disable-rpath \ + --disable-dependency-tracking \ + --disable-doc + +make ${JOBS+-j $JOBS} +make install + +if [ -x "$INSTALLROOT/bin/xz" ]; then + : +else + exit 1 +fi diff --git a/zlib.sh b/zlib.sh new file mode 100644 index 00000000..f48a9c16 --- /dev/null +++ b/zlib.sh @@ -0,0 +1,16 @@ +package: zlib +version: "%(tag_basename)s" +tag: v1.2.13 +source: https://github.com/madler/zlib +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' \ + "$SOURCEDIR"/ "$BUILDDIR"/ + +CONF_FLAG="-fPIC -O3 -DUSE_MMAP -DUNALIGNED_OK -D_LARGEFILE64_SOURCE=1" + +CFLAGS="$CONF_FLAGS" ./configure --prefix="$INSTALLROOT" + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file diff --git a/zstd.sh b/zstd.sh new file mode 100644 index 00000000..c769598d --- /dev/null +++ b/zstd.sh @@ -0,0 +1,24 @@ +package: zstd +version: "%(tag_basename)s" +tag: v1.5.7 +source: https://github.com/facebook/zstd +build_requires: + - CMake +requires: + - gcc +--- +rsync -a --chmod=ug=rwX --delete --exclude '**/.git' "$SOURCEDIR"/ "$BUILDDIR"/ + +cmake build/cmake \ + -DZSTD_BUILD_CONTRIB:BOOL=OFF \ + -DZSTD_BUILD_STATIC:BOOL=OFF \ + -DZSTD_BUILD_TESTS:BOOL=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DZSTD_BUILD_PROGRAMS:BOOL=OFF \ + -DZSTD_LEGACY_SUPPORT:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX:STRING=%{i} \ + -DCMAKE_INSTALL_LIBDIR:STRING=lib \ + -Dzstd_VERSION:STRING=${PKGVERSION} + +make ${JOBS:+-j$JOBS} +make install \ No newline at end of file