我已经设法在Ubuntu 13.10上安装Intel和AMD OpenCL SDK,但是在链接时我得到以下内容:
...
/usr/include/CL/cl.hpp:4555: undefined reference to `clSetKernelArg'
/usr/include/CL/cl.hpp:4555: undefined reference to `clSetKernelArg'
/usr/include/CL/cl.hpp:4555: undefined reference to `clSetKernelArg'
./obj/main.o: In function `setArg<float>':
...
这个名单还在继续。我正在使用的编译器标志是:
CFLAGS = -O3 -Wno-write-strings -g -pthread -I/opt/AMDAPP/include
LFLAGS = -L /opt/AMDAPP/lib/x86_64/
此外,链接器无法识别-lOpenCL标志。这可能是一个错误的安装?如果是这样,怎么解决?
编辑:
以下标志发生同样的情况:
CFLAGS = -O3 -Wno-write-strings -g -pthread -I /opt/intel/opencl-1.2-3.1.1.11385/include
LFLAGS = -L /opt/intel/opencl-1.2-3.1.1.11385/lib64
使用编译/链接命令:
TARGET = mgsolve
OBJ = $(patsubst $(SRC_DIR)/%.cpp, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/*.cpp))
$(TARGET): $(BUILD_DIR) $(OBJ)
@echo "===> LINKING $@"
$(Q)$(CC) -o $(TARGET) $(OBJ) $(LFLAGS)
- 丹尼尔