<div dir="ltr">Hi Dirk and friends<br><br>Thanks for the help. In my attempt to isolate the issue, I wonder if there's an issue with linking to RcppSpdlog. <br><br>I tried compiling with "LinkingTo: Rcpp, RcppEigen, RcppSpdlog", and the error exists: <div><a href="https://win-builder.r-project.org/F2g5vjpw6M1T">https://win-builder.r-project.org/F2g5vjpw6M1T</a></div><div><a href="https://github.com/kharchenkolab/N2R/tree/341fe9ff37a0f3082e1daff03d4b01ecf03d83b2">https://github.com/kharchenkolab/N2R/tree/341fe9ff37a0f3082e1daff03d4b01ecf03d83b2</a><br><br>But when I remove `RcppSpdlog`, it successfully compiles:</div><div><a href="https://win-builder.r-project.org/G0PRavw4yuhZ/">https://win-builder.r-project.org/G0PRavw4yuhZ/</a></div><div><a href="https://github.com/kharchenkolab/N2R/commit/fd49332c6c25655e0926b0935c9741ff8adcfecf">https://github.com/kharchenkolab/N2R/commit/fd49332c6c25655e0926b0935c9741ff8adcfecf</a><br><br>Could this be some issues with linking to both RcppEigen and RcppSpdlog? Issues with RcppSpglog windows binaries? <br><br>As some background, I was using the spdlog library directly, which compiles correctly on windows as well:<br><a href="https://github.com/kharchenkolab/N2R/tree/338f380df4c49da76c797f2e5a3791f978c64156">https://github.com/kharchenkolab/N2R/tree/338f380df4c49da76c797f2e5a3791f978c64156</a><br><a href="https://win-builder.r-project.org/ju94MKp8YSD5/">https://win-builder.r-project.org/ju94MKp8YSD5/</a><br><br>I wanted to switch to RcppSpdlog to stop the CRAN notes/warnings.<br><br><b>> That is worse. It seems to rely on 64bit layout. Yet is uses 'int' as opposed to 'int64_t' which would hardwire the size.<br>> Is the 'int' under your control?  Can you make that an int64_t?</b><br><br>So the above makes me wonder if there's an issue linking to RcppSpdlog and RcppEigen, because there are no issues with 64-bit otherwise.</div><div><br></div><div>I'm not making extensive or complicated calls with spdlog either:<br><a href="https://github.com/kharchenkolab/N2R/blob/master/src/n2/hnsw.cc#L67-L71">https://github.com/kharchenkolab/N2R/blob/master/src/n2/hnsw.cc#L67-L71</a><br><br>Just 'spdlog::get()' and either 'spdlog::stdout_logger_mt()' (in the standard spdlog library) or 'spdlog::r_sink_mt()' (in the RcppSpdlog library).<br><br>Hopefully the above is clear, and thanks for any insight. <br>Best, Evan<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 19, 2020 at 1:01 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi Evan,<br>
<br>
On 19 September 2020 at 10:14, Evan Biederstedt wrote:<br>
| I'm in the process uploading an R package to CRAN, which is a relatively<br>
| simple interface to a C++ library: <a href="https://github.com/kharchenkolab/N2R" rel="noreferrer" target="_blank">https://github.com/kharchenkolab/N2R</a><br>
| <br>
| The windows binaries just became available for RcppSpdLog, so I wanted to<br>
| check how it installed on windows before CRAN submission.<br>
| <br>
| The package currently installs on Linux and Mac OS, but when I check with<br>
| `devtools::check_win_devel()`, I'm getting a Windows-related error.<br>
| <br>
| The error appears to be related to RcppEigen, not the C++ library---this<br>
| feels like something easily fixable, but I'm a bit nonplussed how to fix<br>
| this:<br>
| <br>
| """<br>
| <br>
| d:/RCompile/CRANpkg/lib/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:650:34:<br>
| warning: ignoring attributes on template argument<br>
| 'Eigen::internal::packet_traits<int>::type' {aka '__vector(2) long<br>
| long int'} [-Wignored-attributes]<br>
|<br>
|    return internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m);<br>
| <br>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
| make: *** [D:/RCompile/recent/R/etc/i386/Makeconf:244: n2knn.o] Error 1<br>
| ERROR: compilation failed for package 'N2R'<br>
| * removing 'd:/RCompile/CRANguest/R-devel/lib/N2R'<br>
| * restoring previous 'd:/RCompile/CRANguest/R-devel/lib/N2R'<br>
| <br>
| """<br>
| <br>
| "'Eigen::internal::packet_traits<int>::type' {aka '__vector(2) long long<br>
| int'} [-Wignored-attributes]" appears to be a somewhat standard warning,<br>
<br>
Right. Eigen is very verbose. For my local compilations I often set something<br>
like this in ~/.R/Makevars (uncommented, of course, and later in the file<br>
used in CXX*FLAGS):<br>
<br>
  #PEDANTIC=-pedantic -DBOOST_NO_AUTO_PTR -Wno-ignored-attributes<br>
  #PEDANTIC= -DBOOST_NO_AUTO_PTR -Wno-sign-compare -Wno-parentheses -Wno-maybe-uninitialized<br>
<br>
<br>
| but I'm not sure how to resolve<br>
| "internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m);"<br>
| which is causing the compilation error.<br>
<br>
That is worse. It seems to rely on 64bit layout. Yet is uses 'int' as opposed<br>
to 'int64_t' which would hardwire the size.<br>
<br>
Is the 'int' under your control?  Can you make that an int64_t?<br>
<br>
I don't have any other suggestions. :-/<br>
<br>
Dirk<br>
<br>
| I've tried with C++11 and C++14; same result. I've seen some discussion<br>
| elsewhere that this could be related to the -fopenmp flags here:<br>
| <a href="https://github.com/kharchenkolab/N2R/blob/master/src/n2/Makefile" rel="noreferrer" target="_blank">https://github.com/kharchenkolab/N2R/blob/master/src/n2/Makefile</a><br>
| Perhaps there's something here which clashes with RcppEigen on windows?<br>
| <br>
| Any help is appreciated. Here is the CRAN builds:<br>
| <a href="https://win-builder.r-project.org/D98h1Y2Rr004/" rel="noreferrer" target="_blank">https://win-builder.r-project.org/D98h1Y2Rr004/</a><br>
| <br>
| Best, Evan<br>
| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
-- <br>
<a href="https://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">https://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div>