Intel编译器选项

合集下载

Visual C++ 编译器选项

Visual C++ 编译器选项

/Gs /GT /GX /Gy /Gz /MD /MDd /ML /MLd /MT /MTd
输出文件
控制堆栈探测 支持使用静态线程本地存储区分配的数据的纤程安全 启用同步异常处理 启用函数级链接 使用 __stdcall 调用约定 使用 MSVCRT.lib 创建多线程 DLL 使用 MSVCRTD.lib 创建调试多线程 DLL 使用 LIBC.lib 创建单线程可执行文件 使用 LIBCD.lib 创建调试单线程可执行文件 使用 LIBCMT.lib 创建多线程可执行文件 使用 LIBCMTD.lib 创建调试多线程可执行文件
选项 /Y/Yc
目的 忽略当前生成中的所有其他预编译头编译器选项 创建预编译头文件
/Yd /Yu /YX
杂项
将完整的调试信息放在所有对象文件中 在生成期间使用预编译头文件 自动处理预编译头
选项 @ /? /c /H /HELP /J /nologo /QI0f /QIfdiv QIfist /showIncludes /Tc /TC /Tp /TP /V /W /w /Wall /WL /Zm
启用同步异常处理 启用函数级链接 与 /RTC1 相同 使用 __stdcall 调用约定 限制外部(公共)名称的长度 列出编译器选项 在目录中搜索包含文件 更改默认的 char 类型 创建动态链接库 创建调试动态链接库 将指定的选项传递给 LINK 使用 MSVCRT.lib 创建多线程 DLL 使用 MSVCRTD.lib 创建调试多线程 DLL 使用 LIBC.lib 创建单线程可执行文件 使用 LIBCD.lib 创建调试单线程可执行文件 使用 LIBCMT.lib 创建多线程可执行文件 使用 LIBCMTD.lib 创建调试多线程可执行文件 取消显示登录版权标志 创建小代码 创建快速代码 假设没有别名 控制内联展开 禁用优化 使用全局优化 生成内部函数 改善浮点数一致性 代码大小优先 代码速度优先 假定在函数调用中使用别名 使用最大优化 (/Ob2gity /Gs) 省略框架指针 执行 Pentium 0x0f 错误修复 执行 Pentium FDIV 错误修复 当需要从浮点类型转换为整型时取消 _ftol 将预处理器输出写入文件 启用运行时错误检查 在编译期间显示包含文件的列表 指定 C 源文件 指定 C++ 源文件

Intel oneAPI DPC++ C++编译器简介说明书

Intel oneAPI DPC++ C++编译器简介说明书

