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

GPU on Windows #2

Open
wrathematics opened this issue Jun 3, 2020 · 16 comments
Open

GPU on Windows #2

wrathematics opened this issue Jun 3, 2020 · 16 comments

Comments

@wrathematics
Copy link
Member

I do not have the ability to test this, but I think the package can now be built with GPU backend support on Windows. I would appreciate any input/feedback on this.

If you are willing to test, you can download the development version of the package with git (there are submodules so install_github()-like things won't work):

git clone --recurse-submodules https://github.com/fml-fam/fmlr.git

Modify the first 2 lines of src/Makevars.win. The first should be set to USE_GPU = "TRUE". The second should be set to whatever your CUDA path is. The contents should be include, lib, etc. Actually, just giving me an ls of that path would be very helpful.

Install the package dependencies as needed:

install.packages("R6")
install.packages("float")

Next, try to install the package:

R CMD INSTALL fmlr/

Here's a basic test you can run to see if it works:

suppressMessages(library(fmlr))
c = card()
c

x = gpumat(c, 3, 2)
x$fill_linspace(1, 6)
x$info()
x

Here's an example of the output I see on my Linux box:

## GPU 0 (GeForce GTX 1070 Ti) 821/8116 MB - CUDA 10.1

# gpumat 3x2 type=d 
1.0000 4.0000 
2.0000 5.0000 
3.0000 6.0000 
@mpancia
Copy link

mpancia commented Jun 4, 2020

Here you go.

I'm doing this with CUDA 10.2, and the ls of my CUDA dir is:

CUDA_Toolkit_Release_Notes.txt  doc      lib      nvvm   tools
EULA.txt                        extras   libnvvp  nvvmx  version.txt
bin                             include  nvml     src

I get a compilation error. Here is the output of R CMD INSTALL:

$ R CMD INSTALL fmlr/
* installing to library 'C:/Users/Matthew Pancia/R/win-library/3.6'
* installing *source* package 'fmlr' ...
** using staged installation
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-36~1.3/include" -DNDEBUG -I../inst/include -I"C:/Users/Matthew Pancia/R/win-library/3.6/float/include"        -O3 -Wall  -std=gnu99 -mtune=core2 -c fmlr-native.c -o fmlr-native.o
c:/Rtools/mingw_32/bin/g++ -m32 -std=c++1y  -I"C:/PROGRA~1/R/R-36~1.3/include" -DNDEBUG -I../inst/include -I"C:/Users/Matthew Pancia/R/win-library/3.6/float/include"     -fopenmp   -O3 -Wno-unused-variable -Wno-unused-function -c cpumat.cpp -o cpumat.o
In file included from ../inst/include/fml/src/cpu/cpumat.hh:25:0,
                 from cpumat.cpp:9:
../inst/include/fml/src/cpu/cpuvec.hh: In member function 'void cpuvec<T>::info() const':
../inst/include/fml/src/cpu/cpuvec.hh:276:42: error: must #include <typeinfo> before using typeid
   fml::print::printf(" type=%s", typeid(T).name());
                                          ^
In file included from cpumat.cpp:9:0:
../inst/include/fml/src/cpu/cpumat.hh: In member function 'void cpumat<REAL>::info() const':
../inst/include/fml/src/cpu/cpumat.hh:308:45: error: must #include <typeinfo> before using typeid
   fml::print::printf(" type=%s", typeid(REAL).name());
                                             ^
make: *** [C:/PROGRA~1/R/R-36~1.3/etc/i386/Makeconf:215: cpumat.o] Error 1
ERROR: compilation failed for package 'fmlr'
* removing 'C:/Users/Matthew Pancia/R/win-library/3.6/fmlr'

Here's my normal sessionInfo() (also using the latest version of Rtools40):

R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3   

I'm not sure what other debug info would be useful. Let me know.

@wrathematics
Copy link
Member Author

Thanks!

It looks like it's not getting the correct C++14 flag. WRE says this

Note that Windows builds prior to R 4.0.0 used g++ 4.9.x which had only partial C++14 support, and the flag to obtain that support was not included in the default Windows build of R

I would have assumed that Rtools would be the limiting factor though, not the R version. And you have the latest Rtools.

Could you tell me the directory contents of lib and nvml? I definitely have some CUDA paths wrong in the Makefile.

@mpancia
Copy link

mpancia commented Jun 4, 2020

It's potentially related to that, because this happens after I apply the fix listed here: https://community.rstudio.com/t/error-in-shlib-internal-args-c-14-standard-requested-but-cxx14-is-not-defined/16819

If not for that, I get the error:

Error in .shlib_internal(args) :
  C++14 standard requested but CXX14 is not defined
* removing 'C:/Users/Matthew Pancia/R/win-library/3.6/fmlr'

lib looks like:

Win32  x64

nvml looks like:

example

Not much going on.

@wrathematics
Copy link
Member Author

Thanks. Linking with NVML on Windows may prove interesting. Hopefully it's in lib/${ARCH} somewhere. I've updated Makevars.win to something that's got to be closer to the right thing though.

My guess is that your R version doesn't support C++14 but your Rtools does, so changing your CXX14FLAGS line in~/.R/Makevars.win from -std=c++1y to -std=c++14 might work. If not, I may just have to set the required R version to 4.0.0 for Windows support.

@mpancia
Copy link

mpancia commented Jun 4, 2020

Hah! I get a different error after upgrading to R 4.0.0 (shows how much I use Windows). Looks like it's some weird thing involving the fact that my user name has a space and a lack of string quoting? Sorry, this may be stuff related to general weird Windows Things that I just don't get -- I don't use it much.

$ R CMD INSTALL fmlr/
* installing to library 'C:/Users/Matthew Pancia/R/win-library/4.0'
* installing *source* package 'fmlr' ...
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'        -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fmlr-native.c -o fmlr-native.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c cpumat.cpp -o cpumat.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c cpuvec.cpp -o cpuvec.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c dimops-cpu.cpp -o dimops-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c helpers-cpu.cpp -o helpers-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c linalg-cpu.cpp -o linalg-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c stats-cpu.cpp -o stats-cpu.o
In file included from ../inst/include/fml/src/cpu/cpumat.hh:25,
                 from stats-cpu.cpp:5:
../inst/include/fml/src/cpu/cpuvec.hh: In function 'int linalg::{anonymous}::svd_internals(int, int, cpumat<REAL>&, cpuvec<T>&, cpumat<REAL>&, cpumat<REAL>&) [with REAL = double]':
../inst/include/fml/src/cpu/cpuvec.hh:497:14: warning: '*((void*)& work +4)' may
be used uninitialized in this function [-Wmaybe-uninitialized]
     std::free(this->data);
     ~~~~~~~~~^~~~~~~~~~~~
In file included from ../inst/include/fml/src/cpu/stats.hh:11,
                 from stats-cpu.cpp:6:
../inst/include/fml/src/cpu/linalg.hh:507:20: note: '*((void*)& work +4)' was declared here
       cpuvec<REAL> work(lwork);
                    ^~~~
In file included from ../inst/include/fml/src/cpu/cpumat.hh:25,
                 from stats-cpu.cpp:5:
../inst/include/fml/src/cpu/cpuvec.hh: In function 'int linalg::{anonymous}::svd_internals(int, int, cpumat<REAL>&, cpuvec<T>&, cpumat<REAL>&, cpumat<REAL>&) [with REAL = float]':
../inst/include/fml/src/cpu/cpuvec.hh:497:14: warning: '*((void*)& work +4)' may
be used uninitialized in this function [-Wmaybe-uninitialized]
     std::free(this->data);
     ~~~~~~~~~^~~~~~~~~~~~
In file included from ../inst/include/fml/src/cpu/stats.hh:11,
                 from stats-cpu.cpp:6:
../inst/include/fml/src/cpu/linalg.hh:507:20: note: '*((void*)& work +4)' was declared here
       cpuvec<REAL> work(lwork);
                    ^~~~
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c mpi-dummy-bindings.cpp -o mpi-dummy-bindings.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c gpu-dummy-bindings.cpp -o gpu-dummy-bindings.o
C:/rtools40/mingw32/bin/g++ -shared -s -static-libgcc -o fmlr.dll tmp.def fmlr-native.o cpumat.o cpuvec.o dimops-cpu.o helpers-cpu.o linalg-cpu.o stats-cpu.o mpi-dummy-bindings.o gpu-dummy-bindings.o C:/Users/Matthew Pancia/R/win-library/4.0/float/libs/i386/libfloat.a -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lRlapack -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lRblas -lgfortran -lm -lquadmath -fopenmp -LC:/PROGRA~1/R/R-40~1.0/bin/i386 -lR
g++.exe: error: C:/Users/Matthew: No such file or directory
g++.exe: error: Pancia/R/win-library/4.0/float/libs/i386/libfloat.a: No such file or directory
no DLL was created
ERROR: compilation failed for package 'fmlr'
* removing 'C:/Users/Matthew Pancia/R/win-library/4.0/fmlr'

@wrathematics
Copy link
Member Author

Interesting! Looks like that's the issue. Let me add quotes to everything...

@wrathematics
Copy link
Member Author

I think that should do it...

@mpancia
Copy link

mpancia commented Jun 4, 2020

The quotes might have fixed it, but your prior commit seems to have broken something with the if statement on the architecture -- I get this error both on master and master~1:

$ R CMD INSTALL .
* installing to library 'C:/Users/Matthew Pancia/R/win-library/4.0'
* installing *source* package 'fmlr' ...
** using staged installation
** libs

*** arch - i386
Makevars.win:37: *** Unknown arch.  Stop.
ERROR: compilation failed for package 'fmlr'
* removing 'C:/Users/Matthew Pancia/R/win-library/4.0/fmlr'

@wrathematics
Copy link
Member Author

Ok, I think I have the arch selector right now based on a re-reading of WRE...

Thanks so much again for all the help so far!

@mpancia
Copy link

mpancia commented Jun 5, 2020

Well, it does seem to compile now, but it doesn't seem to compile with GPU support? Maybe the flag is ignored for some reason? When running your sample code, I get the error:

suppressMessages(library(fmlr))
c = card()
#> Warning in .subset2(public_bind_env, "initialize")(...): fmlr built without GPU
#> support; this does nothing
c
#> Warning in self$info(): fmlr built without GPU support; this does nothing

x = gpumat(c, 3, 2)
#> Warning in x$valid_card(): fmlr built without GPU support; this does nothing
#> Error in check_is_card(card): invalid card object
x$fill_linspace(1, 6)
#> Error in eval(expr, envir, enclos): object 'x' not found
x$info()
#> Error in eval(expr, envir, enclos): object 'x' not found
x
#> Error in eval(expr, envir, enclos): object 'x' not found

Attached is my Makevars.win

USE_GPU = "TRUE"
CUDA_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2"

USE_MPI = "FALSE"



# ------------------------------------------------------------------------------
CXX_STD = CXX14

R_SCMD = ${R_HOME}/bin${R_ARCH_BIN}/Rscript -e

# this is exactly what it looks like
$(shell ${R_SCMD} "cat(paste(sub('@USE_MPI@', '"${USE_MPI}"', sub('@USE_GPU@', '"${USE_GPU}"', readLines('../R/02-features.r.in'))), collapse='\n'), file='../R/02-features.r')")

FML_CPPFLAGS = -I../inst/include

ifeq "$(USE_MPI)" "TRUE"
MPI_INCLUDE = $(shell ${R_SCMD} "library(pbdMPI);get.conf('MPI_INCLUDE','"${R_ARCH}"','pbdMPI')")
SPMD_CPPFLAGS = -I"$(MPI_INCLUDE)"
SPMD_LDFLAGS = $(shell ${R_SCMD} "library(pbdMPI);get.conf('MPI_LIB','"${R_ARCH}"','pbdMPI')")
SLAP_LDFLAGS = $(shell ${R_SCMD} "library(pbdMPI);get.lib('R_SLAP','"${R_ARCH}"','pbdSLAP')")
endif

FLOAT_INCL = $(shell ${R_SCMD} "float:::cppflags()")
FLOAT_LIBS = $(shell ${R_SCMD} "float:::ldflags()")

R_CPPFLAGS = $(shell ${R_HOME}/bin${R_ARCH_BIN}/R CMD config --cppflags)

NVCC = $(CUDA_DIR)/bin/nvcc
CUDA_CFLAGS = -I"${CUDA_DIR}"/include
ifeq "$(WIN)" "64"
CUDA_LDFLAGS = -L"${CUDA_DIR}"/lib/x64
else
CUDA_LDFLAGS = -L"${CUDA_DIR}"/lib/Win32
endif



# set arch flags
PKG_LIBS_CPU = "${FLOAT_LIBS}" $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)

