Skip to content
Snippets Groups Projects
Commit 033e5d46 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Added a contributors guide

parent f500f8bd
No related branches found
No related tags found
1 merge request!32Added a contributors guide
# Contributor's Guide
This guide will walk you through how to submit changes to ADIOS and interact
with the project as a developer.
## Workflow
ADIOS uses the GitHub fork-and-branch model. In this, the project "lives" in it's main repository located at https://github.com/ornladios/adios2.git, while each individual developer has their own copy of the repo to work in. Changes are then submitted to the main repository via pull-requests made with branches from your fork.
### Setup
To setup your local repository for development:
1. Fork the main repository on GitHub:
1. Navigate to https://github.com/ornladios/adios2 in your browser.
1. Click the `[Fork]` button in the upper right-hand side of the page.
2. Clone your fork to your local machine:
```
[chuck@hal9000 Code]$ mkdir adios
[chuck@hal9000 Code]$ cd adios
[chuck@hal9000 adios]$ git clone git@github.com:<your-GitHub-username-here>/adios2.git source
Cloning into 'source'...
remote: Counting objects: 4535, done.
remote: Compressing objects: 100% (223/223), done.
remote: Total 4535 (delta 64), reused 0 (delta 0), pack-reused 4301
Receiving objects: 100% (4535/4535), 1.27 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2607/2607), done.
Checking connectivity... done.
[chuck.atkins@hal9000 adios]$
```
3. Run the `scripts/development/setup.sh` script. The script will configure an `upstream` remote and link your local master branch to the upstream.
```
[chuck.atkins@hal9000 adios]$ cd source/
$ ./scripts/developer/setup.sh
Checking GitHub username...
Using GitHub user <your-GitHub-username-here>
Adding upstream remote...
Fetching origin
Fetching upstream
From https://github.com/ornladios/adios2
* [new branch] dashboard -> upstream/dashboard
* [new branch] hooks -> upstream/hooks
* [new branch] master -> upstream/master
Re-configuring local master branch to use upstream
Setting up git aliases...
Setting up git hooks...
$
```
### Making a change and submitting a pull request
At this point you are ready to get to work. The first thing to do is to create a branch. ADIOS uses a "branchy" workflow where all changes are committed through self-contained "topic branches". This helps ensure a clean traceable git history and reduce conflicts.
#### Create the topic branch
1. Make sure you are starting from a current master:
```
$ git checkout master
$ git pull
```
2. Create a branch for your change:
```
$ git checkout -b <your-topic-branch-name>
```
3. Make your changes and commits to the branch.
4. Push the branch to your fork:
```
$ git push -u origin HEAD
Counting objects: 189, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (134/134), done.
Writing objects: 100% (189/189), 70.30 KiB | 0 bytes/s, done.
Total 189 (delta 128), reused 102 (delta 44)
remote: Resolving deltas: 100% (128/128), completed with 82 local objects.
To git@github.com:<your-GitHub-username-here>/adios2.git
* [new branch] HEAD -> <your-topic-branch-name>
Branch <your-topic-branch-name> set up to track remote branch <your-topic-branch-name> from origin.
$
```
##### Do I need to merge master into my branch first?
Not usually. The only time to do that is to resolve conflicts. You're pull request will be automatically rejected if merge-conflicts exist, in which case you can then resolve them by either re-basing your branch the current master (preferable):
```
$ git fetch --all -p
...
$ git rebase upstream/master
$ git push -f
```
or if necessary or re-basing is not a viable option then you can always fall back to merging in master but it should be generally discouraged as it tends to make the git history difficult to follow:
```
$ git fetch --all -p
...
$ git merge upstream/master
$ git push -f
```
#### Submit a pull request
1. Log in to your GitHub fork.
2. You should see a message at the top that informs you of your recently pushed branch, something like: `<your-topic-branch-name> (2 minutes ago)`. On the right side, select the `[Compare & pull request]` button.
3. Fill in the appropriate information for the name of the branch and a brief summary of the changes it contains.
* The default configuration will be for the topic branch to be merged into the upstream's master branch. You can change this if you want to submit to a different branch.
4. Click `[Create pull request]`.
You have now created a pull request (PR) that is pending several status checks before it can be merged. Currently, the only check being performed is for source code formatting and style. In the future, however, the will be a more in depth continuous integration system tied to the pull requests that tests for build and test failures every time a PR is submitted or updated. Once the status checks pass, the PR will be eligible for merging by one of the project maintainers.
### Code formatting and style
ADIOS uses the clang-format tool to automatically enforce source code style and formatting rules. There are various ways to integrate the clang-format tool into your IDE / Code Editor depending on if you use Emacs, Vim, Eclipse, KDevelop, Microsoft Visual Studio, etc. that are a bit outside the scope of this document but a quick google search for "integrate <insert-editor-here> clang-format" should point you in the right direction. However, you can always reformat the code manually by running:
```
clang-format -i SourceFile.cpp SourceFile.h
```
That will apply the formatting rules used by the ADIOS project.
1. Lines no longer than 80 characters.
1. Always use braces { and }, even for 1 line if blocks.
1. Use 4 spaces for indentation.
There are more formatting rules but these three should at least get you close and prevent any drastic re-writes from the re-formatting tools. More details can be found by looking at the .clang-format config file n the root of the repository and by looking at the clang-format documentation http://releases.llvm.org/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html. While the formatting rules are a bit more involved, the main points are:
# Adaptable Input / Output System (ADIOS) v2.0
This is v2.0 of the ADIOS I/O system, developed as part of the
U.S. Department of Energy Exascale Computing Program.
## License
ADIOS >= 2.0 is licensed under the Apache License v2.0. See the accompanying
Copyright.txt for more details.
## Directory layout
* cmake - Project specific CMake modules
* examples - ADIOS Examples
* include - Public header files
* scripts - Project maintenance and development scripts
* source - Main ADIOS source
* foo - Source and private header files for the "foo" component
* testing - Tests
## Developers
###Getting started
Upon cloning this repo, you will need to run the scripts/developer/setup.sh
script. This will perform the following:
* Validate that clang-format is available
* Setup formatting commit hooks
# Adaptable Input / Output System (ADIOS) v2.0
This is v2.0 of the ADIOS I/O system, developed as part of the
U.S. Department of Energy Exascale Computing Program.
## License
ADIOS >= 2.0 is licensed under the Apache License v2.0. See the accompanying
Copyright.txt for more details.
## Directory layout
* cmake - Project specific CMake modules
* examples - ADIOS Examples
* include - Public header files
* scripts - Project maintenance and development scripts
* source - Main ADIOS source
* testing - Tests
## Getting Started
ADIOS 2.0 uses CMake for it's build environment. CMake expects projects to use "out-of-source" builds, which means keeping a separate build and source directory (different from autotools, which usually uses an in-source build). To build ADIOS:
1. Clone the repository:
```
$ mkdir adios
$ cd adios
$ git clone https://github.com/ornladios/adios2.git source
```
2. Create a separate build directory:
```
$ mkdir build
```
3. Configure the project with CMake. The following options can be specified as `ON` or `OFF` with cmake's `-DVAR=VALUE` syntax:
* `ADIOS_BUILD_SHARED_LIBS` - Build shared libraries (`OFF` for static)
* `ADIOS_BUILD_EXAMPLES ` - Build examples
* `ADIOS_BUILD_TESTING ` - Build test code
* `ADIOS_USE_MPI ` - Enable MPI
* `ADIOS_USE_BZip2 ` - Enable BZip2 compression
* `ADIOS_USE_ADIOS1 ` - Enable the ADIOS 1.x engine
* `ADIOS_USE_DataMan ` - Enable the DataMan engine
```
$ cd build
$ cmake -DADIOS_USE_MPI=OFF ../source
-- The C compiler identification is GNU 6.3.1
-- The CXX compiler identification is GNU 6.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
ADIOS2 build configuration:
C++ Compiler: GNU 6.3.1
/usr/bin/c++
Installation prefix: /usr/local
Features:
Library Type: shared
Build Type: Debug
Testing: ON
MPI: OFF
BZip2: ON
ADIOS1: OFF
DataMan: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/adios/build
$
```
You can also use CMake's curses-base UI with `ccmake ../source`.
3. Compile:
```
$ make -j8
```
4. Run tests:
```
$ make test
```
## Developers
Please see the [Contributors Guide](Contributing.md) for how to submit changes
to ADIOS.
#!/usr/bin/env bash
echo "Checking github username..."
echo "Checking GitHub username..."
GHUSER=$(git remote get-url origin | sed 's|.*[:/]\([^/]*\)/adios2.git|\1|')
if [ -z "${GHUSER}" ]
then
echo " Warning: Unable to determine github username. Are you sure you"
echo " Warning: Unable to determine GitHub username. Are you sure you"
echo " cloned your fork?"
exit 1
fi
echo "Using github user ${GHUSER}"
echo "Using GitHub user ${GHUSER}"
echo "Adding upstream remote..."
if git remote show upstream > /dev/null 2>&1
......@@ -19,7 +19,7 @@ else
fi
git fetch --all -p
echo "Reconfiguring local master branch to use upstream"
echo "Re-configuring local master branch to use upstream"
git config branch.master.remote upstream
git config branch.master.mergeOptions "--ff-only"
git config merge.log 100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment