c++ - StarCluster错误中的C++程序编译

标签 c++ compiler-errors compilation openmpi starcluster

我是Starcluster软件的新手,目前正在尝试在3节点群集中编译我的第一个复杂程序。

我按照集群创建的说明进行操作,将文件放置在sgeadmin文件夹中并尝试进行编译。 pop 以下错误:

    sgeadmin@master:~$ make
Building file: MyApp.cpp
Invoking: GCC C++ Compiler
mpiCC -std=c++0x -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"MyApp.d" -MT"MyApp.d" -o "MyApp.o" "MyApp.cpp"
In file included from /usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:201:0,
                 from /usr/lib/openmpi/include/mpi.h:1886,
                 from SAXPopulation.hpp:19,
                 from MyApp.hpp:15,
                 from MyApp.cpp:8:
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/constants.h:94:37: error: expected unqualified-id before numeric constant
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/constants.h:96:37: error: expected unqualified-id before numeric constant
make: *** [MyApp.o] Error 1

似乎在mpi.h中是一个问题,但是starcluster应该为您安装了所有这些...我只是尝试找到解决方案,但未成功找到答案...
有人遇到过这个错误吗?

提前致谢,

贝纳多

编辑
MyApp.cpp的前8行
//============================================================================
// Name        : MyApp.cpp
// Author      : ****
// Version     :
// Copyright   : Your copyright notice
//============================================================================

#include "MyApp.hpp"
#include <mpi.h>

(mpi.h是第9行)

MyAp.hpp前15行
/*
 * MyApp.h
 *
 *  Created on: *****
 *      Author: ****
 */

#ifndef MYAPP_H_
#define MYAPP_H_

#include <stdio.h>
#include <string.h>
#include <fstream>
#include <dirent.h>
#include "SAXPopulation.hpp"

SAXPopulation.hpp前18行
/*
 * SAXPopulation.hpp
 *
 *  Created on: ****
 *      Author: ***
 */

#ifndef SAXPOPULATION_HPP_
#define SAXPOPULATION_HPP_

#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <vector>
#include "MersenneTwister.h"
#include "SAXChromo.hpp"
#include <algorithm>
#include "Stock.hpp"
#include <mpi.h>

(最后一行是19)

最佳答案

尝试将其添加到编译行:

-DOMPI_SKIP_MPICXX

关于c++ - StarCluster错误中的C++程序编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45907555/

相关文章:

c - 字段类型不完整;结构已声明

iphone - Xcode编译为较低版本的iOS

java - 可以将字符串编译为代码吗?

c++ - 操作顺序 int(4*x/y) vs int(x/(y/4))

c++ - "make"是否知道如何在子目录中搜索包含文件?

javascript - 错误TS2339 : Property 'default' does not exist on type 'Special[]'

c# - 如何将不同的类库编译成一个 dll?

c++ - 如何从 OpenGL 中的纹理中删除黑色背景

android - OpenCV Native Android cvtColor 崩溃

ios - FBSOpenApplicationErrorDomain 代码=3