PKG_LIBS_GPU = $(CUDA_LDFLAGS) -lcudart -lcublas -lcusolver -lcurand -lnvidia-ml

PKG_CPPFLAGS_MPI = $(SPMD_CPPFLAGS)
PKG_CXXFLAGS_MPI = $(SPMD_CPPFLAGS)
PKG_LIBS_MPI = $(SLAP_LDFLAGS) $(SPMD_LDFLAGS)



# flags
PKG_CPPFLAGS = $(FML_CPPFLAGS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)



# libs and objects
R_OBJS = fmlr-native.o
CPU_OBJS = cpumat.o cpuvec.o dimops-cpu.o helpers-cpu.o linalg-cpu.o stats-cpu.o
MPI_OBJS = dimops-mpi.o grid.o helpers-mpi.o linalg-mpi.o mpimat.o stats-mpi.o
PKG_LIBS = $(PKG_LIBS_CPU)

ifeq "$(USE_MPI)" "TRUE"
PKG_CPPFLAGS += $(PKG_CPPFLAGS_MPI)
PKG_CXXFLAGS += $(PKG_CXXFLAGS_MPI) 
PKG_LIBS += $(PKG_LIBS_MPI)
MPI_OBJS = dimops-mpi.o grid.o helpers-mpi.o linalg-mpi.o mpimat.o stats-mpi.o
else
MPI_OBJS = mpi-dummy-bindings.o
endif

