Skip to content

Commit

Permalink
Merge pull request #901 from GMLC-TDC/master_merge
Browse files Browse the repository at this point in the history
Master merge for HELICS 2.3 release
  • Loading branch information
phlptp authored Nov 13, 2019
2 parents f8eea8a + 3c29a93 commit 1e65ee7
Show file tree
Hide file tree
Showing 834 changed files with 29,922 additions and 14,796 deletions.
8 changes: 4 additions & 4 deletions .ci/.drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ steps:
image: alpine
commands:
- apk update
- apk add --no-cache build-base git bash cmake ninja boost-dev zeromq-dev swig
- apk add --no-cache build-base git bash cmake ninja boost-dev zeromq-dev
- gcc --version || echo "gcc not installed"
- clang --version || echo "clang not installed"
- cmake --version
- git --version
- mkdir build && cd build
- cmake -GNinja ..
- cmake -GNinja -DHELICS_BUILD_TESTS=ON -DHELICS_BUILD_EXAMPLES=ON ..
- cmake --build .
- ctest -L Continuous --output-on-failure

Expand Down Expand Up @@ -55,12 +55,12 @@ steps:
image: alpine
commands:
- apk update
- apk add --no-cache build-base git bash cmake ninja boost-dev zeromq-dev swig
- apk add --no-cache build-base git bash cmake ninja boost-dev zeromq-dev
- gcc --version || echo "gcc not installed"
- clang --version || echo "clang not installed"
- cmake --version
- git --version
- mkdir build && cd build
- cmake -GNinja ..
- cmake -GNinja -DHELICS_BUILD_TESTS=ON -DHELICS_BUILD_EXAMPLES=ON ..
- cmake --build .
- ctest -L Continuous --output-on-failure
3 changes: 3 additions & 0 deletions .ci/Brewfile-minimal.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
brew "ccache"
brew "cmake"
brew "zeromq"
2 changes: 0 additions & 2 deletions .ci/Brewfile.travis
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
brew "pcre"
brew "ccache"
brew "cmake"
brew "swig"
brew "zeromq"
brew "[email protected]"
112 changes: 112 additions & 0 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
jobs:
- job: Windows
strategy:
matrix:
VS2015-64bit:
imageName: "vs2015-win2012r2"
langArch: "x64"
vsArch: "x64"
VS2017-32bit:
imageName: "vs2017-win2016"
langArch: "x86"
vsArch: "Win32"
VS2017-64bit:
imageName: "vs2017-win2016"
langArch: "x64"
vsArch: "x64"
VS2019-64bit:
imageName: "windows-2019"
langArch: "x64"
vsArch: "x64"
pool:
vmImage: $(imageName)

steps:
# -----------------------
# Install dependencies
# -----------------------
- powershell: |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "##vso[task.prependpath]C:\\ProgramData\\chocolatey\\bin"
choco install boost-msvc-14.1 cmake --yes --limit-output
echo "##vso[task.prependpath]C:\\Program Files\\CMake\\bin"
condition: eq( variables['imageName'], 'vs2015-win2012r2' )
displayName: Install chocolatey, boost, and newer cmake
- bash: choco install swig --yes --limit-output
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install swig

- task: UsePythonVersion@0
inputs:
versionSpec: '3.4'
architecture: $(langArch)
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

- bash: pip3 install pytest
condition: ne( variables['imageName'], 'vs2015-win2012r2' )
displayName: Install pytest

# -----------------------
# Configure HELICS
# -----------------------
- task: CMake@1
inputs:
cmakeArgs: -A $(vsArch) -DHELICS_ENABLE_SWIG=ON -DHELICS_BUILD_CXX_SHARED_LIB=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DHELICS_BUILD_TESTS=ON -DHELICS_BUILD_EXAMPLES=ON ..
displayName: 'Configure HELICS'
condition: eq( variables['Agent.OS'], 'Windows_NT' )

# - task: CMake@1
# inputs:
# cmakeArgs: -DBUILD_PYTHON_INTERFACE=ON .
# displayName: 'Configure Python interface'
# condition: and(ne( variables['imageName'], 'vs2015-win2012r2' ), eq( variables['langArch'], 'x64' ))

- task: CMake@1
inputs:
cmakeArgs: -DBUILD_JAVA_INTERFACE=ON .
displayName: 'Configure Java interface'
condition: and(ne( variables['imageName'], 'vs2015-win2012r2' ), eq( variables['langArch'], 'x64' ))

# -----------------------
# Build HELICS
# -----------------------
- bash: cmake --build . --config Release
displayName: 'Build HELICS'
workingDirectory: build

