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

Windows build issue #34

Closed
eddelbuettel opened this issue May 22, 2016 · 21 comments
Closed

Windows build issue #34

eddelbuettel opened this issue May 22, 2016 · 21 comments

Comments

@eddelbuettel
Copy link
Member

Reported on rcpp-devel in this post

@yixuan Any thoughts?

@dcdillon
Copy link

I must be an idiot but have browsed all the docs for this issue and I can't find a usable error message. Can someone clarify what the error message actually is?

@eddelbuettel
Copy link
Member Author

If you follow the first link in the email by Francois Rousset you get to the CRAN tests results for Eigen which flashes a bright red for Windows and this link. Now that's of course just R CMD check and once again not the actual error.

Which we still need to reproduce.

@dcdillon
Copy link

Gotcha. Thanks
On May 22, 2016 3:13 PM, "Dirk Eddelbuettel" notifications@github.com
wrote:

If you follow the first link in the email by Francois Rousset you get to
the CRAN tests results for Eigen which flashes a bright red for Windows and this
link
https://www.r-project.org/nosvn/R.check/r-devel-windows-ix86+x86_64/RcppEigen-00check.html.
Now that's of course just R CMD check and once again not the actual
error.

Which we still need to reproduce.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#34 (comment)

@kevinushey
Copy link

kevinushey commented May 22, 2016

FWIW, I can't reproduce the R CMD check failure on my Windows machine (32bit R, using R-patched 3.3.0, r70654; dev version of RcppEigen) :-/

> sessionInfo()
R version 3.3.0 Patched (2016-05-20 r70654)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows >= 8 x64 (build 9200)

@yixuan
Copy link
Collaborator

yixuan commented May 23, 2016

Hi everyone, now I can confirm that this issue CAN be reproduced when -O3 is defined AND -DNDEBUG is NOT defined in the compilation flag.

@eddelbuettel
Copy link
Member Author

@yixuan you are very, very impressive.

Now where do we go from here? I vaguely recall that -DNDEBUG was recommended already. Behaviour that varies with/without certain optimization flags is more commonly compiler-related.

@aadler
Copy link

aadler commented May 23, 2016

Lurking here, but core R for Windows (which mainly means recommended packages) overwrites -O3 with -O2 for C++ (lines 74 and 77 of R_HOME/src/gnuwin32/fixed/etc/Makeconf) and has done so for a very long time—not just for the gcc 4.9.3 based Rtools. As there may be other package issues with -O3, would suggesting -O2 for the time being be appropriate?

@kevinushey
Copy link

kevinushey commented May 23, 2016

Here's the (mostly unhelpful) output from WinDbg:

(2e40.2550): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Users\kevin\R\win-library\3.3\RcppEigen\libs\i386\RcppEigen.dll - 
eax=2c28d000 ebx=70daf5ce ecx=6e2c28d0 edx=00000002 esi=000001ce edi=6e2c28d0
eip=6e2b5685 esp=0141b668 ebp=00000000 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
RcppEigen!ZN5Eigen8internal11gebp_kernelIddiLi2ELi2ELb0ELb0EEclEPdiPKdS5_iiidiiiiS3_+0x275:
6e2b5685 dd00            fld     qword ptr [eax] ds:002b:2c28d000=????????????????
 # ChildEBP RetAddr  
WARNING: Stack unwind information not available. Following frames may be wrong.
00 00000000 00000000 RcppEigen!ZN5Eigen8internal11gebp_kernelIddiLi2ELi2ELb0ELb0EEclEPdiPKdS5_iiidiiiiS3_+0x275

The demangled name (in case someone wanted to dive in)

C:\Users\kevin>c++filt -n _ZN5Eigen8internal11gebp_kernelIddiLi2ELi2ELb0ELb0EEclEPdiPKdS5_iiidiiii
Eigen::internal::gebp_kernel<double, double, int, 2, 2, false, false>::operator()(double*, int, double const*, double const*, int, int, int, double, int, int, int, int)

