Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF5 and itkHDF5 #113

Open
tom-albrecht opened this issue Oct 3, 2014 · 6 comments
Open

HDF5 and itkHDF5 #113

tom-albrecht opened this issue Oct 3, 2014 · 6 comments

Comments

@tom-albrecht
Copy link
Contributor

Hi guys,

boost now compiles, but now I have a new HDF5 related problem. I am using my own ITK version, and it finds all the HDF5 symbols as already defined in ithhdf5.
I am currently trying to compile with USE_SYSTEM_ITK OFF, but that can hardly be the solution considering the time and space it needs to compile itk.
I hope we can solve this one, too.

Tom

5> 3>------ Build started: Project: itkBuildDeformationModel, Configuration: Release x64 ------
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: char const * __cdecl H5::Exception::getCDetailMsg(void)const " (?getCDetailMsg@Exception@H5@@QEBAPEBDXZ) already defined in itkhdf5_cpp-4.2.lib(H5Exception.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: __cdecl H5::DataSpace::DataSpace(enum H5S_class_t)" (??0DataSpace@H5@@qeaa@W4H5S_class_t@@@z) already defined in itkhdf5_cpp-4.2.lib(H5DataSpace.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: __cdecl H5::DataSpace::DataSpace(int,unsigned __int64 const *,unsigned __int64 const *)" (??0DataSpace@H5@@qeaa@HPEB_K0@Z) already defined in itkhdf5_cpp-4.2.lib(H5DataSpace.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: int __cdecl H5::DataSpace::getSimpleExtentDims(unsigned __int64 *,unsigned __int64 *)const " (?getSimpleExtentDims@DataSpace@H5@@QEBAHPEA_K0@Z) already defined in itkhdf5_cpp-4.2.lib(H5DataSpace.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual __cdecl H5::DataSpace::~DataSpace(void)" (??1DataSpace@H5@@UEAA@XZ) already defined in itkhdf5_cpp-4.2.lib(H5DataSpace.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class H5::StrType __cdecl H5::AbstractDs::getStrType(void)const " (?getStrType@AbstractDs@H5@@qeba?AVStrType@2@XZ) already defined in itkhdf5_cpp-4.2.lib(H5AbstractDs.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class H5::Group __cdecl H5::CommonFG::createGroup(char const *,unsigned __int64)const " (?createGroup@CommonFG@H5@@qeba?AVGroup@2@PEBD_K@Z) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class H5::Group __cdecl H5::CommonFG::openGroup(char const *)const " (?openGroup@CommonFG@H5@@qeba?AVGroup@2@PEBD@Z) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class H5::DataSet __cdecl H5::CommonFG::createDataSet(char const *,class H5::DataType const &,class H5::DataSpace const &,class H5::DSetCreatPropList const &)const " (?createDataSet@CommonFG@H5@@qeba?AVDataSet@2@PEBDAEBVDataType@2@AEBVDataSpace@2@AEBVDSetCreatPropList@2@@z) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class H5::DataSet __cdecl H5::CommonFG::openDataSet(char const *)const " (?openDataSet@CommonFG@H5@@qeba?AVDataSet@2@PEBD@Z) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: unsigned __int64 __cdecl H5::CommonFG::getNumObjs(void)const " (?getNumObjs@CommonFG@H5@@QEBA_KXZ) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl H5::CommonFG::getObjnameByIdx(unsigned __int64)const " (?getObjnameByIdx@CommonFG@H5@@qeba?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_K@Z) already defined in itkhdf5_cpp-4.2.lib(H5CommonFG.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: __cdecl H5::StrType::StrType(class H5::PredType const &,unsigned __int64 const &)" (??0StrType@H5@@qeaa@AEBVPredType@1@AEB_K@Z) already defined in itkhdf5_cpp-4.2.lib(H5StrType.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual __cdecl H5::StrType::~StrType(void)" (??1StrType@H5@@UEAA@XZ) already defined in itkhdf5_cpp-4.2.lib(H5StrType.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual class H5::DataSpace __cdecl H5::DataSet::getSpace(void)const " (?getSpace@DataSet@H5@@ueba?AVDataSpace@2@XZ) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: void __cdecl H5::DataSet::read(void *,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (?read@DataSet@H5@@QEBAXPEAXAEBVDataType@2@AEBVDataSpace@2@2AEBVDSetMemXferPropList@2@@z) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: void __cdecl H5::DataSet::read(class std::basic_string<char,struct std::char_traits,class std::allocator > &,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (?read@DataSet@H5@@QEBAXAEAV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@AEBVDataType@2@AEBVDataSpace@2@2AEBVDSetMemXferPropList@2@@z) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: void __cdecl H5::DataSet::write(void const *,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (?write@DataSet@H5@@QEBAXPEBXAEBVDataType@2@AEBVDataSpace@2@2AEBVDSetMemXferPropList@2@@z) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: void __cdecl H5::DataSet::write(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (?write@DataSet@H5@@QEBAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@AEBVDataType@2@AEBVDataSpace@2@2AEBVDSetMemXferPropList@2@@z) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual __cdecl H5::DataSet::~DataSet(void)" (??1DataSet@H5@@UEAA@XZ) already defined in itkhdf5_cpp-4.2.lib(H5DataSet.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual void __cdecl H5::Group::close(void)" (?close@Group@H5@@UEAAXXZ) already defined in itkhdf5_cpp-4.2.lib(H5Group.obj)
5>
5>2>hdf5_cpp.lib(hdf5_cpp.dll) : error LNK2005: "public: virtual __cdecl H5::Group::~Group(void)" (??1Group@H5@@UEAA@XZ) already defined in itkhdf5_cpp-4.2.lib(H5Group.obj)

@marcelluethi
Copy link
Member

This is the same issue as #82, for which I don't have an idea how to fix it at the moment.

The problem is, that the ITK version you are using is compiled with a different version of HDF5. As it is not in our control, which ITK version you are using, providing a solution from within statismo is very complicated. As I understand it, this is the kind of problem a superbuild should solve.

If you would like to use an external ITK, you can choose to also use an external HDF5 (where the same HDF5 version is used as the one in ITK), or to compile your external ITK with the HDF5 Version used with Statismo (by setting the USE_EXTERNAL_HDF5 option in ITK).

@tom-albrecht
Copy link
Contributor Author

OK. That makes a lot of sense. Can I also set USE_SYSTEM_HDF5 in the statismo superbuild and point it to ITK's version?

@arnaudgelas
Copy link
Contributor

I don't think it is possible (not 100% sure). Try sending one email on ITK's mailing list, someone may have a solution or can confirm/infirm...

@tom-albrecht
Copy link
Contributor Author

I tried it out, doesn’t work. Cannot find H5Cpp.h.

Of course it would be possible to locate it for the case of using itkHDF5, but that would complicate things too much.

From: Arnaud Gelas [mailto:notifications@github.com]
Sent: Freitag, 3. Oktober 2014 14:20
To: statismo/statismo
Cc: tom-albrecht
Subject: Re: [statismo] HDF5 and itkHDF5 (#113)

I don't think it is possible (not 100% sure). Try sending one email on ITK's mailing list, someone may have a solution or can confirm/infirm...


Reply to this email directly or view it on GitHub #113 (comment) . https://github.com/notifications/beacon/4539251__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNzk1Nzk5NiwiZGF0YSI6eyJpZCI6NDQ2Nzg2OTB9fQ==--2587f6f18450fd8d524c53b5d6a72d624bbe900b.gif

@qianshuqinghan
Copy link

is there anyone who can solve this issue?
I encontour it too, and I have no idea how to handle it

@muefra
Copy link

muefra commented Jun 19, 2015

I assume you use your own ITK version and not the one that comes with the superbuild. (Is that assumption right?)

If that's the case, then try adding the following option when running cmake (for ITK): -DITK_USE_SYSTEM_HDF5:BOOL=ON

Then recompile ITK and it should work. (This of course necessitates that you have hdf5 installed)

example (for linux or mac):

  • cmake -DCMAKE_BUILD_TYPE:STRING=Release -DITK_USE_SYSTEM_HDF5:BOOL=ON /path/to/the/itk/dir
  • make -j $(nproc)
  • make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants