Skip to content

Commit

Permalink
Merge branch 'master' into metallica
Browse files Browse the repository at this point in the history
  • Loading branch information
mlund committed Jun 17, 2024
2 parents ea08f86 + c06a96b commit 3ad61b3
Show file tree
Hide file tree
Showing 142 changed files with 7,930 additions and 2,409 deletions.
10 changes: 7 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*,-modernize-use-nodiscard,-llvmlibc-callee-namespace,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none
FormatStyle: file
MinimumVariableNameLength: 1

CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.VariableCase, value: lower_case}
- { key: readability-identifier-naming.LocalVariableCase, value: lower_case}
- { key: readability-identifier-naming.FunctionCase, value: camelBack}
- { key: readability-identifier-naming.FunctionCase, value: lower_case}
- { key: readability-identifier-naming.FunctionIgnoredRegexp, value: '^to_json$|^from_json$'}
- { key: readability-identifier-naming.ClassMethodCase, value: camelBack}
- { key: readability-identifier-naming.ClassMethodCase, value: lower_case}
- { key: readability-identifier-naming.ClassMethodIgnoredRegexp, value: '^to_json$|^from_json$'}
- { key: readability-identifier-naming.ParameterCase, value: lower_case}
- { key: readability-identifier-naming.ParameterIgnoredRegexp, value: '^j$'}
- { key: readability-identifier-naming.EnumCase, value: CamelCase}
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase}
- { key: readability-identifier-naming.ConstantParameterCase, value: lower_case}
- { key: readability-identifier-naming.ConstexprVariableCase,, value: UPPER_CASE}
- { key: readability-identifier-naming.ConstantParameterIgnoredRegexp, value: lower_case}
- { key: readability-identifier-naming.TypedefCase, value: CamelCase}
- { key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic, value: 'true'}
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/devcontainers/cpp:0-ubuntu-22.04

ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.25.2"

# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/

RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh

# [Optional] Uncomment this section to install additional vcpkg ports.
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"

# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "C++",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/rocker-org/devcontainer-features/miniforge:1": {}
},
"extensions": ["xaver.clang-format", "ms-vscode.cpptools-extension-pack"]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
60 changes: 60 additions & 0 deletions .devcontainer/reinstall-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
set -e

CMAKE_VERSION=${1:-"none"}

if [ "${CMAKE_VERSION}" = "none" ]; then
echo "No CMake version specified, skipping CMake reinstallation"
exit 0
fi

# Cleanup temporary directory and associated files when exiting the script.
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${TMP_DIR}" ]]; then
echo "Executing cleanup of tmp files"
rm -Rf "${TMP_DIR}"
fi
exit $EXIT_CODE
}
trap cleanup EXIT


echo "Installing CMake..."
apt-get -y purge --auto-remove cmake
mkdir -p /opt/cmake

architecture=$(dpkg --print-architecture)
case "${architecture}" in
arm64)
ARCH=aarch64 ;;
amd64)
ARCH=x86_64 ;;
*)
echo "Unsupported architecture ${architecture}."
exit 1
;;
esac

CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)

echo "${TMP_DIR}"
cd "${TMP_DIR}"

curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O

sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license

ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
ln -s /opt/cmake/bin/ccmake /usr/local/bin/ccmake

8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Please edit this text to include a summary of the change and which issue is fixe
- [ ] code naming scheme follows the convention:

Style | Elements
------------ | ---------------------
`PascalCase` | classes, namespaces
`camelCase` | functions
`snake_case` | variables
------------ | --------------------------
`CamelCase` | classes, namespaces, enums
`lower_case` | functions, variables, enum constants
`UPPER_CASE` | constexpr variables
23 changes: 15 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: 13
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17
- uses: actions/checkout@v2

Expand All @@ -36,13 +36,20 @@ jobs:
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_OPENMP=off -DENABLE_PYTHON=off -DENABLE_TBB=off
# Force libc++ due to https://github.com/actions/runner-images/issues/8659
run: |
export CXX=clang++-17
export CC=clang-17
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_OPENMP=on -DENABLE_PYTHON=off -DENABLE_TBB=off -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --target faunus -j 2
run: |
export CXX=clang++-17
export CC=clang-17
cmake --build . --config $BUILD_TYPE --target faunus -j 2
- name: Test
working-directory: ${{github.workspace}}/build
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ include/
examples/
_deps/
sids/

docs/html/
unittests.log
a.out

# VisualStudioCode
.vscode/settings.json
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# CMake
CMakeCache.txt
CMakeFiles
Expand Down
23 changes: 3 additions & 20 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ad61b3

Please sign in to comment.