{"action":"closed","number":1431,"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431","id":30350906,"html_url":"https://github.com/chapel-lang/chapel/pull/1431","diff_url":"https://github.com/chapel-lang/chapel/pull/1431.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/1431.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/1431","number":1431,"state":"closed","locked":false,"title":"Add version detection macros to runtime/include/chpl-comp-detect-macros.h","user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"body":"runtime/include/chpl-comp-detect-macros.h contains code to detect which backend\r\ncompiler is being used. This adds version detection macros for all our backend\r\ncompilers primarily for feature detection. These are required for the upcoming\r\nvectorize-loop-followers patch that attaches the ivdep pragma to loops in\r\nfollower iterators. It is being added separately so the links/info at the end\r\nof this commit message can be easily found in the commit history.\r\n\r\nThis does not provide a single macro for all compilers but instead provides\r\nunique macros for each compiler (since there's no uniform versioning scheme\r\nbetween compilers and you want to be explicit about which compiler you're\r\nchecking.) This primarily serves as a means to avoid having to look up how each\r\ncompiler stores it's version number since the information isn't that easy to\r\nfind.\r\n\r\nVersion number schemes:\r\n```\r\n- Cray  : _RELEASE_MAJOR, _RELEASE_MINOR\r\n- Intel : __INTEL_COMPILER\r\n- Clang : __clang_major__, __clang_minor__, __clang_patchlevel__\r\n- GCC   : __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__\r\n- PGI   : __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__\r\n```\r\n\r\nThese are the links I used for each compiler:\r\n```\r\n- Cray  : http://docs.cray.com/books/S-2179-83/S-2179-83.pdf\r\n- Intel : https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-603F2191-6FC2-4EE6-8B94-55C7CAD72D2E.htm\r\n- Clang : http://clang.llvm.org/docs/LanguageExtensions.html#builtin-macros\r\n- GCC   : https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html\r\n- PGI   : http://sourceforge.net/p/predef/wiki/Compilers/\r\n- Misc  : http://nadeausoftware.com/articles/2012/10/c_c_tip_how_detect_compiler_name_and_version_using_compiler_predefined_macros\r\n```\r\n\r\nConfirmed by checking the predefined macros for each compiler:\r\n```\r\n- Cray  : cc -Wp,-list_final_macros -E <test c file (can't be /dev/null)>\r\n- Intel : icc -dM -E -x c /dev/null\r\n- Clang : clang -dM -E -x c /dev/null\r\n- GCC   : gcc -dM -E -x c /dev/null\r\n- PGI   : pgcc  -dM -E\r\n```\r\n\r\nNote that the major version for cray is _RELEASE_MAJOR *NOT* _RELEASE. _RELEASE\r\nused to be what the docs specified, but there was a bug where _RELEASE reported\r\nthe wrong version for the c compiler. Since 8.3 the docs (and a closed bug) say\r\nto use _RELEASE_MAJOR. The _RELEASE_MAJOR macro has been around for years so we\r\ncan rely on it, it just wasn't documented.\r\n\r\nNote that the clang version macros are not provided because their version\r\nmacros use marketing version numbers. The clang website insists that they are\r\n*NOT* to be used for feature detection as \"different vendors use different\r\nnumbering schemes.\" Instead their feature detection macros should be used.\r\n","created_at":"2015-03-03T07:02:43Z","updated_at":"2015-03-04T00:13:36Z","closed_at":"2015-03-04T00:13:36Z","merged_at":"2015-03-04T00:13:36Z","merge_commit_sha":"ef12b10477edf69eea8e93a5be3a4aa35063ed24","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/1431/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/c5d421708d47194f9382dc7e6ccbb68ef182203a","head":{"label":"ronawho:rt-comp-version-macros","ref":"rt-comp-version-macros","sha":"c5d421708d47194f9382dc7e6ccbb68ef182203a","user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"repo":{"id":21908970,"name":"chapel","full_name":"ronawho/chapel","owner":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ronawho/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/ronawho/chapel","forks_url":"https://api.github.com/repos/ronawho/chapel/forks","keys_url":"https://api.github.com/repos/ronawho/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronawho/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronawho/chapel/teams","hooks_url":"https://api.github.com/repos/ronawho/chapel/hooks","issue_events_url":"https://api.github.com/repos/ronawho/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/ronawho/chapel/events","assignees_url":"https://api.github.com/repos/ronawho/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/ronawho/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/ronawho/chapel/tags","blobs_url":"https://api.github.com/repos/ronawho/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronawho/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronawho/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronawho/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronawho/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/ronawho/chapel/languages","stargazers_url":"https://api.github.com/repos/ronawho/chapel/stargazers","contributors_url":"https://api.github.com/repos/ronawho/chapel/contributors","subscribers_url":"https://api.github.com/repos/ronawho/chapel/subscribers","subscription_url":"https://api.github.com/repos/ronawho/chapel/subscription","commits_url":"https://api.github.com/repos/ronawho/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronawho/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronawho/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronawho/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronawho/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/ronawho/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronawho/chapel/merges","archive_url":"https://api.github.com/repos/ronawho/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronawho/chapel/downloads","issues_url":"https://api.github.com/repos/ronawho/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/ronawho/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/ronawho/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/ronawho/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronawho/chapel/labels{/name}","releases_url":"https://api.github.com/repos/ronawho/chapel/releases{/id}","created_at":"2014-07-16T16:46:31Z","updated_at":"2015-03-03T23:13:24Z","pushed_at":"2015-03-03T23:26:39Z","git_url":"git://github.com/ronawho/chapel.git","ssh_url":"git@github.com:ronawho/chapel.git","clone_url":"https://github.com/ronawho/chapel.git","svn_url":"https://github.com/ronawho/chapel","homepage":"http://chapel.cray.com/","size":255301,"stargazers_count":2,"watchers_count":2,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"2c2c949d2558e3887f3df3aab3c1f8259d0a31bd","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"name":"chapel","full_name":"chapel-lang/chapel","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","created_at":"2014-07-09T18:15:54Z","updated_at":"2015-03-03T23:49:45Z","pushed_at":"2015-03-04T00:13:36Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"http://chapel.cray.com/","size":338076,"stargazers_count":72,"watchers_count":72,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":8,"forks":39,"open_issues":8,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/1431"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/1431"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/1431/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/1431/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/c5d421708d47194f9382dc7e6ccbb68ef182203a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":1,"additions":55,"deletions":0,"changed_files":1}}