pc2 / HPCC_FPGA

A OpenCL-based FPGA benchmark suite for HPC
MIT License
32 stars 11 forks source link

Error while building RandomAccess benchmark #1

Closed gautham-ramesh closed 4 years ago

gautham-ramesh commented 4 years ago

Hi,

I am trying to build and test the RandomAccess benchmark for the Nallatech 520N card. After following the steps outlined in the README and running make all, I get the following output:

Scanning dependencies of target hpcc_fpga_base [ 4%] Building CXX object lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/setup/fpga_setup.cpp.o In file included from /home/UFAD/g.ramesh/HPCC_FPGA/shared/include/setup/fpga_setup.hpp:36:0, from /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:5: /tools/Intel/quartus_pro/19.4.0.64/hld/host/include/CL/cl.hpp:155:110: note: #pragma message: This version of the OpenCL Host API C++ bindings is deprecated, please use cl2.hpp instead.

pragma message("This version of the OpenCL Host API C++ bindings is deprecated, please use cl2.hpp instead.")

                                                                                                          ^

In file included from /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:5:0: /home/UFAD/g.ramesh/HPCC_FPGA/shared/include/setup/fpga_setup.hpp:130:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/include/setup/fpga_setup.hpp:156:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:129:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:213:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ make[2]: [lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/setup/fpga_setup.cpp.o] Error 1 make[1]: [lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/all] Error 2 make: *** [all] Error 2

Consequently, I made the following changes to the file "fpga_setup.hpp" located at "HPCC_FPGA/shared/include/setup/"

  1. Added the following preprocessor macros: #define CL_HPP_TARGET_OPENCL_VERSION 120 #define CL_HPP_MINIMUM_OPENCL_VERSION 120
  2. Changed the included header file from #include "CL/cl.hpp" to #include "CL/cl2.hpp"

Ran the make clean && make all to get this output:

[ 4%] Building CXX object lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/setup/fpga_setup.cpp.o In file included from /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:5:0: /home/UFAD/g.ramesh/HPCC_FPGA/shared/include/setup/fpga_setup.hpp:130:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/include/setup/fpga_setup.hpp:156:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:129:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ /home/UFAD/g.ramesh/HPCC_FPGA/shared/setup/fpga_setup.cpp:213:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type std::unique_ptr ^ make[2]: [lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/setup/fpga_setup.cpp.o] Error 1 make[1]: [lib/hpccbase/CMakeFiles/hpcc_fpga_base.dir/all] Error 2 make: *** [all] Error 2

I am unable to figure out the solution to this error. Please help me.

Relevant details: OS: CentOS Linux 7 Cmake version: 3.17.3 Python3 not installed

michaellass commented 4 years ago

Hi,

cl.hpp and cl2.hpp cannot be interchanged that easily, so you need to revert that change. The problem you are facing comes from the fact that older GCC versions require an additional include to use std::unique_ptr. You should be able to work around it with the following change:

--- a/shared/include/setup/fpga_setup.hpp
+++ b/shared/include/setup/fpga_setup.hpp
@@ -28,6 +28,7 @@ SOFTWARE.
 #include <iomanip>
 #include <chrono>
 #include <fstream>
+#include <memory>

 /* External libraries */
 #include "CL/cl.hpp"
gautham-ramesh commented 4 years ago

Thank you! This resolved the error.