diff --git a/BuildInfo.h.in b/BuildInfo.h.in index 8acd6714a..7debb2738 100644 --- a/BuildInfo.h.in +++ b/BuildInfo.h.in @@ -5,4 +5,3 @@ #define ETH_CLEAN_REPO @ETH_CLEAN_REPO@ #define ETH_BUILD_TYPE @ETH_BUILD_TYPE@ #define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@ -#define ETH_FATDB @ETH_FATDB@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 690048f19..78b423a73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,6 @@ set(D_CMAKE_BUILD_TYPE "Release") set(D_ETHASHCL ON) set(D_ETHASHCUDA OFF) set(D_JSONRPC ON) -set(D_OLYMPIC OFF) -set(D_MINER ON) set(D_ETHSTRATUM OFF) if ("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -51,26 +49,6 @@ function(configureProject) if (ETHSTRATUM) add_definitions(-DETH_STRATUM) endif() - - if (FATDB) - add_definitions(-DETH_FATDB) - endif() - - if (GUI) - add_definitions(-DETH_GUI) - endif() - - if (CURL_FOUND) - add_definitions(-DETH_CURL) - endif() - - if (OLYMPIC) - add_definitions(-DETH_OLYMPIC) - else() - add_definitions(-DETH_FRONTIER) - endif() - - add_definitions(-DETH_TRUE) endfunction() set(CPPETHEREUM 1) @@ -108,7 +86,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}" -DETH_FATDB="${FATDB}" + -DPROJECT_VERSION="${PROJECT_VERSION}" -DGENOIL_VERSION="${GENOIL_VERSION}" -P "${ETH_SCRIPTS_DIR}/buildinfo.cmake" ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) @@ -133,10 +111,8 @@ endmacro() # Normalise build options eth_format_option(JSONRPC) -eth_format_option(MINER) eth_format_option(ETHASHCL) eth_format_option(ETHASHCUDA) -eth_format_option(OLYMPIC) eth_format_option(ETHSTRATUM) # Default CMAKE_BUILD_TYPE accordingly. @@ -160,11 +136,8 @@ message("-- TARGET_PLATFORM Target platform ${TARGET_P message("--------------------------------------------------------------- features") message("-- Chromium support ${ETH_HAVE_WEBENGINE}") message("-- HTTP Request support ${CURL_FOUND}") -message("-- FATDB Full database exploring ${FATDB}") message("-- JSONRPC JSON-RPC support ${JSONRPC}") -message("-- OLYMPIC Default to the Olympic network ${OLYMPIC}") message("------------------------------------------------------------- components") -message("-- MINER Build miner ${MINER}") message("-- ETHASHCL Build OpenCL components ${ETHASHCL}") message("-- ETHASHCUDA Build CUDA components ${ETHASHCUDA}") message("-- ETHSTRATUM Build Stratum components ${ETHSTRATUM}") @@ -186,18 +159,16 @@ createBuildInfo() add_subdirectory(libdevcore) -if (MINER) - add_subdirectory(libethash) - if (ETHASHCL) - add_subdirectory(libethash-cl) - endif () - if (ETHASHCUDA) - add_subdirectory(libethash-cuda) - endif () - if(ETHSTRATUM) - add_subdirectory(libstratum) - endif() +add_subdirectory(libethash) +if (ETHASHCL) + add_subdirectory(libethash-cl) endif () +if (ETHASHCUDA) + add_subdirectory(libethash-cuda) +endif () +if(ETHSTRATUM) + add_subdirectory(libstratum) +endif() add_subdirectory(libethcore) add_subdirectory(ethminer) diff --git a/cmake/scripts/buildinfo.cmake b/cmake/scripts/buildinfo.cmake index a0e439af8..a0666c9f5 100644 --- a/cmake/scripts/buildinfo.cmake +++ b/cmake/scripts/buildinfo.cmake @@ -9,12 +9,6 @@ # example usage: # cmake -DETH_SOURCE_DIR=. -DETH_DST_DIR=build -DETH_BUILD_TYPE=Debug -DETH_BUILD_PLATFORM=mac -P scripts/buildinfo.cmake -if (ETH_FATDB) - set(ETH_FATDB 1) -else() - set(ETH_FATDB 0) -endif() - if (NOT ETH_BUILD_TYPE) set(ETH_BUILD_TYPE "unknown") endif() diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index b88f63275..c9e0ab448 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -41,17 +41,17 @@ #include #include #include -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL #include #endif -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA #include #endif #include #include #include "BuildInfo.h" #include "FarmClient.h" -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM #include #include #endif @@ -156,7 +156,7 @@ public: cerr << "Bad " << arg << " option: " << argv[i] << endl; BOOST_THROW_EXCEPTION(BadArgument()); } -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM else if ((arg == "-S" || arg == "--stratum") && i + 1 < argc) { mode = OperationMode::Stratum; @@ -254,7 +254,7 @@ public: } #endif -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL else if (arg == "--opencl-platform" && i + 1 < argc) try { m_openclPlatform = stol(argv[++i]); @@ -279,7 +279,7 @@ public: } } #endif -#if ETH_ETHASHCL || ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCL || ETH_ETHASHCUDA else if ((arg == "--cl-global-work" || arg == "--cuda-grid-size") && i + 1 < argc) try { m_globalWorkSizeMultiplier = stol(argv[++i]); @@ -303,11 +303,11 @@ public: else if ((arg == "--cl-extragpu-mem" || arg == "--cuda-extragpu-mem") && i + 1 < argc) m_extraGPUMemory = 1000000 * stol(argv[++i]); #endif -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL else if (arg == "--allow-opencl-cpu") m_clAllowCPU = true; #endif -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA else if (arg == "--cuda-devices") { while (m_cudaDeviceCount < 16 && i + 1 < argc) @@ -475,11 +475,11 @@ public: { if (m_shouldListDevices) { -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL if (m_minerType == MinerType::CL || m_minerType == MinerType::Mixed) EthashGPUMiner::listDevices(); #endif -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA if (m_minerType == MinerType::CUDA || m_minerType == MinerType::Mixed) EthashCUDAMiner::listDevices(); #endif @@ -495,7 +495,7 @@ public: } else if (m_minerType == MinerType::CL || m_minerType == MinerType::Mixed) { -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL if (m_openclDeviceCount > 0) { EthashGPUMiner::setDevices(m_openclDevices, m_openclDeviceCount); @@ -522,7 +522,7 @@ public: } else if (m_minerType == MinerType::CUDA || m_minerType == MinerType::Mixed) { -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA if (m_cudaDeviceCount > 0) { EthashCUDAMiner::setDevices(m_cudaDevices, m_cudaDeviceCount); @@ -552,7 +552,7 @@ public: doFarm(m_minerType, m_activeFarmURL, m_farmRecheckPeriod); else if (mode == OperationMode::Simulation) doSimulation(m_minerType); -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM else if (mode == OperationMode::Stratum) doStratum(); #endif @@ -565,7 +565,7 @@ public: << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)" << endl << " -FF,-FO, --farm-failover, --stratum-failover Failover getwork/stratum URL (default: disabled)" << endl << " --farm-retries Number of retries until switch to failover (default: 3)" << endl -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM << " -S, --stratum Put into stratum mode with the stratum server at host:port" << endl << " -FS, --failover-stratum Failover stratum server at host:port" << endl << " -O, --userpass Stratum login credentials" << endl @@ -578,7 +578,7 @@ public: << " 2: EthereumStratum/1.0.0: nicehash" << endl << " -SE, --stratum-email Email address used in eth-proxy (optional)" << endl #endif -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM << " --farm-recheck Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output" << endl #endif << endl @@ -603,12 +603,12 @@ public: << " parallel - load DAG on all GPUs at the same time (default)" << endl << " sequential - load DAG on GPUs one after another. Use this when the miner crashes during DAG generation" << endl << " single - generate DAG on device n, then copy to other devices" << endl -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL << " --cl-extragpu-mem Set the memory (in MB) you believe your GPU requires for stuff other than mining. default: 0" << endl << " --cl-local-work Set the OpenCL local work size. Default is " << toString(ethash_cl_miner::c_defaultLocalWorkSize) << endl << " --cl-global-work Set the OpenCL global work size as a multiple of the local work size. Default is " << toString(ethash_cl_miner::c_defaultGlobalWorkSizeMultiplier) << " * " << toString(ethash_cl_miner::c_defaultLocalWorkSize) << endl #endif -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA << " --cuda-extragpu-mem Set the memory (in MB) you believe your GPU requires for stuff other than mining. Windows rendering e.t.c.." << endl << " --cuda-block-size Set the CUDA block work size. Default is " << toString(ethash_cuda_miner::c_defaultBlockSize) << endl << " --cuda-grid-size Set the CUDA grid size. Default is " << toString(ethash_cuda_miner::c_defaultGridSize) << endl @@ -942,7 +942,7 @@ private: exit(0); } -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM void doStratum() { map::SealerDescriptor> sealers; @@ -1049,15 +1049,15 @@ private: unsigned m_miningThreads = UINT_MAX; bool m_shouldListDevices = false; bool m_clAllowCPU = false; -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL unsigned m_openclDeviceCount = 0; unsigned m_openclDevices[16]; -#if !ETH_ETHASHCUDA || !ETH_TRUE +#if !ETH_ETHASHCUDA unsigned m_globalWorkSizeMultiplier = ethash_cl_miner::c_defaultGlobalWorkSizeMultiplier; unsigned m_localWorkSize = ethash_cl_miner::c_defaultLocalWorkSize; #endif #endif -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA unsigned m_globalWorkSizeMultiplier = ethash_cuda_miner::c_defaultGridSize; unsigned m_localWorkSize = ethash_cuda_miner::c_defaultBlockSize; unsigned m_cudaDeviceCount = 0; @@ -1087,7 +1087,7 @@ private: bool m_farmRecheckSet = false; int m_worktimeout = 180; -#if ETH_STRATUM || !ETH_TRUE +#if ETH_STRATUM int m_stratumClientVersion = 1; int m_stratumProtocol = STRATUM_PROTOCOL_STRATUM; string m_user; diff --git a/libethcore/EthashCUDAMiner.cpp b/libethcore/EthashCUDAMiner.cpp index db40ee200..359b7b45f 100644 --- a/libethcore/EthashCUDAMiner.cpp +++ b/libethcore/EthashCUDAMiner.cpp @@ -21,7 +21,7 @@ along with cpp-ethereum. If not, see . * Determines the PoW algorithm. */ -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA #if defined(WIN32) #include diff --git a/libethcore/EthashCUDAMiner.h b/libethcore/EthashCUDAMiner.h index 19031b8d9..ed8b8200c 100644 --- a/libethcore/EthashCUDAMiner.h +++ b/libethcore/EthashCUDAMiner.h @@ -22,7 +22,7 @@ along with cpp-ethereum. If not, see . */ #pragma once -#if ETH_ETHASHCUDA || !ETH_TRUE +#if ETH_ETHASHCUDA #include "libdevcore/Worker.h" #include "EthashAux.h" diff --git a/libethcore/EthashGPUMiner.cpp b/libethcore/EthashGPUMiner.cpp index 6c7322024..9f2c7b2ba 100644 --- a/libethcore/EthashGPUMiner.cpp +++ b/libethcore/EthashGPUMiner.cpp @@ -21,7 +21,7 @@ * Determines the PoW algorithm. */ -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL #include "EthashGPUMiner.h" #include diff --git a/libethcore/EthashGPUMiner.h b/libethcore/EthashGPUMiner.h index c1b998328..49efd652b 100644 --- a/libethcore/EthashGPUMiner.h +++ b/libethcore/EthashGPUMiner.h @@ -22,7 +22,7 @@ */ #pragma once -#if ETH_ETHASHCL || !ETH_TRUE +#if ETH_ETHASHCL #include "libdevcore/Worker.h" #include "EthashAux.h"