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