From 8c2543a9b1d24c863e26754304c8927fa87c42bf Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Wed, 11 Sep 2024 09:48:24 -0700 Subject: [PATCH 1/2] Just use std::filesystem --- src/chia_filesystem.hpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/chia_filesystem.hpp b/src/chia_filesystem.hpp index ab3f98060..3c486a84c 100644 --- a/src/chia_filesystem.hpp +++ b/src/chia_filesystem.hpp @@ -15,23 +15,7 @@ #ifndef SRC_CPP_CHIA_FILESYSTEM_HPP_ #define SRC_CPP_CHIA_FILESYSTEM_HPP_ -#ifdef __APPLE__ -// std::filesystem is not supported on Mojave -#include "filesystem.hpp" -namespace fs = ghc::filesystem; -#else -#ifdef __has_include -#if __has_include() #include namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif -#else -#include -namespace fs = std::filesystem; -#endif -#endif #endif // SRC_CPP_CHIA_FILESYSTEM_HPP_ From 5554f8e2dca0e6aec1e9fc4169d7e9bb8369e5c7 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Wed, 11 Sep 2024 10:08:17 -0700 Subject: [PATCH 2/2] remove chia_filesystem.hpp and gulrak --- CMakeLists.txt | 8 -------- src/b17sort_manager.hpp | 5 +++-- src/chia_filesystem.hpp | 21 --------------------- src/disk.hpp | 5 ++--- src/phase1.hpp | 5 +++-- src/plotter_disk.hpp | 4 ++-- src/sort_manager.hpp | 5 +++-- 7 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 src/chia_filesystem.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f66687fde..f7e2c3604 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,13 +53,6 @@ if (${CP_BUILD_BLADEBIT_HARVESTER}) FetchContent_MakeAvailable(bladebit) endif() -FetchContent_Declare( - gulrak - GIT_REPOSITORY https://github.com/gulrak/filesystem.git - GIT_TAG v1.5.14 -) -FetchContent_MakeAvailable(gulrak) - set(FSE_LIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/FiniteStateEntropy/lib) set(FSE_FILES ${FSE_LIB}/fse_compress.c @@ -72,7 +65,6 @@ include_directories( ${INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR}/../lib/include ${cxxopts_SOURCE_DIR}/include - ${gulrak_SOURCE_DIR}/include/ghc ${CMAKE_CURRENT_SOURCE_DIR}/../lib/FiniteStateEntropy/lib ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/test diff --git a/src/b17sort_manager.hpp b/src/b17sort_manager.hpp index 0c46efbb0..3f0f2d8c3 100644 --- a/src/b17sort_manager.hpp +++ b/src/b17sort_manager.hpp @@ -20,8 +20,7 @@ #include #include #include - -#include "chia_filesystem.hpp" +#include #include "./bits.hpp" #include "./calculate_bucket.hpp" @@ -30,6 +29,8 @@ #include "./uniformsort.hpp" #include "exceptions.hpp" +namespace fs = std::filesystem; + class b17SortManager { public: b17SortManager( diff --git a/src/chia_filesystem.hpp b/src/chia_filesystem.hpp deleted file mode 100644 index 3c486a84c..000000000 --- a/src/chia_filesystem.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 Chia Network Inc - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SRC_CPP_CHIA_FILESYSTEM_HPP_ -#define SRC_CPP_CHIA_FILESYSTEM_HPP_ - -#include -namespace fs = std::filesystem; - -#endif // SRC_CPP_CHIA_FILESYSTEM_HPP_ diff --git a/src/disk.hpp b/src/disk.hpp index f1a8df508..72fcd0364 100644 --- a/src/disk.hpp +++ b/src/disk.hpp @@ -22,14 +22,13 @@ #include #include #include - +#include // enables disk I/O logging to disk.log // use tools/disk.gnuplot to generate a plot #define ENABLE_LOGGING 0 using namespace std::chrono_literals; // for operator""min; - -#include "chia_filesystem.hpp" +namespace fs = std::filesystem; #include "./bits.hpp" #include "./util.hpp" diff --git a/src/phase1.hpp b/src/phase1.hpp index 600b486dd..b8f3bad68 100644 --- a/src/phase1.hpp +++ b/src/phase1.hpp @@ -35,8 +35,7 @@ #include #include #include - -#include "chia_filesystem.hpp" +#include #include "calculate_bucket.hpp" #include "entry_sizes.hpp" @@ -47,6 +46,8 @@ #include "util.hpp" #include "progress.hpp" +namespace fs = std::filesystem; + struct THREADDATA { int index; Sem::type* mine; diff --git a/src/plotter_disk.hpp b/src/plotter_disk.hpp index 77ab51d25..f62fd1155 100644 --- a/src/plotter_disk.hpp +++ b/src/plotter_disk.hpp @@ -32,8 +32,7 @@ #include #include #include - -#include "chia_filesystem.hpp" +#include #include "calculate_bucket.hpp" #include "encoding.hpp" @@ -51,6 +50,7 @@ #include "util.hpp" #define B17PHASE23 +namespace fs = std::filesystem; class DiskPlotter { public: diff --git a/src/sort_manager.hpp b/src/sort_manager.hpp index 0c5535bf7..a605db39a 100644 --- a/src/sort_manager.hpp +++ b/src/sort_manager.hpp @@ -20,8 +20,7 @@ #include #include #include - -#include "chia_filesystem.hpp" +#include #include "./bits.hpp" #include "./calculate_bucket.hpp" @@ -31,6 +30,8 @@ #include "disk.hpp" #include "exceptions.hpp" +namespace fs = std::filesystem; + enum class strategy_t : uint8_t { uniform,