Hi Sascha,
I think I have a solution (it's compiling now).
Our Centos 5.7 was running gcc and g++ 4.1.2.
After much building/rebuilding with different flags, setting
ADDITIONAL_CXX_FLAGS with -fPIC everywhere I could, double checking the
relocation symbols etc.etc, I then changed the compiler to version 4.4+ and
MITK built just fine.
Thanks for your help.
On another related note, there may be two other issues to fix:
1.) If you set -fPIC into ADDITIONAL_CXX_FLAGS at the MITK SuperBuild level,
this isn't passed through to CTK, and hence doesn't get applied to Log4Qt or
DCMTK in the CTK Superbuild.
2.) I saw that in MITK, there is a separate build for DCMTK, which led me
astray for a bit. CTK is not set to be dependent on DCMTK, so it builds first.
Then, the DCMTK version with the MITK patch is older than the CTK latest
(obviously), and so when DCMTK is built, it is incompatible with the CTK
latest. And also, if you try and make CTK to depend on DCMTK, then there is a
CMake error if MITK_USE_DCMTK is false because DCMTK won't be configured, and
hence CMake can't resolve the dependency for CTK. If you turn MITK_USE_DCMTK to
true, then DCMTK is configured and so, you can then set a dependency between
CTK and DCMTK as you would expect. So, this probably needs tidying up a bit
somewhere.
I hope that makes sense.
Matt
On 19 Sep 2011, at 08:40, Sascha Zelzer wrote:
Hi Matt,
is it CentOS 5.0? I would like to test with the exact version with which you
are experiencing problems.
Thanks,
Sascha
On 09/18/2011 08:39 PM, Clarkson, Matt wrote:
Hi Sascha,
we use Centos 5. I tried adding -fPIC to various places including
ADDITIONAL_CXX_FLAGS, and still got stuck.
Also, if I look in more detail, the -fPIC has to be passed along to CTK, then
onto DCMTK, and it's not passed all the way through to each library.
But then I do not know the exact reason for the problem, or indeed which
library needs it. Also, I'm guessing that for shared libraries, we wouldn't
need -fPIC, so it must only be relevant for something that is built statically.
But I haven't yet tracked down the culprit.
So, in short, I haven't worked it out yet.... and if you could help that would
be great.... but I'm out of the office for a week, working on my Mac, so it's
not holding me up. I can ssh in, to continue testing if that helps.... so,
maybe I can get it sorted this week.
Matt
On 18 Sep 2011, at 14:19, Sascha Zelzer wrote:
Hi Matt,
I have not encountered that problem yet. Which CentOS version are you using? I
could set-up a VM and try to compile it myself.
As Miklos suggested, you could try to add "-fPIC" to the compiler flags as a
temporary workaround. Add it to the ADDITIONAL_CXX_FLAGS variable of the
MITK-build/ CMake cache.
Thanks,
Sascha
On 09/14/2011 06:23 PM, Clarkson, Matt wrote:
Hi there,
on my Centos machine, I have started to get the following error when compiling
MITK
CMakeFiles/QmitkExt.dir/QmitkModuleTableModel.cpp.o: relocation R_X86_64_PC32
against `mitk::GetModuleContext()' can not be used when making a shared object;
recompile with -fPIC
I have not yet seen this on my Mac.
I also tried downloading the a brand new MITK-Project-Template, and doing a
clean fresh rebuild, and that produces the same error.
I also tried putting the -fPIC flag in there, and I still seem to get the same
error, unless of course, it is needed on a dependent library.
Is anyone else getting this? Is it just Centos? Or is it just me?
I'm happy to keep investigating if necessary... but I do need it fixing.. so
happy if someone can confirm whether its a widespread issue, or something silly
I have done.
Thanks as always.
Matt
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users