- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试构建clFFT
库(用于使用OpenCL进行FFT)和clFFT git
中包含的示例。
/opt/
,我做了:git clone https://github.com/clMathLibraries/clFFT.git
/opt/
目录,我做了:$ mkdir build && cd build/
cmake
:cmake -DOpenCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include -DOpenCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64 ../clFFT/src/
确实,在
/opt/
目录中,我已经从
AMDAPPSDK-3.0
文件库中安装了
AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
。
cmake
命令的末尾,我得到:
cmake -DOpenCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include -DOpenCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64 ../clFFT/src/
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- UNICODE feature disabled on linux
-- 64bit build - FIND_LIBRARY_USE_LIB64_PATHS TRUE
-- Could NOT find Boost
CMake Warning at CMakeLists.txt:146 (message):
Try setting Boost_DEBUG and Boost_DETAILED_FAILURE_MSG for more information
-- 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 - found
-- Found OpenCL: /opt/AMDAPPSDK-3.0/lib/x86_64 (found version "2.0")
-- Found FFTW: /usr/lib/x86_64-linux-gnu/libfftw3f.so;/usr/lib/x86_64-linux-gnu/libfftw3.so
-- Detected GNU fortran compiler.
-- CMAKE_CXX_COMPILER flags: -m64 -pthread
-- CMAKE_CXX_COMPILER debug flags: -g
-- CMAKE_CXX_COMPILER release flags: -O3 -DNDEBUG
-- CMAKE_CXX_COMPILER relwithdebinfo flags: -O2 -g -DNDEBUG
-- CMAKE_EXE_LINKER link flags:
FFT clients will NOT be built
GoogleTest unit tests will NOT be built
FFT callback client will NOT be built
-- Configuring done
WARNING: Target "clFFT" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "clFFT" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "StatTimer" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "StatTimer" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft2d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft3d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft1d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /opt/build
更准确地说,我是在谈论:
-- Configuring done
WARNING: Target "clFFT" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "clFFT" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "StatTimer" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "StatTimer" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft2d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft3d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "example_examples_fft1d" requests linking to directory "/opt/AMDAPPSDK-3.0/lib/x86_64". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /opt/build
4.2)将
make
启动到
/opt/build/
目录后,出现以下警告:
$ make
Scanning dependencies of target clFFT
[ 3%] Building CXX object library/CMakeFiles/clFFT.dir/transform.cpp.o
In file included from /opt/clFFT/src/library/repo.h:26,
from /opt/clFFT/src/library/transform.cpp:23:
/opt/clFFT/src/library/../statTimer/statisticalTimer.GPU.h:132:42: warning: ignoring attributes on template argument âcl_uintâ {aka âunsigned intâ} [-Wignored-attributes]
typedef std::pair< std::string, cl_uint > idPair;
^
[ 7%] Building CXX object library/CMakeFiles/clFFT.dir/accessors.cpp.o
In file included from /opt/clFFT/src/library/repo.h:26,
from /opt/clFFT/src/library/accessors.cpp:23:
/opt/clFFT/src/library/../statTimer/statisticalTimer.GPU.h:132:42: warning: ignoring attributes on template argument âcl_uintâ {aka âunsigned intâ} [-Wignored-attributes]
typedef std::pair< std::string, cl_uint > idPair;
^
[ 11%] Building CXX object library/CMakeFiles/clFFT.dir/plan.cpp.o
In file included from /opt/clFFT/src/library/repo.h:26,
from /opt/clFFT/src/library/plan.cpp:25:
/opt/clFFT/src/library/../statTimer/statisticalTimer.GPU.h:132:42: warning: ignoring attributes on template argument âcl_uintâ {aka âunsigned intâ} [-Wignored-attributes]
typedef std::pair< std::string, cl_uint > idPair;
^
[ 15%] Building CXX object library/CMakeFiles/clFFT.dir/repo.cpp.o
In file included from /opt/clFFT/src/library/repo.h:26,
from /opt/clFFT/src/library/repo.cpp:22:
...
最后,我得到以下结束错误:
[ 80%] Building C object examples/CMakeFiles/example_examples_fft2d.dir/fft2d.c.o
/opt/clFFT/src/examples/fft2d.c: In function âmainâ:
/opt/clFFT/src/examples/fft2d.c:63:5: warning: âclCreateCommandQueueâ is deprecated [-Wdeprecated-declarations]
queue = clCreateCommandQueue( ctx, device, 0, &err );
^~~~~
In file included from /opt/clFFT/src/include/clFFT.h:33,
from /opt/clFFT/src/examples/fft2d.c:21:
/opt/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here
clCreateCommandQueue(cl_context /* context */,
^~~~~~~~~~~~~~~~~~~~
[ 84%] Linking C executable examples/fft2d
/usr/bin/ld: CMakeFiles/example_examples_fft2d.dir/fft2d.c.o: in function `main':
fft2d.c:(.text.startup+0x76): undefined reference to `clGetPlatformIDs'
/usr/bin/ld: fft2d.c:(.text.startup+0x9d): undefined reference to `clGetPlatformInfo'
/usr/bin/ld: fft2d.c:(.text.startup+0xd1): undefined reference to `clGetDeviceIDs'
/usr/bin/ld: fft2d.c:(.text.startup+0xf6): undefined reference to `clGetDeviceInfo'
/usr/bin/ld: fft2d.c:(.text.startup+0x13c): undefined reference to `clCreateContext'
/usr/bin/ld: fft2d.c:(.text.startup+0x152): undefined reference to `clCreateCommandQueue'
/usr/bin/ld: fft2d.c:(.text.startup+0x215): undefined reference to `clCreateBuffer'
/usr/bin/ld: fft2d.c:(.text.startup+0x241): undefined reference to `clEnqueueWriteBuffer'
/usr/bin/ld: fft2d.c:(.text.startup+0x307): undefined reference to `clFinish'
/usr/bin/ld: fft2d.c:(.text.startup+0x334): undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: fft2d.c:(.text.startup+0x3a7): undefined reference to `clReleaseMemObject'
/usr/bin/ld: fft2d.c:(.text.startup+0x3cc): undefined reference to `clReleaseCommandQueue'
/usr/bin/ld: fft2d.c:(.text.startup+0x3d5): undefined reference to `clReleaseContext'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clBuildProgram'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clEnqueueNDRangeKernel'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clSetKernelArg'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clGetCommandQueueInfo'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clReleaseEvent'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clGetProgramBuildInfo'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clGetContextInfo'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clCreateProgramWithBinary'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clRetainContext'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clReleaseProgram'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clGetProgramInfo'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clCreateKernel'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clCreateProgramWithSource'
/usr/bin/ld: ../library/libclFFT.so.2.14.0: undefined reference to `clReleaseKernel'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/example_examples_fft2d.dir/build.make:85: examples/examples/fft2d] Error 1
make[1]: *** [CMakeFiles/Makefile2:223: examples/CMakeFiles/example_examples_fft2d.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
我不明白这些错误可能来自何处,似乎我建立的
libclFFT.so.2.14.0
库不包含对OpenCL基本功能的引用(例如
clGetPlatformIDs
或
clCreateCommandQueue
...)。
/usr/bin/ld: ../library/libclFFT.so.2.14.0
,因为该库内置在
/opt/build/library
目录中。
libclFFT.so
,其中考虑了路径
OpenCL_INCLUDE_DIR
和
OpenCL_LIBRARY
指示的OpenCL header 。
cmake
采取的路径问题(即
../library/libclFFT.so.2.14.0
),并将
AMDAPP
SDK中的所有OpenCL函数包含到该库的构建中。
最佳答案
您机器上的cmake
设置应该具有一个OpenCL查找程序,当find_package(OpenCL)
执行cmake
发行版中的CMakeLists.txt
文件时,该命令由clFFT
命令调用(此命令也可以在您自己的CMakeLists.txt
文件中使用)。该查找程序只是一个名为FindOpenCL.cmake
的文件,该文件必须是cmake
配置的一部分。确保您具有以下文件:
find /usr -name FindOpenCL.cmake
OpenCL_INCLUDE_DIR
调用中设置变量
OpenCL_LIBRARY
和
cmake
-查找程序将找到所有所需的OpenCL路径。如果您有这个查找程序,但是它不能正常工作-那么对于它的开发人员来说将是一个问题。如果您没有此查找器,那么在
cmake
安装和/或设置中会出现问题。这个发现者描述为
here。
关于cmake - clFFT编译问题: undefined reference to `clGetPlatformInfo' and other OpenCL functions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56745388/
运行 pip install cmake 时出现上述错误在 alpine linux (WSL) 上。 完整错误: /home/user# pip install cmake Collecting c
我的项目依赖 mariadb-connector-c我正在尝试使用 cmake 自动化下载、构建和链接过程。 我目前将项目下载到一个目录中,然后尝试执行生成忍者文件并运行它们,但我根本无法运行 cma
我正在尝试像这样在 cmake 中执行 execute_process execute_process(COMMAND ${CMAKE_COMMAND} -P myScript.cmake 这仅在文件
我想知道如果我没有给它任何变量告诉它在哪里找到它,cmake 如何找到我的 llvm cmake 配置。 我是 LLVM 新手。我正在构建一个 Hello World LLVM pass。我在 Ubu
我正在开发一个使用 CMake 的项目。顶CMakeLists.txt文件包含以下行: cmake_minimum_required(VERSION 3.7.2) # Kittens will die
我正在使用 Meego 1.2 工具链使用 cmake 运行构建(长话短说)。这个特定的工具链需要使用 --sysroot 选项来查找它需要的任何库。 set (CMAKE_CXX_FLAGS "-f
我们有一些源代码处理工具,可以从多个“片段”生成原始汇编文件等内容。 当使用 make 中的这些工具时,我们可以通过让源处理工具发出“依赖文件”来确保最新的构建,就像 gcc 一样-MD 标志。 例如
如何在 MSYS2 中安装和配置“cmake”?我尝试安装以下 MSYS 包 我在运行任何 cmake 命令时都收到以下错误 '''CMakeLists.txt:5 (cmake_minimum_re
有没有办法在 CMake 中得到一个变量列表?具体来说,我想要做的是调用一个现有函数,该函数接受多个变量并检查它们的计算结果是否为 true。 在某些情况下,其中一些变量将是空列表(计算结果为 fal
我有两组测试(功能测试和单元测试),我希望能够指定通过 cmake 运行哪一组。 一组测试是我想通过“make test”运行的单元测试。 另一组测试是我想通过“制作功能测试”来运行的功能测试。 目前
我的目标是查看有关调用 g++ 的详细信息由 cmake 直接调用从命令行。我不关心 make 的输出就这个问题而言。 根据official FAQ和 the accepted answer on a
我有一个生成库的CMake项目。我已经编写了一个CMake脚本FindXXX.cmake来帮助我的图书馆的用户。这样,他们可以使用find_package(XXX)并获取所需的变量。到现在为止还挺好。
当我看到带有命名空间的 CMake 库时,它们总是在表单中Parent::Component . 如果我有一个足够大的库,那么该库的子部分可能包含组件。我想知道是否可以/适合做 ParentProje
CMake 变量和属性似乎完成了非常相似的事情,我一直无法理解它们之间的区别。 它们每个都有自己的文档部分,但两者都会影响构建系统,两者都是“预先存在的”,并且两者都可以基于其他 CMake 命令动态
我有一个包含多个子目录的 CMake 项目,例如: dir1 subdir11 subdir12 dir2 subdir21 subdir22 根 CMakeLists
如果您想将静态库链接到共享库或可执行文件,同时保持所有符号可见(例如,您可以稍后打开它以找到它们),在 Linux/BSD 上执行此操作的一种非可移植方式是使用标志-Wl,--whole-archiv
CMake 自动创建一个 FooTarget.cmake文件例如添加 install(EXPORT FooTargets FILE FooTargets.cmake NAMESPACE Foo
在CMake中,ELSE和ENDIF控制流函数将表达式作为参数。根据文档,这些是optional。那么这些目的是什么?仅仅是为了维护目的而使原始IF表达式更清晰,还是提供某些功能? 最佳答案 正如您所
我是 cmake 的新手,我发现它非常令人沮丧。我试图在构建运行时评估的文件路径中使用通配符,而不是在生成构建时。 我创建了一个构建,它使用 SWIG 为某些 C++ 代码生成 Java 包装器。我可
我可能在谷歌上搜索错误,但我无法找到 .cmake 文件的用途。 我刚刚偶然发现了一个我必须使用的项目的 CMake 工具,我很难理解它是如何工作的。我明白在包含 CMakeLists.txt 的目录
我是一名优秀的程序员,十分优秀!