From cd6996614fc82c1d5cd39e4df90dbd2c091d2ea5 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 --- bin/hipcc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/hipcc b/bin/hipcc index 8f18ab0d8e..bd01177a77 100755 --- a/bin/hipcc +++ b/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 99d32a195f2fa860bce8f6d64adc222c7dfb2f66 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 --- src/hip_module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hip_module.cpp b/src/hip_module.cpp index dee69e7ba0..da889a2e03 100644 --- a/src/hip_module.cpp +++ b/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