Updated hcc dockerfiles

hcc-hsail has a new github address
hcc-isa includes new instructions to compile in amdphdrs
roc-setup updated with new command line options for removing images
  and dry-runs
This commit is contained in:
Kent Knox 2016-03-24 16:12:57 -05:00
parent 29a08000c9
commit 9f9ab9c000
3 changed files with 84 additions and 12 deletions

View File

@ -51,7 +51,7 @@ ENV PATH ${PATH}:${HCC_INSTALL_PATH}/bin
# Build hcc, install to /usr/local
RUN mkdir -p ${HCC_BUILD_PATH} && \
cd ${HCC_BUILD_PATH} && \
git clone --depth=1 --branch=~~branch~~ https://bitbucket.org/multicoreware/hcc.git ./ && \
git clone --depth=1 --branch=~~branch~~ https://github.com/RadeonOpenCompute/hcc.git ./ && \
mkdir -p build && \
cd build && \
cmake \
@ -66,3 +66,5 @@ RUN mkdir -p ${HCC_BUILD_PATH} && \
cd ~ && rm -rf ${HCC_BUILD_PATH} && \
echo "${HCC_INSTALL_PATH}/lib" >> /etc/ld.so.conf.d/hcc.conf && \
ldconfig
# VOLUME [${HCC_INSTALL_PATH}]

View File

@ -55,6 +55,16 @@ RUN mkdir -p ${HCC_BUILD_PATH} && \
-DCMAKE_BUILD_TYPE=~~config~~ \
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" .. && \
make -j $(nproc) install && \
cd ../../llvm-amdgpu-assembler-extra/ && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_INSTALL_PREFIX=${HCC_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE=~~config~~ \
-DLLVM_DIR="${HCC_BUILD_PATH}/llvm/build" .. && \
make -j $(nproc) install && \
cd ../../hcc && \
mkdir -p build && \
cd build && \
@ -63,9 +73,12 @@ RUN mkdir -p ${HCC_BUILD_PATH} && \
-DCMAKE_BUILD_TYPE=~~config~~ \
-DHSA_LLVM_BIN_DIR=${HCC_INSTALL_PATH}/bin \
-DHSA_AMDGPU_GPU_TARGET=fiji \
-DAMDPHDRS_DIR=${HCC_BUILD_PATH}/llvm-amdgpu-assembler-extra/build/amdphdrs/ \
-DHSA_USE_AMDGPU_BACKEND=ON .. && \
make -j $(nproc) world && \
make install && \
rm -rf ${HCC_BUILD_PATH} && \
echo "${HCC_INSTALL_PATH}/lib" >> /etc/ld.so.conf.d/hcc-isa.conf && \
ldconfig
# VOLUME [${HCC_INSTALL_PATH}]

View File

@ -3,6 +3,9 @@
# Set reasonable defaults for dockerfile builds
# Default: --master, --release
# #################################################
# Initialization of command line parameters
# #################################################
# Build dockerfiles from more stable master branches; exclusive with --develop
build_master=1
@ -15,16 +18,32 @@ build_release=1
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
build_debug=
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
remove_images=
# Build debug binaries; this leaves build tree intact for greater debugging; exclusive with --release
dry_run=
# #################################################
# helper functions
# #################################################
function display_help()
{
echo "Building ROC docker images from templates"
echo "Usage: ./roc-setup [--master | --develop] [--release | --debug]"
echo "Default flags: --master --release"
echo ""
echo "--master) Build dockerfiles from stable master branches; exclusive with --develop"
echo "--develop) Build dockerfiles from integration branches; exclusive with --master"
echo "--release) Build release containers; minimizes size of docker images; exclusive with --debug"
echo "--debug) Build debug containers; symbols generated and build tree intact for debugging; exclusive with --release"
echo "--remove_images) Based on the other flags passed, remove the docker images instead of building them"
echo "--dry_run) Print out what would happen with the script, without executing commands"
}
# #################################################
# Start of main
# #################################################
while :; do
case $1 in
--master)
@ -43,6 +62,12 @@ while :; do
build_release=
build_debug=1
;;
--remove_images)
remove_images=1
;;
--dry_run)
dry_run=1
;;
-h|--help)
display_help
exit
@ -100,22 +125,54 @@ rocr_docker_build="${rocr_docker_build} | sed s/~~config~~/${build_config}/g -"
hcc_hsail_docker_build="${hcc_hsail_docker_build} | sed s/~~config~~/${build_config}/g -"
hcc_isa_docker_build="${hcc_isa_docker_build} | sed s/~~config~~/${build_config}/g -"
# Uncomment below to debug individual dockerfile templates; generated dockerfile is printed to screen
# Uncomment below to print dockerfiles with template substitutions; debugging
#eval ${rock_docker_build}
#eval ${roct_docker_build}
#eval ${rocr_docker_build}
#eval ${hcc_hsail_docker_build}
#eval ${hcc_isa_docker_build}
rock_docker_build="${rock_docker_build} | docker build -t ${rock_name} -"
roct_docker_build="${roct_docker_build} | docker build -t ${roct_name} -"
rocr_docker_build="${rocr_docker_build} | docker build -t ${rocr_name} -"
hcc_hsail_docker_build="${hcc_hsail_docker_build} | docker build -t ${hcc_hsail_name} -"
hcc_isa_docker_build="${hcc_isa_docker_build} | docker build -t ${hcc_isa_name} -"
# Build or remove docker images based on passed in option
if [ -n "${remove_images}" ]; then
rock_docker_build="docker rmi ${rock_name}"
roct_docker_build="docker rmi ${roct_name}"
rocr_docker_build="docker rmi ${rocr_name}"
hcc_hsail_docker_build="docker rmi ${hcc_hsail_name}"
hcc_isa_docker_build="docker rmi ${hcc_isa_name}"
else
rock_docker_build="${rock_docker_build} | docker build -t ${rock_name} -"
roct_docker_build="${roct_docker_build} | docker build -t ${roct_name} -"
rocr_docker_build="${rocr_docker_build} | docker build -t ${rocr_name} -"
hcc_hsail_docker_build="${hcc_hsail_docker_build} | docker build -t ${hcc_hsail_name} -"
hcc_isa_docker_build="${hcc_isa_docker_build} | docker build -t ${hcc_isa_name} -"
fi
# These statements below generate the actual docker images
eval ${rock_docker_build}
eval ${roct_docker_build}
eval ${rocr_docker_build}
eval ${hcc_hsail_docker_build}
eval ${hcc_isa_docker_build}
if [ -n "${dry_run}" ]; then
echo ${rock_docker_build}
echo ${roct_docker_build}
echo ${rocr_docker_build}
echo ${hcc_hsail_docker_build}
echo ${hcc_isa_docker_build}
else
echo "# #################################################"
echo "# Building ROCK container"
echo "# #################################################"
eval ${rock_docker_build}
echo "# #################################################"
echo "# Building ROCT container"
echo "# #################################################"
eval ${roct_docker_build}
echo "# #################################################"
echo "# Building ROCR container"
echo "# #################################################"
eval ${rocr_docker_build}
echo "# #################################################"
echo "# Building HCC-HSAIL container"
echo "# #################################################"
eval ${hcc_hsail_docker_build}
echo "# #################################################"
echo "# Building HCC-ISA container"
echo "# #################################################"
eval ${hcc_isa_docker_build}
fi