Get Started with the Intel® oneAPI DPC ++/C++ CompilerGet Started with the Intel® oneAPI DPC++/C++ CompilerContentsChapter 1: Get Started with the Intel® oneAPI DPC++/C++ Compiler Get Started on Linux* (4)Get Started on Windows* (7)Compile and Execute Sample Code (10)2Get Started with the Intel® oneAPI DPC++/C++ Compiler 1The Intel® oneAPI DPC++/C++ Compiler provides optimizations that help your applications run faster onIntel® 64 architectures on Windows* and Linux*, with support for the latest C, C++, and SYCL languagestandards. This compiler produces optimized code that can run significantly faster by taking advantage of the ever-increasing core count and vector register width in Intel® Xeon® processors and compatible processors.The Intel® Compiler will help you boost application performance through superior optimizations and SingleInstruction Multiple Data (SIMD) vectorization, integration with Intel® Performance Libraries, and byleveraging the OpenMP* 5.0/5.1 parallel programming model.The Intel® oneAPI DPC++/C++ Compiler compiles C++-based SYCL* source files for a wide range ofcompute accelerators.The Intel® oneAPI DPC++/C++ Compiler is part of the Intel® oneAPI Toolkits.Find MoreNotices and DisclaimersIntel technologies may require enabled hardware, software or service activation.No product or component can be absolutely secure.31 Get Started with the Intel® oneAPI DPC++/C++ CompilerYour costs and results may vary.© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.Get Started on Linux*Before You BeginSet Environment VariablesBefore you can use the compiler, you must first set the environment variables by sourcing the environment script using the initialization utility. This initializes all the tools in one step.1.Determine your installation directory,<install_dir>:a.If your compiler was installed in the default location by a root user or sudo user, the compiler willbe installed under/opt/intel/oneapi. In this case, <install_dir> is /opt/intel/oneapi.b.For non-root users, your home directory under intel/oneapi is used. In this case,<install_dir> will be $HOME/intel/oneapi.c.For cluster or enterprise users, your admin team may have installed the compilers on a sharednetwork file system. Check with your local admin staff for the location of installation(<install_dir>).2.Source the environment-setting script for your shell:a.bash: source <install_dir>/setvars.sh intel64b.csh/tcsh: source <install_dir>/setvars.csh intel64Install GPU Drivers or Plug-ins (Optional)You can develop oneAPI applications using C++ and SYCL* that will run on Intel, AMD*, or NVIDIA* GPUs. To develop and run applications for specific GPUs you must first install the corresponding drivers or plug-ins:•To use an Intel GPU, install the latest Intel GPU drivers.•To use an AMD GPU, install the oneAPI for AMD GPUs plugin from Codeplay.•To use an NVIDIA GPU, install the oneAPI for NVIDIA GPUs plugin from Codeplay.Option 1: Use the Command Line®4Get Started with the Intel® oneAPI DPC++/C++ Compiler 1Invoke the compiler using the following syntax:{compiler driver} [option] file1 [file2...]For example:icpx hello-world.cppFor SYCL compilation, use the -fsycl option with the C++ driver:icpx -fsycl hello-world.cppNOTE When using -fsycl, -fsycl-targets=spir64 is assumed unless the -fsycl-targets isexplicitly set in the command.51 Get Started with the Intel® oneAPI DPC++/C++ CompilerIf you are targeting an AMD or NVIDIA GPU, refer to the corresponding Codeplay plugin get started guide for detailed compilation instructions:•oneAPI for AMD GPUs Get Started Guide•oneAPI for NVIDIA GPUs Get Started GuideOption 2: Use the Eclipse* CDTFollow these steps to invoke the compiler from within the Eclipse* CDT.Install the Intel® Compiler Eclipse CDT plugin.1.Start Eclipse2.Select Help > Install New Software3.Select Add to open the Add Site dialog4.Select Archive, browse to the directory <install_dir>/compiler/<version>/linux/ide_support,select the .zip file that starts with piler, then select OK5.Select the options beginning with Intel, select Next, then follow the installation instructions6.When asked if you want to restart Eclipse*, select YesBuild a new project or open an existing project.1.Open Existing Project or Create New Project on Eclipse2.Right click on Project > Properties > C/C++ Build > Tool chain Editor3.Select Intel DPC++/C++ Compiler from the right panelSet build configurations.1.Open Existing Project on Eclipse2.Right click on Project > Properties > C/C++ Build > Settings3.Create or manage build configurations in the right panelBuild a Program From the Command LineUse the following steps to test your compiler installation and build a program.e a text editor to create a file called hello-world.cpp with the following contents:#include <iostream>int main(){std::cout << “Hello, world!\n”;return 0;}pile hello-world.cpp:icpx hello-world.cpp -o hello-worldThe -o option specifies the file name for the generated output.3.Now you have an executable called hello-world which can be run and will give immediate feedback: hello-worldWhich outputs:Hello, world!You can direct and control compilation with compiler options. For example, you can create the object file and output the final binary in two steps:6Get Started with the Intel® oneAPI DPC++/C++ Compiler 1 pile hello-world.cpp:icpx hello-world.cpp -cThe -c option prevents linking at this step.e the icpx compiler to link the resulting application object code and output an executable:icpx hello-world.o -o hello-worldThe -o option specifies the generated executable file name.Refer to Compiler Options for details about available options.© Codeplay Software Limited. Intel, the Intel logo, Codeplay, Codeplay logo and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.Get Started on Windows*Before You BeginSet Environment VariablesThe compiler integrates into the following versions of Microsoft Visual Studio*:•Visual Studio 2022•Visual Studio 2019•Visual Studio 2017NOTE Support for Microsoft Visual Studio 2017 is deprecated as of the Intel® oneAPI 2022.1 release and will be removed in a future release.For full functionality within Visual Studio, including debugging and development, Visual Studio Community Edition or higher is required. Visual Studio Express Edition allows only command-line builds. For all versions, Microsoft C++ support must be selected as part of the Visual Studio install. For Visual Studio 2017 and later, you must use a custom install to select this option.You typically do not need to set the environment variables on Windows, as the compiler command-line window sets these variables for you automatically. If you need to set the environment variables, run the environment script as described in the suite-specific Get Started documentation.The default installation directory (<install_dir>) is C:\Program Files (x86)\Intel\oneAPI.Install GPU Drivers (Optional)To develop and run applications for Intel GPUs you must first install the latest Intel GPU drivers.Option 1: Use the Command Line in Microsoft Visual Studio®71 Get Started with the Intel® oneAPI DPC++/C++ CompilerInvoke the compiler using the following syntax:{compiler driver} [option] file1 [file2...]To invoke the compiler using the command line from within Microsoft Visual Studio, open a command prompt and enter your compilation command. For example:icx hello-world.cppFor SYCL compilation, use the -fsycl option with the C++ driver:icx -fsycl hello-world.cpp8Get Started with the Intel® oneAPI DPC++/C++ Compiler 1 NOTE When using -fsycl, -fsycl-targets=spir64 is assumed unless the -fsycl-targets isexplicitly set in the command.Option 2: Use Microsoft Visual StudioProject Support for the Intel® DPC++/C++ Compiler in Microsoft Visual StudioNew Microsoft Visual Studio projects for DPC++ are automatically configured to use the Intel® oneAPI DPC+ +/C++ Compiler.New Microsoft Visual C++* (MSVC) projects must be manually configured to use the Intel® oneAPI DPC++/C ++ Compiler.NOTE .NET-based CLR C++ project types are not supported by the Intel® oneAPI DPC++/C++Compiler. The specific project types will vary depending on your version of Visual Studio, for example: CLR Class Library, CLR Console App, or CLR Empty Project.Use the Intel® DPC++/C++ Compiler in Microsoft Visual StudioExact steps may vary depending on the version of Microsoft Visual Studio in use.1.Create a Microsoft Visual C++ (MSVC) project or open an existing project.2.In Solution Explorer, select the project(s) to build with the Intel® oneAPI DPC++/C++ Compiler.3.Open Project > Properties .4.In the left pane, expand the Configuration Properties category and select the General propertypage.5.In the right pane change the Platform Toolset to the compiler you want to use:•For C++ with SYCL, select Intel® oneAPI DPC++ Compiler.•For C/C++, there are two toolsets.Select Intel C++ Compiler <major version> (example 2021) to invoke icx.Select Intel C++ Compiler <major.minor> (example 19.2) to invoke icl.Alternatively, you can specify a compiler version as the toolset for all supported platforms andconfigurations of the selected project(s) by selecting Project > Intel Compiler > Use InteloneAPI DPC++/C++ Compiler.6.Rebuild, using either Build > Project only > Rebuild for a single project or Build > RebuildSolution for a solution.Select Compiler VersionIf you have multiple versions of the Intel® oneAPI DPC++/C++ Compiler installed, you can select which version you want from the Compiler Selection dialog box:1.Select a project, then go to Tools > Options > Intel Compilers and Libraries > <compiler> >Compilers, where <compiler> values are C++ or DPC++.e the Selected Compiler drop-down menu to select the appropriate version of the compiler.3.Select OK.Switch Back to the Microsoft Visual Studio C++ CompilerIf your project is using the Intel® oneAPI DPC++/C++ Compiler, you can choose to switch back to the Microsoft Visual C++ compiler:1.Select your project in Microsoft Visual Studio.2.Right-click and select Intel Compiler > Use Visual C++ from the context menu.91 Get Started with the Intel® oneAPI DPC++/C++ CompilerThis action updates the solution file to use the Microsoft Visual Studio C++ compiler. All configurations of affected projects are automatically cleaned unless you select Do not clean project(s). If you choose not to clean projects, you will need to rebuild updated projects to ensure all source files are compiled with the new compiler.Build a Program From the Command LineUse the following steps to test your compiler installation and build a program.e a text editor to create a file called hello-world.cpp with the following contents:#include <iostream>int main(){std::cout << “Hello, world!\n”;return 0;}pile hello-world.cpp:icx hello-world.cpp3.Now you have an executable called hello-world.exe which can be run and will give immediatefeedback:hello-world.exeWhich outputs:Hello, world!You can direct and control compilation with compiler options. For example, you can create the object file and output the final binary in two steps:pile hello-world.cpp:icx hello-world.cpp /c /Fohello-world.objThe /c option prevents linking at this step and /Fo specifies the name for the object file.e the icx compiler to link the resulting application object code and output an executable:icx hello-world.obj /Fehello-world.exeThe /Fe option specifies the generated executable file name.Refer to Compiler Options for details about available options.Compile and Execute Sample CodeMultiple code samples are provided for the Intel® oneAPI DPC++/C++ Compiler so that you can explore compiler features and familiarize yourself with how it works. For example:Sample Project DescriptionOpenMP Offload Sample The OpenMP* Offload sample demonstrates someof the new OpenMP Offload features supported bythe Intel® oneAPI DPC++/C++ Compiler.10Get Started with the Intel® oneAPI DPC++/C++ Compiler 1 Base: Vector Add Sample The Vector Add sample is the equivalent of a 'Hello,World!' sample for data parallel programs. Buildingand running the code sample verifies that yourdevelopment environment is set up correctly anddemonstrates the use of the core features of DPC++.Matrix Multiply Sample The Matrix Multiply sample is a simple program thatmultiplies together two large matrices and verifiesthe results. This program is implemented in twoways: Using Data Parallel C++ (DPC++) and usingOpenMP (OMP).Adaptive Noise Reduction Sample The Adaptive Noise Reduction sample is a DPC++reference design that demonstrates a highlyoptimized image sensor adaptive noise reduction(ANR) algorithm on an FPGA.Next Steps•Use the latest oneAPI Code Samples and follow along with the Intel® oneAPI Training Resources.•Explore the Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference on the Intel® Developer Zone.11。

