Run "pip install cupy==1.0.2 chainer==2.0.2 fuel==0.2.0 tqdm" display anaconda3/compiler_compat/ld: cannot find -lm

root@zhfwyy:~# pip install cupy==1.0.2 chainer==2.0.2 fuel==0.2.0 tqdm
Collecting cupy==1.0.2
Using cached cupy-1.0.2.tar.gz
Complete output from command python setup.py egg_info:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lm
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lpthread
/home/wyy/anaconda3/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Options: {‘profile’: False, ‘linetrace’: False, ‘annotate’: False, ‘no_cuda’: False}
Include directories: [’/usr/local/cuda/include’]
Library directories: [’/usr/local/cuda/lib64’]
Cannot build a stub file.
Original error: command ‘g++’ failed with exit status 1
**************************************************
*** WARNING: Include files not found: [‘cublas_v2.h’, ‘cuda.h’, ‘cuda_profiler_api.h’, ‘cuda_runtime.h’, ‘curand.h’, ‘nvToolsExt.h’]
*** WARNING: Skip installing cuda support
*** WARNING: Check your CFLAGS environment variable
**************************************************
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-goks06vm/cupy/setup.py”, line 29, in
ext_modules = cupy_setup_build.get_ext_modules()
File “/tmp/pip-build-goks06vm/cupy/cupy_setup_build.py”, line 361, in get_ext_modules
extensions = make_extensions(arg_options, compiler, use_cython)
File “/tmp/pip-build-goks06vm/cupy/cupy_setup_build.py”, line 255, in make_extensions
raise Exception('Your CUDA environment is invalid. '
Exception: Your CUDA environment is invalid. Please check above error log.

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-goks06vm/cupy/
Thank you very much! What I should do to solve the issue?