Oneflow-Inc / oneflow

OneFlow is a deep learning framework designed to be user-friendly, scalable and efficient.
http://www.oneflow.org
Apache License 2.0
5.91k stars 667 forks source link

Error in Building from Source! Error File: oneflow/core/ndarray/./of_ccobj_generated_ndarray_apply_broadcast_binary_core.cu.o #3534

Open FNLPprojects opened 4 years ago

FNLPprojects commented 4 years ago
/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2969): error: "constexpr" is not valid here

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2971): error: "is_constructible_v" is not a function or static data member

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2971): error: "constexpr" is not valid here

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2974): error: "is_default_constructible_v" is not a function or static data member

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2974): error: "constexpr" is not valid here

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2977): error: "is_copy_constructible_v" is not a function or static data member

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2977): error: "constexpr" is not valid here

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2980): error: "is_move_constructible_v" is not a function or static data member

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2980): error: "constexpr" is not valid here

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2983): error: "is_assignable_v" is not a function or static data member

/usr/local/miniconda3/envs/dl/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/type_traits(2983): error: "constexpr" is not valid here

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_0000658f_00000000-9_ndarray_apply_broadcast_binary_core.compute_75.cpp1.ii".
Compilation terminated.
CMake Error at of_ccobj_generated_ndarray_apply_broadcast_binary_core.cu.o.cmake:279 (message):
  Error generating file
  /remote-home/my/Softwares/oneflow/build/CMakeFiles/of_ccobj.dir/oneflow/core/ndarray/./of_ccobj_generated_ndarray_apply_broadcast_binary_core.cu.o

make[2]: *** [CMakeFiles/of_ccobj.dir/oneflow/core/ndarray/of_ccobj_generated_ndarray_apply_broadcast_binary_core.cu.o] Error 1
make[1]: *** [CMakeFiles/of_ccobj.dir/all] Error 2
make: *** [all] Error 2

Downloading the latest version of oneflow from github, I met an error in building from source.

After cmake .. in oneflow/build, when running

make -j$(nproc)

I have the upper error log.

The environment of my machine is following:

Ubuntu16.04
cmake 3.14.0
CUDA 10.1
Cudnn 7.6.5
Python 3.6.6
GNU ld (GNU Binutils) 2.23.1
leaves-zwx commented 4 years ago

Could you please present gcc version? The c++ lib you using is 7.3.0, if the gcc version you using is 4.8.5 that may cause an issue.

jackalcooper commented 4 years ago

Usually this kind of error is caused by CUDA toolkit version and GNU gcc/g++ version mismatch. image

FNLPprojects commented 4 years ago

Could you please present gcc version? The c++ lib you using is 7.3.0, if the gcc version you using is 4.8.5 that may cause an issue.


Thank you for your reply!

gcc --version

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


The upper is my gcc version, which is 5.4.0. It seems the error is not caused by the unmatched gcc version?
jackalcooper commented 4 years ago

please post your cmake output here. it prints gcc version.

FNLPprojects commented 4 years ago

please post your cmake output here. it prints gcc version.

Outputs of the command, cmake .., is following:

oneflow/build# cmake ..
CMake Warning at /remote-home/my/Softwares/cmake-3.14.0-Linux-x86_64/share/cmake-3.14/Modules/FindCUDA.cmake:893 (message):
  Expecting to find librt for libcudart_static, but didn't find it.
Call Stack (most recent call first):
  cmake/third_party.cmake:32 (find_package)
  CMakeLists.txt:94 (include)