Intel Visual Fortran安装+使用详细讲解

Intel Visual Fortran安装+使用详细讲解

Intel Visual Fortran安装+使用详细讲解好久都没有用Fortran了,这两周由于帮老师做事,就写了两个插值程序。

刚刚去论坛里面搜了一下关于IVF的帖子,发现不就是很多,个人感觉某些不怎么详细,从我第一次接触IVF已经有三年了,下面我就把我对于IVF的认识与理解跟大家分享咯,求各位同仁不喜勿喷、、、简介:Intel Visual Fortran(IVF)与Compaq Visual Fortran(CVF)类似,都就是用来编写Fortran语言的一个编译器,IVF瞧名字就知道,它就是由Intel公司开发,而CVF则就是由HP公司开发,之前瞧到一个帖子说,HP公司的CVF开发团队加盟到了Intel公司,或者可以说Intel公司收购了HP公司的这个团队,而CVF6、6从2006年开始就不再开发新的CVF系列版本了,这么多年以来CVF也确实没有6、7、6、8、、、、、、之后的版本出现,转而出现的确实IVF2010,IVF2011,IVF2013的新版本的出现。

这就说明IVF就是以后的主流趋势,而CVF只能成为我们的回忆,值得一提的就是,IVF肯定就是在CVF的基础上发展起来的,因此我们用到IVF的时候,会有一种熟悉的感觉。

