This repository has been archived by the owner. It is now read-only.

Eigen with CUDA9: fatal error:math_functions.hpp:No such file or directory #2485

Closed
zxc455052 opened this Issue Mar 30, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@zxc455052
Copy link

zxc455052 commented Mar 30, 2018

If this is a build issue, please fill out the template below.

System information

  • Operating system: x86_64 Linux 4.9.76-gentoo-r1
  • Relevant libraries/versions (e.g. CUDA):cuda9.1.85 cudnn7.0.5

CMake summary output

-- General:
-- CMake version : 3.9.6
-- CMake command : /usr/bin/cmake
-- Git version : v0.8.1-1490-gb129e2a54-dirty
-- System : Linux
-- C++ compiler : /usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/c++
-- C++ compiler version : 6.4.0
-- BLAS : Eigen
-- CXX flags : -fvisibility-inlines-hidden -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization
-- Build type : Release
-- Compile definitions :

-- BUILD_BINARY : ON
-- BUILD_CUSTOM_PROTOBUF : OFF
-- Protobuf compiler : /usr/bin/protoc
-- Protobuf includes : /usr/include
-- Protobuf libraries : /usr/lib/libprotobuf.so;-lpthread
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : ON
-- Python version : 2.7.14
-- Python includes : /home/weiping/anaconda2/include/python2.7
-- BUILD_SHARED_LIBS : ON
-- BUILD_TEST : ON
-- USE_ATEN : OFF
-- USE_ASAN : OFF
-- USE_CUDA : ON
-- CUDA version : 9.1
-- CuDNN version : 7.0.5
-- CUDA root directory : /opt/cuda
-- CUDA library : /usr/lib/libcuda.so
-- CUDA NVRTC library : /opt/cuda/lib64/libnvrtc.so
-- CUDA runtime library: /opt/cuda/lib64/libcudart.so
-- CUDA include path : /opt/cuda/include
-- NVCC executable : /opt/cuda/bin/nvcc
-- CUDA host compiler : /usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0/gcc
-- USE_EIGEN_FOR_BLAS : 1
-- USE_FFMPEG : OFF
-- USE_GFLAGS : ON
-- USE_GLOG : ON
-- USE_GLOO : ON
-- USE_LEVELDB : ON
-- LevelDB version : 1.18
-- Snappy version : ..
-- USE_LITE_PROTO : OFF
-- USE_LMDB : ON
-- LMDB version : 0.9.18
-- USE_METAL : OFF
-- USE_MKL :
-- USE_MOBILE_OPENGL : OFF
-- USE_MPI : ON
-- USE_NCCL : ON
-- USE_NERVANA_GPU : OFF
-- USE_NNPACK : ON
-- USE_OBSERVERS : ON
-- USE_OPENCV : ON
-- OpenCV version : 3.3.0
-- USE_OPENMP : OFF
-- USE_PROF : OFF
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/weiping/caffe2

******** Summary ********
/home/weiping/anaconda2/conda-bld/caffe2-cuda-cudnn_1522373319276/work/caffe2/operators/arg_ops.cu:12:
/home/weiping/anaconda2/conda-bld/caffe2-cuda-cudnn_1522373319276/work/third_party/eigen/Eigen/Core:59:34: fatal error:math_functions.hpp:No such file or directory
     #include <math_functions.hpp>
                                  ^

Here is a same problem.
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1491

@sclarkson

This comment has been minimized.

Copy link

sclarkson commented Mar 30, 2018

This was fixed in eigen at https://bitbucket.org/eigen/eigen/commits/034b6c3e101792a3cc3ccabd9bfaddcabe85bb58?at=default

Until caffe2 updates their eigen submodule, you can just make that change manually.

@pjh5

This comment has been minimized.

Copy link
Contributor

pjh5 commented Apr 3, 2018

@zxc455052 did the change in sclarkson's link fix this problem for you?

@bermanmaxim

This comment has been minimized.

Copy link

bermanmaxim commented Apr 26, 2018

Note that once you have updated the submodule you can call cmake with -DCMAKE_DISABLE_FIND_PACKAGE_Eigen3=TRUE to disable cmake detection of system eigen and force the use of the third-party submodule (in my case I don't have the permissions to update system libraries so this kind of trick is useful to know 😜)

@pjh5 pjh5 closed this Apr 27, 2018

@Jeffalltogether

This comment has been minimized.

Copy link

Jeffalltogether commented May 16, 2018

Followed link provided by @sclarkson

The file that needs to be modified is located in the caffe2 folder here: /caffe2/third_party/eigen/Eigen/Core

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.