Skip to content

Commit

Permalink
updated for verus linux build
Browse files Browse the repository at this point in the history
updated for linux build
  • Loading branch information
Chris S authored and Chris S committed Sep 9, 2018
1 parent 448ce4d commit 1a1b196
Show file tree
Hide file tree
Showing 34 changed files with 1,558 additions and 350 deletions.
23 changes: 17 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ccminer 2.2.6 "phi2 and allium"
ccminer 2.3 "phi2 and cryptonight variants"
---------------------------------------------------------------

***************************************************************
Expand Down Expand Up @@ -41,19 +41,21 @@ Keccak (Maxcoin)
Pentablake (Blake 512 x5)
1Coin Triple S
Neoscrypt (FeatherCoin)
Revolver (X11evo)
x11evo (Revolver)
phi2 (LUXCoin)
Scrypt and Scrypt:N
Scrypt-Jane (Chacha)
Sibcoin (sib)
sib (Sibcoin)
Skein (Skein + SHA)
Signatum (Skein cubehash fugue Streebog)
SonoA (Sono)
Tribus (JH, keccak, simd)
Woodcoin (Double Skein)
Vanilla (Blake256 8-rounds - double sha256)
Vertcoin Lyra2RE
Ziftrcoin (ZR5)
Boolberry (Wild Keccak)
Monero (Cryptonight)
Monero (Cryptonight v7 with -a monero)
Aeon (Cryptonight-lite)

where some of these coins have a VERY NOTABLE nVidia advantage
Expand All @@ -80,8 +82,8 @@ its command line interface and options.
blakecoin use to mine Old Blake 256
blake2s use to mine Nevacoin (Blake2-S 256)
bmw use to mine Midnight
cryptolight use to mine AEON cryptonight (MEM/2)
cryptonight use to mine XMR cryptonight, Bytecoin, Dash, DigitalNote, etc
cryptolight use to mine AEON cryptonight variant 1 (MEM/2)
cryptonight use to mine original cryptonight
c11/flax use to mine Chaincoin and Flax
decred use to mine Decred 180 bytes Blake256-14
deep use to mine Deepcoin
Expand All @@ -99,10 +101,12 @@ its command line interface and options.
lyra2 use to mine CryptoCoin
lyra2v2 use to mine Vertcoin
lyra2z use to mine Zerocoin (XZC)
monero use to mine Monero (XMR)
myr-gr use to mine Myriad-Groest
neoscrypt use to mine FeatherCoin, Trezarcoin, Orbitcoin, etc
nist5 use to mine TalkCoin
penta use to mine Joincoin / Pentablake
phi1612 use to mine Seraph
phi2 use to mine LUXCoin
polytimos use to mine Polytimos
quark use to mine Quarkcoin
Expand All @@ -117,6 +121,8 @@ its command line interface and options.
skein use to mine Skeincoin
skein2 use to mine Woodcoin
skunk use to mine Signatum
sonoa use to mine Sono
stellite use to mine Stellite (a cryptonight variant)
timetravel use to mine MachineCoin
tribus use to mine Denarius
x11evo use to mine Revolver
Expand Down Expand Up @@ -282,6 +288,11 @@ so we can more efficiently implement new algorithms using the latest hardware
features.

>>> RELEASE HISTORY <<<
June 23th 2018 v2.3
Handle phi2 header variation for smart contracts
Handle monero, stellite, graft and cryptolight variants
Handle SonoA algo

June 10th 2018 v2.2.6
New phi2 algo for LUX
New allium algo for Garlic
Expand Down
4 changes: 2 additions & 2 deletions api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#ifdef WIN32
# define _WINSOCK_DEPRECATED_NO_WARNINGS
//# include <winsock2.h>
# include <winsock2.h>
#endif

#include <stdio.h>
Expand Down Expand Up @@ -597,7 +597,7 @@ static size_t base64_encode(const uchar *indata, size_t insize, char *outptr, si
return len;
}

#include "openssl/sha.h"
#include "compat/curl-for-windows/openssl/openssl/crypto/sha/sha.h"

