{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/41830022","id":41830022,"diff_hunk":"@@ -0,0 +1,124 @@\n+require \"requirement\"\n+\n+class BlasRequirement < Requirement\n+  fatal true\n+  # on OSX -lblas and -llapack should work OOB.\n+  # the only case when test should fail is when we\n+  # need BLAS with single precision or complex with Fortran =>\n+  # use veclibfort\n+  default_formula \"veclibfort\" if OS.mac?","path":"Library/Homebrew/requirements/blas_requirement.rb","position":9,"original_position":9,"commit_id":"7bc98e5954ea02f8c2768031d18ba00edeaa0377","original_commit_id":"7bc98e5954ea02f8c2768031d18ba00edeaa0377","user":{"login":"davydden","id":8023934,"avatar_url":"https://avatars.githubusercontent.com/u/8023934?v=3","gravatar_id":"","url":"https://api.github.com/users/davydden","html_url":"https://github.com/davydden","followers_url":"https://api.github.com/users/davydden/followers","following_url":"https://api.github.com/users/davydden/following{/other_user}","gists_url":"https://api.github.com/users/davydden/gists{/gist_id}","starred_url":"https://api.github.com/users/davydden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davydden/subscriptions","organizations_url":"https://api.github.com/users/davydden/orgs","repos_url":"https://api.github.com/users/davydden/repos","events_url":"https://api.github.com/users/davydden/events{/privacy}","received_events_url":"https://api.github.com/users/davydden/received_events","type":"User","site_admin":false},"body":"do you want me to temporary add `openblas` and `veclibfort` to this PR?","created_at":"2015-10-13T06:11:55Z","updated_at":"2015-10-13T06:11:55Z","html_url":"https://github.com/Homebrew/homebrew/pull/44848#discussion_r41830022","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/41830022"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/44848#discussion_r41830022"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848","id":47420441,"html_url":"https://github.com/Homebrew/homebrew/pull/44848","diff_url":"https://github.com/Homebrew/homebrew/pull/44848.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/44848.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44848","number":44848,"state":"open","locked":false,"title":"Blas dependency","user":{"login":"davydden","id":8023934,"avatar_url":"https://avatars.githubusercontent.com/u/8023934?v=3","gravatar_id":"","url":"https://api.github.com/users/davydden","html_url":"https://github.com/davydden","followers_url":"https://api.github.com/users/davydden/followers","following_url":"https://api.github.com/users/davydden/following{/other_user}","gists_url":"https://api.github.com/users/davydden/gists{/gist_id}","starred_url":"https://api.github.com/users/davydden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davydden/subscriptions","organizations_url":"https://api.github.com/users/davydden/orgs","repos_url":"https://api.github.com/users/davydden/repos","events_url":"https://api.github.com/users/davydden/events{/privacy}","received_events_url":"https://api.github.com/users/davydden/received_events","type":"User","site_admin":false},"body":"this is a result of a big disscussion about [linuxbrew on a cluster](https://github.com/Homebrew/linuxbrew/issues/504) with @Rombur @dpo @tjhei @jppelteret @dctrud @sjackman  and two PRs: [original by @tdsmith](https://github.com/Homebrew/linuxbrew/pull/511) and my further work [here](https://github.com/Homebrew/linuxbrew/pull/592).\r\n\r\nBy introducing `:blas` dependency we:\r\n\r\n1. Avoid all `depends_on openblas => :optional`. If someone wants to compile everything with openblas, it's one place to set this;\r\n2. Sometimes we need to use `veclibfort` to wrap `-framework Accelerate` to use single precision or complex valued BLAS Fortran routines. It's is now also done automatically inside the dependency. So in many formulae we will be able cut down something like `if OSX? use veclibfort else if \"openblas\" use openblas else use \"-llapack -lblas\"`.\r\n3. As far as blas is concered, formulae in Homebrew-science will have the same code be it OS-X or Linuxbrew. \r\n4. Finally, the whole infrastructure is ready to use BLAS natively provided by computer vendors or other alternatives such as Atlas and most notably **Math-Kernel-Library (MKL)**, which recently [became free](https://software.intel.com/en-us/articles/free_mkl) and hopefully will be soon available for OSX. \r\n\r\n\r\nSummary of `:blas` usage cases which were tested on  a) **CentOS cluster + MKL**; b) **Ubuntu 14.04 + Openblas**;  b) **Ubuntu 14.04 + system blas** are:\r\n1. library names (space/semicolon separated) + dir: [Hypre](https://github.com/davydden/homebrew-science/blob/mkl_dealii/hypre.rb#L39-L45), [Trilinos](https://github.com/davydden/homebrew-science/blob/mkl_dealii/trilinos.rb#L115-L120)\r\n2. ldflags : [Superlu_dist](https://github.com/davydden/homebrew-science/blob/mkl_dealii/superlu_dist.rb#L31), [scalapack](https://github.com/davydden/homebrew-science/blob/mkl_dealii/scalapack.rb#L28-L29), [mumps](https://github.com/davydden/homebrew-science/blob/mkl_dealii/mumps.rb#L107-L108), [p4est](https://github.com/davydden/homebrew-science/blob/mkl_dealii/p4est.rb#L32)\r\n3. full path (space/semicolon separated) : [Petsc](https://github.com/davydden/homebrew-science/blob/mkl_dealii/petsc.rb#L92-L93), [deal.II](https://github.com/davydden/homebrew-science/blob/mkl_dealii/dealii.rb#L58-L62)\r\n\r\n\r\n@tdsmith [proposed](https://github.com/Homebrew/linuxbrew/pull/511#issuecomment-140774803) to name it `:blas_lapack`, which is cleaner. I have not changed the name yet as there are some static functions of `BlasRequirement` class. One can also discuss the name of the tag (currently `:fortran`), perhaps something like `:fortran_single` (single precision) will be more descriptive. But this are minor changes easy to make if desired. I am open to add further in-code comments if needed.\r\n\r\n\r\nps. \r\n\r\nhere is a nice summary article about BLAS and LAPACK http://glennklockwood.blogspot.de/2014/02/quantum-espresso-compiling-and-choice.html\r\n\r\n>BLAS is the lowest-level library and provides subroutines that do basic vector operations.  Netlib provides a reference implementation of BLAS written in Fortran, but the big idea behind BLAS is to allow hardware vendors to provide highly tuned versions of the BLAS subroutines that obviate the need for application developers to worry about optimizing their linear algebra for every possible computer architecture on which the application might run.  This motivation is also what gave rise to the MPI standard, but unlike MPI, BLAS is not an actual standard.\r\n>\r\n>LAPACK builds upon BLAS and provides higher-level matrix operations such as diagonalization (i.e., solving for eigenvectors and eigenvalues) and inversion.  BLAS and LAPACK seem to be bundled together when actually implemented (e.g., IBM ESSL and Intel MKL both provide both optimized BLAS and LAPACK), but they provide two distinct layers of abstracting the mathematical complexity away from application developers.\r\n>","created_at":"2015-10-12T13:38:18Z","updated_at":"2015-10-13T06:11:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86d2a0daa1be3ca326cdbc843af4b117f310a809","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/44848/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/7bc98e5954ea02f8c2768031d18ba00edeaa0377","head":{"label":"davydden:blas-dependency","ref":"blas-dependency","sha":"7bc98e5954ea02f8c2768031d18ba00edeaa0377","user":{"login":"davydden","id":8023934,"avatar_url":"https://avatars.githubusercontent.com/u/8023934?v=3","gravatar_id":"","url":"https://api.github.com/users/davydden","html_url":"https://github.com/davydden","followers_url":"https://api.github.com/users/davydden/followers","following_url":"https://api.github.com/users/davydden/following{/other_user}","gists_url":"https://api.github.com/users/davydden/gists{/gist_id}","starred_url":"https://api.github.com/users/davydden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davydden/subscriptions","organizations_url":"https://api.github.com/users/davydden/orgs","repos_url":"https://api.github.com/users/davydden/repos","events_url":"https://api.github.com/users/davydden/events{/privacy}","received_events_url":"https://api.github.com/users/davydden/received_events","type":"User","site_admin":false},"repo":{"id":29259053,"name":"homebrew","full_name":"davydden/homebrew","owner":{"login":"davydden","id":8023934,"avatar_url":"https://avatars.githubusercontent.com/u/8023934?v=3","gravatar_id":"","url":"https://api.github.com/users/davydden","html_url":"https://github.com/davydden","followers_url":"https://api.github.com/users/davydden/followers","following_url":"https://api.github.com/users/davydden/following{/other_user}","gists_url":"https://api.github.com/users/davydden/gists{/gist_id}","starred_url":"https://api.github.com/users/davydden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davydden/subscriptions","organizations_url":"https://api.github.com/users/davydden/orgs","repos_url":"https://api.github.com/users/davydden/repos","events_url":"https://api.github.com/users/davydden/events{/privacy}","received_events_url":"https://api.github.com/users/davydden/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davydden/homebrew","description":"The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/davydden/homebrew","forks_url":"https://api.github.com/repos/davydden/homebrew/forks","keys_url":"https://api.github.com/repos/davydden/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davydden/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davydden/homebrew/teams","hooks_url":"https://api.github.com/repos/davydden/homebrew/hooks","issue_events_url":"https://api.github.com/repos/davydden/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/davydden/homebrew/events","assignees_url":"https://api.github.com/repos/davydden/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/davydden/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/davydden/homebrew/tags","blobs_url":"https://api.github.com/repos/davydden/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davydden/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davydden/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/davydden/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davydden/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/davydden/homebrew/languages","stargazers_url":"https://api.github.com/repos/davydden/homebrew/stargazers","contributors_url":"https://api.github.com/repos/davydden/homebrew/contributors","subscribers_url":"https://api.github.com/repos/davydden/homebrew/subscribers","subscription_url":"https://api.github.com/repos/davydden/homebrew/subscription","commits_url":"https://api.github.com/repos/davydden/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/davydden/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/davydden/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/davydden/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/davydden/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/davydden/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davydden/homebrew/merges","archive_url":"https://api.github.com/repos/davydden/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davydden/homebrew/downloads","issues_url":"https://api.github.com/repos/davydden/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/davydden/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/davydden/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/davydden/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davydden/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/davydden/homebrew/releases{/id}","created_at":"2015-01-14T18:30:32Z","updated_at":"2015-01-14T18:30:46Z","pushed_at":"2015-10-12T13:09:39Z","git_url":"git://github.com/davydden/homebrew.git","ssh_url":"git@github.com:davydden/homebrew.git","clone_url":"https://github.com/davydden/homebrew.git","svn_url":"https://github.com/davydden/homebrew","homepage":"http://brew.sh","size":55313,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"fa233b538c6bdbe1e4de27e0d733ccda72d39dfe","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-10-13T05:47:55Z","pushed_at":"2015-10-13T06:07:47Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1630482,"stargazers_count":26411,"watchers_count":26411,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":13100,"mirror_url":null,"open_issues_count":501,"forks":13100,"open_issues":501,"watchers":26411,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/44848"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/44848"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/44848/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/44848/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/7bc98e5954ea02f8c2768031d18ba00edeaa0377"}}}}