centos icc centos官网地址

大家好,今天给各位分享centos icc的一些知识,其中也会对centos官网地址进行解释,文章篇幅可能偏长,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在就马上开始吧!

Intel C++ Compiler配置ICC编译环境

以下是针对 CentOS系统配置 Intel C++ Compiler(icc)的详细步骤:

首先,确保您已准备就绪,从 Intel官网下载 ICC编译器。需要注册并收到包含 license和下载链接的邮件。具体的下载方法请参阅相关参考资料。

接着,通过 yum安装所需的基础包:

bash

yum install libstdc++.so.5

在服务器上创建一个名为“/opt/intel/licenses”的目录,将收到的 license文件(.lic格式)上传至此。

bash

mkdir-p/opt/intel/licenses

然后,关闭 SELinux功能以进行后续安装:

bash

setenforce 0

开始安装过程,解压缩名为 l_ccompxe_intel64_2013.1.117.tgz的文件:

bash

tar-zxvf l_ccompxe_intel64_2013.1.117.tgz

进入解压后的文件夹,执行安装脚本:

bash

./install.sh

安装过程中,只需一路回车即可,可能遇到两个错误信息,可选择忽略。在设置安装路径时,保持默认即可。

安装成功后,将以下内容添加到~/.bashrc文件中,然后保存并退出:

bash

source/opt/intel/composer_xe_2013.1.117/bin/compilervars.sh intel64

运行以下命令使新的环境变量生效:

bash

source~/.bashrc

最后,通过检查 icc的位置来验证安装是否成功:

bash

which icc

如果一切顺利,应输出类似以下结果:

bash

/opt/intel/composer_xe_2013.1.117/bin/intel64/icc

至此,您已经成功配置了 Intel C++ Compiler on CentOS。

使用Intel oneAPI编译器安装WRF和WPS

在2024年1月下旬,本文详述了在CentOS系统下,使用Intel oneAPI编译器安装WRF和WPS的步骤。以下是详细的安装过程:

安装WRF

首先,从github.com/wrf-model/WR...获取WRF-V4.5.2.tar.gz版本。

运行configure文件时,选择oneAPI版本78或79。对于mpi支持,即使没有明确提示,也需要修改MD_FC和DM_CC,将它们设为mpiifx和mpiicx。若选择78,取消对OMP的注释。

保存更改后,使用-j 4(4核并行编译)开始编译,注意输出保存到log文件以供后续调试。

安装过程中,通过命令查看进度。

安装WPS

下载WPS-V4.5.tar.gz,同样从github获取。

配置时,选择19. Linux x86_64, Intel compiler(dmpar)。

在cio.c文件中,为所有函数添加int返回类型,以符合新版编译器要求。

在configure.wps中,更新icc和ifort命令,并在WRF_LIB部分添加必要的lib参数(如-liomp5和-lpthread)。

若使用最新版Jasper,可能需要修改Jasper的lib路径,将其指向lib64。

对于dec_jpeg2000.c的修改,如果遇到引用错误,将相关代码行替换以解决编译问题。

最终,通过修改后的./compile命令确认安装成功,如果geogrid.exe、metgrid.exe和ungrib.exe都编译成功,即安装完成。

以上是基于当时最新版本软件和配置的指导,具体情况可能会因软件更新而有所变化。在实际操作时,务必根据最新文档和版本进行调整。

Centos7安装MPICH出现问题

mpiexec-n<number>./examples/cpi

运行时需要自己修改<number>为自己的值,我指定的是<number>=4

在运行后出现了一下的问题,程序cpi所在的位置不允许运行。

/usr/bin/ld: cannot open output file/home/themingyi/Downloads/mpich-3.3/examples/.libs/14351-lt-cpi: Permission denied

查找资料后发现是程序所在位置权限设置的问题;修改如下:

sudo chown-R"$USER:"/home/themingyi/Downloads/mpich-3.3/examples

chmod-R 777/home/themingyi/Downloads/mpich-3.3/examples

几点解释:

(1)The-R flag stands for recursive, so that directory and all its subfiles and subdirectories will change owner. Remove the-R flag to just change the permissions of the directory itself.

(2)运行时找到examples文件夹,就在自己下载的mpich包的解压文件中

运行结果如下:

cpi.c程序:

/*-*- Mode: C; c-basic-offset:5; indent-tabs-mode:nil;-*-*/↩

/*↩

*(C) 2001 by Argonne National Laboratory.↩

* See COPYRIGHT in top-level directory.↩

*/↩

#include"mpi.h"↩

#include<stdio.h>↩

#include<math.h>↩

double f(double);↩

double f(double a)↩

{↩

return(4.0/(1.0+ a* a));↩

}↩

int main(int argc, char*argv[])↩

{↩

int n, myid, numprocs, i;↩

double PI25DT= 3.141592653589793238462643;↩

double mypi, pi, h, sum, x;↩

double startwtime= 0.0, endwtime;↩

int namelen;↩

char processor_name[MPI_MAX_PROCESSOR_NAME];↩

MPI_Init(&argc,&argv);↩

MPI_Comm_size(MPI_COMM_WORLD,&numprocs);↩

MPI_Comm_rank(MPI_COMM_WORLD,&myid);↩

MPI_Get_processor_name(processor_name,&namelen);↩

fprintf(stdout,"Process%d of%d is on%s\n", myid, numprocs, processor_name);↩

fflush(stdout);↩

n= 10000;/* default# of rectangles*/↩

if(myid== 0)↩

startwtime= MPI_Wtime();↩

MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);

h= 1.0/(double) n;↩

sum= 0.0;↩

/* A slightly better approach starts from large i and works ba ck*/↩

for(i= myid+ 1; i<= n; i+= numprocs){↩

x= h*((double) i- 0.5);↩

sum+= f(x);↩

}↩

mypi= h* sum;↩

MPI_Reduce(&mypi,&pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WOR LD);↩

if(myid== 0){↩

endwtime= MPI_Wtime();↩

printf("pi is approximately%.16f, Error is%.16f\n", pi, fabs(pi- PI25DT));↩

printf("wall clock time=%f\n", endwtime- startwtime);↩

fflush(stdout);↩

}↩

MPI_Finalize();↩

return 0;↩

}↩

建议看看《Linux就该这么学》

阅读剩余
THE END