/* websocket handshake (tested in Chrome) */
static int websocket_handshake(SOCKETTYPE c, char *result, char *clientkey)
Expand Down
2 changes: 2 additions & 0 deletions bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void algo_free_all(int thr_id)
free_nist5(thr_id);
free_pentablake(thr_id);
free_phi(thr_id);
free_phi2(thr_id);
free_polytimos(thr_id);
free_quark(thr_id);
free_qubit(thr_id);
Expand All @@ -92,6 +93,7 @@ void algo_free_all(int thr_id)
free_sha256t(thr_id);
free_sia(thr_id);
free_sib(thr_id);
free_sonoa(thr_id);
free_s3(thr_id);
free_vanilla(thr_id);
free_veltor(thr_id);
Expand Down
4 changes: 2 additions & 2 deletions bignum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

#include "miner.h" // hex2bin
/*

extern "C" double bn_convert_nbits(const uint32_t nBits)
{
uint256 bn = CBigNum().SetCompact(nBits).getuint256();
Expand All @@ -30,7 +30,7 @@ extern "C" void bn_nbits_to_uchar(const uint32_t nBits, unsigned char *target)
snprintf(buff, 65, "%s\n", bn.ToString().c_str()); buff[64] = '\0';
hex2bin(target, buff, 32);
}
*/

// unused, but should allow more than 256bits targets
#if 0
extern "C" double bn_hash_target_ratio(uint32_t* hash, uint32_t* target)
Expand Down
23 changes: 11 additions & 12 deletions bignum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_BIGNUM_H
#define BITCOIN_BIGNUM_H

Expand Down Expand Up @@ -104,13 +103,13 @@ class CBigNum
CBigNum(short n) { init(); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int n) { init(); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(long n) { init(); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int64_t n) { init(); setint64(n); }
CBigNum(int64 n) { init(); setint64(n); }
CBigNum(unsigned char n) { init(); setulong(n); }
CBigNum(unsigned short n) { init(); setulong(n); }
CBigNum(unsigned int n) { init(); setulong(n); }
CBigNum(unsigned long n) { init(); setulong(n); }
CBigNum(uint64_t n) { init(); setuint64(n); }
//explicit CBigNum(uint256_t n) { init(); setuint256(n); }
CBigNum(uint64 n) { init(); setuint64(n); }
explicit CBigNum(uint256 n) { init(); setuint256(n); }

explicit CBigNum(const std::vector<unsigned char>& vch)
{
Expand Down Expand Up @@ -143,14 +142,14 @@ class CBigNum
return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}

void setint64(int64_t sn)
void setint64(int64 sn)
{
unsigned char pch[sizeof(sn) + 6];
unsigned char* p = pch + 4;
bool fNegative;
uint64_t n;
uint64 n;

if (sn < (int64_t)0)
if (sn < (int64)0)
{
// Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
n = -(sn + 1);
Expand Down Expand Up @@ -186,7 +185,7 @@ class CBigNum
BN_mpi2bn(pch, p - pch, self);
}

uint64_t getuint64()
uint64 getuint64()
{
unsigned int nSize = BN_bn2mpi(self, NULL);
if (nSize < 4)
Expand All @@ -195,13 +194,13 @@ class CBigNum
BN_bn2mpi(self, &vch[0]);
if (vch.size() > 4)
vch[4] &= 0x7f;
uint64_t n = 0;
uint64 n = 0;
for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--)
((unsigned char*)&n)[i] = vch[j];
return n;
}

void setuint64(uint64_t n)
void setuint64(uint64 n)
{
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;
Expand All @@ -228,7 +227,7 @@ class CBigNum
BN_mpi2bn(pch, p - pch, self);
}

/* void setuint256(uint256 n)
void setuint256(uint256 n)
{
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;
Expand Down Expand Up @@ -269,7 +268,7 @@ class CBigNum
for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--)
((unsigned char*)&n)[i] = vch[j];
return n;
}*/
}