ifeq "$(USE_GPU)" "TRUE"
PKG_LIBS += $(PKG_LIBS_GPU)
GPU_OBJS = card.o dimops-gpu.o gpumat.o gpuvec.o helpers-gpu.o linalg-gpu.o stats-gpu.o
else
PKG_LIBS = $(PKG_LIBS_MPI) $(PKG_LIBS_CPU)
GPU_OBJS = gpu-dummy-bindings.o
endif

OBJECTS = $(R_OBJS) $(CPU_OBJS) $(MPI_OBJS) $(GPU_OBJS)



# make
all: $(SHLIB)

ifeq "$(USE_GPU)" "TRUE"
%.o: %.cu
	$(NVCC) -DGPU -O2 -x cu -c -arch=sm_61 -Xcompiler "-fPIC $(FML_CPPFLAGS) $(FLOAT_INCL) $(R_CPPFLAGS) $(SPMD_CPPFLAGS)" $< -o $@
else
$(SHLIB): $(OBJECTS)
endif

@wrathematics
Copy link
Member Author

wrathematics commented Jun 5, 2020

Weird. Would you mind giving me the compiler output from the R CMD INSTALL?

Edit: Nevermind. I think I see the issue here. There's a subtlety with quotes that I don't think behaves this way in GNU make on linux. I'll push a fix this evening.

