SixTrack / sixtracklib

Library for single charged particle simulations in accelerators
GNU Lesser General Public License v2.1
12 stars 16 forks source link

Making: sixtracklib complains about `cl_int` template argument #62

Closed aoeftiger closed 5 years ago

aoeftiger commented 5 years ago

After creating the cmake prebuild via cmake .. in the build directory, the make fails at the first step with a warning.

I use gcc 9.10 and cmake 3.11.1 on the GSI AMD Hawaii XT GL GPU cluster.

cmake

~/git/sixtracklib/build$ cmake ..
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/gcc
-- Check for working C compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/g++
-- Check for working CXX compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ---- Project sixtracklib
-- ---- Inside main CMakeLists.txt
-- ---- Setting build type to 'Release' as none was specified.
-- ---- Loaded local settings file
                 /u/aoeftige/git/sixtracklib/Settings.cmake
-- ---- cmake_module_path: /u/aoeftige/git/sixtracklib/cmake
-- ---- Processing cmake/SetupCxx.cmake
-- ---- Processing cmake/SetupPython.cmake
-- Found PythonInterp: /usr/bin/python3 (found version "3.4.2") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found version "3.4.2") 
-- ---- Processing cmake/SetupUnitTesting.cmake
-- ---- Disable creation unit-tests using CTest / GTest
-- ---- Processing cmake/SetupMultiPrecision.cmake
-- ---- Processing cmake/SetupAutoVecSIMD.cmake
-- ------ Optimizing for SSE2 architecture
-- ---- Processing cmake/SetupOpenMP.cmake
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- OpenMP_FOUND: TRUE
-- OPENMP_FOUND: TRUE
-- ---- Processing cmake/SetupOpenCL.cmake
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - not found
-- Looking for CL_VERSION_2_1
-- Looking for CL_VERSION_2_1 - not found
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - not found
-- Looking for CL_VERSION_1_2
-- Looking for CL_VERSION_1_2 - found
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "1.2") 
-- ---- -- Unable to find OpenCL 1.x C++ header  /usr/include/CL/cl2.hpp
-- ---- -- processing cmake/SetupOpenCLFetchOpenCL2CxxHeaders.cmake
-- ---- -- attempting to fetch OpenCL 2.x C++ headers
-- ---- -- successfully provisioned header at /u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp
-- ---- Processing cmake/SetupCuda.cmake
-- ---- processing sixtracklib/CMakeLists.txt
-- ---- processing sixtracklib/common/CMakeLists.txt
-- ---- processing sixtracklib/opencl/CMakeLists.txt
-- ------ python: providing a copy of library to /u/aoeftige/git/sixtracklib/python/pysixtracklib/libsixtrack.so
-- ---- processing examples/c99/CMakeLists.txt
-- ------ Preparing installation of examples/c99
-- ---- processing examples/cxx/CMakeLists.txt
-- ------ Preparing installation of examples/cxx
-- ---- processing tests/testdata_generators/CMakeLists.txt
-- ------ processing tests/sixtracklib/testlib/CMakeLists.txt
-- ------ python: providing a copy of testlib library to /u/aoeftige/git/sixtracklib/python/pysixtracklib_test/libsixtrack_test.so
-- ---- processing tests/python/CMakeLists.txt
-- Configuring done
-- Generating done
-- Build files have been written to: /u/aoeftige/git/sixtracklib/build

make

~/git/sixtracklib/build$ make
Scanning dependencies of target sixtrack_opencl
[  1%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/argument.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/argument.h:46,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/internal/argument.cpp:1:
/u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp:5868:63: error: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Werror=ignored-attributes]
 5868 |     typename std::enable_if<!std::is_pointer<T>::value, cl_int>::type
      |                                                               ^
/u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp:6169:22: error: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Werror=ignored-attributes]
 6169 |         vector<cl_int>* binaryStatus = NULL,
      |                      ^
cc1plus: all warnings being treated as errors
sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/build.make:62: recipe for target 'sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/argument.cpp.o' failed
make[2]: *** [sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/argument.cpp.o] Error 1
CMakeFiles/Makefile2:781: recipe for target 'sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/all' failed
make[1]: *** [sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

intermediate solution

I can ignore the -pedantic flag (from the build directory) in ../sixtracklib/CMakeLists.txt and ../sixtracklib/opencl/CMakeLists.txt which solves it for the moment, but I guess this is something one may want to fix (unless it goes back to an understood fault on my side of course).

aoeftiger commented 5 years ago

I can confirm this is a gcc v>=9 issue, for gcc v4.9.2 this does not happen.

aoeftiger commented 5 years ago

--> could be related to c++17 standard related..