njm18 / gmatrix

R package for unleashing the power of NVIDIA GPU's
Other
16 stars 5 forks source link

Cannot install on osx 10.11.3 #4

Closed ghost closed 8 years ago

ghost commented 8 years ago
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin15.3.0 (64-bit)
Running under: OS X 10.11.3 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] vimcom_1.2-7

loaded via a namespace (and not attached):
[1] rsconnect_0.4.1.4 tools_3.2.3      

PS: I edited gmatrix/src/Makefile.in file to display errors verbosely.

$(TARGET): $(OBJS)
$(NVCC) -arch=sm_50 -v -shared $(LDFLAGS) $(LIBS) $(OBJS) -o $@
> R CMD INSTALL gmatrix.tar.gz --configure-args="--with-arch=sm_50 --with-cuda-home=$CUDA_HOME"

Welcome at  Thu Mar 10 20:18:32 2016
* installing to library ‘../R/library’
* installing *source* package ‘gmatrix’ ...
file ‘src/Makefile.in’ has the wrong MD5 checksum
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
setting CUDA home directory to /Developer/NVIDIA/CUDA-7.5
checking for /Developer/NVIDIA/CUDA-7.5/bin/nvcc... yes
setting compute capability of the target device to sm_50
checking for CUDA headers... checking for /Developer/NVIDIA/CUDA-7.5/include/cublas_v2.h... yes
checking whether this is a 64-bit version of CUDA... checking for /Developer/NVIDIA/CUDA-7.5/lib64/libcublas.so... no
checking whether cusolver is used... checking for /Developer/NVIDIA/CUDA-7.5/include/cusolverDn.h... yes
setting R home directory to /usr/local/Cellar/r/3.2.3_1/R.framework/Resources
checking for R... yes
setting R header files to /usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch -
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" fact.cu -o fact.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" dist.cu -o dist.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" conversions.cu -o conversions.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" general.cu -o general.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" ops.cu -o ops.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" manipulation.cu -o manipulation.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" matrix.cu -o matrix.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -arch=sm_50 -v -shared -L/Developer/NVIDIA/CUDA-7.5/lib -lcudart -lcublas -lcusolver fact.o dist.o conversions.o general.o ops.o manipulation.o  matrix.o  -o gmatrix.so
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/Developer/NVIDIA/CUDA-7.5/bin
#$ _THERE_=/Developer/NVIDIA/CUDA-7.5/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ TOP=/Developer/NVIDIA/CUDA-7.5/bin/..
#$ NVVMIR_LIBRARY_DIR=/Developer/NVIDIA/CUDA-7.5/bin/../nvvm/libdevice
#$ PATH=/Developer/NVIDIA/CUDA-7.5/bin/../open64/bin:/Developer/NVIDIA/CUDA-7.5/bin/../nvvm/bin:/Developer/NVIDIA/CUDA-7.5/bin:/usr/local/opt/coreutils/libexec/gnubin:/Developer/NVIDIA/CUDA-7.5/bin:/../Android/platform-tools:../Android/tools:../Go/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/go/libexec/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
#$ INCLUDES="-I/Developer/NVIDIA/CUDA-7.5/bin/../include"
#$ LIBRARIES=  "-L/Developer/NVIDIA/CUDA-7.5/bin/../lib"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ nvlink --arch=sm_50 --register-link-binaries="../tmpxft_00005c95_00000000-2_gmatrix_dlink.reg.c" -m64 -L"/Developer/NVIDIA/CUDA-7.5/lib" -lcudart -lcublas -lcusolver   "-L/Developer/NVIDIA/CUDA-7.5/bin/../lib" -cpu-arch=X86_64 "fact.o" "dist.o" "conversions.o" "general.o" "ops.o" "manipulation.o" "matrix.o"  -lcudadevrt  -o "../tmpxft_00005c95_00000000-4_gmatrix_dlink.sm_50.cubin"
#$ fatbinary --create="../tmpxft_00005c95_00000000-3_gmatrix_dlink.fatbin" -64 --key="gmatrix_dlink" -link "--image=profile=sm_50,file=../tmpxft_00005c95_00000000-4_gmatrix_dlink.sm_50.cubin" --embedded-fatbin="../tmpxft_00005c95_00000000-3_gmatrix_dlink.fatbin.c"
#$ rm ../tmpxft_00005c95_00000000-3_gmatrix_dlink.fatbin
#$ clang -c -x c++ -fPIC -DFATBINFILE="\"../tmpxft_00005c95_00000000-3_gmatrix_dlink.fatbin.c\"" -DREGISTERLINKBINARYFILE="\"../tmpxft_00005c95_00000000-2_gmatrix_dlink.reg.c\"" -I. "-I/Developer/NVIDIA/CUDA-7.5/bin/../include"   -D"__CUDACC_VER__=70519" -D"__CUDACC_VER_BUILD__=19" -D"__CUDACC_VER_MINOR__=5" -D"__CUDACC_VER_MAJOR__=7" -m64 -o "../tmpxft_00005c95_00000000-5_gmatrix_dlink.o" "/Developer/NVIDIA/CUDA-7.5/bin/crt/link.stub"
#$ clang++ -m64 -o "gmatrix.so"  -Xlinker -force_load  -Xlinker "/Developer/NVIDIA/CUDA-7.5/bin/../lib/libcudart_static.a" "../tmpxft_00005c95_00000000-5_gmatrix_dlink.o" "fact.o" "dist.o" "conversions.o" "general.o" "ops.o" "manipulation.o" "matrix.o" -dynamiclib -L"/Developer/NVIDIA/CUDA-7.5/lib" -lcudart -lcublas -lcusolver   "-L/Developer/NVIDIA/CUDA-7.5/bin/../lib" -lcudadevrt  -Xlinker -rpath  -Xlinker /usr/local/cuda/lib  -Xlinker -framework  -Xlinker CoreFoundation
Undefined symbols for architecture x86_64:
  "_INTEGER", referenced from:
      get_gmat_struct(SEXPREC*) in fact.o
      get_gvec_struct(SEXPREC*) in fact.o
      _gpu_rnorm in dist.o
      _gpu_dnorm in dist.o
      _gpu_pnorm in dist.o
      _gpu_qnorm in dist.o
      _gpu_dunif in dist.o
      ...
  "_LOGICAL", referenced from:
      _gpu_dnorm in dist.o
      _gpu_pnorm in dist.o
      _gpu_qnorm in dist.o
      _gpu_dunif in dist.o
      _gpu_dgamma in dist.o
      _gpu_dbeta in dist.o
      _gpu_dbinom in dist.o
      ...
  "_REAL", referenced from:
      _gpu_scaler_pow12 in ops.o
      _gpu_scaler_pow21 in ops.o
      _gpu_scaler_sub12 in ops.o
      _gpu_scaler_sub21 in ops.o
      _gpu_scaler_div12 in ops.o
      _gpu_scaler_div21 in ops.o
      _gpu_scaler_mod12 in ops.o
      ...
  "_R_CHAR", referenced from:
      _get_device_info in general.o
  "_R_ExternalPtrAddr", referenced from:
      get_gmat_struct(SEXPREC*) in fact.o
      get_gvec_struct(SEXPREC*) in fact.o
      _rcusolve_qr in fact.o
      _rcusolve_svd in fact.o
      _gpu_rnorm in dist.o
      _gpu_dnorm in dist.o
      _gpu_pnorm in dist.o
      ...
  "_R_MakeExternalPtr", referenced from:
      _gpu_register in matrix.o
      _gpu_create in matrix.o
      _gpu_duplicate in matrix.o
      _gpu_rep_1 in matrix.o
      _gpu_rep_m in matrix.o
      _matrix_multiply in matrix.o
      _gpu_outer in matrix.o
      ...
  "_R_NaInt", referenced from:
      _setDevice in general.o
  "_R_NaReal", referenced from:
      _setDevice in general.o
  "_R_NilValue", referenced from:
      _gpu_register in matrix.o
      _gpu_create in matrix.o
      _gpu_duplicate in matrix.o
      _gpu_rep_1 in matrix.o
      _gpu_rep_m in matrix.o
      _matrix_multiply in matrix.o
      _gpu_outer in matrix.o
      ...
  "_R_RegisterCFinalizerEx", referenced from:
      _gpu_register in matrix.o
      _gpu_create in matrix.o
      _gpu_duplicate in matrix.o
      _gpu_rep_1 in matrix.o
      _gpu_rep_m in matrix.o
      _matrix_multiply in matrix.o
      _gpu_outer in matrix.o
      ...
  "_R_alloc", referenced from:
      _rcusolve_svd in fact.o
  "_R_chk_calloc", referenced from:
      _gpu_rnorm in dist.o
      _gpu_dnorm in dist.o
      _gpu_pnorm in dist.o
      _gpu_qnorm in dist.o
      _gpu_dunif in dist.o
      _gpu_runif in dist.o
      _gpu_rgamma in dist.o
      ...
  "_R_chk_free", referenced from:
      gpu_finalizer(SEXPREC*) in matrix.o
  "_R_do_MAKE_CLASS", referenced from:
      _matrix_multiply in matrix.o
      _gpu_order in matrix.o
      _gpu_which in matrix.o
      _gpu_seq in matrix.o
  "_R_do_new_object", referenced from:
      _matrix_multiply in matrix.o
      _gpu_order in matrix.o
      _gpu_which in matrix.o
      _gpu_seq in matrix.o
  "_R_do_slot", referenced from:
      get_gmat_struct(SEXPREC*) in fact.o
      get_gvec_struct(SEXPREC*) in fact.o
      get_matrix_struct(SEXPREC*) in matrix.o
      _matrix_multiply in matrix.o
  "_R_do_slot_assign", referenced from:
      _matrix_multiply in matrix.o
      _gpu_order in matrix.o
      _gpu_which in matrix.o
      _gpu_seq in matrix.o
  "_R_gc", referenced from:
      _rcusolve_qr in fact.o
      _rcusolve_modqr_coef in fact.o
      _rcusolve_chol in fact.o
      _rcusolve_svd in fact.o
      _gpu_rnorm in dist.o
      _gpu_dnorm in dist.o
      _gpu_pnorm in dist.o
      ...
  "_Rf_allocVector", referenced from:
      _get_globals in general.o
      _get_device in general.o
      _get_device_info in general.o
      _gpu_get in matrix.o
      _asSEXPint in matrix.o
      _matrix_multiply in matrix.o
      _gpu_sum in matrix.o
      ...
  "_Rf_asLogical", referenced from:
      _gpu_gmm in matrix.o
      _matrix_multiply in matrix.o
  "_Rf_error", referenced from:
      check_error(cusolverStatus_t) in fact.o
      _rcusolve_qr in fact.o
      _rcusolve_modqr_coef in fact.o
      lower_0(gmat*, int) in fact.o
      _rcusolve_chol in fact.o
      _rcusolve_svd in fact.o
      _gpu_rnorm in dist.o
      ...
  "_Rf_install", referenced from:
      get_gmat_struct(SEXPREC*) in fact.o
      get_gvec_struct(SEXPREC*) in fact.o
      get_matrix_struct(SEXPREC*) in matrix.o
      _matrix_multiply in matrix.o
      _gpu_order in matrix.o
      _gpu_which in matrix.o
      _gpu_seq in matrix.o
      ...
  "_Rf_length", referenced from:
      _gpu_create in matrix.o
  "_Rf_mkChar", referenced from:
      _get_device_info in general.o
  "_Rf_protect", referenced from:
      _get_globals in general.o
      _get_device in general.o
      _get_device_info in general.o
      _gpu_register in matrix.o
      _gpu_create in matrix.o
      _gpu_duplicate in matrix.o
      _gpu_get in matrix.o
      ...
  "_Rf_unprotect", referenced from:
      _get_globals in general.o
      _get_device in general.o
      _get_device_info in general.o
      _gpu_register in matrix.o
      _gpu_create in matrix.o
      _gpu_duplicate in matrix.o
      _gpu_get in matrix.o
      ...
  "_Rf_warning", referenced from:
      _stopCublas in general.o
      _gpu_get in matrix.o
  "_Rprintf", referenced from:
      _rcusolve_qr in fact.o
      _rcusolve_modqr_coef in fact.o
      _rcusolve_chol in fact.o
      _rcusolve_svd in fact.o
      _free_dev_states in general.o
      _setup_curand in general.o
      _startCublas in general.o
      ...
  "_SET_STRING_ELT", referenced from:
      _get_device_info in general.o
  "_SET_VECTOR_ELT", referenced from:
      _get_globals in general.o
  "_STRING_ELT", referenced from:
      _get_device_info in general.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# --error 0x1 --