Q1:为什么要用Intel Visual Fortran?我第一次接触到IVF就是当时我的电脑(Win7)不能正常使用CVF版本,会出现各种意想不到的问题(反正我就是遇到过得,搞得编程的心情都没有了),论坛里面也有一些什么破解的方法,都不管用,于就是就在“小木虫”论坛里面瞧到了IVF,到目前为止,我用IVF在Win7的32位与64位的电脑上没有出现任何不兼容的问题(CVF就是不支持64位机子的)。

我自己的理解就是新版本的出现,先不从稳定不稳定来说,肯定就是有它的优势所在,Fortran标准的版本也在逐步的修改,比如将面向对象这些加入进来,以前版本的编辑器或许就不能支持了。

ubuntu下intel fortran安装

ubuntu下intel fortran安装

Intel FORTRAN 编译器入门系列之一: Linux 安装和使用经过测试, Intel FORTRAN 编译器能支持安装在绝大多数的主流Linux发行版本, 包括Asianux* 3.0, Debian* 4.0, Red Hat Enterprise Linux* 3, 4, 5, Fedora* 7, SUSE LINUX Enterprise Server* 9, 10, TurboLinux* 11, Ubuntu 7.0等等I. Intel FORTRAN 编译器安装1) 下载安装包后, 解包, 并运行安装脚本(请尽量使用root 权限的账号进行安装)> tar -zxvf l_fc_x_10.1.xxx.tar.gz> cd l_fc_x_10.1.xxx> ./install.sh2) 选择1 进行安装, 并提供许可文件(License File). 注意请输入完整的全路径, 包括许可文件名(许可文件通常以.lic结尾, 建议放入缺省目录/opt/intel/licenses)3) 选择1 进行典型安装(Typical Install)4) 根据提示, 阅读许可, 选择安装路径等等, 直到全部结束II. Intel FORTRAN 编译器使用注意, 缺省的安装目录在/opt/intel/fc[e]/xx.x.xxx/ (xx.x.xxx代表版本号, fc代表IA-32 and IA-64版本, fce代表Intel 64版本)使用前, 需要设置相关的环境:] source /opt/intel/fc/10.1.xxx/bin/ifortvars.sh (或者是ifortvars.csh)然后编译源文件:] ifort my_source_file.f90查看当前版本] ifort -V参看支持的所有命令行选项] ifort -helpIII. 常见问题Q: 如果碰到安装失败, 如何解决?A: 首先, 请确认你下载了最新的发行版本, 并检查当前系统,1) 系统是否已经安装Linux Developer tools 选件, 包括GCC, G++ 和其它相关的开发工具包2) 系统是否已经安装Linux 选件compat-libstdc++, 它提供libstdc++.so.5 库3) 如果是Intel 64(EM64T)环境, 系统是否已经安装了32-bit 库(可能被称作ia32-libs )然后, 查看发行说明(Release Notes), 核对你的系统是否支持最后, 联系Intel Premier Support (), 寻求帮助当然, 还可以通过论坛, 搜索网络, 和他人讨论Q: 使用时, 遇到错误信息"ifort: error: could not find directory in which g++ resides"A: Intel Fortran编译器无法在你的系统中找到GNU* g++ 编译器. 可能是由于你没有安装GCC 开发包, 或者g++ 不是安装在缺省路径, 或者你使用了非英文的Linux版本. 解决办法请访问Intel网站: /support/performancetools/fortran/linux/sb/CS-017386.htmQ: 使用时, 遇到错误信息"Intel 10.x compiler's dependency on /usr/lib/libstdc++.so.5"A: Intel 10.x 编译器为了保证和基于GCC 3.2 的系统兼容, 需要使用标准C++ 库/usr/lib/libstdc++.so.5, 但是很多比较新的Linux 发行版本中开始使用GCC 3.4, 并且提供了全新的标准C++ 库/usr/lib/libstdc++.so.6. 因此需要安装compat-libstdc++ RPM包, 它包含了/usr/lib/libstdc++.so.5 库.IV. 常用链接:Intel Linux FORTRAN 编译器帮助文档: /cd/software/products/asmo-na/eng/346152.htmIntel Linux FORTRAN 编译器发行说明: /software/products/compilers/docs/flin/release_notes.htmIntel Linux FORTRAN 编译器安装指导: /software/products/compilers/docs/flin/install.htmIntel Linux FORTRAN 编译器英文FAQ: /cd/software/products/asmo-na/eng/346192.htm安装过程:首先解压缩拿到的安装程序包,拿到的打包好的程序格式为:*****,tar.gz利用 tar -xjf ********.tar.gz 来解压缩,在同一目录下生成一个同名的文件夹,进入该文件夹,运行 ./install.sh 按照屏幕提示来进行操作,先选择1,然后提示输入licence文件的路径,这里需要输入全路径。

