From 5c181b7f7f0088a7dd52a35be8bb360f8a3d7dae Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Tue, 13 Feb 2024 13:42:37 -0500 Subject: [PATCH 1/4] Rearrange Empirical as submodule --- .gitmodules | 3 +++ .vscode/c_cpp_properties.json | 4 ++-- CMakeLists.txt | 4 ++-- README.md | 4 +--- libs/Empirical | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) create mode 160000 libs/Empirical diff --git a/.gitmodules b/.gitmodules index c046d2d5e..21bfe1fce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "libs/backward-cpp"] path = libs/backward-cpp url = https://github.com/bombela/backward-cpp.git +[submodule "libs/Empirical"] + path = libs/Empirical + url = https://github.com/devosoft/Empirical.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 878aa9ba8..f6f10c15b 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -5,7 +5,7 @@ "defines": [], "cStandard": "c11", "browse": { - "path": [ "${workspaceFolder}", "${workspaceFolder}/avida-core/include/public", "${workspaceFolder}/avida-core/include/private", "${workspaceFolder}/../Empirical/source", "${workspaceFolder}/avida-core/include/public/avida/core/*" ], + "path": [ "${workspaceFolder}", "${workspaceFolder}/avida-core/include/public", "${workspaceFolder}/avida-core/include/private", "${workspaceFolder}/libs/Empirical/include/emp", "${workspaceFolder}/avida-core/include/public/avida/core/*" ], "limitSymbolsToIncludedHeaders": true }, "includePath": [ @@ -19,7 +19,7 @@ "${workspaceFolder}/avida-core/source/core", "${workspaceFolder}/avida-core/source/actions", "${workspaceFolder}/avida-core/source/script", - "${workspaceFolder}/../Empirical/source" + "${workspaceFolder}/libs/Empirical/include/emp" ] } ], diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da035567..e901a6aff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ SET(LIBRARY_OUTPUT_PATH "Built libraries are placed here before installation." ) -INCLUDE_DIRECTORIES(../Empirical/include/emp) +INCLUDE_DIRECTORIES(libs/Empirical/include/emp) ADD_SUBDIRECTORY(libs/apto) if(NOT WIN32 AND NOT DEFINED ENV{AVIDA_DISABLE_BACKTRACE}) @@ -34,7 +34,7 @@ IF(NOT WIN32) ADD_SUBDIRECTORY(libs/tcmalloc-1.4) ENDIF(NOT WIN32) ADD_SUBDIRECTORY(avida-core) -# ADD_SUBDIRECTORY(../Empirical/include/emp .) +# ADD_SUBDIRECTORY(libs/Empirical/include/emp .) # Default location for installed software/configs/ docs is the build directory. SET(CMAKE_INSTALL_PREFIX diff --git a/README.md b/README.md index afbe6e6f3..3639bf08b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ This is a version of Avida with the systematics tracker and open-ended evolution metrics from [Empirical](https://github.com/devosoft/Empirical). -Specifically, it has been tested and is known to be compatible with [this release](https://github.com/emilydolson/Empirical/tree/OEE_metrics_paper_submission) -of Empirical. The build file expects the directory containing that version of Empirical to be in the same directory as this -repository (i.e. `ls` should show `Empirical` and `avida-empirical`). +Empirical is managed as a submodule in this repository, pinned to a known-compatible commit. Other than that, this is the same as normal Avida. The README for normal Avida follows. diff --git a/libs/Empirical b/libs/Empirical new file mode 160000 index 000000000..908c2653d --- /dev/null +++ b/libs/Empirical @@ -0,0 +1 @@ +Subproject commit 908c2653d6da4eb3a18e0fbb7b1c653daa1ee5b8 From cdffaf110a62969af65b5c694448e5e249681290 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Tue, 13 Feb 2024 14:03:30 -0500 Subject: [PATCH 2/4] Modernize std::accumulate call breaking compile --- avida-core/source/main/cOrgMessagePredicate.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/avida-core/source/main/cOrgMessagePredicate.h b/avida-core/source/main/cOrgMessagePredicate.h index cb34e9fd4..837754e47 100644 --- a/avida-core/source/main/cOrgMessagePredicate.h +++ b/avida-core/source/main/cOrgMessagePredicate.h @@ -87,7 +87,12 @@ struct cOrgMessagePred_CountDemeMessages : public cOrgMessagePredicate { virtual void Print(int update, std::ostream& out) { out << update << " COUNT " << - std::accumulate(m_msg_counts.begin(), m_msg_counts.end(), 0, apply2nd >()) << " "; + std::accumulate( + std::begin(m_msg_counts), + std::end(m_msg_counts), + int{}, + [](auto first, auto second) { return first + second.second; } + ) << " "; for(MessageCounts::iterator i=m_msg_counts.begin(); i!=m_msg_counts.end(); ++i) { out << " " << i->second; } From a8ba99af85463041b3dd48227ef737016864baf3 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Tue, 13 Feb 2024 14:10:54 -0500 Subject: [PATCH 3/4] Initialize submodules recursively --- build_avida | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build_avida b/build_avida index c203d748d..616f016ae 100755 --- a/build_avida +++ b/build_avida @@ -2,8 +2,7 @@ set -e -git submodule init -git submodule update +git submodule update --init --recursive do_build() { ( From 2e1992066a9a31cfefe29549fd39cff5db38be4a Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Tue, 13 Feb 2024 14:31:26 -0500 Subject: [PATCH 4/4] Remove docker build dependency on tests Tests run really slow on this fork, and guaranteed deploy quality isn't as critical because the repo is for internal use. --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3c21c924..a76f55ade 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,7 +56,6 @@ jobs: docker-build: name: Docker Image Build runs-on: ubuntu-22.04 - needs: tests if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2