I am having a problem compiling my code. The following error is displayed:
make
mpixlcxx -c -O3 potentialqueue_local.cpp
mpixlcxx -c -O3 eventqueue.cpp
"eventqueue_remote.h", line 20.36: 1540-0063 (S) The text "eventqueue_t" is unexpected.
make: *** [eventqueue.o] Error 1
I am fairly new to C++ and not sure if the problem is in the makefile or maybe one of my #include statements. Can anyone see the problem?
eventqueue.h
#ifndef _EVENTQUEUE_H_
#define _EVENTQUEUE_H_
#include <vector>
#include <list>
#undef SEEK_SET
#undef SEEK_END
#undef SEEK_CUR
#include <mpi.h>
#include "event_storage.h"
#include "neuron.h"
#define MAX_EVENT_COUNT 100000
// Base event queue class
class eventqueue_t : public event_storage_t
{
protected:
typedef std::vector<event_t> moment_t;
typedef std::vector<moment_t*> events_t;
public:
// Constructor/Destructor
eventqueue_t(unsigned int size);
virtual ~eventqueue_t();
// Pushing events on the queue
void push_event(const event_t &signal, unsigned int delay);
public:
unsigned int get_capacity();
protected:
events_t event_queue;
};
#endif // _EVENTQUEUE_H_
eventqueue.cpp
#include <iostream>
#include "eventqueue.h"
#include "simulation.h"
#include "config.h"
using namespace std;
eventqueue_t::eventqueue_t(unsigned int size) : event_storage_t(size)
{
event_queue.resize(size, NULL);
// Initialize the queue
int i;
for(i = 0; i < size; i++) {
moment_t *moment_p = new moment_t();
// reserve some events to speed things up
moment_p->reserve(config_t::self_p->queue_reserve_size);
event_queue[i] = moment_p;
}
}
eventqueue_t::~eventqueue_t()
{
// Go through the moments
for(events_t::iterator i = event_queue.begin(); i != event_queue.end(); i++)
{
// Delete the moment
delete *i;
}
}
void eventqueue_t::push_event(const event_t &signal, unsigned int delay)
{
event_queue[(current_event_index + delay) % queue_size]
->push_back(signal);
future_events_count++;
}
unsigned int eventqueue_t::get_capacity()
{
int capacity = 0;
int cycle_index;
for(cycle_index = 0; cycle_index < queue_size; cycle_index++) {
capacity += event_queue[cycle_index]->capacity();
}
return capacity;
}
eventqueue_remote.h
#ifndef _EVENTQUEUE_REMOTE_H_
#define _EVENTQUEUE_REMOTE_H_
#include "eventqueue.h"
#define LEFT 0
#define RIGHT 1
#define UP 2
#define DOWN 3
#define LEFTUP 4
#define LEFTDOWN 5
#define RIGHTUP 6
#define RIGHTDOWN 7
#define EVENTS_UPDATE_MSG 0
#define STATS_MSG 1
// Remote machine event queue
class eventqueue_remote_t : public eventqueue_t
{
public:
eventqueue_remote_t(unsigned int size, unsigned int _remote_machine_id);
void communicate_moment(unsigned long step, MPI_Request *requests, int &request_count);
void execute_moment(unsigned long step);
public:
unsigned int remote_machine_id;
};
#endif // _EVENTQUEUE_REMOTE_H_
makefile
TARGET = brain
OBJS = brain.o config.o connection.o event_storage.o potentialqueue_local.o eventqueue.o \
eventqueue_local.o eventqueue_remote.o main.o neuron.o simulation.o EasyBMP.o
CXX = mpixlcxx
CFLAGS = -O3
LDFLAGS =
$(TARGET): $(OBJS) combine
$(CXX) $(OBJS) -o $(TARGET) $(LDFLAGS)
combine: combine.o EasyBMP.o
$(CXX) combine.o EasyBMP.o -o combine
.SUFFIXES:
.SUFFIXES: .o .cpp .h
.cpp.o:
$(CXX) -c $(CFLAGS) $*.cpp
.h.o:
$(CXX) -c $(CFLAGS) $*.cpp
brain.cpp: brain.h config.h simulation.h eventqueue_remote.h neuron.h connection.h potentialqueue_local.h
config.cpp: config.h
connection.cpp: connection.h config.h neuron.h event_storage.h
event_storage.cpp: event_storage.h
eventqueue.cpp: eventqueue.h event_storage.h neuron.h simulation.h config.h
potentialqueue_local.cpp: potentialqueue_local.h event_storage.h eventqueue_remote.h neuron.h config.h
eventqueue_local.cpp: eventqueue_local.h eventqueue.h eventqueue_remote.h neuron.h simulation.h config.h
eventqueue_remote.cpp: eventqueue_remote.h eventqueue.h config.h
main.cpp: brain.h simulation.h config.h
neuron.cpp: neuron.h connection.h config.h potentialqueue_local.h
simulation.cpp: simulation.h brain.h config.h connection.h EasyBMP.o
brain.o: brain.cpp
config.o: config.cpp
connection.o: connection.cpp
event_storage.o: event_storage.cpp
potentialqueue_local.o: potentialqueue_local.cpp
eventqueue.o: eventqueue.cpp
eventqueue_local.o: eventqueue_local.cpp
eventqueue_remote.o: eventqueue_remote.cpp
main.o: main.cpp
neuron.o: neuron.cpp
simulation.o: simulation.cpp
# combine utility
#combine.cpp:
# third party bmp library
EasyBMP.o: easy_bmp/EasyBMP.cpp
$(CXX) -c $(CFLAGS) easy_bmp/EasyBMP.cpp -o EasyBMP.o
# Cleaning
clean:
rm -f *.o $(TARGET) combine output/* easy_bmp/*.o *~