FROM phsa_runtime37

##################################

# TODO currently AMD SDK 3 doesn't work (causes linker errors)
# cmake -DENABLE_TESTSUITES=AMDSDK3.0 -DTESTSUITE_BASEDIR=/home/examples/build -DTESTSUITE_SOURCE_BASEDIR=/home/examples/source -DENABLE_HSA=1 -DWITH_LLVM_CONFIG=/home/LLVM_37_HSA/bin/llvm-config -DWITH_HSA_RUNTIME_LIB_DIR=/usr/lib/x86_64-linux-gnu  -DWITH_HSA_RUNTIME_INCLUDE_DIR=/usr/include -G Ninja ..

##################################

#### build POCL

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 -DENABLE_ICD=0 -DENABLE_HSA=1 -DWITH_LLVM_CONFIG=/home/LLVM_37_HSA/bin/llvm-config -DWITH_HSA_RUNTIME_LIB_DIR=/usr/lib/x86_64-linux-gnu  -DWITH_HSA_RUNTIME_INCLUDE_DIR=/home/phsa-runtime/include -G Ninja ..
RUN cd /home/pocl/b ; ninja

CMD cd /home/pocl/b ;  /home/pocl/tools/scripts/run_hsa_tests

