Linking problems (windows)

769 views
Skip to first unread message

Sergio Vera

unread,
Jan 27, 2014, 4:26:40 AM1/27/14
to statism...@googlegroups.com
Dear Statismo users,

I'm experiencing some problems when linking against statismo (both with statismo examples and my own application)

My application runs on

Windows 7 (emulated via VMWare Player)
Boost 1.55 (compiled from source)
Qt 4.8.3
CTK (git cloned)
VTK (this version is downloaded by the CTK superbuild and it's a 5.10)
Statismo (git Cloned)

As far as I can tell my CMake Script has all the required instructions to include statismo in the application:

FIND_PACKAGE(STATISMO REQUIRED)
INCLUDE_DIRECTORIES(${STATISMO_INCLUDE_DIRS})
...
INCLUDE_DIRECTORIES( ${STATISMO_INCLUDE_DIRS})
link_directories(${STATISMO_LIBRARY_DIR} )
SET(PROJECTS_LIBRARIES ${Boost_LIBRARIES} ${TinyXml2_LIBRARIES} ${CTK_LIBRARIES} ${VTK_LIBRARIES} QVTK ${STATISMO_LIBRARIES})c
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${PROJECTS_LIBRARIES})


I compiled statismo successfully (without the examples) and when using it to load a SSM and generate some Samples with vtk representer, 45 unresolved externals appear.
I compiled statismo with examples to see if I was making some mistake but the same unresolved symbols appear for the vtk examples (well, BasicStatismoTest and PosteriorModelBuilderTest work, but the others complain about unresolved externals)

I contacted with Marcel and he kindly pointed me to the statismo superbuild that Arnaud Gelas is developing, but basically the same happens (this time not a single vtk Example works). My app is not linking either. He also suggested that my vtk can be redefining hdf5 symbol
I've also noticed that the ITK examples of statismo both fail to compile in vanilla statismo and statismo-superbuild.. apparently some boost symbols are redefined multiple times, but my app does only need the vtk representer.

Any further guidance will be much appreciated. Thanks

PS: This is the kind of errors that I get when I try to compile something statismo related with VTK

