FROM phsa_llvm37

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

#### build PHSA runtime

RUN cd /home ; git clone https://github.com/HSAFoundation/phsa-runtime.git ; cd /home/phsa-runtime ; git checkout master
RUN cd /home/phsa-runtime ; mkdir b ; cd b; cmake -DCMAKE_INSTALL_PREFIX=/usr -G Ninja ..
RUN cd /home/phsa-runtime ; cd b ; ninja
RUN cd /home/phsa-runtime ; cd b ; ninja install

# hsa ext amd makes pocl think this is an AMD hsa runtime (with extra features),
# which then causes errors
RUN rm /home/phsa-runtime/include/hsa_ext_amd.h

CMD /bin/bash

