{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/10488","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10488/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10488/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10488/events","html_url":"https://github.com/chapel-lang/chapel/issues/10488","id":344120747,"node_id":"MDU6SXNzdWUzNDQxMjA3NDc=","number":10488,"title":"Mason: Spack Integration","user":{"login":"Spartee","id":13009163,"node_id":"MDQ6VXNlcjEzMDA5MTYz","avatar_url":"https://avatars0.githubusercontent.com/u/13009163?v=4","gravatar_id":"","url":"https://api.github.com/users/Spartee","html_url":"https://github.com/Spartee","followers_url":"https://api.github.com/users/Spartee/followers","following_url":"https://api.github.com/users/Spartee/following{/other_user}","gists_url":"https://api.github.com/users/Spartee/gists{/gist_id}","starred_url":"https://api.github.com/users/Spartee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spartee/subscriptions","organizations_url":"https://api.github.com/users/Spartee/orgs","repos_url":"https://api.github.com/users/Spartee/repos","events_url":"https://api.github.com/users/Spartee/events{/privacy}","received_events_url":"https://api.github.com/users/Spartee/received_events","type":"User","site_admin":false},"labels":[{"id":496591322,"node_id":"MDU6TGFiZWw0OTY1OTEzMjI=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Third-Party","name":"area: Third-Party","color":"d4c5f9","default":false},{"id":514878276,"node_id":"MDU6TGFiZWw1MTQ4NzgyNzY=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Tools","name":"area: Tools","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"Spartee","id":13009163,"node_id":"MDQ6VXNlcjEzMDA5MTYz","avatar_url":"https://avatars0.githubusercontent.com/u/13009163?v=4","gravatar_id":"","url":"https://api.github.com/users/Spartee","html_url":"https://github.com/Spartee","followers_url":"https://api.github.com/users/Spartee/followers","following_url":"https://api.github.com/users/Spartee/following{/other_user}","gists_url":"https://api.github.com/users/Spartee/gists{/gist_id}","starred_url":"https://api.github.com/users/Spartee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spartee/subscriptions","organizations_url":"https://api.github.com/users/Spartee/orgs","repos_url":"https://api.github.com/users/Spartee/repos","events_url":"https://api.github.com/users/Spartee/events{/privacy}","received_events_url":"https://api.github.com/users/Spartee/received_events","type":"User","site_admin":false},"assignees":[{"login":"Spartee","id":13009163,"node_id":"MDQ6VXNlcjEzMDA5MTYz","avatar_url":"https://avatars0.githubusercontent.com/u/13009163?v=4","gravatar_id":"","url":"https://api.github.com/users/Spartee","html_url":"https://github.com/Spartee","followers_url":"https://api.github.com/users/Spartee/followers","following_url":"https://api.github.com/users/Spartee/following{/other_user}","gists_url":"https://api.github.com/users/Spartee/gists{/gist_id}","starred_url":"https://api.github.com/users/Spartee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spartee/subscriptions","organizations_url":"https://api.github.com/users/Spartee/orgs","repos_url":"https://api.github.com/users/Spartee/repos","events_url":"https://api.github.com/users/Spartee/events{/privacy}","received_events_url":"https://api.github.com/users/Spartee/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/chapel-lang/chapel/milestones/29","html_url":"https://github.com/chapel-lang/chapel/milestone/29","labels_url":"https://api.github.com/repos/chapel-lang/chapel/milestones/29/labels","id":3520956,"node_id":"MDk6TWlsZXN0b25lMzUyMDk1Ng==","number":29,"title":"J Sprint 11","description":"","creator":{"login":"benjamin-robbins","id":30993993,"node_id":"MDQ6VXNlcjMwOTkzOTkz","avatar_url":"https://avatars1.githubusercontent.com/u/30993993?v=4","gravatar_id":"","url":"https://api.github.com/users/benjamin-robbins","html_url":"https://github.com/benjamin-robbins","followers_url":"https://api.github.com/users/benjamin-robbins/followers","following_url":"https://api.github.com/users/benjamin-robbins/following{/other_user}","gists_url":"https://api.github.com/users/benjamin-robbins/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamin-robbins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamin-robbins/subscriptions","organizations_url":"https://api.github.com/users/benjamin-robbins/orgs","repos_url":"https://api.github.com/users/benjamin-robbins/repos","events_url":"https://api.github.com/users/benjamin-robbins/events{/privacy}","received_events_url":"https://api.github.com/users/benjamin-robbins/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":8,"state":"closed","created_at":"2018-07-24T19:58:44Z","updated_at":"2018-08-09T17:58:28Z","due_on":"2018-08-07T07:00:00Z","closed_at":"2018-08-09T17:58:28Z"},"comments":14,"created_at":"2018-07-24T16:51:33Z","updated_at":"2018-08-17T17:13:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"With this integration, Chapel users will not only be able to use dependencies on their machines through the `mason system` command, but also be able to download, install, search for, and find packages that are not on their system through the `mason external` command. Chapel users will use the `mason external` command to interface with a number of options to use external dependencies that closely resemble the existing mason commands.\r\n\r\nThe first external package manager Mason will be interfacing with is Spack. For more information on spack see the [documenation](https://spack.readthedocs.io/en/latest/) or the issue about [external dependencies](https://github.com/chapel-lang/chapel/issues/10037)\r\n\r\n### Features (check = working in branch not master)\r\n- [x] Install and setup Spack\r\n- [x] Install Package\r\n    - In Spack spec grammer form or not. e.g. (openssl@0.1.0%gcc or openssl)\r\n- [x] Uninstall package\r\n- [x] List installed packages\r\n- [x] Search for packages\r\n- [x] Show info for a package\r\n- [x] List available compilers\r\n- [x] Find installed compilers\r\n- [x] Print architecture information\r\n- [x] Help options\r\n   - Search help\r\n   - Install/uninstall help\r\n   - Compiler help\r\n   - Spack spec help\r\n\r\nA `Mason.toml` for an external package that requires `zlib`, `openssl`, and `openblas` would look as follows:\r\n\r\n`Mason.toml`\r\n\r\n```toml\r\n[brick]\r\nname = \"package\"\r\nversion = \"0.1.0\"\r\nchplVersion = \"1.18.0\"\r\nauthor = \"Sam Partee\"\r\n\r\n[dependencies]\r\n\r\n[external]\r\nopenssl = \"1.0.2k\"\r\nopenblas = \"0.2.20\"\r\nzlib = \"1.2.11\"\r\n\r\n```\r\n\r\nThe build information included in the lock file would look as follows:\r\n\r\n`Mason.lock`\r\n\r\n``` toml\r\n[root]\r\nname = \"package\"\r\nversion = \"0.1.0\"\r\nchplVersion = \"1.18.0..1.18.0\"\r\nauthor = \"Sam Partee\"\r\n\r\n[external]\r\n\r\n[external.openblas]\r\nname = \"openblas\"\r\nversion = \"0.2.20\"\r\nlibs = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/gcc-8.1.0/openblas-0.2.20-btofrthi6uvbkr6nxihksesh337spbn6/lib\"\r\ninclude = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/gcc-8.1.0/openblas-0.2.20-btofrthi6uvbkr6nxihksesh337spbn6/include\"\r\n\r\n[external.openssl]\r\nname = \"openssl\"\r\nversion = \"1.0.2k\"\r\nlibs = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/clang-9.0.0-apple/openssl-1.0.2k-fwnsee6qcvbbgvmgp3f5hio6dwg6nh2d/lib\"\r\ninclude = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/clang-9.0.0-apple/openssl-1.0.2k-fwnsee6qcvbbgvmgp3f5hio6dwg6nh2d/include\"\r\n\r\n[external.zlib]\r\nname = \"zlib\"\r\nversion = \"1.2.11\"\r\nlibs = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/clang-9.0.0-apple/zlib-1.2.11-cpdvq4e7otjepbwdtxmgk5bzszze27fj/lib\"\r\ninclude = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/clang-9.0.0-apple/zlib-1.2.11-cpdvq4e7otjepbwdtxmgk5bzszze27fj/include\"\r\n```\r\n\r\nThe build information is gathered through the `spack find -p <package>` command and parsed to return the path to the include and library directory.\r\n\r\nThis build information is then fed to `mason build` through compilation options just like how they would be specified on the command line. This process mimics the process of `Mason System`(pkg-config integration #10289).\r\n\r\nExternal and System packages can also be used in conjunction as the `Mason.toml` below displays. This Mason.toml is for an example of the `LinearAlgebra` library that requires `openBLAS` and `LAPACK`. \r\n\r\n`Mason.toml`\r\n\r\n```toml\r\n[brick]\r\nname = \"cholesky\"\r\nversion = \"0.1.0\"\r\nchplVersion = \"1.18.0\"\r\ncompopts = \"--ccflags -Wno-enum-conversion --ccflags -Wno-strict-prototypes -lopenblas\"\r\n\r\n[dependencies]\r\n\r\n[external]\r\nopenblas = \"0.2.20\"\r\n\r\n[system]\r\nlapack = \"*\"\r\n```\r\n\r\nThe build information for the `Mason.toml would look as follows:\r\n\r\n`Mason.lock`\r\n\r\n```toml\r\n[root]\r\nname = \"cholesky\"\r\ncompopts = \"--ccflags -Wno-enum-conversion --ccflags -Wno-strict-prototypes -lopenblas\"\r\nversion = \"0.1.0\"\r\nchplVersion = \"1.18.0..1.18.0\"\r\n\r\n[external]\r\n\r\n[external.openblas]\r\nname = \"openblas\"\r\nversion = \"0.2.20\"\r\nlibs = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/gcc-8.1.0/openblas-0.2.20-btofrthi6uvbkr6nxihksesh337spbn6/lib\"\r\ninclude = \"/Users/spartee/spack/opt/spack/darwin-sierra-x86_64/gcc-8.1.0/openblas-0.2.20-btofrthi6uvbkr6nxihksesh337spbn6/include\"\r\n\r\n[system]\r\n\r\n[system.lapack]\r\nname = \"lapack\"\r\nversion = \"3.8.0\"\r\nlibs = \"-L/usr/local/Cellar/lapack/3.8.0_1/lib -llapack\"\r\ninclude = \"/usr/local/Cellar/lapack/3.8.0_1/include\"\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/413930963","html_url":"https://github.com/chapel-lang/chapel/issues/10488#issuecomment-413930963","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/10488","id":413930963,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzkzMDk2Mw==","user":{"login":"mppf","id":3653132,"node_id":"MDQ6VXNlcjM2NTMxMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3653132?v=4","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T17:13:21Z","updated_at":"2018-08-17T17:13:21Z","author_association":"MEMBER","body":"@Spartee - thanks for explaining. I'd still like to understand what is hard about it though. I would have expected that with this example:\r\n```\r\n[external]\r\nhdf5 = \"1.10.1 +hl\"\r\n```\r\n\r\nwhen we ask for details about the HDF5 dependency from Spack, we run some Spack command and pass the entire spec (i.e. `hdf5@1.10.1 +hl`) and then Spack tells us about the appropriate libraries/flags/dependencies. It sounds (from your description) that Spack will work with the complete spec if/when we request installation of the package, but not to gather dependencies/libraries/flags? Isn't there just some Spack command we can run (conceptually like the pkg-config commands) to get this information? Why wouldn't we pass the whole spec to that command?"}}
{"actor":{"display_login":"mppf"}}