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