简体   繁体   English

/ bin / sh:在Eclipse中找不到用于并行应用程序开发人员的mpic ++命令

[英]/bin/sh: mpic++ command not found in Eclipse for Parallel Application Developers

I'm trying to use Eclipse for Parallel Application Developers to do some MPI stuff but I can't get the program to compile. 我正在尝试使用Eclipse用于并行应用程序开发人员来做一些MPI东西,但是我无法使程序进行编译。 Below is the error I'm getting in the console: 以下是我在控制台中遇到的错误:

Description Resource    Path        Location        Type
/bin/sh: mpic++: command not found  prog            C/C++ Problem

I use mpic++ from the command line (bash shell) to successfully compile programs. 我从命令行(bash shell)使用mpic++来成功地编译程序。 When I run the command using bourne shell I get an error. 当我使用bourne shell运行命令时,出现错误。

/bin/sh mpic++
/usr/local/bin/mpic++: /usr/local/bin/mpic++: cannot execute binary file

When I use sudo I still get the same error. 当我使用sudo ,仍然出现相同的错误。 But when I first change to the bourne shell then run the mpic++ command it works. 但是,当我第一次更改为bourne shell,然后运行mpic ++命令时,它可以工作。

/bin/sh
sh-3.2$ mpic++
clang: error: no input files

I've been looking at ways to change the shell used by eclipse so I can use the bash shell because I can call mpic++ without any problems. 我一直在寻找改变eclipse使用的shell的方法,因此我可以使用bash shell,因为我可以mpic++调用mpic++ I've also tried launching eclipse with sudo but that didn't work. 我也尝试过使用sudo启动eclipse,但这没有用。

I have compiled mpi in eclipse successfully. 我已经在eclipse中成功编译了mpi。 Please follow the steps: 请按照以下步骤操作:

  1. In terminal type: 在终端类型中:

$ which mpicxx $其中mpicxx

/usr/local/bin/mpicxx

You should get the mpicxx binary path as result. 结果,您应该获得mpicxx二进制路径。 I have my mpicxx in /usr/local/bin/ directory. 我在/usr/local/bin/目录中有我的mpicxx。

  1. In eclipse, go to project properties: 在eclipse中,转到项目属性:

    • Set GCC C Compiler as: /usr/local/bin/mpicxx 将GCC C编译器设置为: /usr/local/bin/mpicxx
    • Also set GCC C+ Compiler as: /usr/local/bin/mpicxx /usr/local/bin/mpicxx GCC C +编译器设置为: /usr/local/bin/mpicxx
    • Set MacOS X C++ Linker as: /usr/local/bin/mpicxx . 将MacOS X C ++链接器设置为: /usr/local/bin/mpicxx Also set All options as -L/usr/local/lib 还将所有选项设置为-L/usr/local/lib

GCC C ++编译器 MacOS X C ++链接器

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

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