{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/brew/issues/3159","repository_url":"https://api.github.com/repos/Homebrew/brew","labels_url":"https://api.github.com/repos/Homebrew/brew/issues/3159/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/3159/comments","events_url":"https://api.github.com/repos/Homebrew/brew/issues/3159/events","html_url":"https://github.com/Homebrew/brew/issues/3159","id":258180441,"number":3159,"title":"Issue when a dependency depends on :mpi","user":{"login":"dpo","id":38760,"avatar_url":"https://avatars1.githubusercontent.com/u/38760?v=4","gravatar_id":"","url":"https://api.github.com/users/dpo","html_url":"https://github.com/dpo","followers_url":"https://api.github.com/users/dpo/followers","following_url":"https://api.github.com/users/dpo/following{/other_user}","gists_url":"https://api.github.com/users/dpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpo/subscriptions","organizations_url":"https://api.github.com/users/dpo/orgs","repos_url":"https://api.github.com/users/dpo/repos","events_url":"https://api.github.com/users/dpo/events{/privacy}","received_events_url":"https://api.github.com/users/dpo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-09-15T22:29:36Z","updated_at":"2017-09-19T07:38:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- [X] Confirmed this is a problem with running a `brew` command and not `brew install`ing or the post-install behaviour of one or more formulae? If it's a formulae-specific problem please file this issue at the relevant tap e.g. for Homebrew/homebrew-core https://github.com/Homebrew/homebrew-core/issues/new\r\n- [X] Ran `brew update` and retried your prior step?\r\n- [X] Ran `brew doctor`, fixed all issues and retried your prior step?\r\n- [X] Ran `brew config` and `brew doctor` and included their output with your issue?\r\n\r\nhttps://gist.github.com/dpo/dcb38eec73e0a4c9a7dc60b6941a96f6\r\n\r\nTo help us debug your issue please explain:\r\n- What you were trying to do (and why)\r\n\r\nBuild `homebrew/science/mumps` and dependencies against `mpich` to investigate https://github.com/Homebrew/homebrew-science/issues/6318.\r\n\r\n- What happened (include command output)\r\n\r\nThe dependencies `parmetis` and `scalapack` (which depend on `:mpi`) can be built from source against `mpich`, but `mumps` cannot:\r\n\r\n```bash\r\n$ brew install mpich # after uninstalling open-mpi and everything depending on it\r\n$ brew install -s parmetis scalapack # works fine\r\n\r\n$ brew install -s mumps\r\n==> Installing mumps from homebrew/science\r\n==> Installing dependencies for homebrew/science/mumps: open-mpi\r\n==> Installing homebrew/science/mumps dependency: open-mpi\r\nError: Cannot install open-mpi because conflicting formulae are installed.\r\nmpich: because both install mpi__ compiler wrappers\r\n\r\nPlease brew unlink mpich before continuing.\r\n```\r\n\r\n- What you expected to happen\r\n\r\nSee `mumps` compile against `mpich` since the `:mpi` dependency is satisfied.\r\n\r\n- Step-by-step reproduction instructions (by running `brew` commands)\r\n\r\n# Symptom\r\n\r\nIt seems that if a formula has a dependency D that depends on `:mpi`, then Homebrew wants to install `open-mpi`, regardless of whether D is already installed and regardless of whether it's been built from source against `mpich`. Here's a minimal example with a trimmed down `mumps.rb`:\r\n```ruby\r\nclass Mumps < Formula\r\n  desc \"Parallel Sparse Direct Solver\"\r\n  homepage \"http://mumps-solver.org\"\r\n  url \"http://mumps.enseeiht.fr/MUMPS_5.1.1.tar.gz\"\r\n  sha256 \"a2a1f89c470f2b66e9982953cbd047d429a002fab9975400cef7190d01084a06\"\r\n\r\n  depends_on :mpi\r\n  # depends_on \"scalapack\"  # scalapack depends_on :mpi\r\n\r\n  def install\r\n    puts \"Hello, MUMPS!\"\r\n  end\r\nend\r\n```\r\nAssume `open-mpi` is not installed but `mpich` is. Then `brew install -s` the above formula succeeds (i.e., does not complain about installing `open-mpi`).\r\n\r\nNow, uncomment the commented out line (and even comment out the explicit `:mpi` dependency) and assume `scalapack` was built from source against `mpich`:\r\n```\r\n$ otool -L /usr/local/opt/scalapack/lib/libscalapack.dylib \r\n/usr/local/opt/scalapack/lib/libscalapack.dylib:\r\n\t...\r\n\t/usr/local/opt/mpich/lib/libmpifort.12.dylib (compatibility version 14.0.0, current version 14.0.0)\r\n\t/usr/local/opt/mpich/lib/libmpi.12.dylib (compatibility version 14.0.0, current version 14.0.0)\r\n\t/usr/local/opt/mpich/lib/libpmpi.12.dylib (compatibility version 14.0.0, current version 14.0.0)\r\n\t...\r\n```\r\nThen\r\n```\r\n$ brew install -s /tmp/mumps.rb\r\n==> Installing dependencies for mumps: open-mpi\r\n==> Installing mumps dependency: open-mpi\r\nError: Cannot install open-mpi because conflicting formulae are installed.\r\n  mpich: because both install mpi__ compiler wrappers\r\n\r\nPlease `brew unlink mpich` before continuing.\r\n```\r\n\r\nI've inserted debugging statements in `mpi_requirement.rb` and `satisfy` returns `true`. Nevertheless, Homebrew wants `open-mpi`. It would be great to know if others can reproduce this."},"comment":{"url":"https://api.github.com/repos/Homebrew/brew/issues/comments/330456180","html_url":"https://github.com/Homebrew/brew/issues/3159#issuecomment-330456180","issue_url":"https://api.github.com/repos/Homebrew/brew/issues/3159","id":330456180,"user":{"login":"ilovezfs","id":5268928,"avatar_url":"https://avatars2.githubusercontent.com/u/5268928?v=4","gravatar_id":"","url":"https://api.github.com/users/ilovezfs","html_url":"https://github.com/ilovezfs","followers_url":"https://api.github.com/users/ilovezfs/followers","following_url":"https://api.github.com/users/ilovezfs/following{/other_user}","gists_url":"https://api.github.com/users/ilovezfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ilovezfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilovezfs/subscriptions","organizations_url":"https://api.github.com/users/ilovezfs/orgs","repos_url":"https://api.github.com/users/ilovezfs/repos","events_url":"https://api.github.com/users/ilovezfs/events{/privacy}","received_events_url":"https://api.github.com/users/ilovezfs/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T07:38:45Z","updated_at":"2017-09-19T07:38:45Z","author_association":"OWNER","body":">I think the workaround is to just list all formulae that require :mpi in the install command so it will know not to build a bottle for that formula.\r\n\r\nYou can also `HOMEBREW_BUILD_FROM_SOURCE=1 brew install mumps` if you don't want to list them."}}
{"actor":{"display_login":"ilovezfs"}}