# -----------------------
# Package HELICS
# -----------------------
- bash: |
cpack_dir="$(which cmake)"
cpack_dir="${cpack_dir%/cmake}"
"${cpack_dir}/cpack" -G "NSIS" -C Release -B "$PWD/installer-output"
displayName: 'Package HELICS'
workingDirectory: build
condition: ne( variables['imageName'], 'vs2015-win2012r2' )
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/build/installer-output'
contents: '*.exe'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: installer
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

# -----------------------
# Test HELICS
# -----------------------
- bash: ctest --output-on-failure --timeout 480 -C Release -L "Continuous"
displayName: 'Test HELICS'
workingDirectory: build

# Packaging tests
- bash: ctest --output-on-failure --timeout 480 -C Release -L "PackagingFast"
displayName: 'Test HELICS packaging'
workingDirectory: build
1 change: 1 addition & 0 deletions .circleci/asan_blacklist.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src:*/libzmq/*
src:*/badInputTests.cpp
22 changes: 8 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,51 +35,45 @@ jobs:
- image: helics/octave:latest
environment:
OCTAVETEST: "/root/project/tests/octave"
CMAKE_FLAGS: "-DBUILD_OCTAVE_INTERFACE=ON"
CMAKE_FLAGS: "-DBUILD_OCTAVE_INTERFACE=ON -DHELICS_BUILD_TESTS=ON"
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true # Save time when caching
- run: *setup_helics
- run: *run_octave_tests

helicsTSan:
docker:
- image: helics/clang-tsan:latest
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=thread -stdlib=libc++ -L/root/develop/libcxx_tsan/lib -lc++abi -I/root/develop/libcxx_tsan/include -I/root/develop/libcxx_tsan/include/c++/v1 -Wno-unused-command-line-argument -g -O1 -Wl,-rpath=/root/develop/libcxx_tsan/lib" -DBUILD_HELICS_BOOST_TESTS=OFF -DZMQ_SUBPROJECT=ON -DZMQ_FORCE_SUBPROJECT=ON -DDISABLE_SYSTEM_CALL_TESTS=ON'
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=thread -stdlib=libc++ -L/root/develop/libcxx_tsan/lib -lc++abi -I/root/develop/libcxx_tsan/include -I/root/develop/libcxx_tsan/include/c++/v1 -Wno-unused-command-line-argument -g -O1 -Wl,-rpath=/root/develop/libcxx_tsan/lib" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON -DHELICS_DISABLE_SYSTEM_CALL_TESTS=ON'
TSAN_OPTIONS: 'second_deadlock_stack=1 suppressions=/root/project/.circleci/tsan_suppression.txt'

steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true # Save time when caching
- run: *setup_helics
- run: *run_helics_tests

helicsASan:
docker:
- image: helics/clang-asan:latest
- image: helics/buildenv:sanitizers
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -stdlib=libc++ -L/root/develop/libcxx_asan/lib -lc++abi -I/root/develop/libcxx_asan/include -I/root/develop/libcxx_asan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_asan/lib -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" -DBUILD_HELICS_BOOST_TESTS=OFF -DZMQ_SUBPROJECT=ON -DZMQ_FORCE_SUBPROJECT=ON'
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -fsanitize-address-use-after-scope -stdlib=libc++ -L/root/develop/libcxx_asan/lib -lc++abi -I/root/develop/libcxx_asan/include -I/root/develop/libcxx_asan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_asan/lib -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
LSAN_OPTIONS: 'suppressions=/root/project/.circleci/leak_suppression.txt'
UBSAN_OPTIONS: 'print_stacktrace=1'

steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true # Save time when caching
- run: *setup_helics
- run: *run_helics_tests

helicsMSan:
docker:
- image: helics/clang-msan:latest
- image: helics/buildenv:sanitizers
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -stdlib=libc++ -L/root/develop/libcxx_msan/lib -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_msan/lib" -DBUILD_HELICS_BOOST_TESTS=OFF -DZMQ_SUBPROJECT=ON -DZMQ_FORCE_SUBPROJECT=ON'
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -stdlib=libc++ -L/root/develop/libcxx_msan/lib -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_msan/lib" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'

steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true # Save time when caching
- run: *setup_helics
- run: *run_helics_tests

Expand Down
2 changes: 2 additions & 0 deletions .circleci/tsan_suppression.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This is a known purposeful leak and possible resulting race condition detection on closing of shared libraries

