UCL / STIR

Software for Tomographic Image Reconstruction
http://stir.sourceforge.net/
Other
111 stars 93 forks source link

Windows 10 build errors #461

Closed evgueni-ovtchinnikov closed 4 years ago

evgueni-ovtchinnikov commented 4 years ago

Building SIRF on my Windows 10 laptop I get:

1>C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\sources\SIRF\src\Registration\NiftyMoMo\BSplineTransformation.cpp(381): error C3028: 'NiftyMoMo::BSplineTransformation::controlPointGridImage': only a variable or static data member can be used in a data-sharing clause
1>C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\sources\SIRF\src\Registration\NiftyMoMo\BSplineTransformation.cpp(527): error C3028: 'NiftyMoMo::BSplineTransformation::controlPointGridImage': only a variable or static data member can be used in a data-sharing clause

Commenting out the two offendng #pragma omp, I get another error caused apparently by NiftiImageData<dataType>::get_inner_product():

7>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\numeric(98): error C2794: 'iterator_category': is not a member of any direct or indirect base class of 'std::iterator_traits<_InIt1>'
7>          with
7>          [
7>              _InIt1=sirf::NiftiImageData<float>::Iterator_const
7>          ]
7>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\numeric(111): note: see reference to function template instantiation '_Ty std::_Inner_product_no_deprecate<_InIt1,_InIt2,_Ty,_Fn21,_Fn22>(_InIt1,_InIt1,_InIt2,_Ty,_Fn21 &,_Fn22 &)' being compiled
7>          with
7>          [
7>              _Ty=float,
7>              _InIt1=sirf::NiftiImageData<float>::Iterator_const,
7>              _InIt2=sirf::NiftiImageData<float>::Iterator_const,
7>              _Fn21=std::plus<void>,
7>              _Fn22=std::multiplies<void>
7>          ]
7>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\numeric(139): note: see reference to function template instantiation '_Ty std::inner_product<_InIt1,_InIt2,_Ty,std::plus<void>,std::multiplies<void>>(_InIt1,_InIt1,_InIt2,_Ty,_Fn21,_Fn22)' being compiled
7>          with
7>          [
7>              _Ty=float,
7>              _InIt1=sirf::NiftiImageData<float>::Iterator_const,
7>              _InIt2=sirf::NiftiImageData<float>::Iterator_const,
7>              _Fn21=std::plus<void>,
7>              _Fn22=std::multiplies<void>
7>          ]
7>  C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\sources\SIRF\src\Registration\cReg\NiftiImageData.cpp(1438): note: see reference to function template instantiation '_Ty std::inner_product<sirf::NiftiImageData<dataType>::Iterator_const,sirf::NiftiImageData<dataType>::Iterator_const,dataType>(_InIt1,_InIt1,_InIt2,_Ty)' being compiled
7>          with
7>          [
7>              _Ty=float,
7>              dataType=float,
7>              _InIt1=sirf::NiftiImageData<float>::Iterator_const,
7>              _InIt2=sirf::NiftiImageData<float>::Iterator_const
7>          ]
7>  C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\sources\SIRF\src\Registration\cReg\NiftiImageData.cpp(1437): note: while compiling class template member function 'float sirf::NiftiImageData<dataType>::get_inner_product(const sirf::NiftiImageData<dataType> &) const'
7>          with
7>          [
7>              dataType=float
7>          ]
7>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\numeric(98): error C2938: '_Iter_cat_t<sirf::NiftiImageData<dataType>::Iterator_const>' : Failed to specialize alias template
7>          with
7>          [
7>              dataType=float
7>          ]
7>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\numeric(98): error C2062: type 'unknown-type' unexpected

After commenting out all occurences of get_inner_product() in C++, Matlab and Python, I finally managed to build all projects except SYN_TESTS_CPLUSPLUS, which fails with this weird message:

4>C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\include\boost-1_65_1\boost/asio/detail/socket_types.hpp(24): fatal error C1189: #error:  WinSock.h has already been included

(even more weirdly, my Visual Studio solution does not even have this project in the Solution Explorer window - its name only appears in the Error List window). After that, at least all non-MR tests run ok except SYN_TESTS_CPLUSPLUS, which is skipped by ctest, and SYN_TEST_PYTHON, which throws exception after about 7 sec.

KrisThielemans commented 4 years ago
evgueni-ovtchinnikov commented 4 years ago

Oops, just realized I created this SIRF issue in a wrong place - is there a quick way to move it to SIRF issues?

evgueni-ovtchinnikov commented 4 years ago

moved to CCPPETMR/SIRF (issue 587)