{"action":"created","issue":{"url":"https://api.github.com/repos/trilinos/Trilinos/issues/1400","repository_url":"https://api.github.com/repos/trilinos/Trilinos","labels_url":"https://api.github.com/repos/trilinos/Trilinos/issues/1400/labels{/name}","comments_url":"https://api.github.com/repos/trilinos/Trilinos/issues/1400/comments","events_url":"https://api.github.com/repos/trilinos/Trilinos/issues/1400/events","html_url":"https://github.com/trilinos/Trilinos/issues/1400","id":234006126,"number":1400,"title":"Get CMake build system to take advantage of kokkos/Makefile.kokkos in setting compilers, compiler options etc.","user":{"login":"bartlettroscoe","id":1959736,"avatar_url":"https://avatars1.githubusercontent.com/u/1959736?v=4","gravatar_id":"","url":"https://api.github.com/users/bartlettroscoe","html_url":"https://github.com/bartlettroscoe","followers_url":"https://api.github.com/users/bartlettroscoe/followers","following_url":"https://api.github.com/users/bartlettroscoe/following{/other_user}","gists_url":"https://api.github.com/users/bartlettroscoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bartlettroscoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartlettroscoe/subscriptions","organizations_url":"https://api.github.com/users/bartlettroscoe/orgs","repos_url":"https://api.github.com/users/bartlettroscoe/repos","events_url":"https://api.github.com/users/bartlettroscoe/events{/privacy}","received_events_url":"https://api.github.com/users/bartlettroscoe/received_events","type":"User","site_admin":false},"labels":[{"id":289605971,"url":"https://api.github.com/repos/trilinos/Trilinos/labels/Kokkos","name":"Kokkos","color":"5319e7","default":false},{"id":317698325,"url":"https://api.github.com/repos/trilinos/Trilinos/labels/ready","name":"ready","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":28,"created_at":"2017-06-06T19:57:48Z","updated_at":"2017-12-01T17:52:29Z","closed_at":null,"author_association":"MEMBER","body":"**CC:** @kruger, @crtrott, @nmhamster, @dsunder, @ibaned \r\n\r\n**Next Action Status:**\r\n\r\nA new plan was discussed in detail on 8/1/2017.  Next:@kruger will write up the detailed plan in kokkos/kokkos#878 and then track work there ...\r\n\r\n**Description:**\r\n\r\nThe native Kokkos Makefile system takes advantage of fairly sophisticated makefile logic to define compilers, compiler options, and libraries given the input variables:\r\n\r\n* `KOKKOS_ARCH`\r\n* `KOKKOS_DEBUG`\r\n* `KOKKS_CXX_STANDARD`\r\n* etc. (could be more)\r\n\r\nAll of this logic is contain in the file kokkos/Makefile.kokkos shown at:\r\n\r\n* https://github.com/kokkos/kokkos/blob/master/Makefile.kokkos\r\n\r\nand this is in the Trilinos snapshot of kokkos shown here:\r\n\r\n* https://github.com/trilinos/Trilinos/blob/develop/packages/kokkos/Makefile.kokkos\r\n\r\nThe goal is to leverage kokkos/Makefile.kokkos as much as possible in the CMake build system for Kokkos under Trilinos.  We want the Trilinos CMake build of kokkos to produce, as much as possible, to create identical build lines to what the native Kokkos makefile system does.\r\n\r\nThe process might be to to:\r\n\r\n1. Define CMake cache `Trilinos_ARCH` (and other already-defined Trilinos CMake vars) and then set the Kokkos input vars shown above.\r\n\r\n2. Execute a dummy makefile pulling in Makefile.kokkos and extracting the out `KOKKOS_CXXFLAGS`, `KOKKOS_LDFLAGS`, etc., and the generated file KokkosCore_config.h file (and use it for the Kokkos_config.h file).\r\n\r\n3. Set `CMAKE_CXX_FLAGS`, etc. using these outputs.\r\n\r\nI think this needs to be done at the global level during the env probing (so it might need a new TriBITS callback function).  But we will have to see.\r\n\r\n**Repos, Issues, PRs, and Branches:**\r\n\r\nThe ATDM Tools & Dev Env issue tracking this work is:\r\n\r\n* https://software-srn.sandia.gov/jira/browse/ATDV-90\r\n\r\nThe three GitHub repos, Issues, PRs, and branches involved are:\r\n\r\n* Trilinos: git@github.com:trilinos/Trilinos.git\r\n  * Issue: https://github.com/trilinos/Trilinos/pull/1400\r\n  * PR: https://github.com/trilinos/Trilinos/pull/1884\r\n  * Branch: https://github.com/Tech-XCorp/Trilinos/tree/trilinos-kokkos-1400 (fork of trilinos/Trilinos)\r\n\r\n* TriBITS: git@github.com:TriBITSPub/TriBITS.git\r\n  * Issue: https://github.com/TriBITSPub/TriBITS/issues/207 **[Closed]**\r\n  * PR: https://github.com/TriBITSPub/TriBITS/pull/233 **[Closed]**\r\n  * Branch: https://github.com/TriBITSPub/TriBITS/tree/kokkos-config-207 **[Merged]**\r\n\r\n* kokkos: git@github.com:kokkos/kokkos.git\r\n  * Issue: https://github.com/kokkos/kokkos/issues/878\r\n  * PR: https://github.com/kokkos/kokkos/pull/1106\r\n  * Branch: https://github.com/Tech-XCorp/kokkos/tree/issue-878 (fork of kokkos/kokkos)\r\n  \r\nTo setup the repos and branches from scratch, do:\r\n\r\n```\r\n$ git clone git@github.com:trilinos/Trilinos.git\r\n$ cd Trilinos/\r\n$ git remote add tech-xcorp git@github.com:Tech-XCorp/Trilinos.git\r\n$ git fetch tech-xcorp\r\n$ git checkout --track tech-xcorp/trilinos-kokkos-1400\r\n\r\n$ git clone git@github.com:TriBITSPub/TriBITS.git\r\n$ cd TriBITS/\r\n$ git checkout --track origin/kokkos-config-207\r\n$ cd ..\r\n\r\n$ git clone git@github.com:kokkos/kokkos.git\r\n$ cd kokkos/\r\n$ git remote add tech-xcorp git@github.com:Tech-XCorp/kokkos.git\r\n$ git fetch tech-xcorp\r\n$ git checkout --track tech-xcorp/issue-878 \r\n$ cd ..\r\n```\r\n\r\nWith that setup, you should see:\r\n\r\n```\r\n$ ./cmake/tribits/python_utils/gitdist --dist-repos=.,TriBITS,kokkos dist-repo-status\r\n---------------------------------------------------------------------------------------------\r\n| ID | Repo Dir        | Branch               | Tracking Branch                 | C | M | ? |\r\n|----|-----------------|----------------------|---------------------------------|---|---|---|\r\n|  0 | Trilinos (Base) | trilinos-kokkos-1400 | tech-xcorp/trilinos-kokkos-1400 |   |   |   |\r\n|  1 | TriBITS         | kokkos-config-207    | orign/kokkos-config-207         |   |   |   |\r\n|  2 | kokkos          | issue-878            | tech-xcorp/issue-878            |   |   |   |\r\n---------------------------------------------------------------------------------------------\r\n```\r\n\r\nWith that, one can configure and bulid Trilinos using the version of TriBITS and kokkos in those branches by adding the cmake configure options:\r\n\r\n```\r\n$ cmake \\\r\n  -DTrilinos_TRIBITS_DIR:STRING=TriBITS/tribits \\\r\n  -DKokkos_SOURCE_DIR_OVERRIDE:STRING=kokkos \\\r\n  [option options] \\\r\n  ${TRILINOS_SRC_DIR}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/trilinos/Trilinos/issues/comments/348562557","html_url":"https://github.com/trilinos/Trilinos/issues/1400#issuecomment-348562557","issue_url":"https://api.github.com/repos/trilinos/Trilinos/issues/1400","id":348562557,"user":{"login":"crtrott","id":9490481,"avatar_url":"https://avatars1.githubusercontent.com/u/9490481?v=4","gravatar_id":"","url":"https://api.github.com/users/crtrott","html_url":"https://github.com/crtrott","followers_url":"https://api.github.com/users/crtrott/followers","following_url":"https://api.github.com/users/crtrott/following{/other_user}","gists_url":"https://api.github.com/users/crtrott/gists{/gist_id}","starred_url":"https://api.github.com/users/crtrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crtrott/subscriptions","organizations_url":"https://api.github.com/users/crtrott/orgs","repos_url":"https://api.github.com/users/crtrott/repos","events_url":"https://api.github.com/users/crtrott/events{/privacy}","received_events_url":"https://api.github.com/users/crtrott/received_events","type":"User","site_admin":false},"created_at":"2017-12-01T17:52:29Z","updated_at":"2017-12-01T17:52:29Z","author_association":"MEMBER","body":"Here is my line to build SandyBridge OpenMP:\r\n```\r\ncmake -DKokkos_SOURCE_DIR_OVERRIDE:STRING=kokkos -DTrilinos_ENABLE_OpenMP=ON -DKOKKOS_ARCH=SNB -DTrilinos_ENABLE_Kokkos=ON -DKokkos_ENABLE_TESTS=ON -DKOKKOS_LEGACY_TRIBITS=OFF -DTrilinos_ENABLE_Teuchos=ON ~/Trilinos\r\n```"}}
{"actor":{"display_login":"crtrott"}}