starcluster错误中c++程序的编译

Compilation of c++ program in starcluster error

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

我按照集群创建的说明,将文件放在sgeadmin文件夹中,并尝试编译。弹出以下错误:

    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