-
Notifications
You must be signed in to change notification settings - Fork 6
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
RcppArrayFire - in Windows #3
Comments
You could try to manually configure the package. The
After that compilation might work. I am very interested in your results. |
According to http://arrayfire.org/docs/using_on_windows.htm the ArrayFire installer sets an environment variable
|
Hey Ralf! Thanks so much - I'll try to get to this today or over the weekend. I'll let you know how this goes. |
Hey Ralf - I tried the adjustments to PS: I can load ArrayFire in Visual Studio and run examples, so I believe my system Path is correct. I got this error when I run Rcmd.exe:
|
Also, I did the above and then copied |
Thanks for your tests! The Problem are the spaces in $AF_PATH, which
You can also make equivalent changes in |
This hints at an issue: The ArrayFire libraries are compiled with Visual Studio, but the Rtools toolchain uses gcc. The C++ ABIs are different for these two compilers. So I fear one either has to compile ArrayFire from source using gcc, or RcppArrayFire would have to use to C API instead of the C++ API, since the C ABIs should be compatible. |
Well, I think you're on to something here...I might have to build ArrayFire from source using gcc. I made the changes you suggested above and got the following (a partial readout....this is probably more problematic than we thought....):
|
I have raised the question of building ArrayFire with mingw in their slack community. |
Good idea - let's see where that goes. I may have a couple of people I can approach as well. |
Response on slack was that it should work given that ArrayFire does not use any Visual C++ specialties on Windows. An alternative solution might be to build the R package using Visual C++, as it is done for LightGBM. |
Hmmm....not sure what to do now....lol.... |
I am not sure either. Good news is that I now have a Windows machine available and I intend to use it also for porting RcppArrayFire. I was already able to reproduce the errors you are getting. |
Hey Ralf, that's great - at least you've reproduced the errors! Let me know when you've made some progress and I'll definitely help test. - John |
Hey Ralf, by the way, I've switched to Windows10 - but this probably won't make much difference. |
Ralf - I've also successfully run some ArrayFire examples under Visual Studio using OpenCL - so I know that works too. I tried using CUDA, but it looks like the directory structure is wrong. I'm probably just going to stick with OpenCL when using with RcppArrayFire. |
I have made some progress with building ArrayFire using a mingw tool chain, but this is slow going ... |
And I can now rule out using Visual C++, since Rcpp is not compatible with that. It seems packages like lightGBM use R's C-API only. |
Yeah, I think the mingw tool chain is the best bet. Sorry I can't be of much help on this.... |
Hello, thank you for the effort of creating RcppArrayFire. Is there any possibility there could be a Windows version? I see there were some ideas about it, but it is a few months since no changes. Best. |
Thanks for your interest, @Despertaferro. The problem is simply that one has to compile ArrayFire for Windows using the mingw tool chain. There is no other way this can work. BTW, this also rules out CUDA support on Windows, since CUDA on windows requires VC++. I have tried to compile ArrayFire on Windows using RTools, but never quite succeeded. I currently do not have a Windows machine available. I am therefore flagging this issue as "help wanted". |
Drive-by comment for Realloc, Free. Maybe this helps someone. Either undefine the allocs: #include <R.h>
#undef Realloc
#define R_Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (size_t)((n) * sizeof(t)) )
#include <windows.h> or define #define STRICT_R_HEADERS
#include <Rcpp.h>
or, even simpler, set -DSTRICT_R_HEADERS in eg CXXFLAGS in ~/.R/Makevars. |
@mschubert Thanks for the comment. |
Hi! I've been trying to install in Windows - and I realize this works under Linux at the moment, but I thought I might be able to build from source since I have RTools installed.
But I get this error:
installing source package 'RcppArrayFire' ...
WARNING: this package has a configure script
It probably needs manual configuration
** libs
*** arch - i386
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-3.4.3/include" -DNDEBUG -I"C:/Users/Documents/R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c RcppArrayFire.cpp -o RcppArrayFire.o
RcppArrayFire.cpp:23:27: fatal error: RcppArrayFire.h: No such file or directory
#include <RcppArrayFire.h>
^
compilation terminated.
Any ideas how I might proceed here? I'm not familiar with building from source, but I do use Rcpp. My ArrayFire install will run examples in Visual Studio with no problem. Thanks!
The text was updated successfully, but these errors were encountered: