From cb454d5366871ec135022bd4b23243b9c83caf01 Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Tue, 31 Oct 2017 18:14:07 +0000 Subject: [PATCH 1/2] use libc++ on centos 7 and rhel 7.4 --- hipamd/bin/hipcc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hipamd/bin/hipcc b/hipamd/bin/hipcc index 8f18ab0d8e..bd01177a77 100755 --- a/hipamd/bin/hipcc +++ b/hipamd/bin/hipcc @@ -127,7 +127,9 @@ if ($HIP_PLATFORM eq "hcc") { # Force -stdlib=libc++ on UB14.04 $HOST_OSVER= `cat /etc/os-release | grep "^VERSION_ID\=" | cut -d= -f2 | tr -d '\n'`; - if ($HOST_OSNAME eq "ubuntu" and $HOST_OSVER eq "\"14.04\"") { + if (($HOST_OSNAME eq "ubuntu" and $HOST_OSVER eq "\"14.04\"") + or ($HOST_OSNAME eq "\"centos\"" and $HOST_OSVER eq "\"7\"") + or ($HOST_OSNAME eq "\"rhel\"" and $HOST_OSVER eq "\"7.4\"")) { $HIPCXXFLAGS .= " -stdlib=libc++"; $setStdLib = 1; } From c1a4ff7b20ddde59889ffbd6d5d5f986da24f6d4 Mon Sep 17 00:00:00 2001 From: Siu Chi Chan Date: Tue, 31 Oct 2017 18:16:12 +0000 Subject: [PATCH 2/2] Centos/RHEL - remove usage of constexpr since libc++ doesn't enable ctor for constexpr pair in C++11 --- hipamd/src/hip_module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index dee69e7ba0..da889a2e03 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -217,7 +217,7 @@ namespace using namespace ELFIO; using namespace std; - static constexpr pair r{0, 0}; + static const pair r{0, 0}; for (auto i = 0u; i != section.get_symbols_num(); ++i) { // TODO: this is boyscout code, caching the temporaries