[CCPPETMR/SIRF-SuperBuild] SIRF-SuperBuild build fails on Windows (#197)

0 views
Skip to first unread message

evgueni-ovtchinnikov

unread,
Jan 24, 2019, 7:49:24 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

SIRF-SuperBuild build fails on Windows with the error message from CMake:

8>  -- FFTW3 WINDOWS libraries: FFTW3F_LIBRARY-NOTFOUND
8>  CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
8>    Could NOT find FFTW3 (missing: FFTW3F_LIBRARY FFTW3_INCLUDE_DIR)
8>  Call Stack (most recent call first):
8>    C:/Program Files/CMake/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
8>    C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/lib/cmake/ISMRMRD/FindFFTW3.cmake:114 (find_package_handle_standard_args)
8>    src/xGadgetron/CMakeLists.txt:31 (find_package)

CMake GUI however displays both 'missing' items with correct values!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Richard Brown

unread,
Jan 24, 2019, 9:02:26 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

It looks like the error is coming from SIRF (thus xGadgetron), but I would have guessed that when you say you're looking at the CMake GUI, you're actually looking at the CMake of the superbuild. Is that correct?

If so, it sounds like FFTW3F_LIBRARY isn't being passed from the superbuild to SIRF. You could check this by looking at builds/SIRF/build/CMakeCache.txt and looking for FFTW3F_LIBRARY there.

Richard Brown

unread,
Jan 24, 2019, 9:04:21 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Here are the arguments in External_SIRF.cmake:

    CMAKE_ARGS
        -DCMAKE_PREFIX_PATH=${SUPERBUILD_INSTALL_DIR}
        -DCMAKE_LIBRARY_PATH=${SUPERBUILD_INSTALL_DIR}/lib
        -DCMAKE_INSTALL_PREFIX=${SIRF_Install_Dir}
        -DBOOST_INCLUDEDIR=${BOOST_ROOT}/include/
        -DBOOST_LIBRARYDIR=${BOOST_LIBRARY_DIR}
        -DBOOST_ROOT=${BOOST_ROOT}
        -DMatlab_ROOT_DIR=${Matlab_ROOT_DIR}
        -DMATLAB_ROOT=${Matlab_ROOT_DIR} # pass this for compatibility with old SIRF
        -DMATLAB_DEST_DIR=${MATLAB_DEST_DIR}
        -DSTIR_DIR=${STIR_DIR}
        -DHDF5_ROOT=${HDF5_ROOT}
        -DHDF5_INCLUDE_DIRS=${HDF5_INCLUDE_DIRS}
        -DISMRMRD_DIR=${ISMRMRD_DIR}
        -DSWIG_EXECUTABLE=${SWIG_EXECUTABLE}
        -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
        -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS}
        -DPYTHON_LIBRARY=${PYTHON_LIBRARIES}
        -DPYTHON_DEST_DIR=${PYTHON_DEST_DIR}
        -DPYTHON_STRATEGY=${PYTHON_STRATEGY}
        -DNiftyReg_Binary_DIR=${NiftyReg_Binary_DIR}

It doesn't look like FFTW3F_LIBRARY is being passed, so maybe you just need to add it in.

evgueni-ovtchinnikov

unread,
Jan 24, 2019, 10:20:57 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Thanks, it worked!
I added to CMAKE_ARGS

		-DFFTW3_INCLUDE_DIR=${FFTW3_ROOT_DIR}
		-DFFTW3F_LIBRARY=${FFTW3F_LIBRARY}

where

  if (WIN32)
    set(FFTW3F_LIBRARY ${FFTW3_ROOT_DIR}/libfftw3f-3.lib)
  else()
    set(FFTW3F_LIBRARY ${FFTW3_ROOT_DIR}/libfftw3f.so)
  endif()

I hope this will not break anything - any comments anyone?

Richard Brown

unread,
Jan 24, 2019, 10:30:19 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

I would have thought that you don't need to set any variables, since these would all be set in External_FFTW3.cmake.

When I'm debugging, I print all available CMake variables like this:

message(STATUS "print all variables...")
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(FATAL_ERROR "all variables printed.")

