diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 15a004e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,80 +0,0 @@ -FROM nvidia/cuda:11.4.2-devel-ubuntu20.04 -MAINTAINER support@arrayfire.com - -ENV DEBIAN_FRONTEND=nonintercative - -RUN apt-get update && apt-get install -y software-properties-common && \ - apt-get install -y --no-install-recommends \ - build-essential \ - clinfo \ - cmake \ - git \ - libboost-all-dev \ - libfftw3-dev \ - libfontconfig1-dev \ - libfreeimage-dev \ - liblapack-dev \ - liblapacke-dev \ - libopenblas-dev \ - ocl-icd-opencl-dev \ - opencl-headers \ - wget \ - xorg-dev && \ - rm -rf /var/lib/apt/lists/* - -# Setting up symlinks for libcuda and OpenCL ICD -RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/libcuda.so.1 && \ - ln -s /usr/lib/libcuda.so.1 /usr/lib/libcuda.so && \ - mkdir -p /etc/OpenCL/vendors && \ - echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd && \ - echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \ - echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf -ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} - -WORKDIR /root - -# Build GLFW from source -RUN git clone --depth 1 --branch 3.3.4 https://github.com/glfw/glfw.git && \ - cd glfw && \ - mkdir build && \ - cd build && \ - cmake -DCMAKE_INSTALL_PREFIX=/usr .. && \ - make -j4 && \ - make install - -RUN cd /tmp && \ - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ - add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" && \ - apt update -y && apt install -y intel-basekit - -SHELL ["/bin/bash", "-c"] - -# AF_DISABLE_GRAPHICS - Environment variable to disable graphics at -# runtime due to lack of graphics support by docker - visit -# http://arrayfire.org/docs/configuring_environment.htm#af_disable_graphics -# for more information -ENV AF_PATH=/opt/arrayfire AF_DISABLE_GRAPHICS=1 -ARG COMPILE_GRAPHICS=OFF -RUN source /opt/intel/oneapi/setvars.sh && \ - git clone --depth 1 --recursive https://github.com/arrayfire/arrayfire.git -b master && \ - cd arrayfire && mkdir build && cd build && \ - cmake .. -DCMAKE_INSTALL_PREFIX=/opt/arrayfire-3 \ - -DCMAKE_BUILD_TYPE=Release \ - -DAF_BUILD_CPU=ON \ - -DAF_BUILD_CUDA=ON \ - -DAF_BUILD_DOCS=OFF \ - -DAF_BUILD_EXAMPLES=ON \ - -DAF_BUILD_OPENCL=ON \ - -DAF_BUILD_UNIFIED=ON \ - -DAF_WITH_FREEIMAGE_STATIC=OFF && \ - # -DCOMPUTES_DETECTED_LIST="30;35;37;50;52;60" \ - make -j8 && make install && \ - mkdir -p ${AF_PATH} && ln -s /opt/arrayfire-3/* ${AF_PATH}/ && \ - echo "${AF_PATH}/lib" >> /etc/ld.so.conf.d/arrayfire.conf && \ - echo "/usr/local/cuda/nvvm/lib64" >> /etc/ld.so.conf.d/arrayfire.conf && \ - ldconfig - -WORKDIR /root/arrayfire diff --git a/README b/README new file mode 100644 index 0000000..d27fe16 --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +Builders are defined in the docker-compose.yml file. + +To run a particular build, do: docker-compose up + +The build script used is: arrayfire/scripts/build_arrayfire.sh + +A directory will be created here with the build files with the form: build__arrayfire__ + +The installer can be tested by copying the installer package to the test docker in test_dockers and building (note for the CUDA back end you will need an Nvidia GPU and the CUDA docker toolkit installed). diff --git a/README.md b/README.md deleted file mode 100644 index dc1adf3..0000000 --- a/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# arrayfire-docker - -Dockerfile for Building and Using ArrayFire https://github.com/arrayfire/arrayfire.git - -## Dependencies - -[nvidia-docker](https://github.com/NVIDIA/nvidia-docker) - -## Building image - -``` -nvidia-docker build -t arrayfire . -``` - -Make sure to modify ArrayFire's -[build arguments](https://github.com/arrayfire/arrayfire-docker/blob/master/Dockerfile#L43) -in the `Dockerfile` to suit your needs prior to building the image. - -## Running container - -``` -nvidia-docker run --rm -ti arrayfire -``` - -Once running, invoke the -[unified backend](http://arrayfire.org/docs/unifiedbackend.htm) test to show -available devices for each of ArrayFire's backends: - -``` -./build/test/backend_unified -``` - -## Compiling stand-alone examples - -``` -cp -R /opt/arrayfire/share/ArrayFire/examples /root/arrayfire-examples -cd /root/arrayfire-examples && mkdir build && cd build -cmake .. -DArrayFire_DIR=/opt/arrayfire/share/ArrayFire/cmake -make -j8 -``` - -Take a look at the examples -[`README.md`](https://github.com/arrayfire/arrayfire/blob/devel/examples/README.md) -for more information. - -### Support and Contact Info - -* Google Groups: https://groups.google.com/forum/#!forum/arrayfire-users -* ArrayFire Services: [Consulting](http://arrayfire.com/consulting/) | [Support](http://arrayfire.com/support/) | [Training](http://arrayfire.com/training/) -* ArrayFire Blogs: http://arrayfire.com/blog/ -* Email: diff --git a/arrayfire/manylinux/cuda_deps/Dockerfile b/arrayfire/manylinux/cuda_deps/Dockerfile new file mode 100644 index 0000000..ba53a8b --- /dev/null +++ b/arrayfire/manylinux/cuda_deps/Dockerfile @@ -0,0 +1,21 @@ +FROM af/manylinux/dependencies +MAINTAINER Christophe Murphy + +ARG AF_CUDA_MAJOR_VERSION +ARG AF_CUDA_MINOR_VERSION + +RUN dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && \ + dnf clean all && \ + dnf -y install cuda-toolkit-${AF_CUDA_MAJOR_VERSION}-${AF_CUDA_MINOR_VERSION} && \ + dnf -y install cudnn-cuda-${AF_CUDA_MAJOR_VERSION}-${AF_CUDA_MINOR_VERSION} && \ + dnf clean all + +# Create Nvidia's ICD and missing standard simlinks for the CUDA driver and OpenCL +RUN mkdir -p /etc/OpenCL/vendors && \ + echo "/usr/local/cuda/targets/x86_64-linux/lib/libOpenCL.so" > /etc/OpenCL/vendors/nvidia.icd && \ + ldconfig && \ + ln -s /usr/local/cuda-${AF_CUDA_MAJOR_VERSION}.${AF_CUDA_MINOR_VERSION}/targets/x86_64-linux/lib/stubs/libcuda.so \ + /usr/local/cuda-${AF_CUDA_MAJOR_VERSION}.${AF_CUDA_MINOR_VERSION}/targets/x86_64-linux/lib/stubs/libcuda.so.1 + +ENV PATH=/usr/local/cuda/bin:${PATH} +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH} diff --git a/arrayfire/manylinux/dependencies/Dockerfile b/arrayfire/manylinux/dependencies/Dockerfile new file mode 100644 index 0000000..8e79498 --- /dev/null +++ b/arrayfire/manylinux/dependencies/Dockerfile @@ -0,0 +1,41 @@ +FROM af/manylinux/dev_base +MAINTAINER Christophe Murphy + +# Boost +FROM af/manylinux/dev_base as boost +RUN cd /usr/src && \ + wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \ + tar -xvzf boost_1_87_0.tar.gz && \ + cd boost_1_87_0 && \ + ./bootstrap.sh --prefix=/artifact && \ + ./b2 install && \ + cd /usr/src && rm -rf boost_1_87_0* + +# Doxygen +FROM af/manylinux/dev_base as doxygen +RUN cd /usr/src && \ + git clone -b Release_1_13_2 https://github.com/doxygen/doxygen.git && \ + cd doxygen && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX:PATH=/artifact .. && \ + make -j$(grep -c processor /proc/cpuinfo) install && \ + cd /usr/src && rm -rf doxygen + +FROM af/manylinux/dev_base +MAINTAINER Christophe Murphy + +# Boost +COPY --from=boost /artifact /usr +# Doxgyen +COPY --from=doxygen /artifact /usr + +# oneAPI +RUN echo $'[oneAPI]\n\ +name=IntelĀ® oneAPI repository\n\ +baseurl=https://yum.repos.intel.com/oneapi\n\ +enabled=1\n\ +gpgcheck=1\n\ +repo_gpgcheck=1\n\ +gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB' > /etc/yum.repos.d/oneAPI.repo && \ +cat /etc/yum.repos.d/oneAPI.repo && \ +dnf -y update && dnf -y install intel-oneapi-base-toolkit && dnf clean all diff --git a/arrayfire/manylinux/dev_base/Dockerfile b/arrayfire/manylinux/dev_base/Dockerfile new file mode 100644 index 0000000..b6739fb --- /dev/null +++ b/arrayfire/manylinux/dev_base/Dockerfile @@ -0,0 +1,29 @@ +FROM quay.io/pypa/manylinux_2_28_x86_64 +MAINTAINER Christophe Murphy +RUN dnf update -y && \ + dnf groupinstall -y "Development Tools" && \ + dnf -y install ocl-icd ocl-icd-devel opencl-headers \ + wget freetype-devel fontconfig-devel \ + fftw-devel openblas-devel lapack-devel \ + glfw-devel graphviz graphviz-devel \ + mesa-libGLU-devel freeimage-devel patchelf && \ + dnf -y install gcc-toolset-10 &&\ + dnf clean all + + +# Set location for OpenCL library +ENV OCL_ROOT=/usr +ENV OPENCL_ROOT=/usr +ENV PATH=/opt/rh/gcc-toolset-10/root/usr/bin:${PATH} +ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-10/root/usr/lib64:/opt/rh/gcc-toolset-10/root/usr/lib:/opt/rh/gcc-toolset-10/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-10/root/usr/lib/dyninst:${LD_LIBRARY_PATH} +ENV CC=/opt/rh/gcc-toolset-10/root/bin/gcc +ENV CXX=/opt/rh/gcc-toolset-10/root/bin/c++ + +# Ninja build system +RUN cd /usr/src && \ + git clone https://github.com/ninja-build/ninja.git && \ + cd ninja && \ + git checkout v1.12.1 && \ + ./configure.py --bootstrap && \ + mv ninja /usr/bin/ && \ + cd .. && rm -rf ninja diff --git a/arrayfire/manylinux/wheels/Dockerfile b/arrayfire/manylinux/wheels/Dockerfile new file mode 100644 index 0000000..32cb1ab --- /dev/null +++ b/arrayfire/manylinux/wheels/Dockerfile @@ -0,0 +1,7 @@ +ARG AF_CUDA_MAJOR_VERSION=12 +ARG AF_CUDA_MINOR_VERSION=8 +FROM af/manylinux/cuda:${AF_CUDA_MAJOR_VERSION}.${AF_CUDA_MINOR_VERSION} + +ARG AF_PYTHON_VERSION +ENV AF_PYTHON_VERSION=${AF_PYTHON_VERSION} +RUN dnf install -y python${AF_PYTHON_VERSION} \ No newline at end of file diff --git a/arrayfire/scripts/build_arrayfire.sh b/arrayfire/scripts/build_arrayfire.sh new file mode 100755 index 0000000..57f5ae7 --- /dev/null +++ b/arrayfire/scripts/build_arrayfire.sh @@ -0,0 +1,176 @@ +#!/bin/bash + +function getLibrary { + find $1 -name $2.so* -exec cp "{}" /tmp \; + find /tmp -name $2.so* -exec patchelf --set-rpath '$ORIGIN' "{}" \; + echo "`find /tmp -name $2.so* | xargs | awk '{ gsub(\" \",\";\",$0); print $0 }'`;" +} + +function getFile { + echo "`find $1 -name $2 | xargs | awk '{ gsub(\" \",\";\",$0); print $0 }'`;" +} + +set -e +set -x + +use_oneapi=ON +with_graphics=ON +build_cpu=ON +build_cuda=ON +build_oneapi=ON +build_opencl=ON +build_type="RelWithDebInfo" +compute_library_cmake_flag="-DAF_COMPUTE_LIBRARY=Intel-MKL" + +distro=$(paste -d "_" <(cat /etc/*release | grep "^NAME=" | head -n 1 | cut -d '"' -f 2) <(cat /etc/*release | grep "^VERSION_ID=" | head -n 1 | cut -d '"' -f 2)) +build_dir=build_$distro + +AF_CUDA_arch_build_targets="5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;9.0+PTX" + +LONGOPTIONS=no-gl,build-type:,no-mkl,no-cpu,no-cuda,no-oneapi,no-opencl,package-type:,cuda-arch: +PARSED=$(getopt --options="" --longoptions=$LONGOPTIONS --name "$0" -- "$@") +if [[ $? -ne 0 ]]; then + # e.g. $? == 1 + # then getopt has complained about wrong arguments to stdout + exit 2 +fi + +eval set -- "$PARSED" + +while true; do + case "$1" in + --no-gl) + with_graphics=OFF + shift + ;; + --build-type) + build_type="$2" + shift 2 + ;; + --no-mkl) + use_oneapi=OFF + build_oneapi=OFF + compute_library_cmake_flag="-DAF_COMPUTE_LIBRARY=FFTW/LAPACK/BLAS -DBLA_VENDOR=OpenBLAS" + shift + ;; + --no-cpu) + build_cpu=OFF + shift + ;; + --no-cuda) + build_cuda=OFF + shift + ;; + --no-oneapi) + build_oneapi=OFF + shift + ;; + --no-opencl) + build_opencl=OFF + shift + ;; + --package-type) + package_type="$2" + shift 2 + ;; + --cuda-arch) + AF_CUDA_arch_build_targets="$2" + shift 2 + ;; + --) + shift + break + ;; + *) + echo "Programming error" + exit 3 + ;; + esac +done + +cd /usr/src + +if [[ ! -d arrayfire/ ]]; then + git clone --recursive https://github.com/arrayfire/arrayfire + cd arrayfire + git config user.email "installer@docker.xyz" + git config user.name "Installer Builder" + git merge -m "add_mkl_install_libs" origin/add_mkl_install_libs + git merge -m "update_af_deps" origin/update_af_deps +else + cd arrayfire + git pull +fi + +mkdir -p "$build_dir" +cd "$build_dir" + +if [ "$use_oneapi" = "ON" ]; then + set +x + source /opt/intel/oneapi/setvars.sh + set -x + compute_library_cmake_flag+=" -DAF_ADDITIONAL_MKL_LIBRARIES:FILEPATHS=" + compute_library_cmake_flag+=$(getLibrary $TBBROOT libtbb) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libimf) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libsycl) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libsvml) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libirng) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libintlc) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libur_loader) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libur_adapter_opencl) + compute_library_cmake_flag+=$(getFile $CMPLR_ROOT/lib cl.cfg) + compute_library_cmake_flag+=$(getFile $CMPLR_ROOT/lib clbltfn*.rtl) + compute_library_cmake_flag+=$(getFile $CMPLR_ROOT/lib cllibrary.rtl) + compute_library_cmake_flag+=$(getFile $CMPLR_ROOT/lib cllibrary*.o) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libcommon_clang) + compute_library_cmake_flag+=$(getLibrary $TCM_ROOT/lib libhwloc) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libintelocl) + compute_library_cmake_flag+=$(getLibrary $CMPLR_ROOT/lib libocl_svml_*) + compute_library_cmake_flag+=$(getLibrary $UMF_ROOT/lib libumf) +fi + +# Look for correct OpenCL library and headers, location depends on the distro +for ocl in "/usr/lib64/libOpenCL.so.1" "/usr/lib/x86_64-linux-gnu/libOpenCL.so.1"; do + if [ -f "$ocl" ]; then ocl_dir=$ocl; break; fi +done +if [ -z "$ocl_dir" ]; then + echo "Couldn't find OpenCL library!" + exit 1 +else + opencl_library_cmake_flag=" -DOpenCL_LIBRARY=$ocl_dir -DOPENCL_LIBRARIES=$ocl_dir" +fi +opencl_include_cmake_flag=" -DOPENCL_INCLUDE_DIRS=${OCL_ROOT}/include -DOpenCL_INCLUDE_DIR=${OCL_ROOT}/include" + +cmake -G Ninja \ + -DCMAKE_BUILD_TYPE:STRING="$build_type" \ + -DFG_USE_STATIC_CPPFLAGS:BOOL=OFF \ + -DAF_WITH_STATIC_CUDA_NUMERIC_LIBS=OFF \ + -DFG_WITH_FREEIMAGE:BOOL=ON \ + $compute_library_cmake_flag \ + -DAF_BUILD_CPU:BOOL="$build_cpu" \ + -DAF_BUILD_DOCS:BOOL=ON \ + -DAF_BUILD_EXAMPLES:BOOL=OFF \ + -DAF_BUILD_ONEAPI:BOOL="$build_oneapi" \ + -DAF_BUILD_CUDA:BOOL="$build_cuda" \ + -DAF_BUILD_OPENCL:BOOL="$build_opencl" \ + -DAF_BUILD_FORGE:BOOL=$with_graphics \ + -DCMAKE_SYCL_COMPILER=icpx \ + -DCMAKE_SYCL_FLAGS="-fsycl -D_GLIBCXX_USE_CXX11_ABI=1" \ + -DAF_WITH_IMAGEIO:BOOL=ON \ + -DAF_WITH_LOGGING:BOOL=ON \ + -DAF_INSTALL_STANDALONE:BOOL=ON \ + -DAF_WITH_SPDLOG_HEADER_ONLY=ON \ + -DAF_WITH_FMT_HEADER_ONLY=ON \ + -DBUILD_TESTING:BOOL=OFF \ + -DCUDA_architecture_build_targets:STRING=$AF_CUDA_arch_build_targets \ + $opencl_library_cmake_flag \ + $opencl_include_cmake_flag \ + .. + +# This may need to be adjusted depending on how much memory your system has. +# oneAPI backend compilation uses a lot. +#cmake --build . -- -v +cmake --build . -j 4 -- -v + +cpack -G "$package_type" + diff --git a/arrayfire/scripts/build_wheel.sh b/arrayfire/scripts/build_wheel.sh new file mode 100644 index 0000000..e2ec270 --- /dev/null +++ b/arrayfire/scripts/build_wheel.sh @@ -0,0 +1,47 @@ +#!/bin/bash + + +#set up opencl +cd /usr/src +if [[ ! -d OpenCL-Headers/ ]]; then +git clone https://github.com/KhronosGroup/OpenCL-Headers.git +fi +cd /usr/src/OpenCL-Headers +cmake -B build -DCMAKE_INSTALL_PREFIX=/usr +cmake --build build --target install -j + +cd /usr/src +if [[ ! -d OpenCL-CLHPP/ ]]; then +git clone https://github.com/KhronosGroup/OpenCL-CLHPP.git +fi +cd /usr/src/OpenCL-CLHPP +cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF +cmake --build build --target install -j + +#build wrapper +python$AF_PYTHON_VERSION -m pip uninstall -y arrayfire* + +cd /usr/src +if [[ ! -d arrayfire-binary-python-wrapper/ ]]; then +git clone https://github.com/edwinsolisf/arrayfire-binary-python-wrapper.git --branch afwheel310 +fi +cd /usr/src/arrayfire-binary-python-wrapper +git pull origin afwheel310 +source /opt/intel/oneapi/setvars.sh +export AF_BUILD_LOCAL_LIBS=1 +export CMAKE_BUILD_PARALLEL_LEVEL=3 +python$AF_PYTHON_VERSION -m pip install -r requirements.txt +python$AF_PYTHON_VERSION -m build --wheel -v + +#test wrapper +python$AF_PYTHON_VERSION -m pip install dist/arrayfire_binary_python_wrapper-0.8.0+af3.10.0-py3-none-linux_x86_64.whl +cd /usr/src +if [[ ! -d arrayfire-py/ ]]; then +git clone https://github.com/edwinsolisf/arrayfire-py.git --branch afwheel310 +fi +cd /usr/src/arrayfire-py +git pull origin afwheel310 +python$AF_PYTHON_VERSION -m pip install -r requirements.txt +python$AF_PYTHON_VERSION -m build --wheel -v +python$AF_PYTHON_VERSION -m pip install dist/arrayfire* +python$AF_PYTHON_VERSION -m pytest \ No newline at end of file diff --git a/arrayfire/ubuntu/cuda_deps/Dockerfile b/arrayfire/ubuntu/cuda_deps/Dockerfile new file mode 100644 index 0000000..564fe3d --- /dev/null +++ b/arrayfire/ubuntu/cuda_deps/Dockerfile @@ -0,0 +1,20 @@ +FROM af/ubuntu/dependencies +MAINTAINER Christophe Murphy + +ARG AF_CUDA_VERSION + +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i cuda-keyring_1.1-1_all.deb && apt-get update -y && \ + apt-get -y install cuda-toolkit-${AF_CUDA_VERSION} && \ + apt-get -y install cudnn9-cuda-${AF_CUDA_VERSION} && \ + apt-get clean -y && rm -rf cuda-keyring_1.1-1_all.deb + +# Create Nvidia's ICD and missing standard simlink for CUDA stub library +RUN mkdir -p /etc/OpenCL/vendors && \ + echo "/usr/local/cuda/targets/x86_64-linux/lib/libOpenCL.so" > /etc/OpenCL/vendors/nvidia.icd && \ + ldconfig && \ + ln -s /usr/local/cuda-12.8/targets/x86_64-linux/lib/stubs/libcuda.so \ + /usr/local/cuda-12.8/targets/x86_64-linux/lib/stubs/libcuda.so.1 + +ENV PATH /usr/local/cuda/bin:${PATH} +ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:${LD_LIBRARY_PATH} diff --git a/arrayfire/ubuntu/dependencies/Dockerfile b/arrayfire/ubuntu/dependencies/Dockerfile new file mode 100644 index 0000000..6f3878f --- /dev/null +++ b/arrayfire/ubuntu/dependencies/Dockerfile @@ -0,0 +1,26 @@ +FROM af/ubuntu/dev_base +MAINTAINER Christophe Murphy + +RUN apt-get update -y + +# Boost +RUN apt-get install -y libboost-all-dev + +# Doxygen +RUN apt-get install -y graphviz libgraphviz-dev flex bison +RUN cd /usr/src && \ + git clone -b Release_1_13_2 https://github.com/doxygen/doxygen.git && \ + cd doxygen && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && \ + make -j$(grep -c processor /proc/cpuinfo) install && \ + cd /usr/src && rm -rf doxygen + +# oneAPI +RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | tee /etc/apt/sources.list.d/oneAPI.list && \ + apt-get update -y && apt-get install -y intel-oneapi-base-toolkit + +RUN apt-get clean -y diff --git a/arrayfire/ubuntu/dev_base/Dockerfile b/arrayfire/ubuntu/dev_base/Dockerfile new file mode 100644 index 0000000..9206181 --- /dev/null +++ b/arrayfire/ubuntu/dev_base/Dockerfile @@ -0,0 +1,32 @@ +ARG UBUNTU_LTS_VERSION + +FROM ubuntu:$UBUNTU_LTS_VERSION +MAINTAINER Christophe Murphy +RUN apt-get update -y && \ + apt-get install -y wget build-essential git \ + libopenblas-dev libfftw3-dev \ + libfreetype-dev libfontconfig-dev \ + liblapacke-dev ocl-icd-opencl-dev \ + opencl-headers libglfw3-dev \ + libfreeimage-dev libglu1-mesa-dev + +# Set location for OpenCL library +ENV OCL_ROOT /usr + +# CMake +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \ + | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \ + | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ + apt-get update -y && apt-get install -y cmake + +RUN apt-get clean -y + +# Ninja build system +RUN cd /usr/src && \ + git clone https://github.com/ninja-build/ninja.git && \ + cd ninja && \ + git checkout v1.12.1 && \ + ./configure.py --bootstrap && \ + mv ninja /usr/bin/ && \ + cd .. && rm -rf ninja diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5e02bdf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,123 @@ +version: "3.4" + +services: + af_manylinux_2_28_base: + build: + context: ./arrayfire/manylinux/dev_base + image: af/manylinux/dev_base + + af_manylinux_2_28_deps: + build: + context: ./arrayfire/manylinux/dependencies + image: af/manylinux/dependencies + depends_on: + - af_manylinux_2_28_base + + af_manylinux_2_28_cuda_12.8: + build: + context: ./arrayfire/manylinux/cuda_deps + args: + AF_CUDA_MAJOR_VERSION: 12 + AF_CUDA_MINOR_VERSION: 8 + image: af/manylinux/cuda:12.8 + depends_on: + - af_manylinux_2_28_deps + + af_manylinux_2_28_cuda_12.6: + build: + context: ./arrayfire/manylinux/cuda_deps + args: + AF_CUDA_MAJOR_VERSION: 12 + AF_CUDA_MINOR_VERSION: 6 + image: af/manylinux/cuda:12.6 + depends_on: + - af_manylinux_2_28_deps + + af_manylinux_2_28_arrayfire_pywheel_3_11: + image: af/manylinux/pywheel:3.11 + depends_on: + - af_manylinux_2_28_cuda_12.6 + build: + context: ./arrayfire/manylinux/wheels + args: + AF_CUDA_MAJOR_VERSION: 12 + AF_CUDA_MINOR_VERSION: 6 + AF_PYTHON_VERSION: 3.11 + volumes: + - ./arrayfire/scripts:/scripts + - ./build_manylinux_arrayfire_pywheel_3_11:/usr/src + stdin_open: true + tty: true + command: "/scripts/build_wheel.sh" + + af_manylinux_2_28_arrayfire_mkl: + image: af/manylinux/cuda:12.8 + depends_on: + - af_manylinux_2_28_cuda_12.8 + volumes: + - ./arrayfire/scripts:/scripts + - ./build_manylinux_arrayfire_mkl_2025_cuda_12_8:/usr/src + stdin_open: true + tty: true + command: "/scripts/build_arrayfire.sh --build-type RelWithDebInfo + --package-type STGZ --cuda-arch \"5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;9.0+PTX\"" + + af_manylinux_2_28_arrayfire_openblas: + image: af/manylinux/cuda:12.8 + depends_on: + - af_manylinux_2_28_cuda_12.8 + volumes: + - ./arrayfire/scripts:/scripts + - ./build_manylinux_arrayfire_openblas_cuda_12_8:/usr/src + stdin_open: true + tty: true + command: "/scripts/build_arrayfire.sh --build-type RelWithDebInfo + --package-type STGZ --cuda-arch \"5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;9.0+PTX\" --no-mkl" + + af_ubuntu_22_04_base: + build: + context: ./arrayfire/ubuntu/dev_base + args: + UBUNTU_LTS_VERSION: 22.04 + image: af/ubuntu/dev_base + + af_ubuntu_22_04_deps: + build: + context: ./arrayfire/ubuntu/dependencies + image: af/ubuntu/dependencies + depends_on: + - af_ubuntu_22_04_base + + af_ubuntu_22_04_cuda_12.8: + build: + context: ./arrayfire/ubuntu/cuda_deps + args: + AF_CUDA_VERSION: 12-8 + image: af/ubuntu/cuda:12.8 + depends_on: + - af_ubuntu_22_04_deps + + af_ubuntu_22_04_arryfire_mkl: + image: af/ubuntu/cuda:12.8 + depends_on: + - af_ubuntu_22_04_cuda_12.8 + volumes: + - ./arrayfire/scripts:/scripts + - ./build_ubuntu_arrayfire_mkl_2025_cuda_12_8:/usr/src + stdin_open: true + tty: true + command: "/scripts/build_arrayfire.sh --build-type RelWithDebInfo + --package-type DEB --cuda-arch \"5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;9.0+PTX\"" + + af_ubuntu_22_04_openblas_cuda_12.8: + image: af/ubuntu/cuda:12.8 + depends_on: + - af_ubuntu_22_04_cuda_12.8 + volumes: + - ./arrayfire/scripts:/scripts + - ./build_ubuntu_arrayfire_openblas_cuda_12_8:/usr/src + stdin_open: true + tty: true + command: "/scripts/build_arrayfire.sh --build-type RelWithDebInfo + --package-type DEB --cuda-arch \"5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;9.0+PTX\" --no-mkl" + diff --git a/test_dockers/STGZ/Dockerfile b/test_dockers/STGZ/Dockerfile new file mode 100644 index 0000000..b67718a --- /dev/null +++ b/test_dockers/STGZ/Dockerfile @@ -0,0 +1,15 @@ +FROM nvidia/cuda:12.8.1-base-ubuntu22.04 + +RUN apt update && apt-get -y install nvidia-compute-utils-570 wget clinfo build-essential cmake + +RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ + apt update && apt-get -y install intel-oneapi-runtime-opencl + +COPY ArrayFire-3.10.0-Linux.sh /usr/src + +RUN cd /usr/src && ./ArrayFire-3.10.0-Linux.sh --skip-license && rm ArrayFire-3.10.0-Linux.sh + +RUN cd /usr/src/share/ArrayFire/examples && mkdir build && cd build && \ + cmake -DArrayFire_DIR=/usr/src/share/ArrayFire/cmake .. && make -j 14