Skip to content

Commit

Permalink
Set CXX=g++ on develop branch (ROCm#103)
Browse files Browse the repository at this point in the history
* hot_fix: use default compilerlike c++ not hcc or hipcc

* Remove hipBLAS dependency on hc_am

* Set cmake CXX as g++

* change C++ compiler to g++ in Jenkinsfile

* CI fixes and removed /usr/bin from C++ compiler
  • Loading branch information
amdkila authored Sep 3, 2019
1 parent c7f936c commit 02fe351
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hipBLASCI:

def hipblas = new rocProject('hipBLAS')
// customize for project
hipblas.paths.build_command = './install.sh -cd -p /opt/rocm/rocblas/lib/cmake'
hipblas.paths.build_command = './install.sh -cd -p /opt/rocm/lib/cmake'

// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(['gfx900 && ubuntu', 'gfx906 && ubuntu', 'gfx900 && centos7', 'gfx906 && centos7'], hipblas)
Expand All @@ -49,15 +49,15 @@ hipBLASCI:
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hipcc ${project.paths.build_command} --hip-clang
LD_LIBRARY_PATH=/opt/rocm/lib CXX=g++ ${project.paths.build_command} --hip-clang
"""
}
else
{
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=g++ ${project.paths.build_command}
"""
}
platform.runCommand(this, command)
Expand Down
5 changes: 2 additions & 3 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ target_include_directories( hipblas-test
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
/opt/rocm/hsa/include
)

target_link_libraries( hipblas-test PRIVATE roc::hipblas cblas lapack ${GTEST_LIBRARIES} ${Boost_LIBRARIES} )
Expand All @@ -90,15 +91,13 @@ if( NOT CUDA_FOUND )
target_compile_definitions( hipblas-test PRIVATE __HIP_PLATFORM_HCC__ )

get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
get_target_property( HCC_AM_LOCATION hcc::hc_am IMPORTED_LOCATION_RELEASE )
target_link_libraries( hipblas-test PRIVATE ${HIP_HCC_LOCATION} ${HCC_AM_LOCATION} )
target_link_libraries( hipblas-test PRIVATE ${HIP_HCC_LOCATION} )


if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$|.*/hipcc$" )
# Remove following when hcc is fixed; hcc emits following spurious warning
# "clang-5.0: warning: argument unused during compilation: '-isystem /opt/rocm/include'"
target_compile_options( hipblas-test PRIVATE -Wno-unused-command-line-argument -mf16c)
target_include_directories( hipblas-test PRIVATE /opt/rocm/hsa/include)

elseif( CMAKE_COMPILER_IS_GNUCXX )
# GCC needs specific flag to turn on f16c intrinsics
Expand Down
5 changes: 2 additions & 3 deletions clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ foreach( exe example-sscal;example-sgemm;example-sgemm-strided-batched )
target_include_directories( ${exe}
SYSTEM PRIVATE
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
/opt/rocm/hsa/include
)

# Try to test for specific compiler features if cmake version is recent enough
Expand All @@ -37,14 +38,12 @@ if( NOT CUDA_FOUND )
target_compile_definitions( ${exe} PRIVATE __HIP_PLATFORM_HCC__ )

get_target_property( HIP_HCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )
get_target_property( HCC_AM_LOCATION hcc::hc_am IMPORTED_LOCATION_RELEASE )
target_link_libraries( ${exe} PRIVATE ${HIP_HCC_LOCATION} ${HCC_AM_LOCATION} )
target_link_libraries( ${exe} PRIVATE ${HIP_HCC_LOCATION} )

if( CMAKE_CXX_COMPILER MATCHES ".*/hcc$|.*/hipcc$" )
# Remove following when hcc is fixed; hcc emits following spurious warning
# "clang-5.0: warning: argument unused during compilation: '-isystem /opt/rocm/include'"
target_compile_options( ${exe} PRIVATE -Wno-unused-command-line-argument )
target_include_directories( ${exe} PRIVATE /opt/rocm/hsa/include)
endif( )
else( )
target_compile_definitions( ${exe} PRIVATE __HIP_PLATFORM_NVCC__ )
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ pushd .
fi

# Build library
${cmake_executable} ${cmake_common_options} ${cmake_client_options} -DCPACK_SET_DESTDIR=OFF -DCMAKE_PREFIX_PATH="$(pwd)/../deps/deps-install;${cmake_prefix_path}" ../..
make -j$(nproc)
CXX=g++ ${cmake_executable} ${cmake_common_options} ${cmake_client_options} -DCPACK_SET_DESTDIR=OFF -DCMAKE_PREFIX_PATH="$(pwd)/../deps/deps-install;${cmake_prefix_path}" ../..
VERBOSE=1 make -j$(nproc)

# #################################################
# install
Expand Down

0 comments on commit 02fe351

Please sign in to comment.