1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BreakBeforeBinaryOperators: false
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
IndentPPDirectives: AfterHash
ColumnLimit: 115
CommentPragmas: ''
KeepEmptyLinesAtTheStartOfBlocks: false
Expand Down
4 changes: 2 additions & 2 deletions .cmake-format.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"line_width": 80,
"line_width": 88,
"dangle_parens": true,
"command_case": "lower",
"separate_fn_name_with_space": false,
"always_wrap": [],
"separate_ctrl_name_with_space": false,
"max_subargs_per_line": 3,
"max_subargs_per_line": 4,
"tab_size": 4,
"keyword_case": "upper",
"enum_char": ".",
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/create-file-update-pr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine:latest

RUN apk add --no-cache \
bash \
jq \
git \
ca-certificates \
curl

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
5 changes: 5 additions & 0 deletions .github/actions/create-file-update-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: 'Create File Update PR'
description: 'Pushes a new branch with changed files and opens a PR for updating the changed files in the base branch'
runs:
using: 'docker'
image: 'Dockerfile'
46 changes: 46 additions & 0 deletions .github/actions/create-file-update-pr/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

PR_URL=$(jq --raw-output .repository.pulls_url "$GITHUB_EVENT_PATH")
PR_URL=${PR_URL%\{*}
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json; application/vnd.github.shadow-cat-preview+json; application/vnd.github.symmetra-preview+json; application/vnd.github.sailor-v-preview+json"
AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"

# Only commit and open a PR if files have changed
files_changed=$(git diff --staged --name-only)
if [[ "$files_changed" != "" ]];
then
hash=$(sha256sum ${files_changed} | sha256sum | cut -c 1-12 -)
current_branch=${GITHUB_REF#refs/heads/}

# Set the git origin url for committing using a GITHUB_TOKEN
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}"
git config user.name "${INPUT_GIT_NAME}"
git config user.email "${INPUT_GIT_EMAIL}"

# Make sure a branch with the same name (hash + base branch) doesn't already exist
pr_branch="${INPUT_BRANCH_PREFIX}update-${current_branch}-${hash}"
git ls-remote --exit-code . "origin/${pr_branch}"
rv=$?
if [[ "$rv" != "0" ]];
then
# Commit the changed files and push the branch to GitHub
git checkout -b "${pr_branch}"
git commit -m "${INPUT_COMMIT_MSG}"
git push -u origin "${pr_branch}"

# Format string values for GitHub API JSON payload
PR_TITLE="$(echo -n "${INPUT_PR_TITLE}" | jq --raw-input --slurp ".")"
PR_BODY="$(echo -n "${INPUT_PR_BODY}" | jq --raw-input --slurp ".")"
PR_BASE="$(echo -n "${current_branch}" | jq --raw-input --slurp ".")"
PR_HEAD="$(echo -n "${pr_branch}" | jq --raw-input --slurp ".")"
pr_api_data="{\"title\":${PR_TITLE}, \"body\":${PR_BODY}, \"base\":${PR_BASE}, \"head\":${PR_HEAD}, \"draft\":false}"

# Open up the GitHub PR
curl -XPOST -fsSL \
-H "${AUTH_HEADER}" \
-H "${API_HEADER}" \
--data "${pr_api_data}" \
"${PR_URL}"
fi
fi
16 changes: 16 additions & 0 deletions .github/workflows/interface_gen_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/sh

# Generate Matlab interface using swig matlab
mkdir build_matlab
pushd build_matlab
cmake -DBUILD_MATLAB_INTERFACE=ON -DHELICS_SWIG_GENERATE_INTERFACE_FILES_ONLY=ON -DHELICS_OVERWRITE_INTERFACE_FILES=ON -DHELICS_BUILD_EXAMPLES=OFF -DENABLE_ZMQ_CORE=OFF -DHELICS_BUILD_TESTS=OFF -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_DISABLE_BOOST=ON -DHELICS_ENABLE_SWIG=ON -DSWIG_EXECUTABLE=/root/swig-matlab/bin/swig ..
make -j2 mfile_overwrite
popd

# Generate Python and Java interfaces
mkdir build_interface
pushd build_interface
cmake -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DHELICS_SWIG_GENERATE_INTERFACE_FILES_ONLY=ON -DHELICS_OVERWRITE_INTERFACE_FILES=ON -DHELICS_BUILD_EXAMPLES=OFF -DENABLE_ZMQ_CORE=OFF -DHELICS_BUILD_TESTS=OFF -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_DISABLE_BOOST=ON -DHELICS_ENABLE_SWIG=ON ..
make -j2 pyfile_overwrite
make -j2 javafile_overwrite
popd
Loading

0 comments on commit 1e65ee7

Please sign in to comment.