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

remaining windows install problems #467

Closed
AnderBiguri opened this issue Jan 11, 2021 · 73 comments
Closed

remaining windows install problems #467

AnderBiguri opened this issue Jan 11, 2021 · 73 comments

Comments

@AnderBiguri
Copy link
Contributor

All instructions are for unix type systems.

We should add instrutions for windows

(may make a PR when I figure out how to build it)

@KrisThielemans
Copy link
Member

There should be something on the wiki, but surely incomplete, as the SuperBuild started the work only a week ago or so, and things are still moving. Summary is

You probably want to stick to STIR release_4 in the first instance due to a recent problem after @danieldeidda's calibration update (although this should not affect you).

@AnderBiguri
Copy link
Contributor Author

Thanks, I have indeed followed those steps, building now.
We should also document which VS versions have been tested, VS is famous for changing as much as possible between versions. I am using 2019 now.

@AnderBiguri
Copy link
Contributor Author

Plus, MVS doesnt come with a lot of things by default, e.g. a C++ compiler (yes, really). So we should clarify too what of MVS is needed :)

@KrisThielemans
Copy link
Member

it'll work with all of them of course 😉 .

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 11, 2021

@KrisThielemans I am having trouble with Boost. I have it installed, but cmake refuses to let me point it out towards its location in my system, it keeps saying not found when I click configure. For a test, can you let me know what folders you use for Boost_DIR, Boost_INCLUDE_DIR and Boost_SOURCE_DIR ?

@KrisThielemans
Copy link
Member

SyneRBI/SIRF#847 is now merged, so now it's easy :-)

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 11, 2021

@KrisThielemans not sure if its easy, I was already using it and still Boost was not being detected... I'll restart from scratch I guess...

@KrisThielemans
Copy link
Member

boost: I used the default settings for the installer, which installed it in c:\local\boost_1_74_0. CMake didn't find that by default. So I created a new variable to tell it where it is. This can be done in the GUI, or from the command line:

cd whereveryoubuild
cmake -DBOOST_ROOT:PATH=c:\local\boost_1_74_0 .

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 11, 2021

Ah, yes, I was playing with that but I was getting illegal character messages (likely an error in copy-pasting stuff somewhere that dissapearedinto a cached variable). Should not that variable be part of the CMAKE (instead of user-specified)? In any case, definitely worth documenting. In which section of the readme do you want it?

@KrisThielemans
Copy link
Member

Sadly they've marked BOOST_ROOT as an advanced variable, so you don't get it by default. Also, CMake is changing its policy for variables called package_ROOT, see SyneRBI/SIRF#233, but we're still on the old behaviour, so it'll work for a bit longer. Their message doesn't tell you what to do though (as often the case).

Illegal characters: you can always try c:/local/boost_1_74_0. Probably safer whatever shell/cmd/powershell you're using.

Of course, we need to document it, but it first needs to work! where to document it? It's quite like that our OS specific install instructions are still on the wiki. That's what I see on https://github.com/SyneRBI/SIRF-SuperBuild/tree/master/#os-specific-information. There's the (terse!) https://github.com/SyneRBI/SIRF/wiki/SIRF-SuperBuild-on-Windows-with-Visual-Studio for instance. And the soon to be outdated https://github.com/SyneRBI/SIRF/wiki/Installation-instructions#steps-on-windows-. We did agree to move info on the wiki to markdown in the repo (and point the wiki to those pages) to reduce the amount of duplication/confusion. That's easy enough (the Github wiki uses markdown and files can be downloaded/copied). But that seems another issue that needs to be created....

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 11, 2021

ah, not use to my laptop for compiling. I get the confusing error When compiling SIRF:

11>CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
11>  Could NOT find Boost (missing: system filesystem thread date_time chrono)
11>  (found suitable version "1.65.1", minimum required is "1.36.0")

Confusing because it found a version that seem OK, and confusing because I installed 1.75.0 and I am not sure if its finding that (because it does have the missing folders).

I set up BOOST_ROOT to where my boost library is, but I can not configure cmake without getting whatever is in Boost_DIR removed.
image

