{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/7770","repository_url":"https://api.github.com/repos/pytorch/pytorch","labels_url":"https://api.github.com/repos/pytorch/pytorch/issues/7770/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/7770/comments","events_url":"https://api.github.com/repos/pytorch/pytorch/issues/7770/events","html_url":"https://github.com/pytorch/pytorch/issues/7770","id":325446857,"number":7770,"title":"Cannot compile Caffe2 on Mac","user":{"login":"peastman","id":4379786,"avatar_url":"https://avatars3.githubusercontent.com/u/4379786?v=4","gravatar_id":"","url":"https://api.github.com/users/peastman","html_url":"https://github.com/peastman","followers_url":"https://api.github.com/users/peastman/followers","following_url":"https://api.github.com/users/peastman/following{/other_user}","gists_url":"https://api.github.com/users/peastman/gists{/gist_id}","starred_url":"https://api.github.com/users/peastman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peastman/subscriptions","organizations_url":"https://api.github.com/users/peastman/orgs","repos_url":"https://api.github.com/users/peastman/repos","events_url":"https://api.github.com/users/peastman/events{/privacy}","received_events_url":"https://api.github.com/users/peastman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-22T20:16:19Z","updated_at":"2018-05-22T21:12:14Z","closed_at":null,"author_association":"NONE","body":"I am trying to compile Caffe2 from source on macOS, but no matter what I try it fails with the error\r\n\r\n```\r\n/Users/peastman/pytorch/caffe2/core/flags.h:59:10: fatal error: \r\n      'gflags/gflags.h' file not found\r\n#include <gflags/gflags.h>\r\n```\r\n\r\nI installed gflags with brew, as described in the instructions.  CMake claims to have found it:\r\n\r\n```\r\n-- Caffe2: Found gflags with new-style gflags target.\r\n```\r\n\r\nand inspecting the cache confirms that:\r\n\r\n```\r\n$ grep gflags CMakeCache.txt \r\ncaffe2_LIB_DEPENDS:STATIC=general;gflags;general;glog::glog;general;nomnigraph;general;nnpack;general;cpuinfo;\r\n//The directory containing a CMake configuration file for gflags.\r\ngflags_DIR:PATH=/usr/local/lib/cmake/gflags\r\n```\r\n\r\nI confirmed that the directory it selected corresponds to the brew version of gflags:\r\n\r\n```\r\n$ ls -l /usr/local/lib/cmake/gflags\r\nlrwxr-xr-x  1 peastman  admin  42 May 22 13:04 /usr/local/lib/cmake/gflags -> ../../Cellar/gflags/2.2.1/lib/cmake/gflags\r\n```\r\n\r\nand also that the headers really are there:\r\n\r\n```\r\n$ ls /usr/local/Cellar/gflags/2.2.1/include/gflags/\r\ngflags.h\t\tgflags_declare.h\r\ngflags_completions.h\tgflags_gflags.h\r\n```\r\n\r\nYet somehow the compiler still fails to find it.\r\n\r\n## System Info\r\n\r\n- PyTorch or Caffe2: Caffe2\r\n- How you installed PyTorch (conda, pip, source): source\r\n- Build command you used (if compiling from source): `make install`\r\n- OS: macOS 10.13.4\r\n- PyTorch version: Latest from repository\r\n- Python version: 3.6.1\r\n- CUDA/cuDNN version: N/A\r\n- GPU models and configuration: N/A\r\n- GCC version (if compiling from source): Apple LLVM version 9.1.0 (clang-902.0.39.1)\r\n- CMake version: 3.11.2\r\n- Versions of any other relevant libraries: gflags 2.2.1\r\n"},"comment":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/comments/391142324","html_url":"https://github.com/pytorch/pytorch/issues/7770#issuecomment-391142324","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/7770","id":391142324,"user":{"login":"ezyang","id":13564,"avatar_url":"https://avatars0.githubusercontent.com/u/13564?v=4","gravatar_id":"","url":"https://api.github.com/users/ezyang","html_url":"https://github.com/ezyang","followers_url":"https://api.github.com/users/ezyang/followers","following_url":"https://api.github.com/users/ezyang/following{/other_user}","gists_url":"https://api.github.com/users/ezyang/gists{/gist_id}","starred_url":"https://api.github.com/users/ezyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezyang/subscriptions","organizations_url":"https://api.github.com/users/ezyang/orgs","repos_url":"https://api.github.com/users/ezyang/repos","events_url":"https://api.github.com/users/ezyang/events{/privacy}","received_events_url":"https://api.github.com/users/ezyang/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T21:12:14Z","updated_at":"2018-05-22T21:12:14Z","author_association":"CONTRIBUTOR","body":"Can you cat the contents of `/usr/local/lib/cmake/gflags`?"}}
{"actor":{"display_login":"ezyang"}}