Skip to content

ATen header missing while building an app with Caffe2 as shared library #10397

@jae1e

Description

@jae1e

Issue description

When I compile external C++ app with CMake using Caffe2 dependency, ATen header is missing.

fatal error: ATen/core/Macros.h: No such file or directory

Seems like ATen headers are not properly copied to /usr/local/include while other headers are well installed.
Reproduced with Caffe2 with Ubuntu 16.04/CUDA 8/CuDNN 7 Dockerfile here.

I was able to resolve the issue by adding the following line to the Dockerfile.

RUN cp -RL /usr/pytorch/aten/src/ATen /usr/local/include/

Code example

I used /usr/local/include as my Caffe2 include directory in my FindCaffe2.cmake as below.

find_path(Caffe2_INCLUDE_DIR NAMES caffe2 onnx google eigen3 ATen HINTS /usr/local/include)

I include four header files in my app, and it makes compile error.

#include <caffe2/core/init.h>
#include <caffe2/core/net.h>
#include <caffe2/core/context_gpu.h>
#include <caffe2/utils/proto_utils.h>

System Info

Ubuntu 16.04 / CUDA 8.0 / CuDNN 7.1 on Docker.

  • PyTorch or Caffe2: Caffe2
  • How you installed PyTorch (conda, pip, source): source
  • Build command you used (if compiling from source): built Dockerfile.
  • OS: Ubuntu 16.04
  • PyTorch version: master
  • Python version: 2
  • CUDA/cuDNN version: 8.0/7.1
  • GPU models and configuration: GTX 1080 Ti
  • GCC version (if compiling from source): 5.4
  • CMake version: 3.5.1
  • Versions of any other relevant libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions