--
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.
--
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.
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.
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.
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.