fortran编译器操作

fortran编译器操作

关于fortran语言的编译器使用问题此文是一个简明教程,仅适合初学者来使用。

老鸟们大牛们就不用在看了。

本文档的目的是为了方便初学者快速的掌握基本的fortran编译器的使用。

一、关于cvf(compaq virtual fortran)CVF操作方便,限制不多。

一般常用的有两种新建工程的方法:a)打开cvf,点击新建file----new,弹出选择对话框,简单的程序可以选择fortran console application。

在左侧projectname处填写工程名字,在location处填写(选择)工程保存路径。

注意cvf中要求不允许出现汉语路径。

操作顺序图如下第一步:第二步:第三步:第四步:运行至此,所有步骤完成。

b)直接打开cvf,点击新建文档(new)然后单击保存,弹出保存对话框,选择保存路径及文件夹,文件名改为“工程名.f90”格式此处注意如果是fortran自由格式,请保存为*.f90或*.f95格式,如果是固定格式请保存为*.for或*.f格式。

因为编译器是根据后缀的不同调用不同的语言编译器,否则将出错。

保存文件的路径和文件夹即为该工程所在的路径和文件夹。

同样不能有汉语。

示意图如下:第一步第二步、第三步、至此,所有的工程完成。

二、关于CVF的调试(debug)在相应代码编辑框左侧发灰色的竖线部分,鼠标变为反三角方向的形状时即可右键鼠标,选择insert/remove BreakPoint选项,在代码左侧可以看到一个红色的标示(代码行尽量不要设在代码最后。

可以设置到自认为可能发生错误的地方。

或者尽量靠前设置),此时就可以按F5进入调试状态。

