2017-08-27 112 views
0

我是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)

+0

你」確定*你的*來源沒有問題?源代碼中沒有缺少分號或其他任何內容?你是什​​麼'MyApp.cpp'文件看起來像包括第8行?在包含第15行之前,「MyApp.hpp」如何?在第19行之前包含「SAXPopulation.hpp」? –

+0

嗨!謝謝回覆!剛剛添加了您詢問的信息 – Bernardo

回答

0

嘗試增加這編譯行:

-DOMPI_SKIP_MPICXX 
+0

謝謝!這在編譯時有訣竅!但是,在本地羣集(多個VM)中進行測試時,顯示了一些警告。只要我檢查它沒有在彙編中的副作用,我會在你的答案中檢查一下。 非常感謝! – Bernardo