If I were you, I would put this somewhere in your External_SIRF.cmake file, and check whether FFTW3F_LIBRARY is already correct (it would save you having to do an if/else).

evgueni-ovtchinnikov

unread,
Jan 24, 2019, 10:48:20 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

will try later

now i have run into another problem when trying to SuperBuild with DEVEL_BUILD on:

8>  CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2048 (message):
8>    Unable to find the requested Boost libraries.
8>
8>    Boost version: 1.65.1
8>
8>    Boost include path:
8>    C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/include/boost-1_65_1
8>
8>
8>    Could not find the following Boost libraries:
8>
8>            boost_system
8>            boost_filesystem
8>            boost_thread
8>            boost_date_time
8>            boost_chrono
8>
8>    Some (but not all) of the required Boost libraries were found.  You may
8>    need to install these additional Boost libraries.  Alternatively, set
8>    BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
8>    to the location of Boost.
8>  Call Stack (most recent call first):
8>    src/xGadgetron/cGadgetron/CMakeLists.txt:18 (find_package)
8>
8>
8>  CMake Deprecation Warning at C:/Program Files/CMake/share/cmake-3.12/Modules/UseSWIG.cmake:492 (message):
8>    SWIG_ADD_MODULE is deprecated.  Use SWIG_ADD_LIBRARY instead.
8>  Call Stack (most recent call first):
8>    src/xGadgetron/pGadgetron/CMakeLists.txt:37 (SWIG_ADD_MODULE)
8>
8>
8>  CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2048 (message):
8>    Unable to find the requested Boost libraries.
8>
8>    Boost version: 1.65.1
8>
8>    Boost include path:
8>    C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/include/boost-1_65_1
8>
8>
8>    Could not find the following Boost libraries:
8>
8>            boost_system
8>            boost_thread
8>            boost_filesystem
8>
8>    Some (but not all) of the required Boost libraries were found.  You may
8>    need to install these additional Boost libraries.  Alternatively, set
8>    BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
8>    to the location of Boost.
8>  Call Stack (most recent call first):
8>    src/xGadgetron/mGadgetron/CMakeLists.txt:21 (find_package)
8>
8>
8>  -- setup.py:pGadgetron<-sirf.Gadgetron
8>  -- setup.py:pSTIR<-sirf.STIR
8>  -- setup.py:pUtilities<-sirf.Utilities
8>  -- setup.py:pygadgetron<-sirf.pygadgetron
8>  -- setup.py:pystir<-sirf.pystir
8>  -- setup.py:pyiutilities<-sirf.pyiutilities
8>  -- setup.py:C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/python/setup.py
8>CUSTOMBUILD : CMake error : The following variables are used in this project, but they are set to NOTFOUND.
8>  -- Configuring incomplete, errors occurred!
8>  See also "C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/builds/SIRF/build/CMakeFiles/CMakeOutput.log".
8>  See also "C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/builds/SIRF/build/CMakeFiles/CMakeError.log".
8>  Please set them or make sure they are set and tested correctly in the CMake files:
8>  Boost_CHRONO_LIBRARY_DEBUG (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_CHRONO_LIBRARY_RELEASE (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_DATE_TIME_LIBRARY_DEBUG (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_DATE_TIME_LIBRARY_RELEASE (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_FILESYSTEM_LIBRARY_DEBUG (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_FILESYSTEM_LIBRARY_RELEASE (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_SYSTEM_LIBRARY_DEBUG (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_SYSTEM_LIBRARY_RELEASE (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_THREAD_LIBRARY_DEBUG (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>  Boost_THREAD_LIBRARY_RELEASE (ADVANCED)
8>      linked by target "cstir" in directory C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/sources/SIRF/src/xSTIR/cSTIR
8>
9>------ Skipped Build: Project: ALL_BUILD, Configuration: Release x64 ------
9>Project not selected to build for this solution configuration 

BOOST_LIBRARYDIR was set as suggested (to Boost/bin.v2/libs)

Richard Brown

unread,
Jan 24, 2019, 10:51:17 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Not sure for Windows, but try setting BOOST_ROOT to C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/. If you can't seen an option for this in your CMake GUI, then try:

cmake . -DBOOST_ROOT=C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/

evgueni-ovtchinnikov

unread,
Jan 24, 2019, 11:02:50 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

no, it does not help, same error message

Richard Brown

unread,
Jan 24, 2019, 11:32:42 AM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Well again, this looks like a SIRF error (not superbuild), so check the value of BOOST_ROOT in builds/SIRF/build/CMakeCache.txt.

Kris Thielemans

unread,
Jan 24, 2019, 6:06:00 PM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

I never succeeded to get CMake to correctly find a Boost version that we compile. It's a very complicated moving target with boost renaming libraries in the build schemes, and CMake trying to catch-up.

I very much recommend to install the Boost binaries as they recommend, and set USE_SYSTEM_BOOST=ON.

Kris Thielemans

unread,
Jan 24, 2019, 7:08:19 PM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Regarding the missing FFTW stuff, @evgueni-ovtchinnikov can you give more information on how you're running this? If USE_SYSTEM_FFTW=ON, see #147.

Otherwise, I'm surprised as it searches for the library with find_library , see for example here. I thought this would go and search in our install directory., but I admit that I cannot see anything related to that in the find_library doc (but If it doesn't, how come USE_SYSTEM_FFTW=OFF works apparently on the VM?)

Kris Thielemans

unread,
Jan 24, 2019, 7:10:09 PM1/24/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

See #7 for other remaining issues with the Windows build. Note however that I succesfully build on Windows 10 with CMake 3.13.2 with USE_SYSTEM_BOOST=ON and USE_SYSTEM_FFTW3=ON

evgueni-ovtchinnikov

unread,
Jan 31, 2019, 9:40:50 AM1/31/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

same problem with boost on windows 7

all boost libraries are actually present in INSTALL/lib, but there are no respective dlls in INSTALL/bin, which is a likely reason for the error messages

moreover, there are no boost dlls in build/SIRF-SuperBuild at all

Richard Brown

unread,
Jan 31, 2019, 10:06:33 AM1/31/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Surely all the dlls belong in INSTALL/lib, and not in INSTALL/bin, so it's normal that there aren't any dlls in INSTALL/bin?

Kris Thielemans

unread,
Jan 31, 2019, 10:11:34 AM1/31/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Please do not waste time trying to set USE_SYSTEM_BOOST=OFF on Windows. It's going to be a struggle. Instead, install the boost binaries, set the BOOST_ROOT environment (or CMake) variable.

evgueni-ovtchinnikov

unread,
Feb 1, 2019, 5:57:38 AM2/1/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

no, it does not help, same error message

evgueni-ovtchinnikov

unread,
Feb 1, 2019, 6:02:30 AM2/1/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

installed boost_1_65_1, boost is ok, back to fftw3 problem:

 -- FFTW3 WINDOWS libraries: FFTW3F_LIBRARY-NOTFOUND
10>  CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
10>    Could NOT find FFTW3 (missing: FFTW3F_LIBRARY FFTW3_INCLUDE_DIR)
10>  Call Stack (most recent call first):
10>    C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
10>    C:/Users/wps46139/Documents/GitHub/build/SIRF-SuperBuild/INSTALL/lib/cmake/ISMRMRD/FindFFTW3.cmake:114 (find_package_handle_standard_args)
10>    src/xGadgetron/CMakeLists.txt:36 (find_package)

evgueni-ovtchinnikov

unread,
Feb 1, 2019, 9:06:18 AM2/1/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Closed #197 via 5b8cb89.

Kris Thielemans

unread,
Feb 1, 2019, 10:33:27 AM2/1/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

This commit makes little sense to me, given the discussion in #147. Maybe I was incorrect there.

In any case,

  • if USE_SYSTEM_FFTW3=OFF, those variables aren't set.
  • it would need similar fixes for ISMRMRD and Gadgetron presumably.

Can we do this via a PR please?

Kris Thielemans

unread,
Feb 1, 2019, 10:33:27 AM2/1/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Reopened #197.

Richard Brown

unread,
Feb 6, 2019, 9:42:50 AM2/6/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Closed #197 via 75b7f6c.

Richard Brown

unread,
Feb 6, 2019, 9:46:31 AM2/6/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

This re-closed itself automatically, not sure why.

Richard Brown

unread,
Feb 6, 2019, 9:46:32 AM2/6/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Reopened #197.

Casper da Costa-Luis

unread,
Feb 6, 2019, 10:22:17 AM2/6/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

because

75b7f6c Revert "added missing CMake FFTW variables to External_SIRF.cmake, fixes #197 (together with installing boost_1_65_1)"

includes the text

fixes #197

github being too clever...

Richard Brown

unread,
Feb 6, 2019, 11:20:16 AM2/6/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

ah... Thanks!

evgueni-ovtchinnikov

unread,
Feb 8, 2019, 11:59:47 AM2/8/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

my standalone SIRF has CMake option SIRF_INSTALL_DEPENDENCIES, which forces copying boost dlls to INSTALL/bin, whereas SIRF-SuperBuild does not have one, and Python and Matlab fail to load SIRF Gadgetron libraries

evgueni-ovtchinnikov

unread,
Feb 8, 2019, 12:02:01 PM2/8/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Matlab fails with the error message

    'There was an error loading the library "C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\matlab\mgadgetron.mexw64"
     
     Missing symbol 'H5P_CLS_DATASET_CREATE_ID_g' in 'C:\Program Files\MATLAB\R2017a/bin/win64\hdf5.dll' required by 'C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\bin\ismrmrd.dll->C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\matlab\mgadgetron.mexw64'
     Missing symbol 'H5P_CLS_LINK_CREATE_ID_g' in 'C:\Program Files\MATLAB\R2017a/bin/win64\hdf5.dll' required by 'C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\bin\ismrmrd.dll->C:\Users\wps46139\Documents\GitHub\build\SIRF-SuperBuild\INSTALL\matlab\mgadgetron.mexw64''

apparently there is a conflict between HDF5 libraries used by SuperBuild and matlab's ones

evgueni-ovtchinnikov

unread,
Feb 11, 2019, 10:00:29 AM2/11/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

overwriting matlab hdf5 dlls (luckily, there are only two of them) does fix the problem, but it is hardly a solution many users would like :(

Casper da Costa-Luis

unread,
Feb 11, 2019, 10:34:13 AM2/11/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

could prefix to matlab's path. Can also contact matlab to get them to update the dlls (I've done this before)

Kris Thielemans

unread,
Feb 11, 2019, 11:23:47 AM2/11/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

This is the same problem as what we're having with Boost CCPPETMR/SIRF#240.

Like there, I think the best thing to do is to build SIRF with the same version as what is used by Matlab. That implies that we need to check what the HDF5 version is for different Matlab versions. Fun.

@evgueni-ovtchinnikov would you be able to send an email to Mathworks support requesting the relevant information (for both HDF5 and Boost). Best to explain them why. feel free to point them to this issue.

Kris Thielemans

unread,
Feb 22, 2019, 11:23:43 AM2/22/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Info from MathWorks:

The BOOST libraries that MATLAB internally uses are as follows:
MATLAB R2016a - R2017b Boost library version 1.56.
MATLAB R2014a to R2015b Boost library version is 1.49
From MATLAB R2018a, our development team has eliminated the compatibility restrictions for the Boost C++ Library.

HDF5 library versions can be got from the MATLAB function,
[majnum,minnum,relnum] = H5.get_libversion()
Documentation link: https://www.mathworks.com/help/matlab/ref/h5.get_libversion.html

The code here illustrates how to call matlab (will need to use $(Matlab_MAIN_PROGRAM)). Here is an example for parse the output. The parsing is far too complicated for what we need of course.

Kris Thielemans

unread,
Feb 23, 2019, 5:32:51 PM2/23/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

HDF5 info is in #208, Boost info is in #207

Kris Thielemans

unread,
Feb 23, 2019, 5:35:25 PM2/23/19
to CCPPETMR/SIRF-SuperBuild, Subscribed

Proposed FFT2 fix is in #204

Reply all
Reply to author
Forward
0 new messages