可以在watch窗口查看各个变量,数组的值与内容。

按F11进行单步运行。

查看错误出处。

具体的更细致的调试,请参看相关文献或书籍。

这类书籍不少。

具体操作如下:6三、关于IVF (intel virtual fortran )编译器的使用由于ivf 要求比较严格,且自身不带IDE 窗口。

ICC与GCC编译器的对比

ICC与GCC编译器的对比

NeoStack 开发工具实用例子性能对比分析说明书上周收到了Intel开发工具实用例子介绍,针对典型几个例子和自己做的详细介绍如下:一、使用icc的例子:1、MySQL在基于Pentium4、Itanium2 和64位Xeon的系统上分别使用icc和个gcc 编译器编译的MySQL代码进行测试,由于icc多变性,所以使用不同的编译选项进行编译:普通的-O2和更具有侵略性的选项,将它们与gcc相同选项编译结果进行对比,如下图:SetQuery使用的时间(秒)Intel Petium 4Intel Itanium 2Intel Xeon EM64-O2Aggressive-O2Aggressive-O2AggressiveIntel C++编译器550519581567265263GNU C编译器666665692671628637执行时间缩减比17%22%16%15%58%59%注:1、Intel Pentium 4:MySQL版本4.1.12,icc 9.0, gcc 3.4.4 ,操作系统为基于P4的SUSE Server8。

2,硬件环境是:P4 2。

7G;1G 内存;512K L3 cache;超线程开关关闭。

2、Itanium 2:MySQL版本4.1.12,icc 9.0, gcc 3.4.4,操作系统是基于Itanium 2服务器的RHEL AS 2.1, 硬件环境:Itaniium 2 1.2G; 1G 内存;6M L3 cache。

3、Intel Xeon EM64:MySQL版本4.1.12,icc 9.0, gcc 3.2.3;操作系统是基于64位的Xeon服务器的RHEL AS3 Update 2, 硬件环境:两路Intel Xeon处理器3.2G; 4G 内存;1M L2 cache,超线程开关打开;4、icc针对P4选项:-O3 -ip ; gcc选项:-O3 -fomit-frame-pointer -feild-constructors fno-rtti -fno-exception5、icc针对I2选项:-O16、icc针对em64选项:-O3Intel处理器Intel C++编译器选项GNU C编译器选项icc代码执行时间gcc代码执行时间Intel编译器性能提高Petium 4O2O21034123616%Petium 4O2, IPOO3, fomit995116014%Itanium 2O2O2771103025%Itanium 2O2, IPOO3, fomit769100724%注:MySQl 4.0.3,icc 7.1,在P4上gcc 3.1,在I2上gcc3.2;基于P4处理器的服务器版本是RHEL7.1;基于I2处理器的服务器版本是RHL AS。

