pointcloudAI / libDepthEye

MIT License
1 stars 2 forks source link

Can't compile in Ubuntu #3

Open troscianko opened 2 months ago

troscianko commented 2 months ago

I haven't been able to compile in Ubuntu 22.04.4 LTS.

I've installed all the dependencies, but get these linking issues (below).

thanks in advance

jolyon@jSpectre:~/Documents/Software/DepthEye/build$ cmake ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0")
CMAKE_SYSTEM_NAME = Linux VERSION=5.15.0-113-generic(5-15-0)
ARCH = x86_64
Build for x86_64
-- Checking for module 'glfw3'
--   Found glfw3, version 3.3.6
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  examples/Tof_GLFW/CMakeLists.txt:12 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - found
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "2.0")
-- GLFW3 = /usr/lib/x86_64-linux-gnu/libglfw.so | OPENGL_gl_LIBRARY = /usr/lib/x86_64-linux-gnu/libGL.so | OpenCL_LIBRARIES = /usr/lib/x86_64-linux-gnu/libOpenCL.so
OPENGL_gl_LIBRARY = /usr/lib/x86_64-linux-gnu/libGL.so
OPENGL_LIBRARY = /usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLU.so
GLFW3_LIBRARIES = /usr/lib/x86_64-linux-gnu/libglfw.so
OPENGL_glu_LIBRARY = /usr/lib/x86_64-linux-gnu/libGLU.so
-- GLFW3 = /usr/lib/x86_64-linux-gnu/libglfw.so | OPENGL_gl_LIBRARY = /usr/lib/x86_64-linux-gnu/libGL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jolyon/Documents/Software/DepthEye/build
jolyon@jSpectre:~/Documents/Software/DepthEye/build$ make
[ 25%] Building CXX object examples/DepthMeasure/CMakeFiles/DepthMeasure.dir/DepthMeasure.cpp.o
In file included from /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/include/pointcloud-3.4.0/CameraSystem.h:12,
                 from /home/jolyon/Documents/Software/DepthEye/examples/DepthMeasure/DepthMeasure.cpp:14:
/home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/include/pointcloud-3.4.0/DepthCamera.h:60:33: warning: type attributes ignored after type is already defined [-Wattributes]
   60 |         class POINTCLOUD_EXPORT FrameGenerator;
      |                                 ^~~~~~~~~~~~~~
[ 50%] Linking CXX executable ../../bin/DepthMeasure
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clBuildProgram'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clEnqueueNDRangeKernel'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clSetKernelArg'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseMemObject'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseContext'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseEvent'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clEnqueueWriteBuffer'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clGetProgramBuildInfo'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseDevice'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clCreateContext'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clGetDeviceIDs'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clGetDeviceInfo'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseCommandQueue'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clGetPlatformIDs'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clWaitForEvents'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clCreateCommandQueue'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clRetainEvent'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseProgram'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clCreateKernel'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clCreateBuffer'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clCreateProgramWithSource'
/usr/bin/ld: /home/jolyon/Documents/Software/DepthEye/./libs/ubuntu/lib/libGPUFrameProcessor.so: undefined reference to `clReleaseKernel'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/DepthMeasure/CMakeFiles/DepthMeasure.dir/build.make:97: bin/DepthMeasure] Error 1
make[1]: *** [CMakeFiles/Makefile2:116: examples/DepthMeasure/CMakeFiles/DepthMeasure.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
jolyon@jSpectre:~/Documents/Software/DepthEye/build$
pointcloudAI commented 1 week ago

Hi ,this is due to the missing of opencl support Please try :

sudo apt install ocl-icd-libopencl1 sudo apt install opencl-headers sudo apt install clinfo sudo apt install ocl-icd-opencl-dev sudo apt-get install mesa-opencl-icd