@mpancia
Copy link

mpancia commented Jun 8, 2020

I get this error now when doing R CMD INSTALL after re-cloning the repo (also shows up when I use devtools to try and install):

Running "C:/PROGRA~1/R/R-40~1.0/bin/x64/Rcmd.exe" INSTALL \
  "C:\Users\MATTHE~1\AppData\Local\Temp\Rtmps3xweT/fmlr_0.2-1-1.tar.gz" \
  --install-tests 
* installing to library 'C:/Users/Matthew Pancia/R/win-library/4.0'
* installing *source* package 'fmlr' ...
** using staged installation
** libs
|
*** arch - i386
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'        -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fmlr-native.c -o fmlr-native.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c cpumat.cpp -o cpumat.o
cpumat.cpp:8:10: fatal error: fml/src/_internals/arraytools/src/arraytools.hpp: No such file or directory
 #include <fml/src/_internals/arraytools/src/arraytools.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:229: cpumat.o] Error 1
ERROR: compilation failed for package 'fmlr'
* removing 'C:/Users/Matthew Pancia/R/win-library/4.0/fmlr'
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
  System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed

@wrathematics
Copy link
Member Author

Did you clone with --recurse-submodules?

git clone --recurse-submodules https://github.com/fml-fam/fmlr.git

The install_github() variants won't work because of the submodules, unfortunately.

@mpancia
Copy link

mpancia commented Jun 8, 2020

Ugh, I'm a doofus, I should have realized that. Sorry. I get a different error now:

$ R CMD INSTALL .
* installing to library 'C:/Users/Matthew Pancia/R/win-library/4.0'
* installing *source* package 'fmlr' ...
** using staged installation
** libs

