简体   繁体   English

为什么我需要使用mpicc

[英]Why I need to use mpicc

I am on Arch Linux. 我在Arch Linux上。 Before I was using msmpi on Windows and I did not need to provide any specific compiler, only usual library, include flags. 在Windows上使用msmpi之前,我不需要提供任何特定的编译器,只需提供通常的库,包括标志。 It seems like openmpi is the only available implementation on Arch Linux, isn't it? 看来openmpi是Arch Linux上唯一可用的实现,不是吗? And what is the reason that I need to use a special (even it is just a wrapper around gcc as I understand) mpicc compiler for this purposes? 为此,我需要使用特殊的(甚至我所理解的只是gcc的包装器)mpicc编译器的原因是什么? I am just always suspicious about using some wrappers (tricks around typical ways of doing) that is why I would like to know is there a way to rid of mpicc and use openmpi implementation without this wrapper. 我只是对使用一些包装程序(对典型的操作方式的技巧)总是感到怀疑,这就是为什么我想知道是否有一种方法可以摆脱mpicc并在没​​有此包装程序的情况下使用openmpi实现。

First, Open MPI is not the only implementation available on Linux. 首先,Open MPI不是Linux上唯一可用的实现。 You can also use MPICH, Intel MPI, etc. 您还可以使用MPICH,Intel MPI等。

Second, for any MPI implementation, you don't have to use the compiler wrappers, it just makes it simpler to compile your code if you do so. 其次,对于任何MPI实现,您都不必使用编译器包装器,这样做可以简化编译代码的过程。 You are welcome to unroll the wrappers and put all the appropriate stuff on the command line yourself if you like. 欢迎您展开包装器,并根据需要自己将所有适当的内容放到命令行中。 There's various ways to do it depending on your implementation. 有多种方法可以实现,具体取决于您的实现。

For MPICH, you can use mpichversion , which will show you how MPICH was compiled, as well as any flags that are used when calling mpicc . 对于MPICH,可以使用mpichversion ,它将显示MPICH的编译方式以及调用mpicc时使用的所有标志。

UPDATE : I should have pointed this out originally. 更新 :我本来应该指出这一点。 It's highly recommended to just use the wrappers. 强烈建议只使用包装纸。 From time to time, the implementations will change what those wrappers do in ways that might cause everything to break for you if you don't use them. 这些实现会不时地更改那些包装器的工作方式,如果不使用它们,可能会导致一切中断。 So unless you have a very good reason not to do so, using them is much safer. 因此,除非您有很好的理由不这样做,否则使用它们会更安全。 If you don't trust them, just check in on them from time to time. 如果您不信任他们,则可以不时检查一下它们。 All the code is open source. 所有代码都是开源的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM