编译starcluster错误中的C++程序
问题描述:
我是Starcluster软件的新手,我正在尝试在3节点集群中编译我的第一个复杂程序。编译starcluster错误中的C++程序
我按照群集创建的说明,将文件放在sgeadmin文件夹中,并尝试编译。以下错误弹出:
[email protected]:~$ 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应该安装所有你......我想只有找到解决方案,但没有找到一个成功回答... 任何人都曾经遇到过这个错误?
由于提前,
伯纳
EDIT 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
+0
谢谢!这在编译时有诀窍!但是,在本地群集(多个VM)中进行测试时,显示了一些警告。只要我检查它没有在汇编中的副作用,我会在你的答案中检查一下。 非常感谢! – Bernardo
你”确定*你的*来源没有问题?源代码中没有缺少分号或其他任何内容?你是什么'MyApp.cpp'文件看起来像包括第8行?在包含第15行之前,“MyApp.hpp”如何?在第19行之前包含“SAXPopulation.hpp”? –
嗨!谢谢回复!刚刚添加了您询问的信息 – Bernardo