From 94955c35bf44920c31a709454e2010ae1a7d3acb Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Mon, 10 Aug 2026 13:48:06 +0100 Subject: [PATCH 1/6] Headers. --- src/base/serialiser.h | 10 +++++----- src/nodes/forcefield.cpp | 1 - tests/algorithms/orderedMap.cpp | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/base/serialiser.h b/src/base/serialiser.h index bf981ec82c..2bf087b91f 100644 --- a/src/base/serialiser.h +++ b/src/base/serialiser.h @@ -4,11 +4,11 @@ #pragma once #include "templates/orderedMap.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include struct wo_comment_config diff --git a/src/nodes/forcefield.cpp b/src/nodes/forcefield.cpp index 31b012ab15..10a51adda8 100644 --- a/src/nodes/forcefield.cpp +++ b/src/nodes/forcefield.cpp @@ -3,7 +3,6 @@ #include "nodes/forcefield.h" #include "data/ff/library.h" -#include ForcefieldNode::ForcefieldNode(Graph *parentGraph) : Node(parentGraph) { diff --git a/tests/algorithms/orderedMap.cpp b/tests/algorithms/orderedMap.cpp index 42b7b92bc3..66da73b579 100644 --- a/tests/algorithms/orderedMap.cpp +++ b/tests/algorithms/orderedMap.cpp @@ -4,7 +4,6 @@ #include "templates/orderedMap.h" #include "base/serialiser.h" #include -#include namespace UnitTest { From 2304a4199d42fd63209b4b915ef79ced985b76f9 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Mon, 10 Aug 2026 13:48:23 +0100 Subject: [PATCH 2/6] ostream vs TOML. --- src/main.cpp | 2 +- src/main/io.cpp | 2 +- tests/io/cbor.cpp | 6 ++++-- tests/testing.cpp | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f8baa4e0d0..3ca4bf15a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,7 +62,7 @@ int main(int args, char **argv) auto toml = Serialisable::ser(&dissolve); std::ofstream outfile; outfile.open(options.writeInputFilename().value()); - outfile << toml; + outfile << toml.as_string(); outfile.close(); result = true; diff --git a/src/main/io.cpp b/src/main/io.cpp index 2aeeb26b03..d6eb872861 100644 --- a/src/main/io.cpp +++ b/src/main/io.cpp @@ -155,7 +155,7 @@ bool Dissolve::saveToml(std::string_view filename) const { std::ofstream outfile; outfile.open(std::string(filename)); - outfile << Serialisable::ser(*this) << std::endl; + outfile << Serialisable::ser(*this).as_string() << std::endl; outfile.close(); return true; } diff --git a/tests/io/cbor.cpp b/tests/io/cbor.cpp index 5965028d5e..9ac10b8446 100644 --- a/tests/io/cbor.cpp +++ b/tests/io/cbor.cpp @@ -17,7 +17,9 @@ class CBORTest : public ::testing::Test ASSERT_TRUE(toml2.is_table()) << location; for (auto &[k, v] : toml.as_table()) { - ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl << "Expected:" << std::endl << toml[k]; + ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl + << "Expected:" << std::endl + << toml[k].as_string(); compare_toml(std::format("{}.{}", location, k), v, toml2.at(k)); } } @@ -25,7 +27,7 @@ class CBORTest : public ::testing::Test { auto arr = toml.as_array(); auto arr2 = toml2.as_array(); - ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml; + ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml.as_string(); for (int i = 0; i < arr.size(); ++i) compare_toml(std::format("{}[{}]", location, i), arr[i], arr2[i]); } diff --git a/tests/testing.cpp b/tests/testing.cpp index 810804bda4..30febc64b2 100644 --- a/tests/testing.cpp +++ b/tests/testing.cpp @@ -429,7 +429,9 @@ void compareToml(std::string location, SerialisedValue toml, SerialisedValue tom ASSERT_TRUE(toml2.is_table()) << location; for (auto &[k, v] : toml.as_table()) { - ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl << "Expected:" << std::endl << toml[k]; + ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl + << "Expected:" << std::endl + << toml[k].as_string(); compareToml(std::format("{}.{}", location, k), v, toml2.at(k)); } } @@ -437,7 +439,7 @@ void compareToml(std::string location, SerialisedValue toml, SerialisedValue tom { auto arr = toml.as_array(); auto arr2 = toml2.as_array(); - ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml; + ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml.as_string(); for (int i = 0; i < arr.size(); ++i) compareToml(std::format("{}[{}]", location, i), arr[i], arr2[i]); } From 6d6f60fbb7eb83e54f42a9274c2e3ac2401bdafd Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Mon, 10 Aug 2026 14:24:00 +0100 Subject: [PATCH 3/6] Simplify toml imports --- src/base/serialiser.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/base/serialiser.h b/src/base/serialiser.h index 2bf087b91f..02f338afb3 100644 --- a/src/base/serialiser.h +++ b/src/base/serialiser.h @@ -4,11 +4,7 @@ #pragma once #include "templates/orderedMap.h" -#include -#include -#include -#include -#include +#include #include struct wo_comment_config From ff72c0af8c5b7f4cb8057a769023f190c6e250fc Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Mon, 10 Aug 2026 14:33:51 +0100 Subject: [PATCH 4/6] Stop vendoring toml11 in Nix --- flake.nix | 3 +-- nix/toml11.nix | 18 ------------------ 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 nix/toml11.nix diff --git a/flake.nix b/flake.nix index 8627287468..e331b1d408 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,6 @@ }: let - toml = pkgs: ((import ./nix/toml11.nix) { inherit pkgs; }); onedpl = pkgs: old: pkgs.onedpl; # ((import ./nix/onedpl.nix) { # inherit (pkgs) @@ -52,7 +51,7 @@ jre pkg-config pugixml - (toml pkgs) + toml11 ]; gui_libs = system: pkgs: qt: [ pkgs.glib diff --git a/nix/toml11.nix b/nix/toml11.nix deleted file mode 100644 index 2b9e259776..0000000000 --- a/nix/toml11.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs }: - -pkgs.stdenv.mkDerivation rec { - name = "toml11"; - version = "v4.4.0"; - cmake = true; - buildInputs = [ pkgs.cmake ]; - src = pkgs.fetchFromGitHub { - owner = "ToruNiina"; - repo = "toml11"; - rev = version; - sha256 = "sha256-sgWKYxNT22nw376ttGsTdg0AMzOwp8QH3E8mx0BZJTQ="; - fetchSubmodules = true; - }; - cmakeFlags = [ - "-DCMAKE_INSTALL_INCLUDEDIR=include/toml11" - ]; -} From d0d46c274f98fd740ff5a0a71a5660c5929ed4df Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Mon, 10 Aug 2026 14:47:07 +0100 Subject: [PATCH 5/6] Remove as_string calls --- src/main.cpp | 2 +- src/main/io.cpp | 2 +- tests/io/cbor.cpp | 6 ++---- tests/testing.cpp | 6 ++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3ca4bf15a1..f8baa4e0d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,7 +62,7 @@ int main(int args, char **argv) auto toml = Serialisable::ser(&dissolve); std::ofstream outfile; outfile.open(options.writeInputFilename().value()); - outfile << toml.as_string(); + outfile << toml; outfile.close(); result = true; diff --git a/src/main/io.cpp b/src/main/io.cpp index d6eb872861..2aeeb26b03 100644 --- a/src/main/io.cpp +++ b/src/main/io.cpp @@ -155,7 +155,7 @@ bool Dissolve::saveToml(std::string_view filename) const { std::ofstream outfile; outfile.open(std::string(filename)); - outfile << Serialisable::ser(*this).as_string() << std::endl; + outfile << Serialisable::ser(*this) << std::endl; outfile.close(); return true; } diff --git a/tests/io/cbor.cpp b/tests/io/cbor.cpp index 9ac10b8446..5965028d5e 100644 --- a/tests/io/cbor.cpp +++ b/tests/io/cbor.cpp @@ -17,9 +17,7 @@ class CBORTest : public ::testing::Test ASSERT_TRUE(toml2.is_table()) << location; for (auto &[k, v] : toml.as_table()) { - ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl - << "Expected:" << std::endl - << toml[k].as_string(); + ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl << "Expected:" << std::endl << toml[k]; compare_toml(std::format("{}.{}", location, k), v, toml2.at(k)); } } @@ -27,7 +25,7 @@ class CBORTest : public ::testing::Test { auto arr = toml.as_array(); auto arr2 = toml2.as_array(); - ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml.as_string(); + ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml; for (int i = 0; i < arr.size(); ++i) compare_toml(std::format("{}[{}]", location, i), arr[i], arr2[i]); } diff --git a/tests/testing.cpp b/tests/testing.cpp index 30febc64b2..810804bda4 100644 --- a/tests/testing.cpp +++ b/tests/testing.cpp @@ -429,9 +429,7 @@ void compareToml(std::string location, SerialisedValue toml, SerialisedValue tom ASSERT_TRUE(toml2.is_table()) << location; for (auto &[k, v] : toml.as_table()) { - ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl - << "Expected:" << std::endl - << toml[k].as_string(); + ASSERT_TRUE(toml2.contains(k)) << location << "." << k << std::endl << "Expected:" << std::endl << toml[k]; compareToml(std::format("{}.{}", location, k), v, toml2.at(k)); } } @@ -439,7 +437,7 @@ void compareToml(std::string location, SerialisedValue toml, SerialisedValue tom { auto arr = toml.as_array(); auto arr2 = toml2.as_array(); - ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml.as_string(); + ASSERT_EQ(arr.size(), arr2.size()) << location << std::endl << "Expected" << std::endl << toml; for (int i = 0; i < arr.size(); ++i) compareToml(std::format("{}[{}]", location, i), arr[i], arr2[i]); } From 0c989d7dcc760d4784e3a647debb3c666c11dcd6 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Mon, 10 Aug 2026 15:13:27 +0100 Subject: [PATCH 6/6] Finish removing vendored onedpl --- flake.nix | 15 ++---------- nix/onedpl.nix | 63 -------------------------------------------------- 2 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 nix/onedpl.nix diff --git a/flake.nix b/flake.nix index e331b1d408..cefc35808d 100644 --- a/flake.nix +++ b/flake.nix @@ -21,17 +21,6 @@ }: let - onedpl = pkgs: old: pkgs.onedpl; - # ((import ./nix/onedpl.nix) { - # inherit (pkgs) - # lib - # stdenv - # fetchFromGitHub - # fetchpatch - # cmake - # ; - # tbb = old.tbb_2021_11; - # }); exe-name = gui: if gui then "dissolve-gui" else "dissolve"; cmake-bool = x: if x then "ON" else "OFF"; version = "1.9.0"; @@ -112,7 +101,7 @@ ++ pkgs.lib.optionals checks (check_libs pkgs) ++ pkgs.lib.optionals threading [ old.tbb_2021_11 - (onedpl pkgs old) + pkgs.onedpl ]; nativeBuildInputs = pkgs.lib.optionals gui [ pkgs.wrapGAppsHook3 ]; @@ -185,7 +174,7 @@ ++ (with pkgs; [ llvmPackages_20.clang-tools - (onedpl pkgs old) + onedpl ccache ccls diff --git a/nix/onedpl.nix b/nix/onedpl.nix deleted file mode 100644 index e34d7ee5d0..0000000000 --- a/nix/onedpl.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, tbb }: - -stdenv.mkDerivation rec { - pname = "oneDPL"; - version = "oneDPL-2022.0.0-release "; - - outputs = [ "out" "dev" ]; - - src = fetchFromGitHub { - owner = "oneapi-src"; - repo = "oneDPL"; - rev = "240685db73e3169e66dbb625b4d5fa1ad06ec79b"; - sha256 = "5E/EUJjhi6VQfYo3qdDHiETnXNEymsLR3hMSH5Gfa0M="; - }; - - nativeBuildInputs = [ cmake ]; - - buildInputs = [ tbb ]; - - # patches = [ - # # Fix musl build from https://github.com/oneapi-src/oneTBB/pull/899 - # (fetchpatch { - # url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch"; - # hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU="; - # }) - - # # Fix/suppress warnings on gcc12.1 from https://github.com/oneapi-src/oneTBB/pull/866 - # (fetchpatch { - # url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/866.patch"; - # hash = "sha256-e44Yv84Hfl5xoxWWTnLJLSGeNA1RBbah4/L43gPLS+c="; - # }) - # ]; - - # Fix build with modern gcc - # In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]', - NIX_CFLAGS_COMPILE = - lib.optionals stdenv.cc.isGNU [ "-Wno-error=stringop-overflow" ] ++ - # Workaround for gcc-12 ICE when using -O3 - # https://gcc.gnu.org/PR108854 - lib.optionals (stdenv.cc.isGNU && stdenv.isx86_32) [ "-O2" ]; - - # Disable failing test on musl - # test/conformance/conformance_resumable_tasks.cpp:37:24: error: ‘suspend’ is not a member of ‘tbb::v1::task’; did you mean ‘tbb::detail::r1::suspend’? - postPatch = lib.optionalString stdenv.hostPlatform.isMusl '' - substituteInPlace test/CMakeLists.txt \ - --replace 'conformance_resumable_tasks' "" - ''; - - meta = with lib; { - description = "Intel Thread Building Blocks C++ Library"; - homepage = "http://threadingbuildingblocks.org/"; - license = licenses.asl20; - longDescription = '' - Intel Threading Building Blocks offers a rich and complete approach to - expressing parallelism in a C++ program. It is a library that helps you - take advantage of multi-core processor performance without having to be a - threading expert. Intel TBB is not just a threads-replacement library. It - represents a higher-level, task-based parallelism that abstracts platform - details and threading mechanisms for scalability and performance. - ''; - platforms = platforms.unix; - }; -}