*** arch - i386
"C:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'        -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fmlr-native.c -o fmlr-native.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c cpumat.cpp -o cpumat.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c cpuvec.cpp -o cpuvec.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c dimops-cpu.cpp -o dimops-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c helpers-cpu.cpp -o helpers-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c linalg-cpu.cpp -o linalg-cpu.o
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c stats-cpu.cpp -o stats-cpu.o
In file included from ../inst/include/fml/src/cpu/cpumat.hh:25,
                 from stats-cpu.cpp:5:
../inst/include/fml/src/cpu/cpuvec.hh: In function 'int linalg::{anonymous}::svd_internals(int, int, cpumat<REAL>&, cpuvec<T>&, cpumat<REAL>&, cpumat<REAL>&) [with REAL = double]':
../inst/include/fml/src/cpu/cpuvec.hh:497:14: warning: '*((void*)& work +4)' may be used uninitialized in this function [-Wmaybe-uninitialized]
     std::free(this->data);
     ~~~~~~~~~^~~~~~~~~~~~
In file included from ../inst/include/fml/src/cpu/stats.hh:11,
                 from stats-cpu.cpp:6:
../inst/include/fml/src/cpu/linalg.hh:507:20: note: '*((void*)& work +4)' was declared
here
       cpuvec<REAL> work(lwork);
                    ^~~~
In file included from ../inst/include/fml/src/cpu/cpumat.hh:25,
                 from stats-cpu.cpp:5:
../inst/include/fml/src/cpu/cpuvec.hh: In function 'int linalg::{anonymous}::svd_internals(int, int, cpumat<REAL>&, cpuvec<T>&, cpumat<REAL>&, cpumat<REAL>&) [with REAL = float]':
../inst/include/fml/src/cpu/cpuvec.hh:497:14: warning: '*((void*)& work +4)' may be used uninitialized in this function [-Wmaybe-uninitialized]
     std::free(this->data);
     ~~~~~~~~~^~~~~~~~~~~~
In file included from ../inst/include/fml/src/cpu/stats.hh:11,
                 from stats-cpu.cpp:6:
../inst/include/fml/src/cpu/linalg.hh:507:20: note: '*((void*)& work +4)' was declared
here
       cpuvec<REAL> work(lwork);
                    ^~~~
"C:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I../inst/include -I'C:/Users/Matthew Pancia/R/win-library/4.0/float/include'     -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c mpi-dummy-bindings.cpp -o mpi-dummy-bindings.o
Error in tools::file_path_as_absolute(float_include_dir_rel) :
  file '' does not exist
Calls: <Anonymous> -> cppflags_string -> <Anonymous>
Execution halted
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2"/bin/nvcc -DGPU -O2 -x cu -c
-arch=sm_61 -Xcompiler "-fPIC -I../inst/include  -IC:/PROGRA~1/R/R-40~1.0/include -IC:/PROGRA~1/R/R-40~1.0/include/i386 " card.cu -o card.o
nvcc fatal   : Cannot find compiler 'cl.exe' in PATH
make: *** [Makevars.win:88: card.o] Error 1
ERROR: compilation failed for package 'fmlr'
* removing 'C:/Users/Matthew Pancia/R/win-library/4.0/fmlr'

@wrathematics
Copy link
Member Author

No worries. I really appreciate your patience working with me so far.

We are finally at the CUDA problems! Sorry this took so much of your time so far. I really thought the makefile was in good enough shape that we would start here...

Well apparently (and I really should have seen this coming) Windows CUDA only supports Microsoft's VC++. I have no idea if installing that and setting the compiler to cl.exe in ~/.R/Makevars.win would work, although I doubt it. I'm trying to find more information at the moment.

@mpancia
Copy link

mpancia commented Jun 9, 2020

No worries. I really appreciate your patience working with me so far.

We are finally at the CUDA problems! Sorry this took so much of your time so far. I really thought the makefile was in good enough shape that we would start here...

Well apparently (and I really should have seen this coming) Windows CUDA only supports Microsoft's VC++. I have no idea if installing that and setting the compiler to cl.exe in ~/.R/Makevars.win would work, although I doubt it. I'm trying to find more information at the moment.

You're doing God's work by trying to grapple with any Windows-related compiler issues, so this is the least I can do. Let me know how I can help.

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

2 participants