From d5eac091f75f60d81c46b037340e7ef83006d2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 10 May 2017 18:47:30 +0200 Subject: [PATCH 1/3] Bump version to 0.10.0, remove Genoil's suffix --- BuildInfo.h.in | 2 +- CMakeLists.txt | 5 ++--- ethminer/main.cpp | 20 +++++++------------- libdevcore/Common.cpp | 9 --------- libdevcore/Common.h | 4 +--- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/BuildInfo.h.in b/BuildInfo.h.in index 7debb2738..5e97b71a5 100644 --- a/BuildInfo.h.in +++ b/BuildInfo.h.in @@ -1,6 +1,6 @@ #pragma once -#define ETH_PROJECT_VERSION "@PROJECT_VERSION@-genoil-@GENOIL_VERSION@" +#define ETH_PROJECT_VERSION "@PROJECT_VERSION@" #define ETH_COMMIT_HASH @ETH_COMMIT_HASH@ #define ETH_CLEAN_REPO @ETH_CLEAN_REPO@ #define ETH_BUILD_TYPE @ETH_BUILD_TYPE@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 95989dc8b..4b230c9f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,10 @@ HunterGate( ) -set(GENOIL_VERSION "1.1.7") cmake_policy(SET CMP0042 OLD) # fix MACOSX_RPATH cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project() -project(ethminer VERSION 0.9.41) +project(ethminer VERSION 0.10.0) # link_directories interprate relative paths with respect to CMAKE_CURRENT_SOURCE_DIR cmake_policy(SET CMP0015 NEW) @@ -100,7 +99,7 @@ function(createBuildInfo) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -DETH_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DETH_DST_DIR="${CMAKE_BINARY_DIR}" -DETH_BUILD_TYPE="${_cmake_build_type}" -DETH_BUILD_PLATFORM="${ETH_BUILD_PLATFORM}" - -DPROJECT_VERSION="${PROJECT_VERSION}" -DGENOIL_VERSION="${GENOIL_VERSION}" + -DPROJECT_VERSION="${PROJECT_VERSION}" -P "${ETH_SCRIPTS_DIR}/buildinfo.cmake" ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index ee37db762..4d8df8fe7 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -56,29 +56,24 @@ void help() void version() { - cout << "ethminer version " << dev::Version << endl; + cout << "ethminer version " << ETH_PROJECT_VERSION << endl; cout << "Build: " << DEV_QUOTED(ETH_BUILD_PLATFORM) << "/" << DEV_QUOTED(ETH_BUILD_TYPE) << endl; exit(0); } int main(int argc, char** argv) { - cout << "Genoil's ethminer " << ETH_PROJECT_VERSION << endl; - cout << "=====================================================================" << endl; - cout << "Forked from github.com/ethereum/cpp-ethereum" << endl; - cout << "CUDA kernel ported from Tim Hughes' OpenCL kernel" << endl; - cout << "With contributions from nicehash, nerdralph, RoBiK and sp_ " << endl << endl; - cout << "Please consider a donation to:" << endl; - cout << "ETH: 0xeb9310b185455f863f526dab3d245809f6854b4d" << endl << endl; - MinerCLI m(MinerCLI::OperationMode::Farm); for (int i = 1; i < argc; ++i) { - string arg = argv[i]; + // Mining options: if (m.interpretOption(i, argc, argv)) - {} - else if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) + continue; + + // Standard options: + string arg = argv[i]; + if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) g_logVerbosity = atoi(argv[++i]); else if (arg == "-h" || arg == "--help") help(); @@ -95,4 +90,3 @@ int main(int argc, char** argv) return 0; } - diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index da76cf6e5..8a87b5808 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -25,12 +25,3 @@ #include "BuildInfo.h" using namespace std; using namespace dev; - -namespace dev -{ - -char const* Version = ETH_PROJECT_VERSION; - -const u256 UndefinedU256 = ~(u256)0; - -} diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 8ddbdead8..63c8b3daf 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -60,8 +60,6 @@ using byte = uint8_t; namespace dev { -extern char const* Version; - // Binary data types. using bytes = std::vector; using bytesRef = vector_ref; @@ -137,4 +135,4 @@ std::string toString(_T const& _t) return o.str(); } -} \ No newline at end of file +} From 0c86011228d9c230a6d88d43f7d3be30b187d65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 10 May 2017 18:56:14 +0200 Subject: [PATCH 2/3] Simplify buildinfo generation --- BuildInfo.h.in | 6 ++---- CMakeLists.txt | 5 ----- cmake/scripts/buildinfo.cmake | 23 +---------------------- ethminer/MinerAux.h | 19 +++++++++---------- ethminer/main.cpp | 4 +++- libdevcore/CMakeLists.txt | 3 +-- libdevcore/Common.cpp | 27 --------------------------- libdevcore/Common.h | 4 ---- 8 files changed, 16 insertions(+), 75 deletions(-) delete mode 100644 libdevcore/Common.cpp diff --git a/BuildInfo.h.in b/BuildInfo.h.in index 5e97b71a5..46379e5de 100644 --- a/BuildInfo.h.in +++ b/BuildInfo.h.in @@ -1,7 +1,5 @@ #pragma once #define ETH_PROJECT_VERSION "@PROJECT_VERSION@" -#define ETH_COMMIT_HASH @ETH_COMMIT_HASH@ -#define ETH_CLEAN_REPO @ETH_CLEAN_REPO@ -#define ETH_BUILD_TYPE @ETH_BUILD_TYPE@ -#define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@ +#define ETH_BUILD_TYPE "@ETH_BUILD_TYPE@" +#define ETH_BUILD_PLATFORM "@ETH_BUILD_PLATFORM@" diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b230c9f2..b8d2bb5a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,8 +92,6 @@ function(createBuildInfo) set(_cmake_build_type "${CMAKE_CFG_INTDIR}") endif() - message("createBuildInfo()") - # Generate header file containing useful build information add_custom_target(BuildInfo.h ALL WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} @@ -103,9 +101,6 @@ function(createBuildInfo) -P "${ETH_SCRIPTS_DIR}/buildinfo.cmake" ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) - - set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(SRC_LIST BuildInfo.h) endfunction() diff --git a/cmake/scripts/buildinfo.cmake b/cmake/scripts/buildinfo.cmake index a0666c9f5..fc4fa477f 100644 --- a/cmake/scripts/buildinfo.cmake +++ b/cmake/scripts/buildinfo.cmake @@ -1,5 +1,5 @@ # generates BuildInfo.h -# +# # this module expects # ETH_SOURCE_DIR - main CMAKE_SOURCE_DIR # ETH_DST_DIR - main CMAKE_BINARY_DIR @@ -17,26 +17,6 @@ if (NOT ETH_BUILD_PLATFORM) set(ETH_BUILD_PLATFORM "unknown") endif() -execute_process( - COMMAND git --git-dir=${ETH_SOURCE_DIR}/.git --work-tree=${ETH_SOURCE_DIR} rev-parse HEAD - OUTPUT_VARIABLE ETH_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET -) - -if (NOT ETH_COMMIT_HASH) - set(ETH_COMMIT_HASH 0) -endif() - -execute_process( - COMMAND git --git-dir=${ETH_SOURCE_DIR}/.git --work-tree=${ETH_SOURCE_DIR} diff --shortstat - OUTPUT_VARIABLE ETH_LOCAL_CHANGES OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET -) - -if (ETH_LOCAL_CHANGES) - set(ETH_CLEAN_REPO 0) -else() - set(ETH_CLEAN_REPO 1) -endif() - set(INFILE "${ETH_SOURCE_DIR}/BuildInfo.h.in") set(TMPFILE "${ETH_DST_DIR}/BuildInfo.h.tmp") set(OUTFILE "${ETH_DST_DIR}/BuildInfo.h") @@ -45,4 +25,3 @@ configure_file("${INFILE}" "${TMPFILE}") include("${ETH_SOURCE_DIR}/cmake/EthUtils.cmake") replace_if_different("${TMPFILE}" "${OUTFILE}" CREATE) - diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 8ff85b44a..755a31b5c 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -46,7 +46,6 @@ #include #endif #include -#include "BuildInfo.h" #include "FarmClient.h" #if ETH_STRATUM #include @@ -238,7 +237,7 @@ public: { m_worktimeout = atoi(argv[++i]); } - + #endif #if ETH_ETHASHCL else if (arg == "--opencl-platform" && i + 1 < argc) @@ -472,7 +471,7 @@ public: EthashGPUMiner::setDevices(m_openclDevices, m_openclDeviceCount); m_miningThreads = m_openclDeviceCount; } - + if (!EthashGPUMiner::configureGPU( m_localWorkSize, m_globalWorkSizeMultiplier, @@ -499,7 +498,7 @@ public: EthashCUDAMiner::setDevices(m_cudaDevices, m_cudaDeviceCount); m_miningThreads = m_cudaDeviceCount; } - + EthashCUDAMiner::setNumInstances(m_miningThreads); if (!EthashCUDAMiner::configureGPU( m_localWorkSize, @@ -521,7 +520,7 @@ public: doBenchmark(m_minerType, m_benchmarkWarmup, m_benchmarkTrial, m_benchmarkTrials); else if (mode == OperationMode::Farm) doFarm(m_minerType, m_activeFarmURL, m_farmRecheckPeriod); - else if (mode == OperationMode::Simulation) + else if (mode == OperationMode::Simulation) doSimulation(m_minerType); #if ETH_STRATUM else if (mode == OperationMode::Stratum) @@ -605,7 +604,7 @@ private: exit(0); } - + void doBenchmark(MinerType _m, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5) { @@ -757,7 +756,7 @@ private: } } - + void doFarm(MinerType _m, string & _remote, unsigned _recheckPeriod) { map::SealerDescriptor> sealers; @@ -904,7 +903,7 @@ private: } m_farmRetries = 0; } - + } } exit(0); @@ -922,7 +921,7 @@ private: #endif if (!m_farmRecheckSet) m_farmRecheckPeriod = m_defaultStratumFarmRecheckPeriod; - + GenericFarm f; // this is very ugly, but if Stratum Client V2 tunrs out to be a success, V1 will be completely removed anyway @@ -1044,7 +1043,7 @@ private: /// Farm params string m_farmURL = "http://127.0.0.1:8545"; string m_farmFailOverURL = ""; - + string m_activeFarmURL = m_farmURL; unsigned m_farmRetries = 0; diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 4d8df8fe7..85526ac93 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -32,6 +32,8 @@ #include #include #include "MinerAux.h" +#include "BuildInfo.h" + using namespace std; using namespace dev; using namespace dev::eth; @@ -57,7 +59,7 @@ void help() void version() { cout << "ethminer version " << ETH_PROJECT_VERSION << endl; - cout << "Build: " << DEV_QUOTED(ETH_BUILD_PLATFORM) << "/" << DEV_QUOTED(ETH_BUILD_TYPE) << endl; + cout << "Build: " << ETH_BUILD_PLATFORM << "/" << ETH_BUILD_TYPE << endl; exit(0); } diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt index 0fbec77d2..27f6d43c2 100644 --- a/libdevcore/CMakeLists.txt +++ b/libdevcore/CMakeLists.txt @@ -5,5 +5,4 @@ find_package(Threads) add_library(devcore ${SOURCES} ${HEADERS}) target_link_libraries(devcore PUBLIC Boost::boost) -target_link_libraries(devcore PRIVATE ${CMAKE_THREAD_LIBS_INIT}) -#target_include_directories(devcore PRIVATE ..) \ No newline at end of file +target_link_libraries(devcore PRIVATE Threads::Threads) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp deleted file mode 100644 index 8a87b5808..000000000 --- a/libdevcore/Common.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - This file is part of cpp-ethereum. - - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . -*/ -/** @file Common.cpp - * @author Gav Wood - * @date 2014 - */ - -#include "Common.h" -#include "Exceptions.h" -#include "Log.h" -#include "BuildInfo.h" -using namespace std; -using namespace dev; diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 63c8b3daf..207abbbf5 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -48,10 +48,6 @@ // CryptoPP defines byte in the global namespace, so must we. using byte = uint8_t; -// Quote a given token stream to turn it into a string. -#define DEV_QUOTED_HELPER(s) #s -#define DEV_QUOTED(s) DEV_QUOTED_HELPER(s) - #define DEV_IGNORE_EXCEPTIONS(X) try { X; } catch (...) {} #define DEV_IF_NO_ELSE(X) if(!(X)){}else From adb9d2a16ca5b37847ffa895d47cd42b05e2de14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 10 May 2017 19:16:26 +0200 Subject: [PATCH 3/3] CMake: remove unused options --- CMakeLists.txt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8d2bb5a5..1d055e957 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,8 +64,6 @@ function(configureProject) endif() endfunction() -set(CPPETHEREUM 1) - function(createBuildInfo) # Set build platform; to be written to BuildInfo.h set(ETH_BUILD_PLATFORM "${TARGET_PLATFORM}") @@ -118,7 +116,6 @@ macro(eth_format_option O) endmacro() # Normalise build options -eth_format_option(JSONRPC) eth_format_option(ETHASHCL) eth_format_option(ETHASHCUDA) eth_format_option(ETHSTRATUM) @@ -149,10 +146,6 @@ message("----------------------------------------------------------------------- message("-- CMake Version ${CMAKE_VERSION}") message("-- CMAKE_BUILD_TYPE Build type ${CMAKE_BUILD_TYPE}") message("-- TARGET_PLATFORM Target platform ${TARGET_PLATFORM}") -message("--------------------------------------------------------------- features") -message("-- Chromium support ${ETH_HAVE_WEBENGINE}") -message("-- HTTP Request support ${CURL_FOUND}") -message("-- JSONRPC JSON-RPC support ${JSONRPC}") message("------------------------------------------------------------- components") message("-- ETHASHCL Build OpenCL components ${ETHASHCL}") message("-- ETHASHCUDA Build CUDA components ${ETHASHCUDA}") @@ -160,13 +153,8 @@ message("-- ETHSTRATUM Build Stratum components ${ETHSTRAT message("------------------------------------------------------------------------") message("") -if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") -set(CMAKE_THREAD_LIBS_INIT pthread) -endif() - include(EthCompilerSettings) -message("creating build info...") createBuildInfo() add_subdirectory(libdevcore)