@KrisThielemans
Copy link
Member

There was a boost 1.65.1 in INSTALL/include, probably because of attempts (not sure). We're trying again after deleting it. More tomorrow.

@AnderBiguri
Copy link
Contributor Author

My problem was that I was either using pre-built 1.75.0 Boost which is not supported by CMAKE (released 5 days before my CMAKE version, but too new nevertheless), or non-built 1.74.0. Installing a pre-built 1.74.0 seems to have solve the problem, but I am getting:

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2039	'runtime_error': is not a member of 'std' [D:\SIRF\build\builds\SIRF\build\src\Registration\cReg\Reg.vcxproj]	SIRF	D:\SIRF\build\sources\SIRF\src\Registration\cReg\Resample.cpp	81	

I can see in here, that a solution to this is to include <stdexcept> which I added in resample.cpp.

This removes the (several) runtime_error errors, but adds

Error	C1189	#error:  WinSock.h has already been included [D:\SIRF\build\builds\SIRF\build\src\Synergistic\tests\SYN_TEST_CPLUSPLUS.vcxproj]	SIRF	C:\local\boost_1_74_0\boost\asio\detail\socket_types.hpp	24	

Internet suggests that changing the location of the include is the solution, but I don't know where to put it, if its the first line of resample.cpp the error is still there.
https://stackoverflow.com/questions/9750344/boostasio-winsock-and-winsock-2-compatibility-issue

Investigating...

@KrisThielemans
Copy link
Member

I strongly suspect your SIRF is out-of-date. I've fixed those 2 recently. See for instance
https://github.com/SyneRBI/SIRF/blob/2e1d74aa4d40f5edf6a441d54e60a26a55f79b71/src/Registration/cReg/Resample.cpp#L31
and SyneRBI/SIRF#847

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 14, 2021

My current steps:

  1. CMAKE, python38, boost (<=1.74.0)
  2. Configure cmake as follows (I use the GUI):
  • USE_ITK: ON
  • DISABLE_Matlab: ON
  • BOOST_ROOT: path_to_boost (e.g. C:\local\boost_1.74.0)
  • USE_NiftyPET: OFF // requires python27
  • SIRF_TAG: origin/master
    -If you have configured and started to build with some other config, I found out that sometimes these chain-react into cached variables in some projects and just "unticking" them is not enough. I tend to need to just remove all the folders and rebuild....
  1. configure/Generate
  2. Open MSV19, built all (release mode)
  3. Set enviroment variables:
    Kris has:
$install="C:\Users\krisf\Documents\devel\buildVC\SIRF-SuperBuild\INSTALL"
 $Env:Path = "${install}\bin" + ";" + $Env:Path
 $Env:Path += ";${install}\FFTW"
 $Env:Path += ";c:/local/boost_1_74_0/lib64-msvc-14.2/"
 # need to be forward slashes 
 $Env:SIRF_PATH = "C:/Users/krisf/Documents/devel/buildVC/SIRF-SuperBuild/sources/SIRF"
 $Env:PYTHONPATH = "${install}\python"
 $Env:MATLABPATH = "${install}\matlab"
 $Env:MATLABPATH+=';C:\Users\krisf\Documents\devel\buildVC\SIRF-SuperBuild\sources\SPM'
 $Env:Path += ";c\Program Files\MATLAB\R2020b\bin\win64;c:\Program Files\MATLAB\R2020b\extern\bin\win64"

I have:

 $install="D:/SIRF/build/INSTALL"
 $Env:Path = "${install}\bin" + ";" + $Env:Path
 $Env:Path += ";${install}\FFTW"
 $Env:Path += ";c:/local/boost_1_74_0/lib64-msvc-14.2/"
 # need to be forward slashes 
 $Env:SIRF_PATH = "D:/SIRF/build/sources/SIRF"
 $Env:PYTHONPATH = "${install}\python"

  1. Open powershell, run the script for env-vars.
  2. Use the shell for python.

@KrisThielemans
Copy link
Member

I think

  • step 1. Install boost via the .exe (do not use the .zip)
  • step 6. Open powershell, copy-paste content of script into the terminal for env-vars