Linux下用Intel编译器编译安装NetCDF-Fortan库(4.2以后版本)

Linux下用Intel编译器编译安装NetCDF-Fortan库(4.2以后版本)

Linux下⽤Intel编译器编译安装NetCDF-Fortan库(4.2以后版本)本来这个问题真的没必要写的,可是真的困扰我太久%>_<%,决定还是记录⼀下。

⾸先,最权威清晰的安装⽂档还是官⽅的:(写此⽂时,最近版为4.2)那这个⽂档最开始就告诉我们,⾃NetCDF库4.2版本以后,Fortran的库和C的库就要分开build啦!⽽且要装Fortran的库必须先装好C的库。

所以先装C的库咯:仍然官⽅⽂档:(写此⽂时,最新版本为4.3.2)那这个⽂档告诉我们:要装NetCDF-C的库,有三个(其实是两个)必须装的:zlib,HDF5,(curl)。

综上,需要下载4个tar的包。

点我们下载:参照官⽅⽂档,zlib和hdf5的安装⽐较简单,指定⼀下安装路径即可:build zlib:$ ./configure --prefix=${DIR1}$ make check installbuild HDF5:$ ./configure --with-zlib=${DIR1} --prefix=${DIR1}$ make$ make check$ make install其中,⽐较容易出问题的是HDF5的安装,参阅成功之后,就可以进⾏netcdf-c和netcdf-fortran库的安装了,这⾥有个问题要注意:编译安装库时候的编译器要和你以后编译你的Fortran代码使⽤的编译器⼀致,否者以后在编译Fortran源代码其中⽤到netcdf库时会出错。

以我为例:我平时⽤Intel的编译器,所以此时在安装这两个库的时候,分别⽤Intel C++ Composer和Intel Fortran Composer进⾏编译(后⾯简称icc和ifort)安装好了icc和ifort以后均需要设置⼀下环境变量:(最好添加到~/.bashrc⽂件中)source <compiler_install_dir>/bin/compilervars.sh intel64接下来就是⽤Intel编译器编译安装netcdf库了:关键就是设置⼏个编译选项:export CC=iccexport CXX=icpcexport CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'export F77=ifortexport FC=ifortexport F90=ifortexport FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'export CPP='icc -E'export CXXCPP='icpc -E'对于c库:export DIR1=/snfs01/ff/netcdf_4.3.2$ CPPFLAGS=-I${DIR1}/include LDFLAGS=-L${DIR1}/lib ./configure --prefix=${DIR1} --disable-dap-remote-tests$ make check install对于Fortran库:⾸先仍然如上设置编译选项,然后假设你的c库安装在路径${DIR1}:export LD_LIBRARY_PATH=${DIR1}/lib:${LD_LIBRARY_PATH}然后和c库的编译过程⼀样:CPPFLAGS=-I${DIR1}/include LDFLAGS=-L${DIR1}/lib ./configure --prefix=${DIR1}makemake checkmake install装好了NetCDF-Fortran库了以后如何使⽤?参考⽂档:。

英特尔Parallel Studio快速上手

英特尔Parallel Studio快速上手

本节只是从简单案例入手,快速介绍Parallel Studio各个模块的大致用法,有些小模块甚至没有用到。

目的是展示Parallel Studio的产品的易用性,上手方便。

方便时间有限的读者。

如果需要更详细的介绍和案例分析,可详细阅读后面章节。

2.2.1 英特尔Parallel Studio的下载安装下载安装英特尔Parallel Studio的步骤如下:(1)进入英特尔官方软件网站:“/en-us/intel-sdp-home/”或者“/en-us/articles/intel-software-evaluation-center/”,在里面点击“Intel Parallel Studio”,进入了注册页面,输入正确的email帐号和地区,然后点击“download”按钮,进入最后的下载页面,点击“Intel Parallel Studio (all tool s)”,存到本地。

或者使用下载管理器更好。

(2)下载安装包,约几百兆。

