Comments (17)
Ah, bum. Kind of weird that the package compiles but the vignette does not - I assume knitr calls sourceCpp
, but I thought that sourceCpp
would use the same build conditions as R itself... Anyway, it looks painful to debug, so, yeah, it's probably easiest to turn off the vignette builds on Windows.
from rcppannoy.
This has been uploaded, and is currently awaiting the required manual inspection at CRAN as it triggers an UBSAN warning (due to the out-of-bounds vector use that is baked in).
from rcppannoy.
I am puzzled too, but not too interested in chasing esoteric Windows crankyness. I will try just turning it off.
from rcppannoy.
Hm, we already have eval=FALSE
as a knitr::opts_chunk
option. So we may not have that option.
from rcppannoy.
There are two chunks that do get executed (compilation and Cpp function check), so it should just be a case of setting the remaining eval=TRUE
to FALSE
on detecting the Windows OS, right?
from rcppannoy.
Would you mind checking? I also used R Hub's builder and I think I got the same failures there.
I use this wrapper to just call it as a one-liner; should work the same way via Rscript
(but you need to get your RHub token into place, see the rhub
package documentation).
from rcppannoy.
I can't even get the package to install in RHub:
294#> ** libs
295#> *** arch - i386
296#> In file included from annoy.cpp:39:0:
297#> ../inst/include/annoylib.h:43:22: fatal error: sys/mman.h: No such file or directory
298#> #include
299#> ^
300#> compilation terminated.
301#> make: *** [annoy.o] Error 1
302#> ERROR: compilation failed for package 'RcppAnnoy'
Seems like _MSC_VER
is not defined - am I missing something?
from rcppannoy.
Ah, crap. I fixed that at home but didn't push yet. Sorry:
1 file changed, 7 insertions(+), 5 deletions(-)
inst/include/annoylib.h | 12 +++++++-----
modified inst/include/annoylib.h
@@ -35,12 +35,14 @@ typedef unsigned __int64 uint64_t;
#include <stdint.h>
#endif
-#ifdef _MSC_VER
-#define NOMINMAX
-#include "mman.h"
-#include <windows.h>
+#ifdef __MINGW32__
+ #ifndef NOMINMAX
+ #define NOMINMAX
+ #endif
+ #include "mman.h"
+ #include <windows.h>
#else
-#include <sys/mman.h>
+ #include <sys/mman.h>
#endif
#include <string.h>
Once we're done with this iteration I'll make sure that also gets to Erik's repo.
(And the condition may need if #defined(_MSC_VER_) || defined(__MINGW32__)
-- our Windows builds clearly have the latter.)
from rcppannoy.
Weird that this issue came up. Looking forward to the PR!
from rcppannoy.
I think we had that before. For you Windows is always _MSC_VER
but R is a little "special" that all Windows builds happens via MinGW's gcc. Not a biggie and I should have caught it. Will send PR once we've squared this.
from rcppannoy.
@LTLA New idea: Why don't we simplify to where we were earlier and make each code a pure pandoc formatting block -- and forget about knitr?
from rcppannoy.
I'm up for that, as long as we can compile it regularly somehow, outside of knitr.
Edit: in any case, the modification to annoylib.h
means that RcppAnnoy passes Windows check on rhub with eval=!is.win
where is.win <- .Platform$OS.type=="windows"
in the first chunk.
from rcppannoy.
Whay do you mean by 'compile it regularly' ?
FWIW what I have (uncommitted) works fine at RHub. It just reverts all code blocks back to
```cpp
// ... stuff here
```
That would be simpler.
from rcppannoy.
Regarding compilation, the idea is to ensure all of the C++ code in the vignette is valid. This is most easily done by concatenating it all together (along with the echo=FALSE
helper chunks in the vignette) and trying to compile it. This doesn't have to be via knitr, but I feel we should have a process to compile it (e.g., a unit test using the script in #31?) to make sure that our instructions are valid. For example, it was clear that the first version wasn't compiled as it had a number of errors.
from rcppannoy.
Simpler is better. We have tests for tests and I'd be open to adding a C++-based unit tests.
I like my vignettes simple. For Rcpp we did just this for years -- typset and not running. (I know BioConductor has differed on this for years and promotes vignettes, but I as maintainer am the one who has to make sure it all works together, and there I think I prefer a simpler one.)
from rcppannoy.
So in b4dafb2 I just pushed a simplification that should get us onto CRAN.
from rcppannoy.
Okey dokey.
from rcppannoy.
Related Issues (20)
- Warning during compilation with Ropen HOT 5
- Expose `set_seed` method HOT 4
- More granular documentation HOT 5
- error installing rcppannoy on Mac 10.9.5, R 3.4.4 HOT 3
- Error in loading RcppAnnoy HOT 2
- RcppAnnoy fails to compile HOT 4
- Error during compilation of RcppAnnoy HOT 9
- rcppannoy loading/installation error HOT 6
- New / remaining sanitizer issues HOT 17
- Version 0.0.15 broke BiocNeighbors HOT 7
- 0.0.16 build from source issues on macOS HOT 5
- Vignette update HOT 9
- More content for RcppAnnoy.h HOT 4
- Unable to Save HOT 3
- Pass the whole matrix to addItem and getNNs function HOT 6
- Multithreading HOT 7
- Any plan for API like RcppHSNW or RANN? HOT 8
- R CMD build issue on Windows with R 4.2 HOT 9
- Run reverse depends checks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcppannoy.