FROM centos:latest
ARG GIT_COMMIT=master
LABEL git-commit=$GIT_COMMIT vendor=pocl distro=Centos7 version=1.0

RUN yum upgrade -y

RUN yum install -y epel-release

RUN sed -i 's|enabled=0|enabled=1|g' /etc/yum.repos.d/CentOS-PowerTools.repo

RUN yum install -y gcc gcc-c++ hwloc-devel hwloc-libs cmake git-core pkgconfig make ninja-build ocl-icd ocl-icd-devel patch findutils wget

RUN dnf -y module install llvm-toolset

RUN yum install -y llvm-devel clang-devel

RUN cd /home ; git clone https://github.com/pocl/pocl.git ; cd /home/pocl ; git checkout $GIT_COMMIT

RUN cd /home/pocl ; mkdir b ; cd b; cmake -G Ninja -DWITH_LLVM_CONFIG=/usr/bin/llvm-config ..

RUN cd /home/pocl/b ; ninja-build

CMD cd /home/pocl/b ; ctest -j4 --output-on-failure -L internal
