Arrayfire学习笔记(一)安装
来源:互联网 发布:淘宝李宁乒乓球运动服 编辑:程序博客网 时间:2024/04/30 12:43
1.安装
arrayfire的官网上有教程。按照步骤基本就可以完成安装。http://arrayfire.org/docs/installing.htm
安装的过程就是很简单了,用户需要做的就是设置一个环境变量。即,In edit mode, append AF_PATH%/lib. NOTE: Ensure that there is a semi-colon separating AF_PATH%/lib from any existing content (e.g. EXISTING_PATHS;AF_PATH%/lib;) otherwise other software may not function correctly.
然后运行例程helloworld 即可。
在我运行例程的时候出现了一个错误。1>项目文件包含 ToolsVersion="12.0"。此工具集可能未知或缺失。在这种情况下,通过安装 MSBuild 的正确版本,或许可以解决此问题。否则,该 build 可能已因策略原因而被强制为某个特定 ToolsVersion。将该项目视为其已具有 ToolsVersion="4.0"。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=291333。
主要是因为我自己是VS2012,因此在项目——属性——配置属性——常规中,将平台工具集改成VS2012即可。
2.使用
(1)如果要将一个arrayfire添加到已存在的解决方案中,则需要完成一下步骤
- Add
"$(AF_PATH)/include;"
to Project Properties -> C/C++ -> General -> Additional Include Directories. - Add
"$(AF_PATH)/lib;"
to Project Properties -> Linker -> General -> Additional Library Directories. - Add
afcpu.lib
orafcuda.lib
orafopencl.lib
to Project Properties -> Linker -> Input -> Additional Dependencies. based on your preferred backend. - (Optional) You may choose to define
NOMINMAX
,AF_<CPU/CUDA/OPENCL>
and/orAF_<DEBUG/RELEASE>
in your projects. This can be added to Project Properties -> C/C++ -> General -> Preprocessor-> Preprocessory definitions.
(2)如果是用的CUDA工程, it is important to ensure that the CUDA NVVM DLLs are copied to the exectuable directory. This can be done by adding a post build event.
Open the Project Properties -> Build Events -> Post Build Events dialog and add the following lines to it.
昨天真的是要日了狗了。由于我的电脑上没有装cuda,所以小伙伴拷给我的工程就不能直接跑。于是新建了一个空工程,想把文件拷进去,按照(1)的方法反正死活都不行。搞了一晚上,调试的时候老说我缺这个库缺那个文件,但是我在我电脑上搜索发现我确实没有那些文件...然后看到官网写
“If you wish to create a project that allows you to use all the ArrayFire backends with ease, the best way to go is to copy the HelloWorld sln/vcxproj/cpp file trio and rename them to suit your project.
All the ArrayFire examples are pre-configured for all ArrayFire backends as well as the Unified API. These can be chosen from the Solution/Platform configuration drop down boxes.
You can alternately download the template project from ArrayFire Template Projects ”
好吧,于是我就把c++ source文件copy进了helloworld,简直完!美!
所以以后就是一直只能这样吗!
要死要死要死
我好方!
反正不管怎么样总算是可以用了不是!刚开始第一天,不要心急小姑娘!!
- Arrayfire学习笔记(一)安装
- Arrayfire学习笔记(二)开始滑翔吧!
- Arrayfire学习笔记(三)常规窄带波束形成
- GPU&VS2012&CUDA&matlab&Arrayfire杂记(一)——序
- Oracle学习笔记(一)安装
- Liferay Portal学习笔记(一):安装
- Liferay Portal学习笔记(一):安装
- Ruby 学习笔记一(Ruby 安装)
- Memcached 学习笔记(一)安装 & helloworld
- cassandra学习笔记(一)------------安装篇
- QT 学习笔记 (一) 环境安装
- LinuxCast学习笔记(一)Linux_install安装
- Django学习笔记(一)安装
- maven(一)学习笔记-安装,配置
- Android安装器学习笔记(一)
- ThinkPHP学习笔记( 一)安装配置
- gradle学习笔记(一)下载安装
- docker学习笔记(一): docker安装
- 【bzoj4071】[Apio2015]巴邻旁之桥 三分套三分
- 软工大作业·源物语(三)
- zhiliti
- 报错:The resource name must start with a letter
- 八皇后问题 回溯
- Arrayfire学习笔记(一)安装
- VC DAO 操作数据库
- Android4.2.2源码目录结构分析
- [leetcode 121] Best Time to Buy and Sell Stock---只能买卖股票一次的最大收益
- 增强for 循环
- 2015-蓝桥杯--格子中输出
- 测试
- JavaScript年月日三级联动
- UITableView