IMHO the best solution is for us to just force -O2 for compilation.

@eddelbuettel
Copy link
Member Author

I just got this email but it was probably tickled by someone else :)

Date: Mon, 23 May 2016 16:47:06 +0200                                                                                                                                                                               
From: Uwe.Ligges@R-Project.org                                                                                                                                                                                      
To: edd@debian.org                                                                                                                                                                                                  
Cc: Uwe.Ligges@R-Project.org                                                                                                                                                                                        
Subject: winbuilder: Package RcppEigen_666.3.2.8.1.tar.gz has been checked and built                                                                                                                                

Dear package maintainer,

this notification has been generated automatically.
Your package RcppEigen_666.3.2.8.1.tar.gz has been built (if working) and checked for Windows.
Please check the log files and (if working) the binary package at:
http://win-builder.r-project.org/QlY633B1xgv5
The files will be removed after roughly 72 hours.
Installation time in seconds: 61
Check time in seconds: 364
Status: 2 NOTEs
R Under development (unstable) (2016-05-23 r70656)

All the best,
Uwe Ligges
(CRAN maintainer of binary packages for Windows)

@f-rousset
Copy link

Hi,

yes I submitted to win-builder RcppEigen_666.3.2.8.1.tar.gz, which is RcppEigen_0.3.2.8.1.tar.gz with -O2 and -DNDEBUG added in Makevars.win, to check whether it would pass the tests that the current version does not. I forgot to change the maintainer email address, so you can see that this works.

Thanks to everyone for caring about this issue.

F.

@kevinushey
Copy link

Another option is to force -fno-omit-frame-pointer in Makevars.win as this seems to sidestep the compilation issue when -O3 and -UNDEBUG are both applied (perhaps it indirectly disables some optimization that is breaking here?)

@f-rousset
Copy link

I just tried -fno-omit-frame-pointer on win-builder and it indeed works.

(For definiteness: I modified he RcppEigen``Makevars.win to contain

ifeq "${R_ARCH}" "/i386"
PKG_CXXFLAGS= -I../inst/include -fno-omit-frame-pointer
else
PKG_CXXFLAGS = -I../inst/include 
endif

)

@eddelbuettel
Copy link
Member Author

You can add it unconditionally. It won't do harm for x86_64.

I can't quite recall where but we used it before methinks. Or maybe I just kept it around in ~/.R/Makevars.

@aadler
Copy link

aadler commented May 23, 2016

@f-rousset Have you tried -O2 without -DNDEBUG?

@f-rousset
Copy link

@aadler -O2 without -DNDEBUG fails to pass the tests for RcppEigen. It fails in the same way as the current RcppEigen version, as far as the win-builder logs show.

@aadler
Copy link

aadler commented May 24, 2016

@f-rousset Thanks. For what it is worth, in the hidden machinations of R for windows (R_HOME/src/gnuwin32/fixed/etc/Makeconf, otherwise known as "Here Be Monsters") has "R_XTRA_CPPFLAGS = -I"$(R_HOME)/include" -DNDEBUG" on line 165.

@f-rousset
Copy link

I have now had an exchange with Uwe Ligges about the compilation flags on win-builder and his latest response can be summarized as "ARGH!". We can expect that they will be fixed back to the expected -DNDEBUG and -O2.

@eddelbuettel
Copy link
Member Author

Very nice -- thanks so much for reporting back and getting it settled upstream at winbuilder!

@eddelbuettel
Copy link
Member Author

And I just got email from Uwe (or rather his bot) that a new RcppEigen has been built.

@yixuan
Copy link
Collaborator

yixuan commented May 25, 2016

Great! Thank everyone who provided help.

@eddelbuettel
Copy link
Member Author

And now got email from Uwe himself, so I think we can close this.

Kudos to @f-rousset for following this through.

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

6 participants