make: *** [gmatrix.so] Error 1
ERROR: compilation failed for package ‘gmatrix’
* removing ‘../R/library/gmatrix’
njm18 commented 8 years ago

Thanks for trying gmatrix. You are the first person that I am aware of trying to install for OS X.

The first question that comes to mind is as to whether "/usr/local/Cellar/r/3.2.3_1/R.framework/Resources/include" is the correct include directory for R?

nathan

ghost commented 8 years ago

@njm18 Yes, it is. In OS X, most of my binaries are installed to /usr/local/Cellar/ by Homebrew

njm18 commented 8 years ago

Hi, It is hard for me to debug this b/c I don't have a Mac to replicate the problem. However, based on looking at the gputools configure.ac file I made a modification for mac users. Could you give it a try:

git clone https://github.com/njm18/gmatrix.git rm ./gmatrix/.git -rf MAKE="make -j7" R CMD INSTALL gmatrix --configure-args="--with-arch=sm_50 --with-cuda-home=$CUDA_HOME"

Please let me know if it works, nathan

ghost commented 8 years ago

Hi, I got another error.

R CMD INSTALL gmatrix --configure-args="--with-arch=sm_50 --with-cuda-home=$CUDA_HOME"

Welcome at  Sat Mar 19 15:29:20 2016
* installing to library ‘../R/library’
* installing *source* package ‘gmatrix’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
setting CUDA home directory to /Developer/NVIDIA/CUDA-7.5
checking for /Developer/NVIDIA/CUDA-7.5/bin/nvcc... yes
setting compute capability of the target device to sm_50
checking for CUDA headers... checking for /Developer/NVIDIA/CUDA-7.5/include/cublas_v2.h... yes
checking whether this is a 64-bit version of CUDA... checking for /Developer/NVIDIA/CUDA-7.5/lib64/libcublas.so... no
checking whether cusolver is used... checking for /Developer/NVIDIA/CUDA-7.5/include/cusolverDn.h... yes
setting R home directory to /usr/local/Cellar/r/3.2.4/R.framework/Resources
checking for R... yes
setting R header files to
Welcome at  Sat Mar 19 15:29:20 2016
/usr/local/Cellar/r/3.2.4/R.framework/Resources/include
Goodbye at  Sat Mar 19 15:29:20 2016
checking build system type... i386-apple-darwin15.3.0
checking host system type... i386-apple-darwin15.3.0
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch -
Makefile:10: *** target pattern contains no `%'.  Stop.
ERROR: compilation failed for package ‘gmatrix’
* removing ‘../R/library/gmatrix’
njm18 commented 8 years ago

Hi, Thanks for staying with me here. It would be great if I could see the actual Makefile generated by configure. Could you send me the results from: cat --number gmatrix/src/Makefile

nathan

ghost commented 8 years ago

Hi, here it is.

     1  # Compilers
     2  NVCC = /Developer/NVIDIA/CUDA-7.5/bin/nvcc
     3
     4  # Program-specifics
     5  OBJS = fact.o dist.o conversions.o general.o ops.o manipulation.o  matrix.o
     6  TARGET = gmatrix.so
     7
     8  # Compiler options
     9  FLAGS = -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I
    10  Welcome at  Sat Mar 19 23:48:50 2016
    11  /usr/local/Cellar/r/3.2.4/R.framework/Resources/include
    12  Goodbye at  Sat Mar 19 23:48:50 2016 "
    13
    14  # linker options
    15  LDFLAGS = -shared -L/Developer/NVIDIA/CUDA-7.5/lib -Xlinker "-L/usr/local/opt/openblas/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -shared -L/Developer/NVIDIA/CUDA-7.5/lib -F/usr/local/Cellar/r/3.2.4/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -lm -liconv -licuuc -licui18n"
    16  LIBS = -lcudart -lcublas -lcusolver
    17
    18  # Build rules
    19  .SUFFIXES: .c .cu .o
    20
    21  all: $(TARGET)
    22
    23  $(TARGET): $(OBJS)
    24      $(NVCC) $(LDFLAGS) $(LIBS) $(OBJS) -o $@
    25
    26  %.o: %.c
    27      $(NVCC) -c $(FLAGS) $< -o $@
    28
    29  %.o: %.cu
    30      $(NVCC) -c $(FLAGS) $< -o $@
    31
    32  clean:
    33      rm -rf $(OBJS) $(TARGET)
    34

I tried to edit it as:

     1  # Compilers
     2  NVCC = /Developer/NVIDIA/CUDA-7.5/bin/nvcc
     3
     4  # Program-specifics
     5  OBJS = fact.o dist.o conversions.o general.o ops.o manipulation.o  matrix.o
     6  TARGET = gmatrix.so
     7
     8  # Compiler options
     9  FLAGS = -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include"
    10
    11  # linker options
    12  LDFLAGS = -shared -L/Developer/NVIDIA/CUDA-7.5/lib -Xlinker "-L/usr/local/opt/openblas/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -shared -L/Developer/NVIDIA/CUDA-7.5/lib -F/usr/local/Cellar/r/3.2.4/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -lm -liconv -licuuc -licui18n"
    13  LIBS = -lcudart -lcublas -lcusolver
    14
    15  # Build rules
    16  .SUFFIXES: .c .cu .o
    17
    18  all: $(TARGET)
    19
    20  $(TARGET): $(OBJS)
    21      $(NVCC) $(LDFLAGS) $(LIBS) $(OBJS) -o $@
    22
    23  %.o: %.c
    24      $(NVCC) -c $(FLAGS) $< -o $@
    25
    26  %.o: %.cu
    27      $(NVCC) -c $(FLAGS) $< -o $@
    28
    29  clean:
    30      rm -rf $(OBJS) $(TARGET)
    31

but still got same error.

Welcome at  Sat Mar 19 23:51:13 2016
* installing to library ‘../R/library’
* installing *source* package ‘gmatrix’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
setting CUDA home directory to /Developer/NVIDIA/CUDA-7.5
checking for /Developer/NVIDIA/CUDA-7.5/bin/nvcc... yes
setting compute capability of the target device to sm_50
checking for CUDA headers... checking for /Developer/NVIDIA/CUDA-7.5/include/cublas_v2.h... yes
checking whether this is a 64-bit version of CUDA... checking for /Developer/NVIDIA/CUDA-7.5/lib64/libcublas.so... no
checking whether cusolver is used... checking for /Developer/NVIDIA/CUDA-7.5/include/cusolverDn.h... yes
setting R home directory to /usr/local/Cellar/r/3.2.4/R.framework/Resources
checking for R... yes
setting R header files to
Welcome at  Sat Mar 19 23:51:13 2016
/usr/local/Cellar/r/3.2.4/R.framework/Resources/include
Goodbye at  Sat Mar 19 23:51:13 2016
checking build system type... i386-apple-darwin15.3.0
checking host system type... i386-apple-darwin15.3.0
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch -
Makefile:10: *** target pattern contains no `%'.  Stop.
ERROR: compilation failed for package ‘gmatrix’
* removing ‘../R/library/gmatrix’
njm18 commented 8 years ago