@AnderBiguri
Copy link
Contributor Author

@KrisThielemans indeed. For step 6, I instead save it in a .ps1 file and run it from the powershell

@evgueni-ovtchinnikov
Copy link
Contributor

Tried to build SIRF-SuperBuild afresh, got these errors:

13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(535): error C2131: expression did not evaluate to a constant [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(563): error C2131: expression did not evaluate to a constant [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(569): error C2446: ':': no conversion from 'hsize_t *' to 'int' [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(613): error C2131: expression did not evaluate to a constant [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(658): error C2131: expression did not evaluate to a constant [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(664): error C2446: ':': no conversion from 'hsize_t *' to 'int' [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(695): error C2131: expression did not evaluate to a constant [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]
13>C:\Users\wps46139\Documents\GitHub\try\build\sources\STIR\src\IO\GEHDF5Wrapper.cxx(703): error C2446: ':': no conversion from 'hsize_t *' to 'int' [C:\Users\wps46139\Documents\GitHub\try\build\builds\STIR\build\src\IO\IO.vcxproj]

Conversion from 'hsize_t *' to 'int' is not a problem, but the other errors are very puzzling given the declaration of m_max_dataset_dims:

    const int m_max_dataset_dims =5;

@KrisThielemans
Copy link
Member

are you using STIR master? I've fixed a similar error on release_4 (see UCL/STIR#777) and haven't merged that yet to master. can try and do it now

@evgueni-ovtchinnikov
Copy link
Contributor

I do (git fetch does not fetch).

Quick fixed m_max_dataset_dims error by

#define m_max_dataset_dims 5

and built STIR. Now going through the usual fixes in SIRF build, will comment separately.

@evgueni-ovtchinnikov
Copy link
Contributor

SIRF Windows build annoyance 1.

CMake puts this rubbish in SIRF.sln:

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "C:", "C:", "{EDA60312-2021-3C94-8E6A-E3C505A86C58}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Users", "C:\Users", "{E760C743-ABDE-3140-8D0A-356CA064D5A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wps46139", "C:\Users\wps46139", "{A05394FE-A4A1-3C77-ABAE-B9B5BC4DACC4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documents", "C:\Users\wps46139\Documents", "{2E5941D4-A2D2-3884-A881-A7AE1A3F4C48}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "C:\Users\wps46139\Documents\GitHub", "{B04EF322-7E84-36C8-8C14-1628406FBE2D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "try", "C:\Users\wps46139\Documents\GitHub\try", "{8B5DBC82-06F0-3331-8977-CC29F738067C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "C:\Users\wps46139\Documents\GitHub\try\build", "{A24ECC70-224F-329F-9016-0C2910523406}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "INSTALL", "C:\Users\wps46139\Documents\GitHub\try\build\INSTALL", "{80639F0D-8C7C-3029-8E40-92043AA82323}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "bin", "C:\Users\wps46139\Documents\GitHub\try\build\INSTALL\bin", "{B99B5A13-953C-3B24-9BCD-C9C7FC2D246F}"
EndProject

which creates spurious projects C, Users etc. So, each time the build of SIRF runs CMake, I have to remove this rubbish manually using a text editor.

@evgueni-ovtchinnikov
Copy link
Contributor

SIRF Windows build annoyance 2.

SIRF projects _pygadgetron, _pyreg, _pysirf, _pystir, MR_TESTS_CPLUSPLUS, REG_TEST_CPLUSPLUS, SYN_TEST_CPLUSPLUS, cstir_tests, sirf_affine_to_disp, sirf_change_datatype, sirf_convert_image_type, sirf_crop_image, sirf_do_images_match, sirf_flip_or_mirror_image, sirf_inverse_transform, sirf_nifti_maths, sirf_print_nifti_info, sirf_registration, sirf_resample, sirf_tensor_split_join and test_conv_img have extra dependency on hdf5.lib without path (in addition to one with the proper path), which I have to remove manually each time the SIRF build runs CMake.

@KrisThielemans
Copy link
Member

@evgueni-ovtchinnikov can you please confirm your CMake version? It needs to be 3.19.2... (some fixes coming in 3.19.3 and hopefully final ones in 3.20.0...)

@AnderBiguri and I are using VS 2019, but that shouldn't matter.

the point is obviously that none of these edits should be necessary! If you have to make them, then I would stop right trying to fix them manually.

@evgueni-ovtchinnikov
Copy link
Contributor

I was using 3.13.3 - will upgrade now.

@KrisThielemans
Copy link
Member

UCL/STIR#797 to update master is created but will probably only be merged tomorrow.

@evgueni-ovtchinnikov
Copy link
Contributor

same story with CMake 3.19.3

@KrisThielemans
Copy link
Member

I am completely baffled. Why would CMake generate wrong project files on your computer and not ours? It makes no sense to me. Sigh.

Possibly you could post your CMakeCache.txt? (Ideally the one from the SuperBuild directory and the one it generates in builds/SIRF/build).

@KrisThielemans KrisThielemans changed the title Add windows install instructions remaining windows install problems Jan 14, 2021
@evgueni-ovtchinnikov
Copy link
Contributor

evgueni-ovtchinnikov commented Jan 15, 2021

CMakeCache.txt in folder build:

CMakeCache.txt

@AnderBiguri
Copy link
Contributor Author

@evgueni-ovtchinnikov not sure if this changes anything, but I needed to create a new variable BOOST_ROOT: C:/local/boost_1.74.0 (in my case that path) to make the thing compile, otherwise it would not find boost. I can see it in my Cmake-cache.txt, but not in yours.

@KrisThielemans
Copy link
Member

I hope you meant "I can now import sirf.Utilities"...

For the STIR import, I strongly suspect that your path doesn't have the DLLs that are needed. Continuing along the HDF5 line of suspects (even though your previous problem wasn't), you should have hdf5_cpp.dll in your INSTALL\bin, AND your PATH has to include it.

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 18, 2021

@KrisThielemans of course yes, I meant that.

I do have hdf5_cpp.dll:

PS D:\SIRF\build\INSTALL\bin> dir hdf5*


    Directory: D:\SIRF\build\INSTALL\bin


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        18/01/2021     10:30        2934272 hdf5.dll
-a----        18/01/2021     10:31         275968 hdf5_cpp.dll
-a----        18/01/2021     10:26         653312 hdf5_cpp_D.dll
-a----        18/01/2021     10:25        8660480 hdf5_D.dll
-a----        18/01/2021     10:31         117248 hdf5_hl.dll
-a----        18/01/2021     10:31          15360 hdf5_hl_cpp.dll
-a----        18/01/2021     10:26          63488 hdf5_hl_cpp_D.dll
-a----        18/01/2021     10:26         249856 hdf5_hl_D.dll

and D:\SIRF> Get-ChildITem Env:Path returns:

Name                           Value
----                           -----
Path                           D:/SIRF/build/INSTALL/bin;   (etc)

@KrisThielemans
Copy link
Member

right. not HDF5 then...

we have to find what it's missing then. Looks like we need dumpbin or dependency walker, see https://stackoverflow.com/a/64620736/15030207

@KrisThielemans
Copy link
Member

here's what I got

PS ...\INSTALL\python\sirf>  &"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx86\x86\dumpbin.exe" /dependents _pystir.pyd
Microsoft (R) COFF/PE Dumper Version 14.28.29336.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file _pystir.pyd

File Type: DLL

  Image has the following dependencies:

    python38.dll
    hdf5_cpp.dll
    hdf5.dll
    KERNEL32.dll
    MSVCP140.dll
    VCOMP140.DLL
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll

  Summary

        1000 .00cfg
       18000 .data
        7000 .idata
       1E000 .pdata
       AE000 .rdata
        7000 .reloc
        1000 .rsrc
      326000 .text
        1000 .tls

You can find the location of dumpbin but opening a "VS 2019 command prompt" (via Start) and doing where dumpbin

@KrisThielemans
Copy link
Member

oops, the above was for _pystir.pyd. For _pysirf.pyd the relevant bit is

   python38.dll
    ismrmrd.dll
    libfftw3f-3.dll
    boost_thread-vc142-mt-x64-1_74.dll
    hdf5_cpp.dll
    hdf5.dll
    boost_filesystem-vc142-mt-x64-1_74.dll
    KERNEL32.dll
    MSVCP140.dll
    VCOMP140.DLL
    WS2_32.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 18, 2021

I dont have libfftw3f-3.dll. I mean, its in D:\SIRF\build\INSTALL\FFTW, but not in the dumpbin output

@KrisThielemans
Copy link
Member

I think your path is not correct. that directory should have been added, see #467 (comment). Check if it is. I believe that you either copy-paste the content, or do . ./script (see https://superuser.com/a/71490)

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 18, 2021

@KrisThielemans I simply have not show the entire path in the comment because its my personal laptop and I have tons of things in Path, but its there.

D:/SIRF/build/INSTALL/bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe;C:\Program Files\PuTTY\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\MATLAB_software\runtime\win64;D:\MATLAB_software\bin;C:\Program Files\CMake\bin;C:\Users\Ander\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\Ander\AppData\Local\Programs\Python\Python38\;C:\Users\Ander\AppData\Local\Microsoft\WindowsApps;C:\Users\Ander\AppData\Roaming\Dashlane\5.3.1.13504\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\Ander\AppData\Roaming\Dashlane\5.3.1.13504\ucrt;C:\Users\Ander\AppData\Local\atom\bin;C:\Users\Ander\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Users\Ander\AppData\Roaming\MiKTeX\2.9\miktex\bin\x64\;C:\Users\Ander\AppData\Local\Programs\Microsoft VS Code\bin;;D:/SIRF/build/INSTALL\FFTW;c:/local/boost_1_74_0/lib64-msvc-14.2/

@KrisThielemans
Copy link
Member

KrisThielemans commented Jan 18, 2021

D:/SIRF/build/INSTALL\FFTW mixes forward and backslashes. that isn't going to work probably

@AnderBiguri
Copy link
Contributor Author

@KrisThielemans tried that already, nothing changes. Also I removed the extra ;

@KrisThielemans
Copy link
Member

all of them should be \ really. Also the first entry is wrong.

@AnderBiguri
Copy link
Contributor Author

AnderBiguri commented Jan 18, 2021

@KrisThielemans can you clarify why its wrong? the / you mean?

(note that I see no diference in dumpbin or behavior of python with \ vs /)

@KrisThielemans
Copy link
Member

yes, I do mean D:\SIRF\build\INSTALL\FFTW etc. if that isn't it, then I don't know...

@AnderBiguri
Copy link
Contributor Author

Just to add info:

my current dumpbin looks like this:

 &"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx86\x86\dumpbin.exe" /dependents _pysirf.pyd

File Type: DLL

  Image has the following dependencies:

    python38.dll
    ismrmrd.dll
    boost_thread-vc141-mt-x64-1_74.dll
    hdf5_cpp.dll
    hdf5.dll
    ITKIOBruker-4.13.dll
    ITKIOHDF5-4.13.dll
    ITKIOLSM-4.13.dll
    ITKIOMINC-4.13.dll
    ITKIOMRC-4.13.dll
    ITKIOBMP-4.13.dll
    ITKIOBioRad-4.13.dll
    ITKIOGDCM-4.13.dll
    ITKIOGE-4.13.dll
    ITKIOGIPL-4.13.dll
    ITKIOJPEG-4.13.dll
    ITKIOTIFF-4.13.dll
    ITKIOMeta-4.13.dll
    WSOCK32.dll
    ITKIONIFTI-4.13.dll
    ITKIONRRD-4.13.dll
    ITKIOPNG-4.13.dll
    ITKIOStimulate-4.13.dll
    ITKIOVTK-4.13.dll
    ITKIOImageBase-4.13.dll
    ITKCommon-4.13.dll
    WS2_32.dll
    boost_filesystem-vc141-mt-x64-1_74.dll
    KERNEL32.dll
    MSVCP140.dll
    VCOMP140.DLL
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll

  Summary

       13000 .data
       14000 .pdata
       84000 .rdata
        4000 .reloc
        1000 .rsrc
      228000 .text

Adding all the DLLs and libs into the /libs folder does not change any of the behaviors described until now.

Also, I can see in the SIRF (not superbuild) CMAKE parameters, the following correct values:

test

@KrisThielemans
Copy link
Member

Sorry, can you remind me what the current problem is. Is it still the one from above

ImportError: DLL load failed while importing _pysirf: The specified module could not be found.

You could give http://dependencywalker.com/ a go.

@AnderBiguri
Copy link
Contributor Author

Yes it is. I will give that a go. Still usnure why I dont see FFTW in the dumpbin .... Will report back.

@evgueni-ovtchinnikov
Copy link
Contributor

evgueni-ovtchinnikov commented Jan 26, 2021

SIRF Windows build annoyance 2 (extra dependency on hdf5.lib without path in addition to one with the proper path) disappeared!

My deep gratitude to whoever fixed this!

@KrisThielemans
Copy link
Member

SIRF Windows build annoyance 2

what about annoyance 1? And does your Python now finally run?

@evgueni-ovtchinnikov
Copy link
Contributor

Annoyance 1 is still there, but it is much less annoying as it takes less than half a minute to edit VS solution file.

Python still crashes on reading MR acquisition data.

@KrisThielemans
Copy link
Member

KrisThielemans commented Jan 27, 2021

interesting, I see the same "annoyance 1" mess in my SIRF.sln, but VS didn't complain about it. Nevertheless, it shouldn't be there. Could be the same as #410 (Edit: #410 was diagnosed by @rijobro to be related to our FFTW3 files, which doesn't have anything to do with this)

@KrisThielemans
Copy link
Member

As it isn't in other solutions, I guess this is a SIRF Bug

@evgueni-ovtchinnikov
Copy link
Contributor

My VS does not complain either - I only noticed something was wrong when I could not find one of my projects (VS Solution Explorer apparently has a limit for the number of projects it can show).

There must be a mistake in SIRF CMake files, and I spent quite a lot of time last couple of weeks trying to find it, but did not succeed. One thing that is obvious is that those spurious projects names are part of the path to INSTALL\bin.

@KrisThielemans
Copy link
Member

Possible lines for conda (with conda-forge channel enabled)

conda install hdf5 numpy boost-cpp swig fftw nlohmann_json

could use it to install cmake and even a C++ compiler i guess. If you install CMake with its own installer, make sure you tick the box "add to user path").

Then in powershell

git clone https://github.com/SyneRBI/SIRF-SuperBuild.git
mkdir build
cd build
cmake ../SIRF-SuperBuild -DUSE_SYSTEM_HDF5:BOOL=ON -DUSE_SYSTEM_SWIG:BOOL=ON -DUSE_SYSTEM_FFTW3:BOOL=ON -DUSE_SYSTEM_JSON:BOOL=ON -DUSE_ITK:BOOL=OFF

Then fine-tune the configuration (either with the CMake GUI or ccmake if present in conda). Possibly it doesn't find boost files, in which case you'd have to set BOOST_ROOT (see above)

Note, I think with Conda we have to not use ITK at the moment due to the problem I saw
conda-forge/stir-feedstock#33 (comment)
but I suppose you could try with ITK and let us know.

Then build, which you could do from the Visual Studio project or

cmake . --build -C Release

Then set your environment as in #460

@KrisThielemans
Copy link
Member

KrisThielemans commented Mar 18, 2022

Just trying again with USE_SYSTEM_HDF5=OFF and other default settings, I have to set

  • ITK_USE_SYSTEM_HDF5=OFF as the default HDF5 library is too old and ITK complains about backwards compatibility. see HDF5 is too old for ITK in Windows #680
  • USE_ROOT=OFF as ROOT compilation fails with missing zconf.h

@KrisThielemans
Copy link
Member

I've created SyneRBI/SIRF#1127 for "annoyance 1".
I believe things mentioned above have either been resolved or have now their own issues (which is probably best anyway!).

So I'll close this.

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

3 participants