-- Found cuDNN: v7.6.5  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn_static.a)
-- A library with BLAS API found.
-- Found Blas Lib: /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a/opt/intel/mkl/lib/intel64/libmkl_sequential.a/opt/intel/mkl/lib/intel64/libmkl_core.a
-- oneflow_third_party_libs: -lpthread/remote-home/my/Softwares/oneflow/third_party/glog/lib/libglog.a/remote-home/my/Softwares/oneflow/third_party/gflags/lib/libgflags.a/remote-home/my/Softwares/oneflow/third_party/googletest/lib/libgtest.a/remote-home/my/Softwares/oneflow/third_party/googletest/lib/libgtest_main.a/remote-home/my/Softwares/oneflow/third_party/googlemock/lib/libgmock.a/remote-home/my/Softwares/oneflow/third_party/googlemock/lib/libgmock_main.a/remote-home/my/Softwares/oneflow/third_party/protobuf/lib/libprotobuf.a/remote-home/my/Softwares/oneflow/third_party/grpc/lib/libgrpc++_unsecure.a/remote-home/my/Softwares/oneflow/third_party/grpc/lib/libgrpc_unsecure.a/remote-home/my/Softwares/oneflow/third_party/grpc/lib/libgpr.a/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a/opt/intel/mkl/lib/intel64/libmkl_sequential.a/opt/intel/mkl/lib/intel64/libmkl_core.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libopencv_imgproc.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libopencv_highgui.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libopencv_imgcodecs.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libopencv_core.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libIlmImf.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/libittnotify.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/liblibjasper.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/liblibpng.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/liblibtiff.a/remote-home/my/Softwares/oneflow/third_party/opencv/lib/liblibwebp.a/remote-home/my/Softwares/oneflow/third_party/cocoapi/lib/libcocoapi_static.a/remote-home/my/Softwares/oneflow/third_party/libjpeg-turbo/lib/libturbojpeg.a/remote-home/my/Softwares/oneflow/third_party/zlib/lib/libz.a/remote-home/my/Softwares/oneflow/third_party/re2/lib/libre2.a/usr/local/cuda/lib64/libcudart_static.a-lpthreaddl/usr/local/cuda/lib64/libculibos.a/usr/local/cuda/lib64/libcurand_static.a/usr/local/cuda/lib64/libcublas_static.a/usr/local/cuda/lib64/libcudnn_static.a/remote-home/my/Softwares/oneflow/third_party/nccl/lib/libnccl_static.a
-- CUDA_NVCC_FLAGS: -w-Wno-deprecated-gpu-targets-gencodearch=compute_60,code=sm_60-gencodearch=compute_60,code=compute_60-gencodearch=compute_61,code=sm_61-gencodearch=compute_61,code=compute_61-gencodearch=compute_70,code=sm_70-gencodearch=compute_70,code=compute_70-gencodearch=compute_75,code=sm_75-gencodearch=compute_75,code=compute_75
-- CMAKE_CXX_COMPILER_VERSION: 7.3.0
-- Found Python3: /usr/local/miniconda3/envs/dl/bin/python3.6 (found version "3.6.6") found components:  Interpreter
-- Python3 specified. Version found: 3.6.6
-- Using Python executable: /usr/local/miniconda3/envs/dl/bin/python3.6
-- Installing necessary Python packages...
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: black==19.10b0 in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (19.10b0)
Requirement already satisfied: numpy in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 2)) (1.19.1)
Requirement already satisfied: protobuf in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 3)) (3.13.0)
Requirement already satisfied: wheel in /usr/local/miniconda3/envs/dl/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 4)) (0.32.2)
Requirement already satisfied: tqdm in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 5)) (4.48.2)
Requirement already satisfied: requests in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 6)) (2.24.0)
Requirement already satisfied: onnx in /root/.local/lib/python3.6/site-packages (from -r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 7)) (1.7.0)
Requirement already satisfied: attrs>=18.1.0 in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (20.1.0)
Requirement already satisfied: typed-ast>=1.4.0 in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (1.4.1)
Requirement already satisfied: toml>=0.9.4 in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (0.10.1)
Requirement already satisfied: appdirs in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (1.4.4)
Requirement already satisfied: click>=6.5 in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (7.1.2)
Requirement already satisfied: pathspec<1,>=0.6 in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (0.8.0)
Requirement already satisfied: regex in /root/.local/lib/python3.6/site-packages (from black==19.10b0->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 1)) (2020.7.14)
Requirement already satisfied: six>=1.9 in /root/.local/lib/python3.6/site-packages (from protobuf->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 3)) (1.15.0)
Requirement already satisfied: setuptools in /usr/local/miniconda3/envs/dl/lib/python3.6/site-packages (from protobuf->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 3)) (40.5.0)
Requirement already satisfied: chardet<4,>=3.0.2 in /root/.local/lib/python3.6/site-packages (from requests->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 6)) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /root/.local/lib/python3.6/site-packages (from requests->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 6)) (1.25.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/miniconda3/envs/dl/lib/python3.6/site-packages (from requests->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 6)) (2018.10.15)
Requirement already satisfied: idna<3,>=2.5 in /root/.local/lib/python3.6/site-packages (from requests->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 6)) (2.10)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /root/.local/lib/python3.6/site-packages (from onnx->-r /remote-home/my/Softwares/oneflow/dev-requirements.txt (line 7)) (3.7.4.3)
-- Python packages are installed.
-- Found Python3: /usr/local/miniconda3/envs/dl/lib/libpython3.6m.so (found version "3.6.6") found components:  Development NumPy Interpreter
-- Found python include directory /usr/local/miniconda3/envs/dl/include/python3.6m
-- Found numpy include directory /root/.local/lib/python3.6/site-packages/numpy/core/include
-- pybind11 v2.6.0 dev
-- Configuring done
-- Generating done
-- Build files have been written to: /remote-home/my/Softwares/oneflow/build
jackalcooper commented 4 years ago

-- CMAKE_CXX_COMPILER_VERSION: 7.3.0

In your log is it g++ 7.3.

Now you can run make -j1 VERBOSE=1 to see where this g++ binary is located.

FNLPprojects commented 4 years ago

-- CMAKE_CXX_COMPILER_VERSION: 7.3.0

In your log is it g++ 7.3.

Now you can run make -j1 VERBOSE=1 to see where this g++ binary is located.

Thanks!