SixTrack / sixtracklib

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

Making: downloaded openCL headers seem not to be found #63

Closed aoeftiger closed 5 years ago

aoeftiger commented 5 years ago

Following issue #62 , I have removed the -pedantic flags and try to compile. There are no openCL headers found on the system, so Martin's new check automatically downloads the v2 headers from kronos. This seems to work during the download in the cmake process but they seem to be missing afterwards during the make...?

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: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-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: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-attributes]
 6169 |         vector<cl_int>* binaryStatus = NULL,
      |                      ^
[  2%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/base_context.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/internal/base_context.h:18,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/internal/base_context.cpp:1:
/u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp:5868:63: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-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: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-attributes]
 6169 |         vector<cl_int>* binaryStatus = NULL,
      |                      ^
[  3%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/context.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/context.h:24,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/internal/context.cpp:1:
/u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp:5868:63: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-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: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-attributes]
 6169 |         vector<cl_int>* binaryStatus = NULL,
      |                      ^
[  4%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/track_job_cl.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/context.h:24,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/track_job_cl.h:22,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/internal/track_job_cl.cpp:1:
/u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp:5868:63: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-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: warning: ignoring attributes on template argument 'cl_int' {aka 'int'} [-Wignored-attributes]
 6169 |         vector<cl_int>* binaryStatus = NULL,
      |                      ^
[  4%] Built target sixtrack_opencl
Scanning dependencies of target sixtrack_common_buffer
[  5%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/alignment.c.o
[  7%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/buffer.c.o
[  8%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/mem_pool.c.o
[  8%] Built target sixtrack_common_buffer
Scanning dependencies of target sixtrack_common_context_cxx
[  9%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base.cpp.o
[ 10%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_c99.cpp.o
[ 11%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_with_nodes.cpp.o
[ 12%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_with_nodes_c99.cpp.o
[ 14%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/argument_base.cpp.o
[ 15%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/argument_base_c99.cpp.o
[ 15%] Built target sixtrack_common_context_cxx
Scanning dependencies of target sixtrack_common_context
[ 16%] Building C object sixtracklib/common/context/CMakeFiles/sixtrack_common_context.dir/compute_arch.c.o
[ 16%] Built target sixtrack_common_context
Scanning dependencies of target sixtrack_common_internal_cxx
[ 17%] Building CXX object sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job_base.cpp.o
[ 18%] Building CXX object sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/context.h:24,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/track_job_cl.h:22,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/common/internal/track_job.cpp:3 :
/u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39:14: fatal error: CL/cl2.hpp: No such file or directory
   39 |     #include <CL/cl2.hpp>
      |              ^~~~~~~~~~~~
compilation terminated.
sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/build.make:75: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o' failed
make[2]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o] Error 1
CMakeFiles/Makefile2:377: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all' failed
make[1]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
martinschwinzerl commented 5 years ago

(replicating the email conversation here for completeness)

Can you please verify whether there is a ext_opencl_clhpp folder inside your build directory after the cmake .. stage?

I haven't downloaded anything by hand, as you can see in the cmake output, it claims to have downloaded it if I understand correctly.

thanks for the verification. The only reason why the file would then be missing from compilation is if the include path is not set accordingly. Could you please re-run with

make VERBOSE=1

and post the the list of command line flags? specifically whether /u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp is added?

Thank you!

aoeftiger commented 5 years ago

It doesn't seem so:

$ make VERBOSE=1
(...)
[ 17%] Building CXX object sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o
cd /u/aoeftige/git/sixtracklib/build/sixtracklib/common/internal && /usr/bin/c++   -I/u/aoeftige/git/sixtracklib  -O3 -DNDEBUG -fPIC   -Wall -Werror -pedantic -ansi -msse2 -std=gnu++11 -o CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o -c /u/aoeftige/git/sixtracklib/sixtracklib/common/internal/track_job.cpp
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/context.h:24:0,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/track_job_cl.h:22,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/common/internal/track_job.cpp:31:
/u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39:26: fatal error: CL/cl2.hpp: No such file or directory
     #include <CL/cl2.hpp>
                          ^
compilation terminated.
sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/build.make:75: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o' failed
make[2]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o] Error 1
make[2]: Leaving directory '/u/aoeftige/git/sixtracklib/build'
CMakeFiles/Makefile2:377: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all' failed
make[1]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all] Error 2
make[1]: Leaving directory '/u/aoeftige/git/sixtracklib/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
aoeftiger commented 5 years ago

Why is it using /usr/bin/c++ anyway, shouldn't it be the g++ I've loaded in my environment variables?

martinschwinzerl commented 5 years ago

That's ok, /usr/bin/c++ should be a symlink to g++.

aoeftiger commented 5 years ago

here this assumption seems not to be true unfortunately..

$ /usr/bin/c++ --version
c++ (Debian 4.9.2-10+deb8u2) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ which g++
/cvmfs/it.gsi.de/compiler/gcc/8.2.0/bin/g++

$ g++ --version
g++ (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
aoeftiger commented 5 years ago

I mean, yes, it is a symlink to g++ -- just the system-wide one and not the one I loaded with module load

(following our skype version: seems like the system provided libOpenCL.so has not been compiled vs. gcc 8.2.0 so cmake apparently automatically falls back to the system-wide gcc 4.9.2 despite the module loaded 8.2.0 ...)

aoeftiger commented 5 years ago

funnily enough, not loading any module, I don't get it to work even with the system-wide gcc v==4.9.2 (which should be theoretically compatible with the system provided libOpenCL)..

In the cmake process (as documented above, same for gcc 4.9.2) I get

(...)
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "1.2")
(...)

It also downloads the headers

(...)
-- ---- -- attempting to fetch OpenCL 2.x C++ headers
-- ---- -- successfully provisioned header at /u/aoeftige/git/sixtracklib/build/ext_opencl_clhpp/CL/cl2.hpp
(...)

Later in make after the successful cmake .. I again don't find the cl2.hpp:

$ make
Scanning dependencies of target sixtrack_opencl
[  1%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/argument.cpp.o
[  2%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/base_context.cpp.o
[  3%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/context.cpp.o
[  4%] Building CXX object sixtracklib/opencl/CMakeFiles/sixtrack_opencl.dir/internal/track_job_cl.cpp.o
[  4%] Built target sixtrack_opencl
Scanning dependencies of target sixtrack_common_buffer
[  5%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/alignment.c.o
[  7%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/buffer.c.o
[  8%] Building C object sixtracklib/common/buffer/CMakeFiles/sixtrack_common_buffer.dir/mem_pool.c.o
[  8%] Built target sixtrack_common_buffer
Scanning dependencies of target sixtrack_common_context_cxx
[  9%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base.cpp.o
[ 10%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_c99.cpp.o
[ 11%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_with_nodes.cpp.o
[ 12%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/context_base_with_nodes_c99.cpp.o
[ 14%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/argument_base.cpp.o
[ 15%] Building CXX object sixtracklib/common/context/CMakeFiles/sixtrack_common_context_cxx.dir/argument_base_c99.cpp.o
[ 15%] Built target sixtrack_common_context_cxx
Scanning dependencies of target sixtrack_common_context
[ 16%] Building C object sixtracklib/common/context/CMakeFiles/sixtrack_common_context.dir/compute_arch.c.o
[ 16%] Built target sixtrack_common_context
Scanning dependencies of target sixtrack_common_internal_cxx
[ 17%] Building CXX object sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job_base.cpp.o
[ 18%] Building CXX object sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o
In file included from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/context.h:24:0,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/opencl/track_job_cl.h:22,
                 from /u/aoeftige/git/sixtracklib/sixtracklib/common/internal/track_job.cpp:31:
/u/aoeftige/git/sixtracklib/sixtracklib/opencl/cl.h:39:26: fatal error: CL/cl2.hpp: No such file or directory
     #include <CL/cl2.hpp>
                          ^
compilation terminated.
sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/build.make:75: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o' failed
make[2]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/track_job.cpp.o] Error 1
CMakeFiles/Makefile2:377: recipe for target 'sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all' failed
make[1]: *** [sixtracklib/common/internal/CMakeFiles/sixtrack_common_internal_cxx.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
aoeftiger commented 5 years ago

While the file is there ;)

$ ls ext_opencl_clhpp/CL/
cl2.hpp
martinschwinzerl commented 5 years ago

Could you please try to pull from the upstream_master branch of my fork git@github.com:martinschwinzerl/sixtracklib.git and check whether this fixes your problems?

I've created a pull request (#64) but since the problems are difficult to reproduce, I would feel better if you could give it a go and run the full opencl unit-tests before merging

Thank you!

aoeftiger commented 5 years ago

Yay!!

$ make
(...)
[100%] Built target generate_buffer_generic_obj
$
martinschwinzerl commented 5 years ago

Pull request #64 seems to have fixed the issue, please re-open if the problem persists.