1>Scene.obj : error LNK2019: unresolved external symbol __imp__vtk__H5check_version referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall H5::Exception::getCDetailMsg(void)const " (__imp_?getCDetailMsg@Exception@H5@@QBEPBDXZ) referenced in function __catch$?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z$0
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::IdComponent & __thiscall H5::IdComponent::operator=(class H5::IdComponent const &)" (__imp_??4IdComponent@H5@@QAEAAV01@ABV01@@Z) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::DataSpace::DataSpace(enum H5S_class_t)" (__imp_??0DataSpace@H5@@QAE@W4H5S_class_t@@@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeString(class H5::CommonFG const &,char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeString@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::DataSpace::DataSpace(int,unsigned __int64 const *,unsigned __int64 const *)" (__imp_??0DataSpace@H5@@QAE@HPB_K0@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::readMatrix(class H5::CommonFG const &,char const *,unsigned int,class Eigen::Matrix<float,-1,-1,1,-1,-1> &)" (?readMatrix@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDIAAV?$Matrix@M$0?0$0?0$00$0?0$0?0@Eigen@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall H5::DataSpace::getSimpleExtentDims(unsigned __int64 *,unsigned __int64 *)const " (__imp_?getSimpleExtentDims@DataSpace@H5@@QBEHPA_K0@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::DataSpace::selectHyperslab(enum H5S_seloper_t,unsigned __int64 const *,unsigned __int64 const *,unsigned __int64 const *,unsigned __int64 const *)const " (__imp_?selectHyperslab@DataSpace@H5@@QBEXW4H5S_seloper_t@@PB_K111@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::readMatrix(class H5::CommonFG const &,char const *,unsigned int,class Eigen::Matrix<float,-1,-1,1,-1,-1> &)" (?readMatrix@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDIAAV?$Matrix@M$0?0$0?0$00$0?0$0?0@Eigen@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::DataSpace::~DataSpace(void)" (__imp_??1DataSpace@H5@@UAE@XZ) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::Attribute __thiscall H5::H5Object::openAttribute(char const *)const " (__imp_?openAttribute@H5Object@H5@@QBE?AVAttribute@2@PBD@Z) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readStringAttribute(class H5::Group const &,char const *)" (?readStringAttribute@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVGroup@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::StrType __thiscall H5::AbstractDs::getStrType(void)const " (__imp_?getStrType@AbstractDs@H5@@QBE?AVStrType@2@XZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readString(class H5::CommonFG const &,char const *)" (?readString@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::Attribute::read(class H5::DataType const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)const " (__imp_?read@Attribute@H5@@QBEXABVDataType@2@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readStringAttribute(class H5::Group const &,char const *)" (?readStringAttribute@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVGroup@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::Attribute::~Attribute(void)" (__imp_??1Attribute@H5@@UAE@XZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readStringAttribute(class H5::Group const &,char const *)" (?readStringAttribute@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVGroup@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::Group __thiscall H5::CommonFG::createGroup(char const *,unsigned int)const " (__imp_?createGroup@CommonFG@H5@@QBE?AVGroup@2@PBDI@Z) referenced in function "public: virtual void __thiscall statismo::BuilderInfo::Save(class H5::CommonFG const &)const " (?Save@BuilderInfo@statismo@@UBEXABVCommonFG@H5@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::Group __thiscall H5::CommonFG::openGroup(char const *)const " (__imp_?openGroup@CommonFG@H5@@QBE?AVGroup@2@PBD@Z) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::DataSet __thiscall H5::CommonFG::createDataSet(char const *,class H5::DataType const &,class H5::DataSpace const &,class H5::DSetCreatPropList const &)const " (__imp_?createDataSet@CommonFG@H5@@QBE?AVDataSet@2@PBDABVDataType@2@ABVDataSpace@2@ABVDSetCreatPropList@2@@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeMatrix(class H5::CommonFG const &,char const *,class Eigen::Matrix<float,-1,-1,1,-1,-1> const &)" (?writeMatrix@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$Matrix@M$0?0$0?0$00$0?0$0?0@Eigen@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class H5::DataSet __thiscall H5::CommonFG::openDataSet(char const *)const " (__imp_?openDataSet@CommonFG@H5@@QBE?AVDataSet@2@PBD@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __thiscall H5::CommonFG::getNumObjs(void)const " (__imp_?getNumObjs@CommonFG@H5@@QBE_KXZ) referenced in function "private: static void __cdecl statismo::BuilderInfo::FillKeyValueListFromInfoGroup(class H5::CommonFG const &,class std::list<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > &)" (?FillKeyValueListFromInfoGroup@BuilderInfo@statismo@@CAXABVCommonFG@H5@@AAV?$list@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@V?$allocator@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall H5::CommonFG::getObjnameByIdx(unsigned __int64)const " (__imp_?getObjnameByIdx@CommonFG@H5@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_K@Z) referenced in function "private: static void __cdecl statismo::BuilderInfo::FillKeyValueListFromInfoGroup(class H5::CommonFG const &,class std::list<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > &)" (?FillKeyValueListFromInfoGroup@BuilderInfo@statismo@@CAXABVCommonFG@H5@@AAV?$list@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@V?$allocator@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::IntType::IntType(class H5::PredType const &)" (__imp_??0IntType@H5@@QAE@ABVPredType@1@@Z) referenced in function "public: static int __cdecl statismo::HDF5Utils::readInt(class H5::CommonFG const &,char const *)" (?readInt@HDF5Utils@statismo@@SAHABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::IntType::IntType(class H5::PredType const &)" (__imp_??0IntType@H5@@QAE@ABVPredType@1@@Z) referenced in function "public: static int __cdecl statismo::HDF5Utils::readInt(class H5::CommonFG const &,char const *)" (?readInt@HDF5Utils@statismo@@SAHABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::IntType::~IntType(void)" (__imp_??1IntType@H5@@UAE@XZ) referenced in function "public: static int __cdecl statismo::HDF5Utils::readInt(class H5::CommonFG const &,char const *)" (?readInt@HDF5Utils@statismo@@SAHABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::FloatType::FloatType(class H5::PredType const &)" (__imp_??0FloatType@H5@@QAE@ABVPredType@1@@Z) referenced in function "public: static float __cdecl statismo::HDF5Utils::readFloat(class H5::CommonFG const &,char const *)" (?readFloat@HDF5Utils@statismo@@SAMABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::FloatType::~FloatType(void)" (__imp_??1FloatType@H5@@UAE@XZ) referenced in function "public: static float __cdecl statismo::HDF5Utils::readFloat(class H5::CommonFG const &,char const *)" (?readFloat@HDF5Utils@statismo@@SAMABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::StrType::StrType(class H5::PredType const &,unsigned int const &)" (__imp_??0StrType@H5@@QAE@ABVPredType@1@ABI@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeString(class H5::CommonFG const &,char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeString@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::StrType::~StrType(void)" (__imp_??1StrType@H5@@UAE@XZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readString(class H5::CommonFG const &,char const *)" (?readString@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class H5::DataSpace __thiscall H5::DataSet::getSpace(void)const " (__imp_?getSpace@DataSet@H5@@UBE?AVDataSpace@2@XZ) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::DataSet::read(void *,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (__imp_?read@DataSet@H5@@QBEXPAXABVDataType@2@ABVDataSpace@2@2ABVDSetMemXferPropList@2@@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::DataSet::read(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (__imp_?read@DataSet@H5@@QBEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVDataType@2@ABVDataSpace@2@2ABVDSetMemXferPropList@2@@Z) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl statismo::HDF5Utils::readString(class H5::CommonFG const &,char const *)" (?readString@HDF5Utils@statismo@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::DataSet::write(void const *,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (__imp_?write@DataSet@H5@@QBEXPBXABVDataType@2@ABVDataSpace@2@2ABVDSetMemXferPropList@2@@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeMatrix(class H5::CommonFG const &,char const *,class Eigen::Matrix<float,-1,-1,1,-1,-1> const &)" (?writeMatrix@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$Matrix@M$0?0$0?0$00$0?0$0?0@Eigen@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall H5::DataSet::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class H5::DataType const &,class H5::DataSpace const &,class H5::DataSpace const &,class H5::DSetMemXferPropList const &)const " (__imp_?write@DataSet@H5@@QBEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVDataType@2@ABVDataSpace@2@2ABVDSetMemXferPropList@2@@Z) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeString(class H5::CommonFG const &,char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeString@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::DataSet::~DataSet(void)" (__imp_??1DataSet@H5@@UAE@XZ) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall H5::Group::close(void)" (__imp_?close@Group@H5@@UAEXXZ) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::Group::~Group(void)" (__imp_??1Group@H5@@UAE@XZ) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::H5File::H5File(char const *,unsigned int,class H5::FileCreatPropList const &,class H5::FileAccPropList const &)" (__imp_??0H5File@H5@@QAE@PBDIABVFileCreatPropList@1@ABVFileAccPropList@1@@Z) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall H5::H5File::close(void)" (__imp_?close@H5File@H5@@UAEXXZ) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall H5::H5File::H5File(void)" (__imp_??0H5File@H5@@QAE@XZ) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall H5::H5File::~H5File(void)" (__imp_??1H5File@H5@@UAE@XZ) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::DataSpace const H5::DataSpace::ALL" (__imp_?ALL@DataSpace@H5@@2V12@B) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::DSetCreatPropList const H5::DSetCreatPropList::DEFAULT" (__imp_?DEFAULT@DSetCreatPropList@H5@@2V12@B) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeMatrix(class H5::CommonFG const &,char const *,class Eigen::Matrix<float,-1,-1,1,-1,-1> const &)" (?writeMatrix@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$Matrix@M$0?0$0?0$00$0?0$0?0@Eigen@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::DSetMemXferPropList const H5::DSetMemXferPropList::DEFAULT" (__imp_?DEFAULT@DSetMemXferPropList@H5@@2V12@B) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::FileAccPropList const H5::FileAccPropList::DEFAULT" (__imp_?DEFAULT@FileAccPropList@H5@@2V12@B) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::FileCreatPropList const H5::FileCreatPropList::DEFAULT" (__imp_?DEFAULT@FileCreatPropList@H5@@2V12@B) referenced in function "public: static class statismo::StatisticalModel<class vtkPolyDataRepresenter> * __cdecl statismo::StatisticalModel<class vtkPolyDataRepresenter>::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?Load@?$StatisticalModel@VvtkPolyDataRepresenter@@@statismo@@SAPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::PredType const H5::PredType::C_S1" (__imp_?C_S1@PredType@H5@@2V12@B) referenced in function "public: static void __cdecl statismo::HDF5Utils::writeString(class H5::CommonFG const &,char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?writeString@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::PredType const H5::PredType::NATIVE_CHAR" (__imp_?NATIVE_CHAR@PredType@H5@@2V12@B) referenced in function "public: static void __cdecl statismo::HDF5Utils::getFileFromHDF5(class H5::CommonFG const &,char const *,char const *)" (?getFileFromHDF5@HDF5Utils@statismo@@SAXABVCommonFG@H5@@PBD1@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::PredType const H5::PredType::NATIVE_FLOAT" (__imp_?NATIVE_FLOAT@PredType@H5@@2V12@B) referenced in function "public: static float __cdecl statismo::HDF5Utils::readFloat(class H5::CommonFG const &,char const *)" (?readFloat@HDF5Utils@statismo@@SAMABVCommonFG@H5@@PBD@Z)
1>Scene.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class H5::PredType const H5::PredType::NATIVE_INT32" (__imp_?NATIVE_INT32@PredType@H5@@2V12@B) referenced in function "public: static int __cdecl statismo::HDF5Utils::readInt(class H5::CommonFG const &,char const *)" (?readInt@HDF5Utils@statismo@@SAHABVCommonFG@H5@@PBD@Z)
1>C:\work\bin\hear-eu-planner\Release\HiResViewer\CoreApp\Release\CoreApp.exe : fatal error LNK1120: 45 unresolved externals
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Arnaud Gelas

unread,
Jan 27, 2014, 4:49:18 AM1/27/14
to Sergio Vera, statism...@googlegroups.com
Hi Sergio,

You've mentioned you tried the superbuild I have been working on (I have been looking for some more feedbacks, especially on windows)...
Could you please report what's the outcome if you build statismo alone with the superbuild, please?
And when you try linking to some basic example out of the source tree, please?

There are still issues to be fixed in the superbuild (for sure), it would be great if you can give some help on the windows side and push forward this effort!!

---

When using the superbuild, it will download and build Boost 1.54, VTK 6.0, HDF5 1.8.12, ITK 4.5; there may be some issues with the version you use in your project?

Best,
Arnaud

--
You received this message because you are subscribed to the Google Groups "statismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to statismo-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sergio Vera

unread,
Jan 27, 2014, 8:18:47 AM1/27/14
to statism...@googlegroups.com, arnau...@gmail.com

Hello Arnaud,

I've tried to compile the superbuild from the correct branch, as you suggested.

There are some problems when compiling ITK and boost

ITK: ITKIOMesh-all and ITKIOXML-all fail because some H5 header cannot be found.

boost: It fails when a patch is applied, and after CMake seems unable to find boost
I have my own boost 1.55 installed and my BOOST_ROOT variable is set to the directory where my boost is located.


these are the errors:

6>  16>------ Build started: Project: ITKIOMesh-all, Configuration: Release Win32 ------
6>  
6>C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory
6>  
6>C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory
 
6>  31>------ Build started: Project: ITKIOXML-all, Configuration: Release Win32 ------
6>  
6>C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory
6>  
6>  6>  Generating Code...
 
-- extracting... [clean up]
4>  -- extracting... done
4>  No update step for 'boost'
4>  Performing patch step for 'boost'
4>  "sh" no se reconoce como un comando interno o externo,
4>  programa o archivo por lotes ejecutable.
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 9009.
7>------ Build started: Project: Statismo, Configuration: Release Win32 ------
7>  Building Custom Rule C:/work/src/statismosbuild/statismo/3rdParty/CMakeLists.txt
7>  CMake does not need to re-run because C:\work\bin\statismosbuild\W32R\CMakeFiles\generate.stamp is up-to-date.
7>  Creating directories for 'Statismo'
7>  No download step for 'Statismo'
7>  No update step for 'Statismo'
7>  No patch step for 'Statismo'
7>  Performing configure step for 'Statismo'
7>  CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:732 (file):
7>    file STRINGS file
7>    "C:/work/bin/statismosbuild/W32R/3rdParty/include/boost/version.hpp" cannot
7>    be read.
7>  Call Stack (most recent call first):
7>    CMakeLists.txt:26 (find_package)
7>  
7>  
7>  CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:746 (math):
7>    math cannot parse the expression: " / 100000": syntax error, unexpected
7>    exp_DIVIDE, expecting exp_OPENPARENT or exp_NUMBER (2)
7>  Call Stack (most recent call first):
7>    CMakeLists.txt:26 (find_package)
7>  
7>  
7>  CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:747 (math):
7>    math cannot parse the expression: " / 100 % 1000": syntax error, unexpected
7>    exp_DIVIDE, expecting exp_OPENPARENT or exp_NUMBER (2)
7>  Call Stack (most recent call first):
7>    CMakeLists.txt:26 (find_package)
7>  
7>  
7>  CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:748 (math):
7>    math cannot parse the expression: " % 100": syntax error, unexpected
7>    exp_MOD, expecting exp_OPENPARENT or exp_NUMBER (2)
7>  Call Stack (most recent call first):
7>    CMakeLists.txt:26 (find_package)
7>  
7>  
7>  -- Boost version: ..
7>  -- Configuring incomplete, errors occurred!
7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 1.
8>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
8>  Build all projects
========== Build: 5 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

Arnaud Gelas

unread,
Jan 27, 2014, 9:12:25 AM1/27/14
to Sergio Vera, statism...@googlegroups.com
Hi Sergio,

Can you send me the commit hash, you've tried on this branch, please?
It seems to me that you have been using the branch just before I've pushed this morning (there was a bug about the patching of boost).

I don't have any windows machine, so I can't really test on windows… In the process, hdf5 gets downloaded, compiled and installed, can you given me the path of the installation, please?

---

As of now, the superbuild downloads the dependencies even if you have hdf5, vtk, itk installed. Later on, I will be working on providing the ability for the users to set his own path for these libraries if already present on the machine.
Unfortunately, I don't have much time for that now; but I can definitively provide some guidance/tips to whoever wants to work on it, now...

Best
Arnaud

Patrik Huber

unread,
Jan 27, 2014, 9:30:04 AM1/27/14
to Sergio Vera, statism...@googlegroups.com
Dear Sergio,

I'm on windows as well, and I noticed that actually setting the BOOST_ROOT variable in CMake has no effect whatsoever!
Instead, the boost library/DLL directory of your own boost needs to be in the windows PATH env variable. Then, CMake is able to find it correctly, at least that works on all my windows systems.

Regards,

Patrik


Sergio Vera

unread,
Jan 27, 2014, 11:48:02 AM1/27/14
to statism...@googlegroups.com
Hi Arnaud,

Yes indeed, I did a git pull and I got the last version, that patches boost correctly

vtk compiles ok (
hdf5 compiles ok. It seems that headers are copied in ${CMAKE_BUILD_DIRECTORY}/3rdParty/include and libraries are installed on ${CMAKE_BUILD_DIRECTORY}/3rdParty/lib

ITK fails to compile in a couple of projects

Statismo itself seems to fail due to a mixing of Release/debug versions and boost redefinitions


Thanks


El lunes, 27 de enero de 2014 10:26:40 UTC+1, Sergio Vera escribió:

Livia Barazzetti

unread,
Jan 28, 2014, 5:59:58 AM1/28/14
to statism...@googlegroups.com

Hi Sergio,
which compiler are you using? I got weird linking problem with Boost (and ITK examples not working) when trying to build Statismo with Visual Studio 2012 (maybe related to C+11? )
In another computer I had Visual Studio 2010 and a functioning Statismo installation, so I copied that configuration:
installed VS2010 (with SP1), and succesfully built Statismo with examples (for precision sake, I built ITK4.4.2, VTK5.10.1). The build directory is inside Statismo source tree.
I remember that in other cases I had to build Statismo in Release mode to get the HDF5 compilation working, and after that also building in Debug mode would succeed.
To avoid VTK to redefine HDF5 symbol, in the VTK examples I modified  CMakeLists.txt such that VTK is included last:

SET(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
include_directories(BEFORE ${STATISMO_ROOT_DIR}  ${STATISMO_ROOT_DIR}/3rdParty  ${STATISMO_INCLUDE_DIR}
                      ${STATISMO_ROOT_DIR}/Representers/VTK
                    ${HDF5_INCLUDE_DIR} ${HDF5_INCLUDE_DIR_CPP})                   
include_directories(AFTER ${VTK_INCLUDE_DIR})
link_directories(${STATISMO_LIBRARY_DIR} ${VTK_LIBRARY_DIR} ${HDF5_LIBRARY_DIR})
 
 Hope that helps,
Best
Livia

Arnaud Gelas

unread,
Jan 28, 2014, 6:10:42 AM1/28/14
to Sergio Vera, statism...@googlegroups.com
Hi Sergio,

 hmmm…
This is interesting to know that ITK is failing on windows with an installed version of HDF5…

Could you report which ITK sub-projects are failing and the errors please?

I'll try to set up a windows VM with msvc 2012.

Thanks
Arnaud


Sergio Vera

unread,
Jan 28, 2014, 7:25:28 AM1/28/14
to Arnaud Gelas, statism...@googlegroups.com
Livia,

yes I'm using vs2012... I'll try another VS compiler later on.. Also I'll try your CMAKE commands. Thanks.

Arnaud:
These are the ITK errors

------ Build started: Project: ITKIOTransformHDF5, Configuration: Release Win32 ------
  
    itkHDF5TransformIO.cxx
  
C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory
  
    itkHDF5TransformIOFactory.cxx
  
C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory
  
    Generating Code...
  
  ------ Build started: Project: ITKIOHDF5, Configuration: Release Win32 ------
  
    itkHDF5ImageIO.cxx
  
C:/work/bin/statismosbuild/W32R/ITK-build/Modules/ThirdParty/HDF5/src\itk_H5Cpp.h(25): fatal error C1083: Cannot open include file: 'H5Cpp.h': No such file or directory


Regards

Sergio Vera

unread,
Jan 30, 2014, 5:09:21 AM1/30/14
to Livia Barazzetti, statism...@googlegroups.com
Livia,

you are right!
I've managed to compile successfully the "vanilla" statismo both in VS2010 and VS 2012 using your include_directories trick with the vtk examples.
Sadly, I cannot get the same effect on my own application, it stills complaints linking or with tons of errors if I try to do the same. However, at least I can implement part of the functionality as an external executable.

Thanks


--
You received this message because you are subscribed to a topic in the Google Groups "statismo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/statismo-users/v22GHA3bDUQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to statismo-user...@googlegroups.com.

Thomas Albrecht

unread,
Feb 14, 2014, 6:35:36 AM2/14/14
to statism...@googlegroups.com

Hi everybody,

 

I have some feedback on the SuperBuild under Windows.

 

·         First of all, in the ThirdParty/CMakeLists.txt the cmake variables for major/minor version are misspelled. It should be VERSION_MAJOR, not MAJOR_VERSION. The same with minor of course.

 

·         Then, there is a Windows specific problem: CMake tries to find the HDF5 library files that were compiled from the automatically downloaded version. I think this comes from the main CMakeLists.txt of statismo. For some reason, it tries to find a Debug version, which is not available in a Release build. This is Windows specific,  because the Debug Library has a different name with a “_D” in it.

 

·         Somehow linked to the previous problem, although the super build installs HDF5 into the 3rdParty/lib and /include directories, CMake always finds the build directory HDF5_build as the ${HDF5_DIR}. This causes further problems, e.g. it looks for the above-mentioned libraries in the folder HDF5_build/bin/Debug/. This however does not exist. I tried setting the install directory in the CMake files, but it gets overwritten.

 

·         If there is a pre-existing ITK Version with HDF5 compiled, it clashes with the HDF5 from the SuperBuild.

 

·         There is a clash between boost and Microsoft Visual Studio 2012 regarding multiple declarations of TR1 functionality resulting in errors like:
statismo-SuperBuild\3rdParty\include\boost/tr1/functional.hpp(31): error C2874: using-declaration causes a multiple declaration of 'boost::reference_wrapper'

 

 

I tried to fix some of these problems. Of course the renaming into VERSION_MAJOR was really easy. But all in all, I could not get the SuperBuild to work. For now, I will try to install statismo with all the 3rd Party libraries installed manually, but if anyone knows how to deal with these issues, we can try to work on a solution together.

 

Cheers

 

Thomas Albrecht

--

You received this message because you are subscribed to the Google Groups "statismo" group.

To unsubscribe from this group and stop receiving emails from it, send an email to statismo-user...@googlegroups.com.

Arnaud Gelas

unread,
Feb 17, 2014, 7:36:39 AM2/17/14
to Thomas Albrecht, statism...@googlegroups.com
Hi Thomas,

Thanks for the feedback!

Can you provide the commit's hash you have tested, please?

(1) About the misspell version thing, can you provide the line, please?

(2) All subprojects should be compiled with the same CMAKE_BUILD_TYPE:
release and/or debug. Have you compiled everything in debug and/or
release?

(3) HDF5_DIR is ${CMAKE_BINARY_DIR}/3rdParty/share/cmake/hdf5/; so it
should looks for libraries in HDF5_build/bin/Debug, or it'd miss cmake
config files there are wrong...
https://github.com/arnaudgelas/statismo/blob/BuildSystem/3rdParty/External-HDF5.cmake#L28

(4) is the previous installation found and used during the superbuild?
Can you provide a bit more detail, please?

Thanks again for you precious feedback!

Cheers
Arnaud

Thomas Albrecht

unread,
Feb 17, 2014, 9:14:13 AM2/17/14
to Arnaud Gelas, statism...@googlegroups.com
Hi Arnaud,


Thanks for the feedback!

Can you provide the commit's hash you have tested, please?

I'm afraid I can't. I used github's feature "Download as .zip file." Sorry
for this beginner's mistake.

(1) About the misspell version thing, can you provide the line, please?

Every occurrence of _MINOR_VERSION in 3rdParty/CMakeLists.txt needs to be
changed into _VERSTION_MINOR. The same with MAJOR.
I think it is easiest to just do a Find/Replace in that file.

(2) All subprojects should be compiled with the same CMAKE_BUILD_TYPE:
release and/or debug. Have you compiled everything in debug and/or release?

Yes, everything was built in Release mode. In Windows, you don't specifiy
this in CMake, but in Visual Studio. I chose "Release" there, and all
subprojects were built in Release mode.
However, then CMake, not Visual Studio, tries to find the actual library
files for HDF5. It finds out correctly were the files should be, but it
lists the Debug versions, which were not built.
This could be in the main CMakeLists.txt file, probably after line 34, and
could be some kind of workaround that was introduced in the countless tries
to get HDF5 to work, like for instance to get it to work with VTK's HDF5,
which renames the libraries.
Anyway, there are now many different commands in 3 files:
/CMakeLists.txt
/3rdParty/CMakeLists.txt
/3rdParty/External-HDF5.cmake
in which we try to find and/or install HDF5, and I have lost any kind of
overview how and where things go wrong.

(3) HDF5_DIR is ${CMAKE_BINARY_DIR}/3rdParty/share/cmake/hdf5/; so it should
looks for libraries in HDF5_build/bin/Debug, or it'd miss cmake config files
there are wrong...

https://github.com/arnaudgelas/statismo/blob/BuildSystem/3rdParty/External-H
DF5.cmake#L28

Yes, I saw that. However it was never installed in that folder, but in the
folder without the "share". I removed the "share" in that file but that did
not help the actual problem.
Typically, there are always (at least) two directories that can be specified
when FIND_PACKAGE is called: The build and the install directory. When the
build directory is chose, the libraries are in build_directory/bin/Release/,

when the install directory is chosen, they are in install_directory/lib/ .
Now, even if the install_directory is chosen on the first run of CMake, it
automatically chooses the build_directory on subsequent runs, and then tries
to find the libraries in build_directory/bin/Debug/, even though they are in
build_directory/bin/Release/. I first thought I only need to force the use
of the install_directory, which would be possible with the little trick that
Patrick Huber gave in his last mail, but even that would not work, because
the debug libraries in Windows always have a "_D" at the end of the file
name, and CMake looks for those files.

(4) is the previous installation found and used during the superbuild?
Can you provide a bit more detail, please?

Yes, all the old installations of ITK, HDF5 and statismo were automatically
found and the superbuild did not work at all. Especially the conflict of
ITK's HDF5 and the superbuild seemed really hard to solve.

But then I deleted everything and started a fresh superbuild and it produced
the problems I described above. I guess the problem is that some of the many
HDF5-related CMake commands are conflicting.


Thanks again for you precious feedback!

Thank you for working on the superbuild. Let me know if you have any more
questions.

Arnaud Gelas

unread,
Feb 17, 2014, 10:40:02 AM2/17/14
to Thomas Albrecht, statism...@googlegroups.com
Hi Thomas,

On Feb 17, 2014, at 3:14 PM, "Thomas Albrecht" <tom.al...@gmx.de> wrote:

Hi Arnaud,


Thanks for the feedback!

Can you provide the commit's hash you have tested, please?

I'm afraid I can't. I used github's feature "Download as .zip file." Sorry
for this beginner's mistake.

(1) About the misspell version thing, can you provide the line, please?

Every occurrence of _MINOR_VERSION in 3rdParty/CMakeLists.txt needs to be
changed into _VERSTION_MINOR. The same with MAJOR.
I think it is easiest to just do a Find/Replace in that file.

Can you explain why make such as change, please?

If you have a look at FindVTK.cmake, you'll see VTK_MAJOR_VERSION and VTK_MINOR_VERSION are defined, same for ITK and Boost…




(2) All subprojects should be compiled with the same CMAKE_BUILD_TYPE:
release and/or debug. Have you compiled everything in debug and/or release?

Yes, everything was built in Release mode. In Windows, you don't specifiy
this in CMake, but in Visual Studio. I chose "Release" there, and all
subprojects were built in Release mode.
However, then CMake, not Visual Studio, tries to find the actual library
files for HDF5. It finds out correctly were the files should be, but it
lists the Debug versions, which were not built.
This could be in the main CMakeLists.txt file, probably after line 34,

Can you paste the line, please? cause for me line 34 does not make any sense...

Here is what I have
 34 set( HDF5_LIBRARY_DIR )
 35 foreach( _library ${HDF5_LIBRARIES} )
 36   get_filename_component( _tempDir${_library} ${_library} PATH )
 37   list( APPEND HDF5_LIBRARY_DIR ${_tempDir${_library}} )
 38 endforeach()

and
could be some kind of workaround that was introduced in the countless tries
to get HDF5 to work, like for instance to get it to work with VTK's HDF5,
which renames the libraries.
Anyway, there are now many different commands in 3 files:
/CMakeLists.txt
/3rdParty/CMakeLists.txt
/3rdParty/External-HDF5.cmake
in which we try to find and/or install HDF5, and I have lost any kind of
overview how and where things go wrong.

(3) HDF5_DIR is ${CMAKE_BINARY_DIR}/3rdParty/share/cmake/hdf5/; so it should
looks for libraries in HDF5_build/bin/Debug, or it'd miss cmake config files
there are wrong...

https://github.com/arnaudgelas/statismo/blob/BuildSystem/3rdParty/External-H
DF5.cmake#L28

Yes, I saw that. However it was never installed in that folder, but in the
folder without the "share". I removed the "share" in that file but that did
not help the actual problem.

I need to know the location of the file HDF5Config.cmake on windows after the installation part of the superbuild.

Could you tell me the location of this file, please?

I'll try to investigate in hdf5 itself...

Typically, there are always (at least) two directories that can be specified
when FIND_PACKAGE is called: The build and the install directory. When the
build directory is chose, the libraries are in build_directory/bin/Release/,

It is better here to provide the installation folder, since you do not want to keep all temporary files forever...


when the install directory is chosen, they are in install_directory/lib/ .
Now, even if the install_directory is chosen on the first run of CMake, it
automatically chooses the build_directory on subsequent runs, and then tries
to find the libraries in build_directory/bin/Debug/, even though they are in
build_directory/bin/Release/. I first thought I only need to force the use
of the install_directory, which would be possible with the little trick that
Patrick Huber gave in his last mail, but even that would not work, because
the debug libraries in Windows always have a "_D" at the end of the file
name, and CMake looks for those files.

(4) is the previous installation found and used during the superbuild?
Can you provide a bit more detail, please?

Yes, all the old installations of ITK, HDF5 and statismo were automatically
found and the superbuild did not work at all. Especially the conflict of
ITK's HDF5 and the superbuild seemed really hard to solve.

Here, did you try recompiling hdf5? or use the detected one?


But then I deleted everything and started a fresh superbuild and it produced
the problems I described above. I guess the problem is that some of the many
HDF5-related CMake commands are conflicting.


Thanks again for you precious feedback!

Thank you for working on the superbuild. Let me know if you have any more
questions.



Sorry for all these questions, but I don't have any windows machine and won't get any anytime soon…

Best,
Arnaud

Thomas Albrecht

unread,
Feb 17, 2014, 12:04:51 PM2/17/14
to Arnaud Gelas, statism...@googlegroups.com

Hi Arnaud,

 

I’m afraid this e-mail is getting a bit hard to read, but I will still but the answers in below. It turns out, that too is more difficult under Windows (with Outlook at least).

 

From: Arnaud Gelas [mailto:arnau...@gmail.com]
Sent: Monday, February 17, 2014 4:40 PM
To: Thomas Albrecht
Cc: statism...@googlegroups.com
Subject: Re: Linking problems (windows)

 


Every occurrence of _MINOR_VERSION in 3rdParty/CMakeLists.txt needs to be
changed into _VERSTION_MINOR. The same with MAJOR.
I think it is easiest to just do a Find/Replace in that file.

 

Can you explain why make such as change, please?

 

If you have a look at FindVTK.cmake, you'll see VTK_MAJOR_VERSION and VTK_MINOR_VERSION are defined, same for ITK and Boost…

 

 

 

Hmm, that’s interesting. Did you try it out with a previous install of ITK? I did, and because ITK was found, it went into the block where the versions are tested.

  set( _isValidITK ${ITK_FOUND} )

 

  if( ${_isValidITK} )

    if

        ( ${ITK_VERSION_MAJOR} LESS ${_RequiredVersionMajorITK} ) OR

        ( ( ${ITK_VERSION_MAJOR} EQUAL ${_RequiredVersionMajorITK} ) AND ( ${ITK_VERSION_MINOR} LESS ${_RequiredVersionMinorITK} ) )

      )

      set( _isValidITK false )

    endif()

  endif()

 

There CMake crashed, because ITK_MAJOR_VERSION was not defined. I checked out the CMake documentation, where it said that projects define the variable <PROJECT>_VERSION_MAJOR. Then I did the replace and it worked.

 

 


(2) All subprojects should be compiled with the same CMAKE_BUILD_TYPE:
release and/or debug. Have you compiled everything in debug and/or release?

Yes, everything was built in Release mode. In Windows, you don't specifiy
this in CMake, but in Visual Studio. I chose "Release" there, and all
subprojects were built in Release mode.
However, then CMake, not Visual Studio, tries to find the actual library
files for HDF5. It finds out correctly were the files should be, but it
lists the Debug versions, which were not built.
This could be in the main CMakeLists.txt file, probably after line 34,

 

Can you paste the line, please? cause for me line 34 does not make any sense...

 

Here is what I have

 34 set( HDF5_LIBRARY_DIR )

 35 foreach( _library ${HDF5_LIBRARIES} )

 36   get_filename_component( _tempDir${_library} ${_library} PATH )

 37   list( APPEND HDF5_LIBRARY_DIR ${_tempDir${_library}} )

 38 endforeach()

 

Yes, that is the line I was talking about. But that is only a guess. As I said before,

 

/CMakeLists.txt
/3rdParty/CMakeLists.txt
/3rdParty/External-HDF5.cmake

 

all define, search and install things concerning HDF5. Those lines were my guess because I think the problems with the library names occur in the statismo subproject of the SuperBuild, and these lines seem like they try to find the library name explicitly, which could really result in the error I was experiencing, that almost-correct library names were found.


(3) HDF5_DIR is ${CMAKE_BINARY_DIR}/3rdParty/share/cmake/hdf5/; so it should
looks for libraries in HDF5_build/bin/Debug, or it'd miss cmake config files
there are wrong...

https://github.com/arnaudgelas/statismo/blob/BuildSystem/3rdParty/External-H
DF5.cmake#L28

Yes, I saw that. However it was never installed in that folder, but in the
folder without the "share". I removed the "share" in that file but that did
not help the actual problem.

 

I need to know the location of the file HDF5Config.cmake on windows after the installation part of the superbuild.

 

Could you tell me the location of this file, please?

 

It is :

 ${CMAKE_BINARY_DIR}/3rdParty/cmake/hdf5/

 

 

 

I'll try to investigate in hdf5 itself...


Yes, all the old installations of ITK, HDF5 and statismo were automatically
found and the superbuild did not work at all. Especially the conflict of
ITK's HDF5 and the superbuild seemed really hard to solve.

 

Here, did you try recompiling hdf5? or use the detected one?

 

 

I noticed that CMake found the ITK HDF5 version, so I also wanted to recompile HDF5. However, because HDF5 was found, i.e. the variable _isValidHDF5 set to true, the option External_HDF5 does not even appear in the CMake GUI, so I could not really choose to recompile HDF5, the same goes for ITK.



Sorry for all these questions, but I don't have any windows machine and won't get any anytime soon…

 

It would be really good if we could get the SuperBuild to work together. Unfortunately I am really not good enough at CMake to work out all the problems myself.

 

Did you consider installing Windows on a VirtualBox? VirtualBox itself is free from Oracle, but of course you would need a Windows and Visual Studio license. That really only works if your Uni/Employer offers such licenses.

 

Reply all
Reply to author
Forward
0 new messages