c++compiler-errorscompilationopenmpistarcluster

Compilation of c++ program in starcluster error


I'm new to Starcluster software and I'm currently trying to compile my first complex program in a 3 node cluster.

I followed the instructions of cluster creation, placed the files in the sgeadmin folder and tried to compile. The following error pops up:

    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

It seems like a problem in mpi.h, but starcluster is supposed to install it all for you... I tried to find solutions only but did not have success in finding an answer... Anyone has ever reached this error?

Thanks in advance,

Bernardo

EDIT MyApp.cpp first 8 lines

//============================================================================
// Name        : MyApp.cpp
// Author      : ****
// Version     :
// Copyright   : Your copyright notice
//============================================================================

#include "MyApp.hpp"
#include <mpi.h>

(mpi.h is line 9)

MyAp.hpp first 15 lines

/*
 * 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 first 18 lines

/*
 * 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>

(last line is 19)


Solution

  • Try adding this to the compilation line:

    -DOMPI_SKIP_MPICXX