{"action":"created","issue":{"url":"https://api.github.com/repos/LLNL/spack/issues/350","labels_url":"https://api.github.com/repos/LLNL/spack/issues/350/labels{/name}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/350/comments","events_url":"https://api.github.com/repos/LLNL/spack/issues/350/events","html_url":"https://github.com/LLNL/spack/pull/350","id":126484790,"number":350,"title":"Add NAG Fortran Compiler support","user":{"login":"adamjstewart","id":12021217,"avatar_url":"https://avatars.githubusercontent.com/u/12021217?v=3","gravatar_id":"","url":"https://api.github.com/users/adamjstewart","html_url":"https://github.com/adamjstewart","followers_url":"https://api.github.com/users/adamjstewart/followers","following_url":"https://api.github.com/users/adamjstewart/following{/other_user}","gists_url":"https://api.github.com/users/adamjstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjstewart/subscriptions","organizations_url":"https://api.github.com/users/adamjstewart/orgs","repos_url":"https://api.github.com/users/adamjstewart/repos","events_url":"https://api.github.com/users/adamjstewart/events{/privacy}","received_events_url":"https://api.github.com/users/adamjstewart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-13T18:38:56Z","updated_at":"2016-01-20T18:50:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/LLNL/spack/pulls/350","html_url":"https://github.com/LLNL/spack/pull/350","diff_url":"https://github.com/LLNL/spack/pull/350.diff","patch_url":"https://github.com/LLNL/spack/pull/350.patch"},"body":"Ok, I have NAG mostly supported now. For example, `spack compiler info nag` works as expected. However, `spack compiler add /soft/nag/6.0/bin` returns `==> Found no new compilers` Any idea how to get this working?"},"comment":{"url":"https://api.github.com/repos/LLNL/spack/issues/comments/173322428","html_url":"https://github.com/LLNL/spack/pull/350#issuecomment-173322428","issue_url":"https://api.github.com/repos/LLNL/spack/issues/350","id":173322428,"user":{"login":"adamjstewart","id":12021217,"avatar_url":"https://avatars.githubusercontent.com/u/12021217?v=3","gravatar_id":"","url":"https://api.github.com/users/adamjstewart","html_url":"https://github.com/adamjstewart","followers_url":"https://api.github.com/users/adamjstewart/followers","following_url":"https://api.github.com/users/adamjstewart/following{/other_user}","gists_url":"https://api.github.com/users/adamjstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjstewart/subscriptions","organizations_url":"https://api.github.com/users/adamjstewart/orgs","repos_url":"https://api.github.com/users/adamjstewart/repos","events_url":"https://api.github.com/users/adamjstewart/events{/privacy}","received_events_url":"https://api.github.com/users/adamjstewart/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T18:50:20Z","updated_at":"2016-01-20T18:50:20Z","body":"I just discovered why `spack compiler add` wasn't finding any NAG compilers.\r\n\r\nUnlike all of the other compilers, `nagfor -V` sends its version information to STDERR, not STDOUT. `get_compiler_version()` in lib/spack/spack/compiler.py is setup to send all error messages to /dev/null:\r\n```python\r\noutput = compiler(version_arg, return_output=True, error=os.devnull)\r\n```\r\nSince get_compiler_version doesn't get any version output, it sets the version to \"unknown\". `find` is setup to \"skip compilers with unknown version\", and therefore can't find any compilers even though they exist.\r\n\r\nThe easiest solution to this problem would be to change '-V' in Nag.py to '-V 2>&1' so that nagfor sends it version information to STDOUT. However, this seems kind of hacky to me. If someone adds another compiler in the future that sends its version information to STDERR, they will run into the same problem.\r\n\r\nA better solution, in my opinion, would be to change the above compiler call so that it returns STDOUT and STDERR. I can't foresee this causing any major problems, unless an older version of a compiler doesn't support a particular option and the regexp is too generic. I'm not sure if this change needs to take place inside of executable.py's `__call__()` or if I can change the input parameters inside of get_compiler_version, but I will continue to play around with it.\r\n\r\nLet me know which of these solutions you would prefer."}}