Skip to content

Rwindows#562

Closed
muschellij2 wants to merge 66 commits intoInsightSoftwareConsortium:masterfrom
muschellij2:Rwindows
Closed

Rwindows#562
muschellij2 wants to merge 66 commits intoInsightSoftwareConsortium:masterfrom
muschellij2:Rwindows

Conversation

@muschellij2
Copy link
Contributor

@muschellij2 muschellij2 commented Feb 28, 2019

For building ITK with R, the following changes are required. Some changes are Windows-related.

Eigen3 changes

The changes to Eigen3 are required as ITK is built using R CMD check, which creates a temporary folder to check the package and build the binary: https://travis-ci.org/muschellij2/ITKR/jobs/500018126#L2538. The change ensures that ITKEigen3.cmake in the output has a relative path as currently it is using ${CMAKE_INSTALL_PREFIX}, which makes it less robust, especially if the path is moved. This causes issues when a package wishes to build on ITK, such as ANTs, which is built in R using ANTsRCore and the binary ITKR which was built above: https://travis-ci.org/muschellij2/ANTsRCore/jobs/500018491#L6596. The error here relates to the absolute path Eigen3 is making in the cmake file.

H5wins changes

For building ITKR on Windows (https://ci.appveyor.com/project/muschellij2/itkr), this uses Rtools (https://cran.r-project.org/bin/windows/Rtools/), which is an MSYS2/MINGW build (https://github.com/r-windows/rtools-packages). Here, the builds were failing with

In function 'H5D__efl_read':
C:\run\ITKR.Rcheck\00_pkg_src\ITKR\src\itks\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5win32defs.h:57:66: error: expected expression before ')' token

https://ci.appveyor.com/project/muschellij2/itkr/builds/19044355/job/pvyblx15dws7x66d#L4280. We found this switch to work well. This patch was suggested in #66 but seemed abandoned https://review.source.kitware.com/#/c/23773/ and I don't believe #397 fixes this.

VNL

The VNL fix is the most dubious out of all of these. The issue in https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/VNL/src/vxl/vcl/CMakeLists.txt#L18 is that this causes an incorrect absolute path on Windows as seen in :
https://ci.appveyor.com/project/muschellij2/itkr/builds/21974640/job/v6xp383af3jfp1j8#L6815. I'm not sure of the fix, so I'm fine if this is not incorporated, but I'm unsure on how to resolve this other than removing the compiler header.

stnava and others added 30 commits September 4, 2018 10:26
Change-Id: I63ccba3a5ba610fffc6453cb6e125fd47b68521b
Change-Id: I79c6cbbcbb0595635612dd6bdca3de51c509dc05
Change-Id: I00b5e22e526421d3d4aeedf71b248adfe0cfca3d
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'
Change-Id: I63ccba3a5ba610fffc6453cb6e125fd47b68521b
Change-Id: I00b5e22e526421d3d4aeedf71b248adfe0cfca3d
...

Change-Id: Ibd069b33f0bf4a11c34e1fcdc20e6dfbb2dea730
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'themaster/master'
Change-Id: I415e606b91c477f973abb21c1b81c0d1c8699bbb
Merge remote-tracking branch 'themaster/master'
Change-Id: I03270c61ffcaaff48aad79f571624193f5aaaf53
...

Change-Id: Ia7f07eb19a5cd5c4853f4fc5d060490cff8abd03
http://review.source.kitware.com/#/c/23783/ is the correct way

Change-Id: Ifc2e13c323d128ddc86dd55449f9b782e90b188e
Change-Id: I1cdb904a6beb96ff836bd65e15d969ba892a6a9b
...

Change-Id: I7bb742f3493cb055b93cbfc7aa0751fe816b64ca
great fixes for annoying hdf5 warnings

Change-Id: I258109d16c17db31e5abb507355c0d5f2d603d28
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'themaster/master'
    vnl_matrix_fixed+double.1.1-.cxx error
@dzenanz
Copy link
Member

dzenanz commented Mar 1, 2019

I am looking into the VNL absolute path issue.

@thewtex thewtex requested a review from dzenanz March 1, 2019 16:29
@hjmjohnson
Copy link
Member

@dzenanz I think that the absolute path issue was fixed upstream. We need to wait until the windows builds work again before updating VNL.

Is there an update on when windows builds will work again?


#ifdef H5_HAVE_VISUAL_STUDIO

/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I believe so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually believe that this fixes it sufficiently without hte rest of the HDF5 changes as failures happen with H5Defl.c:

C:\run\ITKR.Rcheck\00_pkg_src\ITKR\src\itks\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5Defl.c: In function 'H5D__efl_read':
C:\run\ITKR.Rcheck\00_pkg_src\ITKR\src\itks\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5Defl.c:291:44: error: macro "HDopen" requires 3 arguments, but only 2 given
         if((fd = HDopen(full_name, O_RDONLY)) < 0)
                                            ^
C:\run\ITKR.Rcheck\00_pkg_src\ITKR\src\itks\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5Defl.c:291:18: error: 'HDopen' undeclared (first use in this function)
         if((fd = HDopen(full_name, O_RDONLY)) < 0)
                  ^
C:\run\ITKR.Rcheck\00_pkg_src\ITKR\src\itks\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5Defl.c:291:18: note: each undeclared identifier is reported only once for each function it appears in

https://ci.appveyor.com/project/muschellij2/itkr/builds/23054691

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still is an issue, but I think we can bring up in new PR

@dzenanz
Copy link
Member

dzenanz commented Mar 1, 2019

VNL absolute path issue should be fixed by vxl/vxl#604.

@dzenanz
Copy link
Member

dzenanz commented Mar 1, 2019

I squashed the PR into a single commit. This simplifies reviewing.

@dzenanz
Copy link
Member

dzenanz commented Mar 1, 2019

Once VNL fix is integrated, this should be rebased on top with VNL-related changes removed.

@muschellij2
Copy link
Contributor Author

muschellij2 commented Mar 1, 2019 via email

@dzenanz
Copy link
Member

dzenanz commented Mar 5, 2019

Please rebase on current master.

@phcerdan
Copy link
Contributor

phcerdan commented Mar 5, 2019

Should we open a new PR with just the Eigen fix?

@dzenanz
Copy link
Member

dzenanz commented Mar 5, 2019

That would work. Please add @muschellij2 as a co-author. Then if there are any leftover problems, a new issues or pull request can be created.

phcerdan added a commit to phcerdan/ITK that referenced this pull request Mar 5, 2019
Fix extracted from InsightSoftwareConsortium#562

Closes InsightSoftwareConsortium#566

Co-authored-by: John Muschelli <muschellij2@gmail.com>
@phcerdan
Copy link
Contributor

phcerdan commented Mar 5, 2019

@muschellij2 @dzenanz I opened #567 (Co-authored-by @muschellij2 ) to fix Eigen3.

@thewtex
Copy link
Member

thewtex commented Mar 11, 2019

/azp run ITK.Windows

@thewtex
Copy link
Member

thewtex commented Mar 14, 2019

@muschellij2 @dzenanz @phcerdan can this please be rebased on master to resolve the Eigen conflict?

@dzenanz
Copy link
Member

dzenanz commented Mar 14, 2019

This PR is so outdated now, I will close it. @muschellij2 if there is still some leftover problems, please create a new PR or issue.

@dzenanz dzenanz closed this Mar 14, 2019
@muschellij2 muschellij2 mentioned this pull request Aug 29, 2019
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Aug 30, 2019
The HDF532defs.h were changed, as the number of arguments was wrong in
Mingw32. This was referenced on InsightSoftwareConsortium#562 (comment) in InsightSoftwareConsortium#562 but wasn't
incorporated. Left it as it didn't seem to be an issue anyone else had
until yesterday.

Co-authored by: John Muschelli <muschellij2@gmail.com>
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Aug 30, 2019
The HDF532defs.h were changed, as the number of arguments was wrong in
Mingw32. This was referenced on InsightSoftwareConsortium#562 (comment) in InsightSoftwareConsortium#562 but wasn't
incorporated. Left it as it didn't seem to be an issue anyone else had
until yesterday.

Co-authored by: John Muschelli <muschellij2@gmail.com>
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Oct 23, 2019
The HDF532defs.h were changed, as the number of arguments was wrong in
Mingw32. This was referenced on InsightSoftwareConsortium#562 (comment) in InsightSoftwareConsortium#562 but wasn't
incorporated. Left it as it didn't seem to be an issue anyone else had
until yesterday.

Co-authored by: John Muschelli <muschellij2@gmail.com>
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

Successfully merging this pull request may close these issues.

7 participants