Thanks... strange. Looks like R is adding an additional welcome message when I try to extract the include director. This doesn't happen in linux. Can you try running these two commands: R --slave --no-save -e "cat(R.home('include'))" R --silent --slave --no-save -e "cat(R.home('include'))"

If the silent option avoids the "Welcome" message I will change the configure.ac file. If the silent option doesn't work, I will have to find another approach. nathan

ghost commented 8 years ago

Yes, of course! You're welcome!

 > R --slave --no-save -e "cat(R.home('include'))"

Welcome at  Sun Mar 20 00:35:29 2016
/usr/local/Cellar/r/3.2.4/R.framework/Resources/include
Goodbye at  Sun Mar 20 00:35:29 2016
 > R --silent --slave --no-save -e "cat(R.home('include'))"

Welcome at  Sun Mar 20 00:35:36 2016
/usr/local/Cellar/r/3.2.4/R.framework/Resources/include
Goodbye at  Sun Mar 20 00:35:36 2016

In addition, probably I know why is that. In my R profile (~/.Rprofile), I added those words:

  2 .First <- function(){
  3     cat("\nWelcome at ", date(), "\n")
  4 }
  5
...

 19 .Last <- function(){
 20     cat("\nGoodbye at ", date(), "\n")
 21 }

And I know that I'm not the only person doing that. :)