(3)安装MS Visual Studio 2005。

(4)安装英特尔Parallel Studio, 具体组件包括:英特尔Parallel Composer(含英特尔C++ Compiler for 32位和64位,debug扩展以及文档),英特尔性能基本库IPP(32位和64位),英特尔线程构建模块TBB),英特尔Parallel Inspector及英特尔Parallel Amplifier 。

2.2.2 选择案例为了更清楚地介绍各个模块,选择一个范例贯穿整个Parallel Studio的基本使用方法,这里就以N皇后(Queens)问题为例。

NQueen问题是一个很经典的棋盘问题,是数据结构的一个经典算例。

在国际象棋棋盘中,放一个皇后,那么在8个方向上就不能再放其他棋子了,但是在别的位置还能放置其他皇后,使她们不会相互攻击。

那么在一个大小为N×N的棋盘中,可以放多少个皇后,有多少种方法。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Intel编译器选项
Linux* and Mac OS* X
Windows*
Description
-O3
/O3
Enables aggressive optimization for code speed. Recommended for code with loops that perform substantial calculations or process large data sets.
Enables -O2(Linux and Mac OS X) or /O2(Windows) optimizations, as well as more aggressive optimizations, including prefetching, scalar replacement, cache blocking, and loop and memory access transformations.
As compared to -O2 (Linux) or /O2 (Windows), the optimizations enabled by this option often result in faster program execution, but can slow down code execution in some cases. Using this option may result in longer compilation times.
当循环中处理大量float运算或是大数据集时,使用该选项
-O2 (or -O)
/O2
Affects code speed. This is the default option; the compiler uses this optimization level if you do not specify anything.
This option enables the following capabilities for performance gain: inlining intrinsic functions, constant propagation, copy propagation, dead-code elimination, global register allocation, global instruction scheduling and control speculation, loop unrolling, optimized code selection, partial redundancy elimination, strength reduction/induction variable simplification, variable renaming, exception handling
optimizations, tail recursions, peephole optimizations, structure assignment lowering optimizations, and dead store elimination.
For IA-32 and Intel 64 architectures:
Enables certain optimizations for speed, such as vectorization.
-O1
/O1
Affects code size and locality. Disables specific optimizations.
-fast
/fast
Enables a collection of common, recommended optimizations for run-time performance. Can introduce architecture dependency.
-O0
/Od
Disables optimization. Use this for rapid compilation while debugging an application.
Linux OS and Mac OS X
Windows OS
Description
-axSSE4.2
/QaxSSE4.2
Can generate Intel® SSE4 Efficient Accelerated String and Text Processing instructions supported by Intel® Core™ i7 processors. Can generate Intel® SSE4 Vectorizing Compiler and Media Accelerator, Intel® SSSE3, SSE3, SSE2,
and SSE instructions and it can optimize for the Intel® Core™ processor family.
-axSSE4.1
/QaxSSE4.1
Can generate Intel® SSE4 Vectorizing Compiler and Me dia Accelerator instructions for Intel processors. Can generate Intel® SSSE3, SSE3, SSE2, and SSE instructions and it can optimize for Intel® 45nm Hi-k next generation Intel® Core™ microarchitecture. This replaces value S, which is deprecated.
Mac OS X: IA-32 and Intel® 64 architectures.
-axSSSE3
/QaxSSSE3
Can generate Intel® SSSE3, SSE3, SSE2, and SSE instructions for Intel processors and it can optimize for the Intel® Core™2Duo processor family. This replaces value T, which is deprecated.
Mac OS X: IA-32 architecture.
-axSSE3
/QaxSSE3
Can generate Intel® SSE3, SSE2, and SSE instructions for Int el processors and it can optimize for processors based on Intel® Core™ microarchitecture and Intel NetBurst® microarchitecture. This replaces value P, which is deprecated.
Mac OS X: IA-32 architecture.
-axSSE2
/QaxSSE2
Can generate Intel® SSE2 and SSE instructions for Intel processors, and it can optimize for Intel® Pentium® 4 processors, Intel® Pentium® M processors, and Intel® Xeon® processors with Intel® SSE2.
Linux and Windows: IA-32 architecture。

相关文档
最新文档