{"action":"created","issue":{"url":"https://api.github.com/repos/zdevito/ATen/issues/183","repository_url":"https://api.github.com/repos/zdevito/ATen","labels_url":"https://api.github.com/repos/zdevito/ATen/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/zdevito/ATen/issues/183/comments","events_url":"https://api.github.com/repos/zdevito/ATen/issues/183/events","html_url":"https://github.com/zdevito/ATen/issues/183","id":279608024,"number":183,"title":"PRId64 (__STDC_FORMAT_MACROS) in older g++ again","user":{"login":"ShigekiKarita","id":6745326,"avatar_url":"https://avatars3.githubusercontent.com/u/6745326?v=4","gravatar_id":"","url":"https://api.github.com/users/ShigekiKarita","html_url":"https://github.com/ShigekiKarita","followers_url":"https://api.github.com/users/ShigekiKarita/followers","following_url":"https://api.github.com/users/ShigekiKarita/following{/other_user}","gists_url":"https://api.github.com/users/ShigekiKarita/gists{/gist_id}","starred_url":"https://api.github.com/users/ShigekiKarita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShigekiKarita/subscriptions","organizations_url":"https://api.github.com/users/ShigekiKarita/orgs","repos_url":"https://api.github.com/users/ShigekiKarita/repos","events_url":"https://api.github.com/users/ShigekiKarita/events{/privacy}","received_events_url":"https://api.github.com/users/ShigekiKarita/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-06T02:53:39Z","updated_at":"2017-12-11T04:40:44Z","closed_at":null,"author_association":"NONE","body":"related to this issue https://github.com/pytorch/pytorch/issues/3571\r\nSince header organization is changed, this happens again in my CentOS7 & GCC4.8.5.\r\n\r\nThe problem is that `__STDC_FORMAT_MACROS` is defined after `#include <inttypes.h>`.\r\n+ As a [github search](https://github.com/zdevito/ATen/search?utf8=%E2%9C%93&q=inttypes.h&type=\r\n) indicates that  `inttypes.h` is included in `THGeneral.h`. \r\n+ Then THXxx.h were included at https://github.com/zdevito/ATen/blob/master/src/ATen/templates/TensorDerived.h#L3\r\n+ That header is included before `#define __STDC_FORMAT_MACROS` at https://github.com/zdevito/ATen/blob/master/src/ATen/templates/TensorDerived.cpp#L9\r\n\r\nI confirmed and suggest two solutions for this problem.\r\n\r\n1. global change: `add_definitions(-D__STDC_FORMAT_MACROS)`  in `CMakeLists.txt`\r\n2. local change: `#define __STDC_FORMAT_MACROS` before `$th_headers` at https://github.com/zdevito/ATen/blob/master/src/ATen/templates/TensorDerived.h#L3 (also suggested in https://github.com/pytorch/pytorch/issues/3949#issuecomment-348368810)\r\n\r\nI prefer 1st one because it covers every header files while you use CMake."},"comment":{"url":"https://api.github.com/repos/zdevito/ATen/issues/comments/350620928","html_url":"https://github.com/zdevito/ATen/issues/183#issuecomment-350620928","issue_url":"https://api.github.com/repos/zdevito/ATen/issues/183","id":350620928,"user":{"login":"chaihua483","id":8024096,"avatar_url":"https://avatars2.githubusercontent.com/u/8024096?v=4","gravatar_id":"","url":"https://api.github.com/users/chaihua483","html_url":"https://github.com/chaihua483","followers_url":"https://api.github.com/users/chaihua483/followers","following_url":"https://api.github.com/users/chaihua483/following{/other_user}","gists_url":"https://api.github.com/users/chaihua483/gists{/gist_id}","starred_url":"https://api.github.com/users/chaihua483/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaihua483/subscriptions","organizations_url":"https://api.github.com/users/chaihua483/orgs","repos_url":"https://api.github.com/users/chaihua483/repos","events_url":"https://api.github.com/users/chaihua483/events{/privacy}","received_events_url":"https://api.github.com/users/chaihua483/received_events","type":"User","site_admin":false},"created_at":"2017-12-11T04:40:44Z","updated_at":"2017-12-11T04:40:44Z","author_association":"NONE","body":"Thank you! That helps a lot! It would be better if anyone could merge this change."}}
{"actor":{"display_login":"chaihua483"}}