void setvch(const std::vector<unsigned char>& vch)
Expand Down
39 changes: 15 additions & 24 deletions ccminer.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
Expand All @@ -26,7 +26,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CLRSupport>false</CLRSupport>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
Expand All @@ -39,7 +39,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.2.props" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.0.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand Down Expand Up @@ -131,7 +131,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_WRAPNVML;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\OpenSSL-Win64\include;.;compat;compat\includes;compat\includes-x64;compat\getopt;compat\includes\pthreads;compat\curl-for-windows\zlib;</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)</AdditionalIncludeDirectories>
<MinimalRebuild>true</MinimalRebuild>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -142,9 +142,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>normaliz.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pthreadVC2.lib;libcurl.lib;libcrypto.lib;zlibstat.lib;ws2_32.lib;Wldap32.lib;cudart.lib;nvapi64.lib;jansson.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>cudart_static.lib;cuda.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pthreadVC2.lib;libcurl.x86.lib;openssl.x86.lib;zlib.x86.lib;ws2_32.lib;Wldap32.lib;nvapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalLibraryDirectories>C:\OpenSSL-Win64\lib;compat\libs\x64;compat\nvapi\amd64;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>compat\pthreads\x86;compat\curl-for-windows\out\x86\Release\lib;compat\nvapi\x86;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir)</AdditionalLibraryDirectories>
<AdditionalOptions>/NODEFAULTLIB:LIBCMT %(AdditionalOptions)</AdditionalOptions>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<LinkStatus>false</LinkStatus>
Expand All @@ -155,7 +155,7 @@
<MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep>
<CodeGeneration>compute_50,sm_50</CodeGeneration>
<CodeGeneration>compute_50,sm_50;compute_52,sm_52;compute_30,sm_30</CodeGeneration>
<AdditionalOptions>--ptxas-options="-O2" --Wno-deprecated-gpu-targets %(AdditionalOptions)</AdditionalOptions>
<Optimization>O2</Optimization>
</CudaCompile>
Expand All @@ -176,8 +176,8 @@
<CompileAsManaged>false</CompileAsManaged>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_STRUCT_TIMESPEC;WIN32;NDEBUG;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_WRAPNVML;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\OpenSSL-Win64\include;.;compat;compat\includes;compat\includes-x64;compat\getopt;compat\includes\pthreads;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CURL_STATICLIB;USE_WRAPNVML;SCRYPT_KECCAK512;SCRYPT_CHACHA;SCRYPT_CHOOSE_COMPILETIME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;compat;compat\curl-for-windows\curl\include;compat\jansson;compat\getopt;compat\pthreads;compat\curl-for-windows\openssl\openssl\include;compat\curl-for-windows\zlib;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir)</AdditionalIncludeDirectories>
<MinimalRebuild>true</MinimalRebuild>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
Expand All @@ -186,28 +186,23 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>normaliz.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pthreadVC2.lib;libcurl.lib;libcrypto.lib;zlibstat.lib;ws2_32.lib;Wldap32.lib;cudart.lib;nvapi64.lib;jansson.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pthreadVC2.lib;libcurl.x64.lib;openssl.x64.lib;zlib.x64.lib;ws2_32.lib;Wldap32.lib;cudart_static.lib;cuda.lib;nvapi64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalLibraryDirectories>C:\OpenSSL-Win64\lib;compat\libs\x64;compat\nvapi\amd64;%(AdditionalIncludeDirectories);$(CudaToolkitLibDir)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>compat\pthreads\x64;compat\curl-for-windows\out\x64\Release\lib;compat\nvapi\amd64;%(AdditionalLibraryDirectories);$(CudaToolkitLibDir)</AdditionalLibraryDirectories>
<AdditionalOptions>/NODEFAULTLIB:LIBCMT %(AdditionalOptions)</AdditionalOptions>
<LinkStatus>false</LinkStatus>
<LargeAddressAware>true</LargeAddressAware>
</Link>
<CudaCompile>
<CInterleavedPTX>false</CInterleavedPTX>
<MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>false</PtxAsOptionV>
<PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep>
<CodeGeneration>compute_52,sm_52</CodeGeneration>
<CodeGeneration>compute_52,sm_52;compute_50,sm_50;compute_35,sm_35;compute_30,sm_30</CodeGeneration>
<Include>$(NVTOOLSEXT_PATH)\include</Include>
<Optimization>O3</Optimization>
<TargetMachinePlatform>64</TargetMachinePlatform>
<AdditionalOptions>--Wno-deprecated-gpu-targets %(AdditionalOptions)</AdditionalOptions>
<CudaRuntime>Shared</CudaRuntime>
<FastMath>true</FastMath>
<Runtime>MT</Runtime>
<RuntimeChecks>Default</RuntimeChecks>
<TypeInfo>false</TypeInfo>
</CudaCompile>
<CudaLink>
<Optimization>O3</Optimization>
Expand Down Expand Up @@ -273,7 +268,6 @@
<ClCompile Include="neoscrypt\neoscrypt.cpp" />
<ClCompile Include="neoscrypt\neoscrypt-cpu.c" />
<ClInclude Include="neoscrypt\cuda_vectors.h" />
<ClInclude Include="verus\haraka.h" />
<ClInclude Include="x11\cuda_x11_simd512_sm2.cuh" />
<ClInclude Include="x16\cuda_x16.h" />
<CudaCompile Include="Algo256\bmw.cu" />
Expand Down Expand Up @@ -338,8 +332,6 @@
<ClCompile Include="sph\hamsi.c" />
<ClCompile Include="sph\hamsi_helper.c" />
<ClCompile Include="sph\whirlpool.c" />
<ClCompile Include="verus\haraka.c" />
<ClCompile Include="verus\verusscan.cu" />
<ClCompile Include="x13\sm3.c" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -443,7 +435,6 @@
<CudaCompile Include="sha256\sha256d.cu" />
<CudaCompile Include="sha256\cuda_sha256t.cu" />
<CudaCompile Include="sha256\sha256t.cu" />
<CudaCompile Include="verus\verus.cu" />
<CudaCompile Include="zr5.cu" />
<CudaCompile Include="heavy\cuda_blake512.cu">
</CudaCompile>
Expand Down Expand Up @@ -632,7 +623,7 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.2.targets" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.0.targets" />
</ImportGroup>
<!-- Copy the required dlls -->
<Target Name="AfterBuild">
Expand All @@ -641,4 +632,4 @@
<Target Name="AfterClean">
<Delete Files="@(FilesToCopy->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" />
</Target>
</Project>
</Project>
14 changes: 1 addition & 13 deletions ccminer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@
<ClCompile Include="equi\blake2\blake2bx.cpp">
<Filter>Source Files\equi</Filter>
</ClCompile>
<ClCompile Include="verus\haraka.c">
<Filter>Source Files\CUDA</Filter>
</ClCompile>
<ClCompile Include="verus\verusscan.cu">
<Filter>Source Files\CUDA</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="algos.h">
Expand Down Expand Up @@ -617,9 +611,6 @@
<ClInclude Include="x16\cuda_x16.h">
<Filter>Header Files\CUDA</Filter>
</ClInclude>
<ClInclude Include="verus\haraka.h">
<Filter>Source Files\CUDA</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CudaCompile Include="cuda.cpp">
Expand Down Expand Up @@ -1033,9 +1024,6 @@
<CudaCompile Include="x16\x16s.cu">
<Filter>Source Files\CUDA\x16</Filter>
</CudaCompile>
<CudaCompile Include="verus\verus.cu">
<Filter>Source Files\CUDA</Filter>
</CudaCompile>
</ItemGroup>
<ItemGroup>
<Image Include="res\ccminer.ico">
Expand All @@ -1052,4 +1040,4 @@
<Filter>Ressources</Filter>
</Text>
</ItemGroup>
</Project>
</Project>
Loading

0 comments on commit 1a1b196

Please sign in to comment.