ddemidov / vexcl

VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP
http://vexcl.readthedocs.org
MIT License
702 stars 82 forks source link

CUDA only support #275

Open byronfa opened 5 years ago

byronfa commented 5 years ago

I was tinkering with VexCL on an NVidia jetson nano, which only supports cuda. It appears if CL isn't available at all, the project files have issues? (Even if I install OpenCL headers, the lack of a library still causes a failure). Any hints?

-- Looking for CL/cl_platform.h -- Looking for CL/cl_platform.h - not found CMake Warning at CMakeLists.txt:180 (message): The JIT interface requires OpenCL headers to be available.You can download them from https://github.com/KhronosGroup/OpenCL-HeadersSet OpenCL_INCLUDE_DIR to the location of the headers.For now, disabling the JIT target.

CMake Error at CMakeLists.txt:244 (add_library): add_library cannot create ALIAS target "VexCL::Backend" because target "OpenCL" does not already exist.

ddemidov commented 5 years ago

Can you try to configure the project with cmake .. -DVEXCL_BACKEND=CUDA? The default value is 'OpenCL', set here:

https://github.com/ddemidov/vexcl/blob/a0fe836ee70280b697bbabcaee7edd2fba8faac0/CMakeLists.txt#L240

I agree the choice of the default should be more intelligent and check if the backend is available first.

ddemidov commented 5 years ago

588fab65 should help.

byronfa commented 5 years ago

That got me past the install issues.. I was poking around the examples recently and I get the following: /usr/bin/ld: cannot find -lVexCL::Backend

What exactly is VexCL::Backend trying to pick up?

Thanks!

ddemidov commented 5 years ago

VexCL::Backend is a cmake alias for one of VexCL::OpenCL, VexCL::CUDA, VexCL::Compute, or VexCL::JIT:

https://github.com/ddemidov/vexcl/blob/4a99b23fe6d9e6a393fa6815cb72f181e8567c8f/CMakeLists.txt#L250-L258

Each of these is an interface cmake target that brings all appropriate includes and libraries. The error you get means that the linker actually tries to link against VexCL::Backend, which most probably means that you did something wrong while poking around. Does git diff show any modified CMakeLists.txt files? If not, I would recommend removing the build directory (or create another one), and reconfigure the examples from scratch.