I want to compile an OpenCL program that uses clAmdFFT, AMDs OpenCL FFT, which is closed-source.

$ objdump -x libclAmdFft.Runtime.so
Dynamic Section:
  NEEDED               libOpenCL.so.1
Version References:
  required from libOpenCL.so.1:
    0x028568b0 0x00 05 OPENCL_1.0

On one machine, I'm using the AMD driver, which comes with a libOpenCL.so that includes version information, like this:

a$ objdump -T /opt/AMDAPP/lib/x86_64/libOpenCL.so
0000000000002610 g    DF .text  0000000000000018  OPENCL_1.0  clGetSamplerInfo
00000000000032e0 g    DF .text  0000000000000018  OPENCL_1.1  clSetEventCallback
0000000000002350 g    DF .text  0000000000000018  OPENCL_1.2  clCreateSubDevices

Everything is fine on this machine.

On another machine, I'm using the nVidia driver, which comes with a libOpenCL.so that doesn't include version information, like this:

b$ objdump -T /usr/lib/libOpenCL.so # -> /usr/lib/nvidia-current/libOpenCL.so
00000000000021f0 g    DF .text  0000000000000018  Base        clGetSamplerInfo
0000000000002a40 g    DF .text  0000000000000018  Base        clSetEventCallback

Linking a program with -llibOpenCL.so -llibclAmdFft.Runtime.so fails here, since clAmdFft wants to link to the tagged symbols:

libclAmdFftRuntime.so: undefinded reference to `clCreateBuffer@OPENCL_1.0`

The dynamic linker also generates this complaint:

b$ ldd libclAmdFft.Runtime.so
libclAmdFft.Runtime.so: …/libOpenCL.so.1: no version information available …

Since the nVidia driver implements OpenCL 1.1 and AmdFFT only needs 1.0, it should work, if I can convince it that Base = OPENCL_1.0. Is that possible?

I can't force nVidia-users to install another version, since the libOpenCL is part of the driver, like libGL.


Linking with --unresolved-symbols=ignore-in-shar

Edit
Report