Repository: cupy/cupy

Issue:
Cupy 4.0.0b4 cannot install on Windows
My environment is Windows10, Python 3.6.1
When I try to install 4.0.0b4 by `pip install -e . --no-cache-dir` then it fails by an error:
```
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\sakurai\Desktop\cupy\setup.py", line 64, in <module>
        ext_modules = cupy_setup_build.get_ext_modules()
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 547, in get_ext_modules
        extensions = make_extensions(arg_options, compiler, use_cython)
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 402, in make_extensions
        rpath.append('{}{}/_lib'.format(_rpath_base(), '/..' * depth))
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 330, in _rpath_base
        raise Exception('not supported on this platform')
    Exception: not supported on this platform
```

I modified the code 
from https://github.com/cupy/cupy/blob/v4.0.0b4/cupy_setup_build.py#L399
```
            if use_wheel_libs_rpath:
```
to
```
            if use_wheel_libs_rpath and sys.platform != 'win32':
```
then I can install successfully. But I'm not sure this is appropriate or not.

## Full error log

```
C:\Users\sakurai\Desktop\cupy>git status
HEAD detached at v4.0.0b4
nothing to commit, working directory clean
```

```
C:\Users\sakurai\Desktop\cupy>pip install -e . --no-cache-dir
Obtaining file:///C:/Users/sakurai/Desktop/cupy
    Complete output from command python setup.py egg_info:
    Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [], 'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False}

    -------- Configuring Module: cuda --------
    a.cpp
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda_runtime.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda_runtime.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code

    -------- Configuring Module: cudnn --------
    a.cpp
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda_runtime.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code
    a.cpp
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda_runtime.h: warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    c:\program files\nvidia gpu computing toolkit\cuda\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    Generating code
    Finished generating code

    -------- Configuring Module: nccl --------
    a.cpp
    C:\Users\sakurai\AppData\Local\Temp\tmpaxqifyf4\a.cpp(1): fatal error C1083: Cannot open include file: 'nccl.h': No such file or directory
    command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    -------- Configuring Module: cusolver --------
    a.cpp
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code

    -------- Configuring Module: thrust --------
    a.cpp
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda_runtime_api.h(1950): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\thrust/system/detail/error_category.inl(102): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt\string.h(178): note: see declaration of 'strerror'
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code
    a.cpp
    Generating code
    Finished generating code

    ************************************************************
    * CuPy Configuration Summary                               *
    ************************************************************

    Build Environment:
      Include directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\include', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\include']
      Library directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\lib\\x64', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\lib\\x64']
      nvcc command       : ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin/nvcc.exe']

    Environment Variables:
      CFLAGS          : (none)
      LDFLAGS         : (none)
      LIBRARY_PATH    : (none)
      CUDA_PATH       : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
      NVCC            : (none)

    Modules:
      cuda      : Yes (version 9.0.0)
      cudnn     : Yes (version 7.0.3)
      nccl      : No
        -> Include files not found: ['nccl.h']
        -> Check your CFLAGS environment variable.
      cusolver  : Yes
      thrust    : Yes

    WARNING: Some modules could not be configured.
    CuPy will be installed without these modules.
    Please refer to the Installation Guide for details:
    https://docs-cupy.chainer.org/en/stable/install.html

    ************************************************************

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\sakurai\Desktop\cupy\setup.py", line 64, in <module>
        ext_modules = cupy_setup_build.get_ext_modules()
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 547, in get_ext_modules
        extensions = make_extensions(arg_options, compiler, use_cython)
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 402, in make_extensions
        rpath.append('{}{}/_lib'.format(_rpath_base(), '/..' * depth))
      File "C:\Users\sakurai\Desktop\cupy\cupy_setup_build.py", line 330, in _rpath_base
        raise Exception('not supported on this platform')
    Exception: not supported on this platform

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\sakurai\Desktop\cupy\
```



Discussion:
Related to #899

Resolving patch:
diff --git a/cupy_setup_build.py b/cupy_setup_build.py
--- a/cupy_setup_build.py
+++ b/cupy_setup_build.py
@@ -344,7 +344,7 @@ def make_extensions(options, compiler, use_cython):
         x for x in settings['library_dirs'] if path.exists(x)]
 
     # Adjust rpath to use CUDA libraries in `cupy/_lib/*.so`) from CuPy.
-    use_wheel_libs_rpath = 'wheel_libs' in options
+    use_wheel_libs_rpath = 0 < len(options['wheel_libs'])
 
     # This is a workaround for Anaconda.
     # Anaconda installs libstdc++ from GCC 4.8 and it is not compatible


Test patch: