njm18 / gmatrix

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

Have a separate compiler flag for cuda-include #10

Open mjmg opened 7 years ago

mjmg commented 7 years ago

For my Fedora 25 system using negativo17 nvidia/cuda repository https://negativo17.org/nvidia-driver/ all the cuda binaries, libraries and includes are not on a single cuda root directory that can be specified by a single CUDA_HOME variable.

$ which nvcc
/usr/bin/nvcc
$ ldconfig -p | grep cuda
    libicudata.so.57 (libc6,x86-64) => /lib64/libicudata.so.57
    libcudart.so.8.0 (libc6,x86-64) => /lib64/libcudart.so.8.0
    libcudart.so (libc6,x86-64) => /lib64/libcudart.so
    libcuda.so.1 (libc6,x86-64) => /lib64/libcuda.so.1
    libcuda.so (libc6,x86-64) => /lib64/libcuda.so
$ ls /usr/include/cuda
builtin_types.h            curand_mtgp32dc_p_11213.h      math_functions_dbl_ptx3.h                 nvToolsExtMeta.h
channel_descriptor.h       curand_mtgp32.h                math_functions_dbl_ptx3.hpp               nvToolsExtSync.h
CL                         curand_mtgp32_host.h           math_functions.h                          nvvm.h
common_functions.h         curand_mtgp32_kernel.h         math_functions.hpp                        sm_20_atomic_functions.h
crt                        curand_normal.h                nppcore.h                                 sm_20_atomic_functions.hpp
cublas_api.h               curand_normal_static.h         nppdefs.h                                 sm_20_intrinsics.h
cublas.h                   curand_philox4x32_x.h          npp.h                                     sm_20_intrinsics.hpp
cublas_v2.h                curand_poisson.h               nppi_arithmetic_and_logical_operations.h  sm_30_intrinsics.h
cublasXt.h                 curand_precalc.h               nppi_color_conversion.h                   sm_30_intrinsics.hpp
cuComplex.h                curand_uniform.h               nppi_compression_functions.h              sm_32_atomic_functions.h
cuda_device_runtime_api.h  cusolver_common.h              nppi_computer_vision.h                    sm_32_atomic_functions.hpp
cuda_fp16.h                cusolverDn.h                   nppi_data_exchange_and_initialization.h   sm_32_intrinsics.h
cudaGL.h                   cusolverRf.h                   nppi_filtering_functions.h                sm_32_intrinsics.hpp
cuda_gl_interop.h          cusolverSp.h                   nppi_geometry_transforms.h                sm_35_atomic_functions.h
cuda.h                     cusolverSp_LOWLEVEL_PREVIEW.h  nppi.h                                    sm_35_intrinsics.h
cudalibxt.h                cusparse.h                     nppi_linear_transforms.h                  sm_60_atomic_functions.h
cuda_occupancy.h           cusparse_v2.h                  nppi_morphological_operations.h           sm_60_atomic_functions.hpp
cuda_profiler_api.h        cuviddec.h                     nppi_statistics_functions.h               sm_61_intrinsics.h
cudaProfiler.h             Debugger                       nppi_support_functions.h                  sm_61_intrinsics.hpp
cuda_runtime_api.h         device_atomic_functions.h      nppi_threshold_and_compare_operations.h   sobol_direction_vectors.h
cuda_runtime.h             device_atomic_functions.hpp    npps_arithmetic_and_logical_operations.h  surface_functions.h
cuda_surface_types.h       device_double_functions.h      npps_conversion_functions.h               surface_functions.hpp
cuda_texture_types.h       device_double_functions.hpp    npps_filtering_functions.h                surface_indirect_functions.h
cudaVDPAU.h                device_functions_decls.h       npps.h                                    surface_indirect_functions.hpp
cuda_vdpau_interop.h       device_functions.h             npps_initialization.h                     surface_types.h
cudnn.h                    device_functions.hpp           npps_statistics_functions.h               texture_fetch_functions.h
cufft.h                    device_launch_parameters.h     npps_support_functions.h                  texture_fetch_functions.hpp
cufftw.h                   device_types.h                 nppversion.h                              texture_indirect_functions.h
cufftXt.h                  driver_functions.h             nvblas.h                                  texture_indirect_functions.hpp
CUPTI                      driver_types.h                 nvcuvid.h                                 texture_types.h
curand_discrete2.h         fatBinaryCtl.h                 nvfunctional                              thrust
curand_discrete.h          fatbinary.h                    nvgraph.h                                 vector_functions.h
curand_globals.h           fortran                        nvml.h                                    vector_functions.hpp
curand.h                   host_config.h                  nvrtc.h                                   vector_types.h
curand_kernel.h            host_defines.h                 nvToolsExtCuda.h
curand_lognormal.h         library_types.h                nvToolsExtCudaRt.h
curand_mrg32k3a.h          math_constants.h               nvToolsExt.h

R however has separate flags for R_HOME and R_INCLUDE

with_r_home
with_r_include

Thus with using this cuda repository, I'm unable to compile gmatrix since the cuda binaries and libraries are in standard system locations but the includes are in a separate /usr/include/cuda directory.

I could symlink the includes, but it would be a maintenance nightmare.

As Fedora 26 is about to be released in a few weeks, it is expected that negativo1's nvidia and cuda repository will be adopted as standard third party repository through GNOME Software. https://blogs.gnome.org/uraeus/2016/11/01/discrete-graphics-and-fedora-workstation-25/