|
From: Murphy, J. T. <jtm...@an...> - 2011-07-28 11:49:45
|
Kashif,
Thanks for continuing to track down these errors; it's very useful to know how RepastHPC and the demo models will compile- or will not compile- on different compilers than the ones we have in-house here at Argonne.
Try making these changes to ZombieObserver.h:
void setup(repast::Properties props);
Should be changed to:
virtual void setup(repast::Properties& props);
And:
void go();
Should be changed to:
virtual void go();
Additionally, change the signature of the setup method in ZombieObserver.cpp to match the declaration in ZombieObserver.h by including the &:
void ZombieObserver::setup(Properties& props) {
There are also two changes being made here: the addition of the 'virtual' keyword, which is applied to both the 'setup' and the 'go' method, and the change to the method signature of 'setup', which should receive a reference.
Let us know if these work- best,
John
--
John T. Murphy
Computational Postdoctoral Fellow
Decision and Information Sciences and
Argonne Leadership Computing Facility
Argonne National Laboratory
jtm...@an...
From: Kashif Zia <ka...@pe...<mailto:ka...@pe...>>
Date: Thu, 28 Jul 2011 03:00:10 -0500
To: "rep...@li...<mailto:rep...@li...>" <rep...@li...<mailto:rep...@li...>>
Subject: [Repast-interest] Repast HPC: compilation on Linux (icc) isuues
Hello Everyone
Trying to compile zombie_model on Linux using Intel C.
First I recognized that in icc, the virtual functions overriding is not supported as I have understanding of it. For example: in ZombieObserver.h
The functions:
void go();
void setup(repast::Properties props);
should work as it is, but the following error was generated:
icpc main.cpp -lboost_mpi -lboost_filesystem -lrepast_hpc-1.0 -lrelogo-1.0 -lmpi -lnetcdf_c++
ZombieObserver.h(64): warning #1125: function "repast::relogo::Observer::setup(repast::Properties &)" is hidden by "ZombieObserver::setup" -- virtual function override intended?
void setup(repast::Properties props);
^
/usr/lib64/sgi/intel9/libimf.so: warning: warning: feupdateenv is not implemented and will always fail
ld: warning: libboost_filesystem.so.1.33.1, needed by /apps/repasthpc-1.0b/lib/librepast_hpc-1.0.so, may conflict with libboost_filesystem.so.1.45.0
/tmp/icpclI4dfT.o: In function `void repast::relogo::SimulationRunner::run<ZombieObserver, repast::relogo::Patch>(repast::Properties&)':
main.cpp:(.gnu.linkonce.t._ZN6repast6relogo16SimulationRunner3runI14ZombieObserverNS0_5PatchEEEvRNS_10PropertiesE[.gnu.linkonce.t._ZN6repast6relogo16SimulationRunner3runI14ZombieObserverNS0_5PatchEEEvRNS_10PropertiesE]+0x6f2): undefined reference to `ZombieObserver::setup(repast::Properties)'
/tmp/icpclI4dfT.o: In function `ZombieObserver* repast::relogo::WorldCreator::createWorld<ZombieObserver, repast::relogo::Patch, repast::relogo::DefaultAgentCreator<repast::relogo::Patch> >(repast::relogo::WorldDefinition const&, std::vector<int, std::allocator<int> > const&, repast::relogo::DefaultAgentCreator<repast::relogo::Patch>&)':
main.cpp:(.gnu.linkonce.t._ZN6repast6relogo12WorldCreator11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefinitionERKSt6vectorIiSaIiEERT1_[.gnu.linkonce.t._ZN6repast6relogo12WorldCreator11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefinitionERKSt6vectorIiSaIiEERT1_]+0x74): undefined reference to `vtable for ZombieObserver'
make: *** [default] Error 1
After searching for two hours, I came to know that some intel compilers model need explicit mention of virtual functions. So I added the following line:
using repast::relogo::Observer::setup;
void go();
void setup(repast::Properties props);
Still not successful and faced the following error:
k330174@service0:~/sim/src/zombie> make
icpc main.cpp -lboost_mpi -lboost_filesystem -lrepast_hpc-1.0 -lrelogo-1.0 -lmpi -lnetcdf_c++
/apps/repasthpc-1.0b/include/relogo/SimulationRunner.h(116): error: more than one instance of overloaded function "ZombieObserver::setup" matches the argument list:
function "repast::relogo::Observer::setup(repast::Properties &)"
function "ZombieObserver::setup(repast::Properties)"
argument types are: (repast::Properties)
object type is: ZombieObserver
obs->setup(props);
^
detected during instantiation of "void repast::relogo::SimulationRunner::run<ObserverType,PatchType>(repast::Properties &) [with ObserverType=ZombieObserver, PatchType=repast::relogo::Patch]" at line 57 of "main.cpp"
compilation aborted for main.cpp (code 2)
make: *** [default] Error 2
It seemed that there is some problem with intel during its handling with dynamic binding. Look at: http://octave.1599824.n4.nabble.com/Compiling-Octave-3-2-3-with-icpc-10-1-fails-more-than-one-instance-of-overloaded-function-quot-octav-td2327457.html
So I simply changed the function name entirely (from setup to setup1). Now the above errors are removed, but still not able to compile. See recent errors below:
k330174@service0:~/sim/src/zombie> make
icpc main.cpp -lboost_mpi -lboost_filesystem -lrepast_hpc-1.0 -lrelogo-1.0 -lmpi -lnetcdf_c++
/usr/lib64/sgi/intel9/libimf.so: warning: warning: feupdateenv is not implemented and will always fail
ld: warning: libboost_filesystem.so.1.33.1, needed by /apps/repasthpc-1.0b/lib/librepast_hpc-1.0.so, may conflict with libboost_filesystem.so.1.45.0
/tmp/icpcefhQ0V.o: In function `ZombieObserver* repast::relogo::WorldCreator::createWorld<ZombieObserver, repast::relogo::Patch, repast::relogo::DefaultAgentCreator<repast::relogo::Patch> >(repast::relogo::WorldDefinition const&, std::vector<int, std::allocator<int> > const&, repast::relogo::DefaultAgentCreator<repast::relogo::Patch>&)':
main.cpp:(.gnu.linkonce.t._ZN6repast6relogo12WorldCreator11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefinitionERKSt6vectorIiSaIiEERT1_[.gnu.linkonce.t._ZN6repast6relogo12WorldCreator11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefinitionERKSt6vectorIiSaIiEERT1_]+0x74): undefined reference to `vtable for ZombieObserver'
make: *** [default] Error 1
Changing the function name probably will work as it is the highest level function. However it need to remove the remaining errors first.
Any ideas?
Thanks and Regards.
---
Kashif Zia
PhD Candidate
Institut für Pervasive Computing, Johannes Kepler Universität Linz, Altenberger Straße 69, A-4040 Linz
Room: P105, Phone: +43-732-2468-9673, Fax: +43-732-2468-8426
E-Mail: ka...@pe...<mailto:ka...@pe...>
|