njm18 commented 8 years ago

Ok. I see. Thanks! I didn't think about that. I did a work around on the config file now. Can you try again? nathan

ghost commented 8 years ago

Hi nathan, almost done except this error.

R CMD INSTALL gmatrix --configure-args="--with-arch=sm_50 --with-cuda-home=$CUDA_HOME"

Welcome at  Sun Mar 20 09:53:34 2016
* installing to library ‘../R/library’
* installing *source* package ‘gmatrix’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
setting CUDA home directory to /Developer/NVIDIA/CUDA-7.5
checking for /Developer/NVIDIA/CUDA-7.5/bin/nvcc... yes
setting compute capability of the target device to sm_50
checking for CUDA headers... checking for /Developer/NVIDIA/CUDA-7.5/include/cublas_v2.h... yes
checking whether this is a 64-bit version of CUDA... checking for /Developer/NVIDIA/CUDA-7.5/lib64/libcublas.so... no
checking whether cusolver is used... checking for /Developer/NVIDIA/CUDA-7.5/include/cusolverDn.h... yes
setting R home directory to /usr/local/Cellar/r/3.2.4/R.framework/Resources
checking for R... yes
setting R header files to /usr/local/Cellar/r/3.2.4/R.framework/Resources/include
checking build system type... i386-apple-darwin15.3.0
checking host system type... i386-apple-darwin15.3.0
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch -
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" fact.cu -o fact.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" dist.cu -o dist.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" conversions.cu -o conversions.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" general.cu -o general.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" ops.cu -o ops.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" manipulation.cu -o manipulation.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" matrix.cu -o matrix.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -shared -L/Developer/NVIDIA/CUDA-7.5/lib -Xlinker "-L/usr/local/opt/openblas/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -shared -L/Developer/NVIDIA/CUDA-7.5/lib -F/usr/local/Cellar/r/3.2.4/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -lm -liconv -licuuc -licui18n" -lcudart -lcublas -lcusolver fact.o dist.o conversions.o general.o ops.o manipulation.o  matrix.o  -o gmatrix.so
ld: library not found for -licuuc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [gmatrix.so] Error 1
ERROR: compilation failed for package ‘gmatrix’
* removing ‘../R/library/gmatrix’
ghost commented 8 years ago

