Added hip-clang options to install script, and openmp/pthread options to CMakeLists.txt

이 커밋은 다음에 포함됨:
Akila Premachandra
2019-08-23 22:02:42 +00:00
부모 6759660529
커밋 f48ae5c98d
3개의 변경된 파일38개의 추가작업 그리고 21개의 파일을 삭제
벤더링 됨
+11 -12
파일 보기
@@ -1,7 +1,7 @@
#!/usr/bin/env groovy
// Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved.
// This shared library is available at https://github.com/ROCmSoftwarePlatform/rccl
@Library('rocJenkins@noDocker') _
@Library('rocJenkins') _
// This is file for internal AMD use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.
@@ -32,7 +32,7 @@ rcclCI:
def rccl = new rocProject('rccl')
// customize for project
rccl.paths.build_command = './install.sh -t'
rccl.paths.build_command = './install.sh'
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(['RCCL'], rccl)
@@ -47,10 +47,10 @@ rcclCI:
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=${project.compiler.compiler_path} ${project.paths.build_command}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX= ${project.paths.build_command} -t --hip-clang
"""
sh command
platform.runCommand(this,command)
}
def testCommand =
@@ -59,11 +59,11 @@ rcclCI:
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/release/test
HSA_FORCE_FINE_GRAIN_PCIE=1 ./UnitTests --gtest_output=xml --gtest_color=yes
cd ${project.paths.project_build_prefix}
${project.paths.project_build_prefix} -r --hip-clang
"""
sh command
platform.runCommand(this,command)
//junit "${project.paths.project_build_prefix}/build/release/*.xml"
}
@@ -79,11 +79,10 @@ rcclCI:
mv *.deb package/
sudo dpkg -i package/*.deb
"""
//platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/package/*.deb""")
platform.runCommand(this,command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/package/*.deb""")
}
buildProjectNoDocker(rccl, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
buildProject(rccl, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}
}
+22 -5
파일 보기
@@ -13,6 +13,7 @@ function display_help()
echo " [-p|--package_build] Build RCCL package."
echo " [-t|--tests_build] Build unit tests, but do not run."
echo " [-r|--run_tests] Run unit tests (must be built already.)"
echo " [--hip-clang] Build library using hip-clang compiler."
echo " [--prefix] Specify custom directory to install RCCL to (default: /opt/rocm)."
}
@@ -26,6 +27,7 @@ build_tests=false
run_tests=false
build_release=true
install_library=false
build_hip_clang=false
# #################################################
# Parameter parsing
@@ -34,7 +36,7 @@ install_library=false
# check if we have a modern version of getopt that can handle whitespace and long parameters
getopt -T
if [[ $? -eq 4 ]]; then
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,package_build,tests_build,run_tests,prefix: --options hiptr -- "$@")
GETOPT_PARSE=$(getopt --name "${0}" --longoptions help,install,package_build,tests_build,run_tests,hip-clang,prefix: --options hiptr -- "$@")
else
echo "Need a new version of getopt"
exit 1
@@ -65,6 +67,9 @@ while true; do
-r|--run_tests)
run_tests=true
shift ;;
--hip-clang)
build_hip_clang=true
shift ;;
--prefix)
install_prefix=${2}
shift 2 ;;
@@ -97,7 +102,6 @@ else
mkdir -p debug; cd debug
fi
# build type
if [[ "${build_release}" == true ]]; then
cmake_common_options="${cmake_common_options} -DCMAKE_BUILD_TYPE=Release"
@@ -105,10 +109,23 @@ else
cmake_common_options="${cmake_common_options} -DCMAKE_BUILD_TYPE=Debug"
fi
if ($build_tests); then
CXX=$rocm_path/hcc cmake -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=$install_prefix ../../.
compiler=hcc
if [[ "${build_hip_clang}" == true ]]; then
compiler=hipcc
fi
cmake_executable=cmake
if [[ -e /etc/redhat-release ]]; then
yum install chrpath libgomp
cmake_executable=cmake3
else
CXX=$rocm_path/hcc cmake -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$install_prefix ../../.
apt install chrpath libomp-dev
fi
if ($build_tests); then
CXX=$rocm_path/$compiler $cmake_executable -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=$install_prefix ../../.
else
CXX=$rocm_path/$compiler $cmake_executable -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$install_prefix ../../.
fi
if ($install_library); then
+5 -4
파일 보기
@@ -11,10 +11,11 @@ if(BUILD_TESTS)
endif()
# OpenMP is used to drive GPUs (one per thread)
find_package(OpenMP REQUIRED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
if(EXISTS /etc/redhat-release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp=libgomp -pthread")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread")
endif()
# Download and unpack googletest at configure time
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)