score-p / scorep_plugin_x86_energy

This is the Score-P power and energy event plugin counter for newer Intel and AMD processors (via RAPL, resp. APM). The plugin supports reading msr registers directly or through the x86_adapt library.
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Old compilers do not like this: #7

Open rschoene opened 6 years ago

rschoene commented 6 years ago

Hi,

The things that needed to be done to get this working with icc 2016 (welcome to the HPC world, where the tools are old and the build procedures are scary). Please check whether you can do sth from it.

diff --git a/extern/scorep_plugin_cxx_wrapper b/extern/scorep_plugin_cxx_wrapper
--- a/extern/scorep_plugin_cxx_wrapper
+++ b/extern/scorep_plugin_cxx_wrapper
@@ -1 +1 @@
-Subproject commit 74401d74e634f528b1dff1438f7c3baf488cc0f0
+Subproject commit 74401d74e634f528b1dff1438f7c3baf488cc0f0-dirty
diff --git a/src/x86_energy_measurement_thread.cpp b/src/x86_energy_measurement_thread.cpp
index 035378f..8aa2e2c 100644
--- a/src/x86_energy_measurement_thread.cpp
+++ b/src/x86_energy_measurement_thread.cpp
@@ -5,6 +5,8 @@
  *      Author: gocht
  */

+#include <type_traits>
+
 #include <x86_energy_measurement_thread.hpp>

 x86_energy_measurement_thread::x86_energy_measurement_thread(std::chrono::microseconds intervall_)
diff --git a/src/x86_energy_plugin.cpp b/src/x86_energy_plugin.cpp
index 10f34a0..85c9724 100644
--- a/src/x86_energy_plugin.cpp
+++ b/src/x86_energy_plugin.cpp
@@ -60,7 +60,10 @@ x86_energy_plugin::x86_energy_plugin()
         {
             source.init();
             logging::debug() << "Add Source: " << source.name();
-            active_sources.push_back(std::make_unique<x86_energy::AccessSource>(std::move(source)));
+            active_sources.push_back(
+               std::unique_ptr<x86_energy::AccessSource> { 
+                  new x86_energy::AccessSource(std::move(source))
+               } );
         }
         catch (std::exception& e)
         {
diff --git a/src/x86_energy_sync_plugin.cpp b/src/x86_energy_sync_plugin.cpp
index 844ca1c..3a7ce3b 100644
--- a/src/x86_energy_sync_plugin.cpp
+++ b/src/x86_energy_sync_plugin.cpp
@@ -94,7 +94,10 @@ x86_energy_sync_plugin::x86_energy_sync_plugin()
         {
             source.init();
             logging::debug() << "Add Source: " << source.name();
-            active_sources.push_back(std::make_unique<x86_energy::AccessSource>(std::move(source)));
+            active_sources.push_back(std::unique_ptr <x86_energy::AccessSource>
+            {
+                new x86_energy::AccessSource(std::move(source))
+            });
         }
         catch (std::exception& e)
         {
AndreasGocht commented 6 years ago

The problem is not intel2016 but gcc4.8, where the last version is released in 2014. Ass gcc5 is around nearly since 2014 as well, which is C++14 feature complete, I am not sure, if it is a good idea supporting as old compilers.

Best,

Andreas