Skip to content

Commit

Permalink
Merge pull request #1238 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
HELICS 2.5.0 merge from Develop
  • Loading branch information
phlptp authored Apr 27, 2020
2 parents 2ab5cc8 + d00c5f8 commit 26e473d
Show file tree
Hide file tree
Showing 542 changed files with 18,272 additions and 10,984 deletions.
12 changes: 7 additions & 5 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
# -----------------------
# Configure HELICS
# -----------------------
- bash: |
echo "##vso[task.setvariable variable=BOOST_ROOT]$BOOST_ROOT_1_72_0"
- 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 ..
Expand All @@ -49,11 +51,11 @@ jobs:
# 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: eq( variables['langArch'], 'x64' )
# - task: CMake@1
# inputs:
# cmakeArgs: -DBUILD_JAVA_INTERFACE=ON .
# displayName: 'Configure Java interface'
# condition: eq( variables['langArch'], 'x64' )

# -----------------------
# Build HELICS
Expand Down
5 changes: 4 additions & 1 deletion .circleci/asan_blacklist.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
src:*/libzmq/*
src:*/badInputTests.cpp
src:*/*/badInputTests*
fun:*getMessageObj*
[undefined]
fun:*helicsFederateRegister*
82 changes: 79 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,7 +1,83 @@
---
Checks: '*,-hicpp-vararg,-hicpp-explicit-conversions, -hicpp-special-member-functions, -fuchsia-*,-modernize-use-override,-hicpp-no-array-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-llvm-include-order,-llvm-header-guard,-hicpp-use-override,-readability-redundant-declaration,-misc-unused-parameters,-modernize-use-override,-cppcoreguidelines-pro-type-vararg,-google-default-arguments,-google-runtime-references,-google-readability-todo,-google-readability-namespace-comments,-clang-analyzer-alpha.core.CastToStruct,-clang-diagnostic-pragma-once-outside-header,-google-build-using-namespace,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cert-err58-cpp,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-reinterpret-cast,-misc-misplaced-widening-cast,-clang-analyzer-alpha.deadcode.UnreachableCode'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: file

Checks: '
-*,
google-*,
-google-runtime-int,
-google-runtime-references,
-google-build-using-namespace,
-google-default-arguments,
llvm-include-order,
llvm-namespace-comment,
modernize*,
-modernize-use-trailing-return-type,
-modernize-use-override,
-modernize-avoid-c-arrays,
-modernize-pass-by-value,
-modernize-use-equals-default,
hicpp-*,
-hicpp-use-equals-default,
-hicpp-explicit-conversions,
-hicpp-use-override,
-hicpp-special-member-functions,
-hicpp-avoid-c-arrays,
-hicpp-no-array-decay,
clang-analyzer-*,
bugprone-*,
-bugprone-narrowing-conversions,
misc-*,
-misc-non-private-member-variables-in-classes,
cert-*,
-cert-err58-cpp,
portability-*,
readability-*,
-readability-magic-numbers,
performance-*
'

WarningsAsErrors: '
-*,
google-*,
-google-runtime-int,
-google-runtime-references,
-google-build-using-namespace,
-google-default-arguments,
-google-explicit-constructor,
llvm-include-order,
llvm-namespace-comment,
modernize*,
-modernize-use-trailing-return-type,
-modernize-use-override,
-modernize-use-using,
-modernize-avoid-c-arrays,
-modernize-pass-by-value,
-modernize-use-equals-default,
hicpp-*,
-hicpp-use-equals-default,
-hicpp-explicit-conversions,
-hicpp-use-override,
-hicpp-special-member-functions,
-hicpp-avoid-c-arrays,
-hicpp-no-array-decay,
clang-analyzer-*,
-clang-analyzer-optin.cplusplus.VirtualCall,
bugprone-*,
-bugprone-narrowing-conversions,
misc-*,
-misc-non-private-member-variables-in-classes,
cert-*,
-cert-err58-cpp,
portability-*,
readability-*,
-readability-magic-numbers,
-readability-identifier-naming,
performance-*
-performance-unnecessary-value-param
'

HeaderFilterRegex: 'src/helics/*.hp?p?'

AnalyzeTemporaryDtors: false
CheckOptions:
- key: cert-dcl59-cpp.HeaderFileExtensions
Expand Down
5 changes: 2 additions & 3 deletions .github/actions/linux-release-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ FROM phusion/holy-build-box-64:latest

# Install a copy of git and the Boost headers
# curl -L follows redirects and -k ignores SSL certificate warnings
RUN yum install -y rh-git29 devtoolset-8 \
&& curl -Lk -o boost.tar.gz https://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz/download \
&& tar --strip-components=1 -xf boost.tar.gz boost_1_70_0/boost \
RUN curl -Lk -o boost.tar.gz https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.gz/download \
&& tar --strip-components=1 -xf boost.tar.gz boost_1_72_0/boost \
&& cp -R boost /usr/include/boost/ \
&& rm -rf boost \
&& rm boost.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/linux-release-builder/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

scl enable rh-git29 devtoolset-8 "${INPUT_SCRIPT}"
/hbb/activate-exec "${INPUT_SCRIPT}"
2 changes: 2 additions & 0 deletions .github/workflows/release-build/installer-Windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

echo "Building ${CPACK_GEN} installer with ${BUILD_GEN} for ${BUILD_ARCH}"
choco install -y swig
BOOST_ROOT="${BOOST_ROOT_1_72_0}"
export BOOST_ROOT
mkdir build && cd build || exit
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Release -DHELICS_ENABLE_PACKAGE_BUILD=ON -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DSTATIC_STANDARD_LIB=static -DHELICS_USE_ZMQ_STATIC_LIBRARY=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-build/msvc-Windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ echo "Building with ${BUILD_GEN} for ${BUILD_ARCH}"
choco install -y swig
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
BOOST_ROOT="${BOOST_ROOT_1_72_0}"
export BOOST_ROOT
mkdir build && cd build || exit
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Debug -DHELICS_ENABLE_PACKAGE_BUILD=ON -DHELICS_BUILD_CXX_SHARED_LIB=ON -DHELICS_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_BUILD_APP_LIBRARY=ON -DHELICS_DISABLE_C_SHARED_LIB=ON ..
cmake --build . --config Debug
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-build/shared-library-Windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

echo "Building shared library with ${BUILD_GEN} for ${BUILD_ARCH}"
choco install -y swig
BOOST_ROOT="${BOOST_ROOT_1_72_0}"
export BOOST_ROOT
mkdir build && cd build || exit
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Release -DHELICS_ENABLE_PACKAGE_BUILD=ON -DSTATIC_STANDARD_LIB=static -DHELICS_USE_ZMQ_STATIC_LIBRARY=ON -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_BUILD_APP_LIBRARY=OFF -DHELICS_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF ..
cmake --build . --config Release
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/run-clang-tidy-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
FILES_URL="$(jq -r '.pull_request._links.self.href' "$GITHUB_EVENT_PATH")/files"
FILES=$(curl -s -X GET -G "$FILES_URL" | jq -r '.[] | .filename')
echo "====Files Changed in PR===="
echo "$FILES"
filecount=$(echo "$FILES" | grep -c -E '\.(cpp|hpp|c|h)$' || true)
echo "Total changed: $filecount"
tidyerr=0
if (( filecount > 0 && filecount <= 20 )); then
echo "====Configure CMake===="
mkdir build && cd build || exit
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DHELICS_BUILD_BENCHMARKS=ON -DHELICS_BUILD_EXAMPLES=ON -DHELICS_BUILD_TESTS=ON ..
cd ..
echo "====Run clang-tidy===="
while read -r line ; do
if echo "$line" | grep -E '\.(cpp|hpp|c|h)$'; then
python3 /usr/share/clang/run-clang-tidy.py "$line" -p build -quiet
rc=$?
echo "clang-tidy exit code: $rc"
if [[ "$rc" != "0" ]]; then
tidyerr=1
fi
fi
done <<< "$FILES"
fi
exit $tidyerr

26 changes: 26 additions & 0 deletions .github/workflows/static-analyzers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Static Analyzers

on:
push:
pull_request:

jobs:
cpplint:
runs-on: ubuntu-latest
container: helics/buildenv:cpplint

steps:
- uses: actions/checkout@v2
- name: Run cpplint
run: cpplint --counting=detailed --recursive examples benchmarks src tests

clang-tidy:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
container: helics/buildenv:clang-extra-tools

steps:
- uses: actions/checkout@v2
- name: Run clang-tidy on changed files
shell: bash
run: ./.github/workflows/run-clang-tidy-pr.sh
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
A note on future revisions.
Everything within a major version number should be code compatible (with the exception of experimental interfaces). The most notable example of an experimental interface is the support for multiple source inputs. The APIs to deal with this will change in future minor releases. Everything within a single minor release should be network compatible with other federates on the same minor release number. Compatibility across minor release numbers may be possible in some situations but we are not going to guarantee this as those components are subject to performance improvements and may need to be modified at some point. Patch releases will be limited to bug fixes and other improvements not impacting the public API or network compatibility. Check the [Public API](./docs/Public_API.md) for details on what is included and excluded from the public API and version stability.

## [2.5.0][] - 2020-04-25
Some library reorganization, additional static analysis(CppLint and clang-tidy), multiBroker

### Changed
- Split the HELICS core library into a separate core and network library
- Update FMT library to version 6.2.0
- The core and broker Factories use a map instead of a fixed list which is a step toward allowing user defined cores
- Updated CLI11 included code to customized version to allow configuration of cores and brokers through Json files
- The ordering of the helics_error_types enum is in ascending order
- Refactored the Matlab and Java swig interface builds to enable standalone builds

### Fixed
- Added CPPlint and fixed a number of issues that check identified.

### Added
- `helicsEndpointSendMessageObjectZeroCopy` to allow transferring messages with minimal copying.
- `helics<Interface>IsValid` functions to the C API
- `helicscpp::cleanHelicsLibrary` to the C++98 API.
- A Comm factory to the Core to enable constructing Comm interfaces directly from the type.
- The REST API in the webserver was updated to include ability to create and destroy brokers.
- A websocket server similar to the REST API but will respond to JSON queries.
- A test suite for the HTTP and websocket servers.
- A Multibroker that can allow multiple communication types to interact together.
- Support for `HELICS_BUILD_CONFIGURATION` cmake variable for building on unique platforms. The only supported one right now is "PI" for building on raspberry pi platforms.

### Deprecated
- in the C shared library `helicsFederateGetMessage`, `helicsEndpointGetMessage`, and `helicsEndpointSendMessage` are deprecated in favor of the object version These will be removed in HELICS 3.0
- deprecated `helicsEndpointClearMessage` this function does nothing right now, all messages are on a federate level.

### Removed

## [2.4.2][] - 2020-03-27
Increased code coverage and additional bug fixes.

Expand Down Expand Up @@ -567,3 +598,4 @@ This is a major revision so this changelog will not capture all the changes that
[2.4.0]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.4.0
[2.4.1]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.4.1
[2.4.2]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.4.2
[2.5.0]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.5.0
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ else()
cmake_policy(VERSION 3.16)
endif()

project(HELICS VERSION 2.4.2)
project(HELICS VERSION 2.5.0)

# -----------------------------------------------------------------------------
# HELICS Version number
# -----------------------------------------------------------------------------
set(HELICS_VERSION_BUILD)
# use ISO date YYYY-MM-DD
set(HELICS_DATE "2020-03-27")
set(HELICS_DATE "2020-04-26")

set(HELICS_VERSION_UNDERSCORE
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"
Expand Down Expand Up @@ -436,6 +436,17 @@ option(ENABLE_ZMQ_CORE "Enable ZeroMQ networking library" ON)

mark_as_advanced(ENABLE_MPI_CORE ENABLE_ZMQ_CORE)

# -------------------------------------------------------------
# Some specialized configurations
# -------------------------------------------------------------

show_variable(HELICS_BUILD_CONFIGURATION STRING "specify a build configuration to use for some specialized systems that are not otherwise detectable" "")
mark_as_advanced(HELICS_BUILD_CONFIGURATION)

if (HELICS_BUILD_CONFIGURATION STREQUAL "PI")
target_link_libraries(helics_base INTERFACE atomic)
endif()

# -------------------------------------------------------------
# finding MPI
# -------------------------------------------------------------
Expand Down Expand Up @@ -621,7 +632,7 @@ if(NOT WIN32)
get_filename_component(zmqdir ${zmqlibfile} DIRECTORY)
# message(STATUS "zmqdir path =${zmqdir}")
if(APPLE)
# TODO: Make sure it works for building ZMQ from source automatically using
# TODO(@nightlark): Make sure it works for building ZMQ from source automatically using
# CMake
list(APPEND CMAKE_INSTALL_RPATH ${ZeroMQ_INSTALL_PATH}/lib)
list(APPEND CMAKE_BUILD_RPATH ${ZeroMQ_INSTALL_PATH}/lib)
Expand Down
18 changes: 18 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set noparent

# Checks to eventually enable

filter=-readability/multiline_comment,-readability/multiline_string # Errors due to cpplint not handling multiline comments/strings well

# Unused checks
filter=-build/c++11 # Reports C++11 headers that aren't allowed for specific Google projects.
filter=-build/include_order # Requires unusual include order that encourages creating not self-contained headers
filter=-readability/nolint # Conflicts with clang-tidy
filter=-runtime/references # Requires fundamental change of API, don't see need for this
filter=-whitespace # Formatting determined by clang-format
filter=-runtime/indentation_namespace #conflicts with clang format
filter=-runtime/explicit #issues caught by clang-tidy
filter=-readability/casting # this is picking up a number of false positives
filter=-build/include_subdir # forces an organization of include files that is specific to google and not usable for helics
filter=-runtime/string # this should be reenabled for HELICS 3.0 since we can use string_view which should be more prevalent in the API and more usable.
filter=-readability/inheritance # A style preference to use virtual in addition to override or final so this is ignored
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ HELICS is also highly scalable, enabling everything from simple connections betw
### Windows

Each [release](https://github.com/GMLC-TDC/HELICS/releases/latest) comes with a Windows installer and zip file containing the HELICS apps and C shared library with Python 3.6 and Java 1.8 interfaces, zip files containing compiled HELICS static libraries built against several MSVC versions, and an archive containing just the C shared library with headers. For building with Debug support it is generally recommended to build from Source or use HELICS as a subproject.
Make sure the latest [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) is installed.

### Conda

Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/concurrency
Loading

0 comments on commit 26e473d

Please sign in to comment.