I fixed this. It works now!

 > brew uninstall icu4c
Uninstalling /usr/local/Cellar/icu4c/56.1... (244 files, 63.7M)
 > brew install icu4c
==> Downloading http://7xkcej.dl1.z0.glb.clouddn.com/bottles/icu4c-56.1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring icu4c-56.1.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

OS X provides libicucore.dylib (but nothing else).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/icu4c/lib
    CPPFLAGS: -I/usr/local/opt/icu4c/include

==> Summary
🍺  /usr/local/Cellar/icu4c/56.1: 244 files, 63.7M
 > brew link icu4c
Warning: icu4c is keg-only and must be linked with --force
Note that doing so can interfere with building software.
 > brew link icu4c --force
Linking /usr/local/Cellar/icu4c/56.1... 71 symlinks created

Then I added these two parameter to LDFLAGS and CPPFLAGS separately. And reinstall gmatrix.

> R CMD INSTALL gmatrix --configure-args="--with-arch=sm_50 --with-cuda-home=$CUDA_HOME"

Welcome at  Sun Mar 20 10:17:52 2016
* installing to library ‘../R/library’
* installing *source* package ‘gmatrix’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
setting CUDA home directory to /Developer/NVIDIA/CUDA-7.5
checking for /Developer/NVIDIA/CUDA-7.5/bin/nvcc... yes
setting compute capability of the target device to sm_50
checking for CUDA headers... checking for /Developer/NVIDIA/CUDA-7.5/include/cublas_v2.h... yes
checking whether this is a 64-bit version of CUDA... checking for /Developer/NVIDIA/CUDA-7.5/lib64/libcublas.so... no
checking whether cusolver is used... checking for /Developer/NVIDIA/CUDA-7.5/include/cusolverDn.h... yes
setting R home directory to /usr/local/Cellar/r/3.2.4/R.framework/Resources
checking for R... yes
setting R header files to /usr/local/Cellar/r/3.2.4/R.framework/Resources/include
checking build system type... i386-apple-darwin15.3.0
checking host system type... i386-apple-darwin15.3.0
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch -
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" fact.cu -o fact.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" dist.cu -o dist.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" conversions.cu -o conversions.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" general.cu -o general.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" ops.cu -o ops.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" manipulation.cu -o manipulation.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -c -arch=sm_50 -O2 -DADD_ -I/Developer/NVIDIA/CUDA-7.5/include -Xcompiler "-O2 -DADD_ -fPIC -I/usr/local/Cellar/r/3.2.4/R.framework/Resources/include" matrix.cu -o matrix.o
/Developer/NVIDIA/CUDA-7.5/bin/nvcc -shared -L/Developer/NVIDIA/CUDA-7.5/lib -Xlinker "-L/usr/local/opt/openblas/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -shared -L/Developer/NVIDIA/CUDA-7.5/lib -F/usr/local/Cellar/r/3.2.4/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -lm -liconv -licuuc -licui18n" -lcudart -lcublas -lcusolver fact.o dist.o conversions.o general.o ops.o manipulation.o  matrix.o  -o gmatrix.so
installing to ../R/library/gmatrix/libs
** R
** inst
** preparing package for lazy loading
Creating a generic function for ‘as.matrix’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘as.vector’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘rownames’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘colnames’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘rownames<-’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘colnames<-’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘t’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘diag’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘diag<-’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘crossprod’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘tcrossprod’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘%o%’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘colMeans’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘rowMeans’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘mean’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘sort’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘which’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘ifelse’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘%x%’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘solve’ from package ‘base’ in package ‘gmatrix’
Creating a generic function for ‘qr’ from package ‘base’ in package ‘gmatrix’
Creating a new generic function for ‘svd’ in package ‘gmatrix’
Creating a generic function for ‘chol’ from package ‘base’ in package ‘gmatrix’
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

Welcome at  Sun Mar 20 10:19:16 2016
Now using device 0 - "GeForce GTX 750 Ti"
Starting cublas on device 0.
Creating new states on device 0.

Goodbye at  Sun Mar 20 10:19:18 2016
* DONE (gmatrix)

Goodbye at  Sun Mar 20 10:19:18 2016

Thank you! :+1: