|
From: Kashif Z. <ka...@pe...> - 2011-07-28 08:00:35
|
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._ZN6repast6relogo16SimulationRunner3runI14ZombieOb
serverNS0_5PatchEEEvRNS_10PropertiesE[.gnu.linkonce.t._ZN6repast6relogo16Sim
ulationRunner3runI14ZombieObserverNS0_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._ZN6repast6relogo12WorldCreator11createWorldI14Zom
bieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefin
itionERKSt6vectorIiSaIiEERT1_[.gnu.linkonce.t._ZN6repast6relogo12WorldCreato
r11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEP
T_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::Proper
ties &) [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-fa
ils-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._ZN6repast6relogo12WorldCreator11createWorldI14Zom
bieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEPT_RKNS0_15WorldDefin
itionERKSt6vectorIiSaIiEERT1_[.gnu.linkonce.t._ZN6repast6relogo12WorldCreato
r11createWorldI14ZombieObserverNS0_5PatchENS0_19DefaultAgentCreatorIS4_EEEEP
T_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: <mailto:ka...@pe...> ka...@pe...
|