VC6+Intel Compiler 9.1
前提准备:
l 下载Intel Compiler 9.1安装包,
进入链接http://www.intel.com/cd/software/products/asmo-na/eng/388198.htm
按要求输入,一定要填写正确的邮件地址,(lic是通过这个邮件发给你的)
下载,当前最新版是11.1,但为了使用VC6,
l 关闭VS6.0应用程序
安装:
1.安装完Intel编译器后,在VC6.0的Tools下面会新增一个关于Intel编译器,进入勾选安装的Intel编译器版本(推荐使用Intel Compiler 9.1版本)。
图1 勾选Inter版本
2.在project中打开project settings,在C/C++ ->Preprocessor definitions里加入_USE_INTEL_COMPILER 即可以使用Intel Compiler 进行编译。
图2 填写Preprocessor definitions
编译窗口应该显示使用icl进行编译,
3.OpenMP支持可以在C/C++ -> Project Options 里添加 /Qopenmp。
图3 填写Project Options
4.测试运行环境,写入以下代码
图4 测试代码
如果你是单核CPU 采用以下测试程序
#include "omp.h"
#include <iostream>
void main()
{
#pragma omp parallel num_threads(3)
}
输出如下:
出现三个hello world,说明有三个线程,由num_threads(3)指定
5.至此,openMP编程环境搭好。