{"id":19706209,"url":"https://github.com/llnl/raja-project-template","last_synced_at":"2025-04-29T16:33:07.837Z","repository":{"id":42520904,"uuid":"213969712","full_name":"LLNL/RAJA-project-template","owner":"LLNL","description":"A template project using CMake \u0026 BLT to build a RAJA application","archived":false,"fork":false,"pushed_at":"2022-12-20T16:28:10.000Z","size":19,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-05T18:11:29.505Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LLNL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-09T16:34:54.000Z","updated_at":"2023-08-30T12:00:56.000Z","dependencies_parsed_at":"2023-01-30T01:16:00.966Z","dependency_job_id":null,"html_url":"https://github.com/LLNL/RAJA-project-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FRAJA-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FRAJA-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FRAJA-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FRAJA-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LLNL","download_url":"https://codeload.github.com/LLNL/RAJA-project-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251540472,"owners_count":21605910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp"],"created_at":"2024-11-11T21:34:39.191Z","updated_at":"2025-04-29T16:33:02.827Z","avatar_url":"https://github.com/LLNL.png","language":"C++","readme":"# RAJA Project Template\n\nThis project is a template that demonstrates how to use RAJA and BLT in an\napplication project that uses CMake or Make.\n\n## Quick Start using CMake\n\nClone this repository, and all the submodules:\n\n    git clone --recursive https://github.com/llnl/raja-project-template\n\nBefore we describe how to build the project, it is important to note that \nit requires out-of-source builds.\n\nTo configure and build this project using a default compiler on your system,\nfirst create a build subdirectory in the top-level directory of this repo and \nthen run CMake and make:\n\n    mkdir build \u0026\u0026 cd build\n    cmake ../\n    make\n\nThis will create the binary `example.exe` in the `./bin` directory. \n\nWhen you run the executable, you will see that it runs a sequential CPU kernel.\nYou can also run an OpenMP multithreaded CPU kernel or a CUDA GPU kernel by \nenabling those features when you run CMake, specifically, passing the following\noptions to CMake:\n\n- `-DENABLE_OPENMP=On` will enable the OpenMP back-end (RAJA default: `On`)\n- `-DENABLE_CUDA=On` will enable the CUDA back-end (RAJA default: `Off`)\n\nIf you want to experiment with RAJA before trying it in your application, \nyou can modify the file `./src/example.cpp`, and rebuild the code by running \n`make` in the `build` directory you created earlier.\n\n## Using CMake and an Installed Version of RAJA\n\nThis project can also be configured to use a pre-installed version of RAJA. \nThis is the recommended method for using RAJA in most applications. Please \nsee the [RAJA documentation]() for details on building and installing RAJA.\n\nOnce you have RAJA installed, configure the project by specifying the RAJA\nlocation using the CMake option `RAJA_DIR`:\n\n    cmake -DRAJA_DIR=\u003cpath to RAJA install directory\u003e/share/raja/cmake ../\n\nThen build as before:\n\n    make\n\nIf you are building your application against an installed version of RAJA,\nit's important to make sure that the options you passed to CMake to build\nRAJA match the options you use to build this project, apart from the one \nindicated above.\n\n## Using RAJA with Make\n\nTo use RAJA in a project with a make-based build system, you need to add the\n`include` directory where RAJA is installed to your compile flags and \nlink against the installed RAJA library. You must also ensure that you add \nthe appropriate flags for any RAJA features you have enabled (e.g. `-fopenmp` \nor equivalent if you built RAJA with OpenMP enabled).\n\nFor completeness, to compile and link the example in this project using the g++ \ncompiler, you could do the following on the command line:\n\n    g++ -I \u003cpath to RAJA install directory\u003e/include -std=c++11 -fopenmp ./src/example.cpp -o example.exe \u003cpath to RAJA install directory\u003e/lib/libRAJA.a\n\nSince most applications contain more than one source file, you probably want\nto create a Makefile to use to build your project. Here are the contents of a\nsimple Makefile that builds the example in this project:\n\n    CXX=\u003ccompiler executable\u003e\n    CXXFLAGS=-I$(INC_DIR) -std=c++11 -fopenmp\n\n    INC_DIR =\u003cpath to RAJA install directory\u003e/include\n    LIB_DIR =\u003cpath to RAJA install directory\u003e/include/lib\n\n    LIBS=-lRAJA\n\n    SRC_DIR=./src\n    OBJ_DIR=$(SRC_DIR)\n\n    OBJ = example.o\n\n    $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp\n         $(CXX) -c -o $@ $\u003c $(CXXFLAGS)\n\n    example.exe: $(OBJ_DIR)/$(OBJ)\n         $(CXX) -o $@ $^ $(CXXFLAGS) -L $(LIB_DIR) $(LIBS)\n\n    .PHONY: clean\n\n    clean:\n         rm -f $(OBJ_DIR)/*.o example.exe\n\nTo try it out, you can copy these lines into a file called Makefile in the \ntop-level project directory and type 'make'. The executable `example.exe` will \nbe generated in the same directory.\n\n## Next Steps\n\n- For more information on RAJA, check out the RAJA\n  [tutorial](https://raja.readthedocs.io/en/master)\n- For more information on using BLT and CMake, check out the BLT\n  [tutorial](https://llnl-blt.readthedocs.io/en/develop)\n\nIf you have questions, comments or ideas, please join the RAJA mailing list on\nGoogle Groups [here](https://groups.google.com/forum/#!forum/raja-users).\n\n## License\n\nRAJA is licensed under the BSD 3-Clause license, (BSD-3-Clause or\nhttps://opensource.org/licenses/BSD-3-Clause).\n\nCopyrights and patents in the RAJA project are retained by contributors.  No\ncopyright assignment is required to contribute to RAJA.\n\nUnlimited Open Source - BSD 3-clause Distribution\n`LLNL-CODE-689114`  `OCEC-16-063`\n\n## SPDX usage\n\nIndividual files contain SPDX tags instead of the full license text.\nThis enables machine processing of license information based on the SPDX\nLicense Identifiers that are available here: https://spdx.org/licenses/\n\nFiles that are licensed as BSD 3-Clause contain the following\ntext in the license header:\n\n    SPDX-License-Identifier: (BSD-3-Clause)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fraja-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllnl%2Fraja-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fraja-project-template/lists"}