Compare commits

...

239 Commits

Author SHA1 Message Date
XMRig
d97b5a7552 v6.5.1 2020-11-08 15:47:12 +07:00
XMRig
cbd0c45c2b Merge branch 'dev' 2020-11-08 15:46:32 +07:00
xmrig
e5fd83554b Update CHANGELOG.md 2020-11-08 15:22:51 +07:00
xmrig
c9e17780e7 Update README.md 2020-11-07 20:04:22 +07:00
xmrig
5df1686810 Merge pull request #1932 from SChernykh/dev
New MSR mod for Ryzen
2020-11-07 13:09:21 +07:00
SChernykh
1e3e8ff8ee Update RxConfig.cpp 2020-11-06 22:59:18 +01:00
SChernykh
d4750239ea New MSR mod for Ryzen
+3.5% on Zen2, +1-2% on Zen3
2020-11-06 22:56:09 +01:00
XMRig
99e9073993 Fixed build without HTTP. 2020-11-03 00:21:22 +07:00
XMRig
51690ebad6 #1918 Fixed check for 1GB huge pages on ARM Linux. 2020-11-02 21:26:35 +07:00
xmrig
5ac908c027 Merge pull request #1926 from SChernykh/dev
Fix compilation on ARMv8 with GCC 9.3.0
2020-11-02 19:55:29 +07:00
SChernykh
f1a24b7ddd Fix compilation on ARMv8 with GCC 9.3.0 2020-11-02 13:50:10 +01:00
XMRig
f977b31331 v6.5.1-dev 2020-11-02 19:33:49 +07:00
XMRig
80b980c9d3 Merge branch 'master' into dev 2020-11-02 19:33:04 +07:00
XMRig
ddb4f9be76 v6.5.0 2020-11-02 14:37:29 +07:00
XMRig
a87d9d31e2 Merge branch 'dev' 2020-11-02 14:36:51 +07:00
XMRig
6c26e04fbe Merge branch 'nopeinomicon-patch-1' into dev 2020-11-02 13:57:27 +07:00
XMRig
eb95d0339e Update Process class and use APP_ID instead of hardcoded config name for #1925 2020-11-02 13:56:21 +07:00
XMRig
e295a938f8 Merge branch 'patch-1' of https://github.com/nopeinomicon/xmrig into nopeinomicon-patch-1 2020-11-02 12:59:36 +07:00
Emily Roberts
bccffa63a4 Add checking for config files in user home directory
Check for configuration files in the home directory to make packaging XMRig for Linux easier.
2020-11-01 16:17:23 -07:00
xmrig
ca6ca4cb67 Update CHANGELOG.md 2020-11-01 23:52:44 +07:00
XMRig
3910cf9e69 Added vendor to ARM CPUs name and added "arch" field. 2020-11-01 12:06:35 +07:00
XMRig
5d274777f6 Copy benchmark_1M.cmd and benchmark_10M.cmd 2020-10-31 18:38:18 +07:00
XMRig
dad1fdb505 Update build.uv.sh and build.openssl.sh. 2020-10-31 14:15:53 +07:00
XMRig
565d36d9e4 Fix build. 2020-10-30 23:42:09 +07:00
XMRig
e32e22474a v6.5.0-dev 2020-10-30 23:26:07 +07:00
XMRig
905713f1ca Merge branch 'feature-bench-submit' into dev 2020-10-30 23:25:09 +07:00
XMRig
5f314edb2f Print benchmark url 2020-10-30 23:24:01 +07:00
xmrig
315d74c319 Merge pull request #1917 from SChernykh/dev
Fixed Debug build in Visual Studio
2020-10-27 20:37:22 +07:00
SChernykh
6b7b3511ce Also fix RelWithDebIfno build in Visual Studio 2020-10-27 14:25:43 +01:00
SChernykh
50bdaba526 Fixed Debug build in Visual Studio 2020-10-27 14:08:36 +01:00
XMRig
4914fefb1f Added "msr" field for CPU backend. 2020-10-25 16:36:37 +07:00
XMRig
03cd56ed73 Implemented PATCH requests. 2020-10-25 13:41:39 +07:00
XMRig
79c96418c7 Implemented BenchClient. 2020-10-24 19:43:23 +07:00
XMRig
36c1cb23e0 Implemented static benchmark verification (--bench --seed --hash) 2020-10-24 13:53:49 +07:00
xmrig
6dba0635f1 Merge pull request #1912 from cohcho/fix_msr
MSR: supress kernel module warning
2020-10-23 20:48:40 +07:00
cohcho
99b58580e9 MSR: supress kernel module warning 2020-10-23 13:09:13 +00:00
XMRig
027a6f8ae2 Added BenchConfig class. 2020-10-22 17:33:41 +07:00
xmrig
a3daaf09f5 Merge pull request #1907 from cohcho/fix_async_wrapper
Async: remove unreachable code
2020-10-21 15:58:01 +07:00
cohcho
da8b87b007 Async: remove unreachable code 2020-10-21 08:28:52 +00:00
XMRig
87b4d97798 New Async wrapper. 2020-10-21 08:09:44 +07:00
XMRig
6860450147 Removed legacy CUDA plugin API. 2020-10-20 18:04:56 +07:00
XMRig
b0de5aefb1 v6.4.1-dev 2020-10-19 05:09:30 +07:00
XMRig
d2e2f5f800 v6.4.1 2020-10-19 05:09:00 +07:00
XMRig
3088f915f9 Merge branch 'master' into dev 2020-10-19 05:08:35 +07:00
XMRig
4c5421b2bf v6.4.0 2020-10-19 03:21:04 +07:00
XMRig
6dd281b508 Merge branch 'dev' 2020-10-19 03:20:21 +07:00
xmrig
599958c982 Update CHANGELOG.md 2020-10-18 02:10:03 +07:00
XMRig
328f985e07 Added Benchmark class. 2020-10-17 04:03:42 +07:00
XMRig
7fc7b976bf Removed m_bench field from Job class. 2020-10-16 20:29:11 +07:00
XMRig
36b1523194 Code cleanup. 2020-10-16 19:35:36 +07:00
XMRig
5155139e9a Improve some benchmark log messages. 2020-10-16 04:11:50 +07:00
XMRig
a152d6be42 Added CMake option WITH_BENCHMARK. 2020-10-16 02:18:07 +07:00
xmrig
ccebf6bb20 Merge pull request #1901 from cohcho/fix_math1
WorkerJob: fix calls of add/nextRound
2020-10-15 22:29:20 +07:00
cohcho
5b4648339a WorkerJob: fix calls of add/nextRound
WorkerJob::nextRound() doesn't require roundSize to be power of 2
Use CudaWorker::intensity(), OclWorker::intensity() to get device batch size
Sync nonce and device iteration
2020-10-15 14:56:37 +00:00
xmrig
7727014eea Merge pull request #1900 from SChernykh/dev
Fixed roundSize() usage in OCL/CUDA
2020-10-15 19:44:03 +07:00
SChernykh
8c45e3226d Fixed roundSize() usage in OCL/CUDA 2020-10-15 14:39:54 +02:00
xmrig
75403ee275 Merge pull request #1899 from SChernykh/dev
Make round size power of 2
2020-10-15 19:33:32 +07:00
SChernykh
c4db1435b2 Make round size power of 2 2020-10-15 14:29:15 +02:00
xmrig
f3ea3c5227 Merge pull request #1897 from SChernykh/dev
Benchmark: added more check hashes and a progress indicator
2020-10-15 15:08:33 +07:00
SChernykh
722e468bd9 Benchmark: added more check hashes and a progress indicator 2020-10-15 08:23:47 +02:00
xmrig
9569772e7e Merge pull request #1895 from SChernykh/dev
Added benchmark and stress test
2020-10-15 02:16:37 +07:00
SChernykh
144f9c4409 Fixed compile errors in Linux 2020-10-14 21:03:21 +02:00
SChernykh
2ecece7b3d Added benchmark and stress test
Easy to use and zero configuration embedded benchmark/stress test.
2020-10-14 19:45:05 +02:00
xmrig
677d287135 Merge pull request #1893 from cohcho/fix_partial_read
LineReader: fix partial read
2020-10-14 14:47:51 +07:00
XMRig
62eb66486d Added copyright. 2020-10-13 23:27:47 +07:00
cohcho
da03d74ade LineReader: fix partial read 2020-10-13 16:11:39 +00:00
xmrig
9fcc542676 Merge pull request #1889 from cohcho/fix_uv_issue
uv: fix performance issue
2020-10-13 22:35:29 +07:00
xmrig
581d004568 Merge pull request #1890 from SChernykh/dev
Added argon2/chukwav2 algorithm
2020-10-13 14:54:34 +07:00
SChernykh
4f7186cb0e Added argon2/chukwav2 algorithm
New Turtlecoin algorithm. Source: https://github.com/turtlecoin/turtlecoin/blob/development/src/crypto/hash.h#L57
2020-10-12 08:26:57 +02:00
cohcho
65fa1d9bf3 uv: fix performance issue
unix implementation of uv_async_t has been wasting cpu cycles for nothing since 1.29.0 release
implement efficient callback scheduling for linux
2020-10-12 04:09:09 +00:00
xmrig
f85efd163c Merge pull request #1887 from SChernykh/dev
Fixed total hashrate update
2020-10-10 22:07:37 +07:00
xmrig
eb8cf3ee5a Merge pull request #1886 from cohcho/fix_cpu_stats
CPU: use raw counter
2020-10-10 22:07:23 +07:00
SChernykh
793a2454ad Fixed total hashrate update
Don't add data points where one of the threads doesn't have hashrate data yet.
2020-10-10 17:00:30 +02:00
cohcho
4a74ce3242 CPU: use raw counter 2020-10-10 13:28:14 +00:00
xmrig
87a54766eb Merge pull request #1885 from SChernykh/dev
More precise hashrate calculation
2020-10-10 16:35:14 +07:00
SChernykh
22a69f70da Fix HashrateInterpolator::addDataPoint 2020-10-10 11:22:19 +02:00
SChernykh
3fbf2ac3d4 More precise hashrate calculation
- Use only steady timestamp counters to guarantee correctness
- CPU backend: directly measure total hashrate using raw hash counters from each thread; update data more often on ARM CPUs because they're slower
- GPU backends: directly measure total hashrate too, but use interpolator with 4 second lag to fix variance from batches of hashes

Total hashrate is now measured directly (realtime for CPU, 4 seconds lag for GPU), so it might differ a bit from the sum of all thread hashrates because data points are taken at different moments in time.

Overhead is reduced a lot since it doesn't have to go through all threads to calculate max total hashrate on every timer tick (2 times a second).
2020-10-10 11:18:01 +02:00
xmrig
0a2fe5caa7 Merge pull request #1882 from cohcho/fix_atomic_init
Worker: specify default value
2020-10-09 21:35:34 +07:00
cohcho
17795e3d7b Worker: specify default value 2020-10-09 14:28:36 +00:00
xmrig
1fdc8631e3 Merge pull request #1881 from SChernykh/dev
Fix possible race condition in hashrate counting code
2020-10-09 19:47:36 +07:00
SChernykh
858463ceba Change to fetch_xor to make code simpler 2020-10-09 11:50:11 +02:00
SChernykh
a4550f55ea Fix possible race condition in hashrate counting code
Use single atomic operation to switch between data points.
2020-10-09 10:29:18 +02:00
xmrig
d9b6f46a6a Merge pull request #1879 from SChernykh/dev
Fix 32-bit compilation
2020-10-07 23:22:14 +07:00
SChernykh
4bac3e7695 Fix 32-bit compilation 2020-10-07 18:19:35 +02:00
xmrig
59bd6d4187 Merge pull request #1878 from SChernykh/dev
Fixed ARM compilation
2020-10-07 23:11:39 +07:00
SChernykh
166c011d37 Fixed ARM compilation 2020-10-07 18:09:42 +02:00
xmrig
1f55c6eb02 Merge pull request #1877 from SChernykh/dev
Fix FreeBSD compilation
2020-10-07 23:03:07 +07:00
SChernykh
c2bdae70fe Fix FreeBSD compilation 2020-10-07 18:00:36 +02:00
xmrig
1289942567 Merge pull request #1876 from SChernykh/dev
RandomX: added `huge-pages-jit` config parameter
2020-10-07 22:48:57 +07:00
SChernykh
44dcded866 RandomX: added huge-pages-jit config parameter
Set to false by default, gives 0.2% boost on Ryzen 7 3700X with 16 threads, but hashrate might be unstable on Ryzen between launches. Use with caution.
2020-10-07 17:42:55 +02:00
xmrig
8deb247b3e Merge pull request #1875 from cohcho/fix_alignment
RandomX: align args
2020-10-07 22:42:22 +07:00
cohcho
a705ab775b RandomX: align args
tempHash/output must be 16-byte aligned for randomx_calculate_hash{,_first,_next}
2020-10-07 14:47:18 +00:00
xmrig
bfd5a81937 Merge pull request #1874 from cohcho/fix_vm_create1
RxVM: fix compilation error
2020-10-07 18:16:59 +07:00
cohcho
c710ee5fb5 RxVM: fix compilation error 2020-10-07 09:27:25 +00:00
SChernykh
a8466a139c RandomX: allocate 2 MB pages for generated code, if possible
+0.2% boost on Ryzen 7 3700X
2020-10-07 10:35:10 +02:00
xmrig
ba47219185 Merge pull request #1870 from cohcho/fix_miner_state_machine
Miner: fix state machine
2020-10-07 12:25:17 +07:00
xmrig
cf54c85b76 Merge pull request #1872 from cohcho/fix_vm_create
RxVm: fix randomx_create_vm call
2020-10-07 12:22:54 +07:00
cohcho
fa5b872782 RxVm: fix randomx_create_vm call
randomx_create_vm requires either cache or dataset, but not both
2020-10-06 19:45:43 +00:00
cohcho
3ee0cd8c51 Miner: fix state machine
Remove unexpected resume due to disconnect during dataset init
2020-10-06 13:34:19 +00:00
cohcho
7bdeba4d08 Nonce: refactor static init 2020-10-06 13:34:19 +00:00
xmrig
116fb3d3f9 Merge pull request #1864 from cohcho/soft_aes_optimization2
soft_aes: fix previous optimization
2020-10-05 12:20:41 +07:00
xmrig
54a17a75ab Merge pull request #1862 from SChernykh/dev
RandomX: removed rx/loki
2020-10-05 12:19:43 +07:00
cohcho
5f0f2506e8 soft_aes: fix previous optimization
Previously removed unrolled variant is faster on some CPUs
Some CPUs are faster with added unrolled variant
The best variant depends on number of threads on some CPUs
2020-10-04 14:47:58 +00:00
XMRig
31e896feef v6.4.0-dev 2020-10-03 13:49:40 +07:00
XMRig
8bfd7bcf05 Merge branch 'master' into dev 2020-10-03 13:48:22 +07:00
XMRig
ec13337228 v6.3.5 2020-10-03 11:48:34 +07:00
XMRig
cfe2a098ce Merge branch 'dev' 2020-10-03 11:47:07 +07:00
xmrig
a89c2c8dd1 Update CHANGELOG.md 2020-10-02 22:39:26 +07:00
SChernykh
ebf259fa7c RandomX: removed rx/loki
Loki forks to PoS on October 9th.
2020-10-02 17:02:52 +02:00
XMRig
1b4a124bc5 Fix x86 build. 2020-10-01 17:46:05 +07:00
XMRig
4bb8be8a29 Merge branch 'ph4r05-pr/001-with-sse' into dev 2020-10-01 11:00:52 +07:00
XMRig
d45bb24a32 Renamed WITH_SSE to WITH_SSE4_1 and make it work on all platforms. 2020-10-01 11:00:08 +07:00
Dusan Klinec
5a7bcb2d03 fies #1844, adds WITH_SSE cmake option
now it is possible to disable sse for Blake2, which is not supported on ARMs
2020-09-30 20:09:54 +02:00
xmrig
f1ec8a18f6 Merge pull request #1859 from SChernykh/dev
RandomX: optimized soft AES code
2020-09-30 09:01:45 +07:00
SChernykh
7b4f768114 RandomX: optimized soft AES code
Unrolled loop was 5-10% slower depending on CPU.
2020-09-29 21:22:11 +02:00
xmrig
dfab81e9fa Merge pull request #1858 from SChernykh/dev
RandomX: removed duplicate constants in Blake2b
2020-09-27 16:51:03 +07:00
SChernykh
3025c265e8 RandomX: removed duplicate constatns in Blake2b 2020-09-27 11:50:08 +02:00
xmrig
ee603ab9e2 Merge pull request #1857 from SChernykh/dev
RandomX: isolate SSE4.1 code to fix crashes on old CPUs
2020-09-27 16:47:56 +07:00
SChernykh
84f8a0dc54 RandomX: isolate SSE4.1 code to fix crashes on old CPUs 2020-09-27 11:46:32 +02:00
xmrig
481deff163 Merge pull request #1856 from SChernykh/dev
Fixed SSE4.1 for old CPUs
2020-09-27 14:01:34 +07:00
SChernykh
0e9ed351a1 Fixed SSE4.1 for old CPUs
Enable SSE4.1 only where it's needed.
2020-09-27 08:55:57 +02:00
xmrig
8952f6892d Merge pull request #1852 from cohcho/fix_string
String: distinguish nullptr/empty str
2020-09-27 07:56:33 +07:00
xmrig
d51fe01273 Merge pull request #1849 from cohcho/soft_aes_optimization1
soft_aes: fix previous optimization
2020-09-27 07:56:03 +07:00
cohcho
f7d6348948 String: distinguish nullptr/empty str 2020-09-26 16:41:15 +00:00
xmrig
3a01ebe277 Merge pull request #1850 from cohcho/filter_invalid_algos
Miner: filter invalid algos
2020-09-26 15:15:23 +07:00
cohcho
189cc78d44 Miner: filter invalid algos 2020-09-25 17:52:13 +00:00
cohcho
9be3b69109 soft_aes: fix previous optimization
the best order of hash/fill/prefetch depends on hw/soft AES
only hw AES is faster after previous optimization
2020-09-25 15:26:19 +00:00
xmrig
7b38af703e Merge pull request #1846 from SChernykh/dev
KawPow: fixed OpenCL memory leak
2020-09-25 15:55:36 +07:00
SChernykh
bef9031b03 KawPow: fixed OpenCL memory leak 2020-09-25 10:53:24 +02:00
xmrig
e4929d7c06 Merge pull request #1845 from SChernykh/dev
Fix for ARM compilation
2020-09-23 16:48:08 +07:00
SChernykh
1e26e58660 Fix for ARM compilation 2020-09-23 11:44:08 +02:00
XMRig
8fe0577d60 v6.3.5-dev 2020-09-23 08:06:28 +07:00
XMRig
64f42feba9 Merge branch 'master' into dev 2020-09-23 08:05:58 +07:00
XMRig
36ed0b4309 v6.3.4 2020-09-23 06:00:07 +07:00
XMRig
cb0bba7e10 Merge branch 'dev' 2020-09-23 05:59:35 +07:00
xmrig
51a72afb0e Update CHANGELOG.md 2020-09-23 05:29:29 +07:00
xmrig
b1b0a3ba95 Merge pull request #1843 from SChernykh/dev
RandomX improved performance of GCC compiled binaries
2020-09-23 04:44:47 +07:00
SChernykh
9768bf65d1 RandomX improved performance of GCC compiled binaries
JIT compilator was slower compared to MSVC compiled binary. Up to +0.1% speedup on rx/wow in Linux.
2020-09-22 13:48:11 +02:00
xmrig
1584cca6d1 Merge pull request #1842 from SChernykh/dev
RandomX: AES improvements
2020-09-22 03:13:23 +07:00
SChernykh
891a46382e RandomX: AES improvements
- A bit faster hardware AES code when compiled with MSVC
- More reliable software AES benchmark
2020-09-21 17:51:08 +02:00
xmrig
db920e8006 Merge pull request #1841 from SChernykh/dev
Fixed Cryptonight OpenCL for AMD 20.7.2 drivers
2020-09-20 04:14:49 +07:00
SChernykh
768a4581e0 Fixed Cryptonight OpenCL for AMD 20.7.2 drivers
Vega 64 + Windows 10 + AMD 20.7.2 drivers were broken on Cryptonight algorithms.
2020-09-19 23:12:05 +02:00
xmrig
866245b525 Merge pull request #1840 from SChernykh/dev
RandomX refactoring, moved more stuff to compile time
2020-09-19 02:01:06 +07:00
SChernykh
c7476e076b RandomX refactoring, moved more stuff to compile time
Small x86 JIT compiler speedup.
2020-09-18 20:51:25 +02:00
xmrig
d11a313d88 Merge pull request #1835 from SChernykh/dev
RandomX: returned old soft AES impl and auto-select between the two
2020-09-16 01:54:40 +07:00
SChernykh
8d1168385a RandomX: returned old soft AES impl and auto-select between the two 2020-09-15 20:48:27 +02:00
xmrig
852fe14604 Merge pull request #1831 from cohcho/nonce_iteration_without_tests
reserve at most 1 bit for wrapping detection
2020-09-14 02:12:49 +07:00
cohcho
30be1cd102 reserve at most 1 bit for wrapping detection 2020-09-13 18:42:16 +00:00
xmrig
fa0bb0e1bf Merge pull request #1830 from SChernykh/dev
RandomX: added performance profiler (for developers)
2020-09-13 04:38:03 +07:00
SChernykh
a05393727c RandomX: added performance profiler (for developers)
Also optimized Blake2b SSE4.1 code size to avoid code cache pollution.
2020-09-12 23:07:52 +02:00
xmrig
adf833b60a Merge pull request #1827 from cohcho/nonce_iteration_without_tests
nonce iteration optimization
2020-09-10 19:33:23 +07:00
xmrig
23daceb4dc Merge pull request #1828 from SChernykh/dev
RandomX: added SSE4.1-optimized Blake2b
2020-09-10 19:31:51 +07:00
SChernykh
4a9db89527 RandomX: added SSE4.1-optimized Blake2b
+0.15% on `rx/0`
+0.3% on `rx/wow`
2020-09-10 14:28:40 +02:00
cohcho
060c1af4c4 fix nonce mask 2020-09-09 19:39:52 +00:00
cohcho
b826985d05 nonce iteration optimization
efficient and correct nonce iteration without duplicates
2020-09-09 10:03:37 +00:00
xmrig
0f09883429 Merge pull request #1823 from SChernykh/dev
RandomX: added parameter for scratchpad prefetch mode
2020-09-04 21:31:18 +07:00
SChernykh
a84b45b1bb RandomX: added parameter for scratchpad prefetch mode
`scratchpad_prefetch_mode` can have 4 values:
0: off
1: use `prefetcht0` instruction (default, same as previous XMRig versions)
2: use `prefetchnta` instruction (faster on Coffee Lake and a few other CPUs)
3: use `mov` instruction
2020-09-04 16:16:07 +02:00
XMRig
a5b6383f7b v6.3.4 2020-08-28 23:50:16 +07:00
XMRig
24f8f76714 Merge branch 'master' into dev 2020-08-28 23:49:47 +07:00
XMRig
ba336122c0 v6.3.3 2020-08-28 21:39:26 +07:00
XMRig
591744174c Merge branch 'dev' 2020-08-28 21:38:55 +07:00
xmrig
fc85017948 Update CHANGELOG.md 2020-08-28 21:25:26 +07:00
xmrig
24f541a0dd Update README.md 2020-08-26 23:09:05 +07:00
XMRig
f552577e71 Merge branch 'dev' of github.com:xmrig/xmrig into dev 2020-08-26 16:11:48 +07:00
XMRig
a06ec06e8b Fix colors on macOS. 2020-08-26 16:11:29 +07:00
xmrig
96833d4790 Merge pull request #1817 from SChernykh/dev
Fixed self-select login sequence
2020-08-25 21:23:19 +07:00
SChernykh
5611ae9a30 Fixed self-select login sequence
In self-select mode, we only have pool wallet right after login.
2020-08-25 16:17:48 +02:00
XMRig
72c8404d18 Fix compile warnings. 2020-08-24 10:04:46 +07:00
XMRig
bc128d11d9 Add strip for clang. 2020-08-23 23:48:05 +07:00
XMRig
ff13675d31 Improved CUDA loader error reporting and fixed plugin load on Linux. 2020-08-23 21:30:12 +07:00
XMRig
4b682b6633 Better scripts/build.*.sh compatibility. 2020-08-23 15:46:56 +07:00
XMRig
879e160ba3 Fix compile warning. 2020-08-23 14:22:08 +07:00
XMRig
9a6b8594f3 Removed bzip2 dependency for hwloc build. 2020-08-21 09:14:22 +07:00
XMRig
a354e9d217 Fixed tag in OclLib. 2020-08-21 08:21:51 +07:00
XMRig
950b5fa75e Disable GPU backends with static build on Linux. 2020-08-20 15:02:31 +07:00
XMRig
9f66d59c0a Merge branch 'master' of https://github.com/alxnegrila/xmrig into dev 2020-08-20 14:40:53 +07:00
XMRig
9d99fef52e v6.3.3-dev 2020-08-20 13:54:52 +07:00
XMRig
3b22f1704f Merge branch 'master' into dev 2020-08-20 13:54:24 +07:00
xmrig
c89ad6b36d Update README.md 2020-08-20 13:44:20 +07:00
xmrig
45300f1ff5 Update README.md 2020-08-20 13:43:20 +07:00
XMRig
847d08cdbc v6.3.2 2020-08-20 12:54:22 +07:00
XMRig
81af1e964d Merge branch 'dev' 2020-08-20 12:53:45 +07:00
xmrig
3662e45435 Update CHANGELOG.md 2020-08-20 12:49:31 +07:00
XMRig
f06e30e343 Merge branch 'battery-macos' of https://github.com/jtgrassie/xmrig into dev 2020-08-20 12:46:09 +07:00
xmrig
34d4aa4012 Update CHANGELOG.md 2020-08-19 07:42:10 +07:00
XMRig
3e4bf8cd6c Fix compile warning 2020-08-17 06:08:14 +07:00
XMRig
206b675892 Always use all available threads on ARM. 2020-08-16 17:36:38 +07:00
XMRig
00b4ae9c36 Fixed compile warning and updated build.uv.sh. 2020-08-16 16:03:27 +07:00
XMRig
8d5ea745bb Merge branch 'dev' of github.com:xmrig/xmrig into dev 2020-08-16 15:47:57 +07:00
XMRig
cac48cdd27 Added ARM CPU name detection based on lscpu code. 2020-08-16 15:47:29 +07:00
xmrig
c20010ed54 Merge pull request #1807 from SChernykh/dev
RandomX JIT: optimized address mask calculation
2020-08-12 21:48:20 +07:00
SChernykh
5926dee354 RandomX JIT: optimized address mask calculation 2020-08-12 16:45:16 +02:00
Jethro Grassie
b78b0b5c6b fix macos battery detection 2020-08-11 18:04:56 -04:00
XMRig
43afa437e4 Merge branch 'dev' of github.com:xmrig/xmrig into dev 2020-08-07 21:55:06 +07:00
XMRig
050568a4ab Fixed rare protocol error in HTTP client. 2020-08-07 21:54:22 +07:00
xmrig
8bf40cea36 Update CHANGELOG.md 2020-08-01 13:02:11 +07:00
XMRig
ae3ff0f570 Fixed RandomX cache initialization if 1GB pages fails to allocate on a first NUMA node. 2020-08-01 12:30:02 +07:00
xmrig
0addf91a70 Merge pull request #1794 from SChernykh/dev
More robust 1 GB pages handling
2020-07-31 20:45:27 +07:00
SChernykh
abb78302b8 Try to allocate scratchpad from dataset's 1 GB huge pages, if normal huge pages are not available 2020-07-31 13:37:22 +02:00
XMRig
e5579d8635 v6.3.2-dev 2020-07-31 16:50:23 +07:00
XMRig
3986c43fa5 Merge branch 'master' into dev 2020-07-31 16:48:54 +07:00
SChernykh
838cc08680 Force 2 MB pages size in allocateLargePagesMemory() on Linux 2020-07-31 09:55:49 +02:00
XMRig
a0fe49f946 v6.3.1 2020-07-31 13:20:56 +07:00
XMRig
70dbe8562c Merge branch 'dev' 2020-07-31 13:20:11 +07:00
xmrig
41fcd1e49a Update CHANGELOG.md 2020-07-31 13:16:58 +07:00
xmrig
90195caa1d Merge pull request #1792 from SChernykh/dev
Fixed crash in RelWithDbgInfo MSVC build
2020-07-29 15:42:09 +07:00
SChernykh
cdb6287d89 Fixed crash in RelWithDbgInfo MSVC build
Same problem as in https://github.com/xmrig/xmrig/pull/1784 , fixed with compiler flags this time.
2020-07-29 10:39:58 +02:00
XMRig
32e9b7e34a Added command line option --pause-on-battery and renamed config option. 2020-07-23 15:45:01 +07:00
XMRig
6484bbb716 Add tags 2020-07-23 10:26:56 +07:00
xmrig
e59806d6ae Merge pull request #1786 from SChernykh/dev
Added mining on battery setting
2020-07-23 09:20:06 +07:00
SChernykh
299b180b28 Added mining on battery setting 2020-07-22 20:21:42 +02:00
XMRig
1acd88ed39 Cleanup 2020-07-22 21:27:40 +07:00
XMRig
109c088e8a Cleanup usage output. 2020-07-22 19:58:08 +07:00
xmrig
bb18239642 Update README.md 2020-07-22 09:14:25 +07:00
xmrig
ccded7cc0a Merge pull request #1784 from SChernykh/dev
Fixed RandomX initialization for VS debug builds
2020-07-21 19:04:02 +07:00
SChernykh
5bc89fdc8b Fixed RandomX initialization for VS debug builds 2020-07-21 10:10:07 +02:00
XMRig
70c7f33a20 Added command line options --cache-qos (--randomx-cache-qos) and --argon2-impl (--cpu-argon2-impl). 2020-07-20 09:17:59 +07:00
XMRig
1ec185a3a0 v6.3.1-dev 2020-07-17 03:13:02 +07:00
XMRig
6aa4eeefbb Merge branch 'master' into dev 2020-07-17 03:12:36 +07:00
XMRig
10ea567084 v6.3.0 2020-07-17 00:17:55 +07:00
XMRig
028d6503aa Merge branch 'dev' 2020-07-17 00:17:24 +07:00
XMRig
51346c2b2b v6.3.0-dev 2020-07-17 00:04:31 +07:00
XMRig
ca535c7813 Sync changes with the proxy. 2020-07-16 23:29:21 +07:00
xmrig
ba80e27349 Merge pull request #1780 from SChernykh/dev
Cryptonight OpenCL: fix for long input data
2020-07-16 19:56:20 +07:00
SChernykh
bd8cf54a0b Cryptonight OpenCL: fix for long input data 2020-07-16 10:39:32 +02:00
XMRig
e0eed7d5d6 Fixed build without MSR support. 2020-07-16 05:15:35 +07:00
XMRig
8dff08f15f Merge branch 'haven-protocol-org-master' into dev 2020-07-15 23:33:53 +07:00
XMRig
47d68b068b Merge branch 'master' of https://github.com/haven-protocol-org/xmrig into haven-protocol-org-master 2020-07-15 23:33:17 +07:00
Neil Coggins
a648a8b9be Increased max blob size to support Haven offshore capability 2020-07-14 11:52:43 +01:00
xmrig
7eefccc6bc Merge pull request #1776 from SChernykh/dev
Removed cache QoS warning at exit on unsupported CPUs
2020-07-14 01:45:18 +07:00
SChernykh
1bf159d1e8 Removed cache QoS warning at exit on unsupported CPUs 2020-07-13 20:43:49 +02:00
xmrig
bf46cb8684 Merge pull request #1774 from SChernykh/dev
RandomX: added cache QoS support
2020-07-14 01:35:46 +07:00
SChernykh
72c385c870 Cache QoS: fix for seting MSR 2020-07-13 20:30:44 +02:00
SChernykh
c83429c55c RandomX: added cache QoS support
False by default. If set to true, all non-mining CPU cores will not have access to L3 cache.
2020-07-13 17:23:18 +02:00
xmrig
e5a2689052 Merge pull request #1771 from jserv/update-sse2neon
Adopt new SSE2NEON and reduce ARM-specific changes
2020-07-11 02:32:56 +07:00
Jim Huang
b665d2d865 Adopt new SSE2NEON and reduce ARM-specific changes
This patch updated SSE2NEON [1], which contains more functions
provided by Intel intrinsics, only implemented with NEON-based
counterparts to produce the exact semantics of the intrinsics.
Consequently, ARM-specific changes against CryptoNight_arm can
be reduced as well.

[1] https://github.com/DLTcollab/sse2neon/
2020-07-11 01:55:11 +08:00
XMRig
e06a76ef1c v6.2.4-dev 2020-07-10 03:12:00 +07:00
XMRig
f523fddbfd Merge branch 'master' into dev 2020-07-10 02:49:33 +07:00
Alexandru Negrila
89e6998054 Fix OpenSSL static link when BUILD_STATIC=ON is provided 2020-04-09 09:09:21 +03:00
226 changed files with 28887 additions and 8941 deletions

View File

@ -1,3 +1,78 @@
# v6.5.1
- [#1932](https://github.com/xmrig/xmrig/pull/1932) New MSR mod for Ryzen, up to +3.5% on Zen2 and +1-2% on Zen3.
- [#1918](https://github.com/xmrig/xmrig/issues/1918) Fixed 1GB huge pages support on ARMv8.
- [#1926](https://github.com/xmrig/xmrig/pull/1926) Fixed compilation on ARMv8 with GCC 9.3.0.
- [#1929](https://github.com/xmrig/xmrig/issues/1929) Fixed build without HTTP.
# v6.5.0
- **Added [online benchmark](https://xmrig.com/benchmark) mode for sharing results.**
- Added new command line options: `--submit`, ` --verify=ID`, ` --seed=SEED`, `--hash=HASH`.
- [#1912](https://github.com/xmrig/xmrig/pull/1912) Fixed MSR kernel module warning with new Linux kernels.
- [#1925](https://github.com/xmrig/xmrig/pull/1925) Add checking for config files in user home directory.
- Added vendor to ARM CPUs name and added `"arch"` field to API.
- Removed legacy CUDA plugin API.
# v6.4.0
- [#1862](https://github.com/xmrig/xmrig/pull/1862) **RandomX: removed `rx/loki` algorithm.**
- [#1890](https://github.com/xmrig/xmrig/pull/1890) **Added `argon2/chukwav2` algorithm.**
- [#1895](https://github.com/xmrig/xmrig/pull/1895) [#1897](https://github.com/xmrig/xmrig/pull/1897) **Added [benchmark and stress test](https://github.com/xmrig/xmrig/blob/dev/doc/BENCHMARK.md).**
- [#1864](https://github.com/xmrig/xmrig/pull/1864) RandomX: improved software AES performance.
- [#1870](https://github.com/xmrig/xmrig/pull/1870) RandomX: fixed unexpected resume due to disconnect during dataset init.
- [#1872](https://github.com/xmrig/xmrig/pull/1872) RandomX: fixed `randomx_create_vm` call.
- [#1875](https://github.com/xmrig/xmrig/pull/1875) RandomX: fixed crash on x86.
- [#1876](https://github.com/xmrig/xmrig/pull/1876) RandomX: added `huge-pages-jit` config parameter.
- [#1881](https://github.com/xmrig/xmrig/pull/1881) Fixed possible race condition in hashrate counting code.
- [#1882](https://github.com/xmrig/xmrig/pull/1882) [#1886](https://github.com/xmrig/xmrig/pull/1886) [#1887](https://github.com/xmrig/xmrig/pull/1887) [#1893](https://github.com/xmrig/xmrig/pull/1893) General code improvements.
- [#1885](https://github.com/xmrig/xmrig/pull/1885) Added more precise hashrate calculation.
- [#1889](https://github.com/xmrig/xmrig/pull/1889) Fixed libuv performance issue on Linux.
# v6.3.5
- [#1845](https://github.com/xmrig/xmrig/pull/1845) [#1861](https://github.com/xmrig/xmrig/pull/1861) Fixed ARM build and added CMake option `WITH_SSE4_1`.
- [#1846](https://github.com/xmrig/xmrig/pull/1846) KawPow: fixed OpenCL memory leak.
- [#1849](https://github.com/xmrig/xmrig/pull/1849) [#1859](https://github.com/xmrig/xmrig/pull/1859) RandomX: optimized soft AES code.
- [#1850](https://github.com/xmrig/xmrig/pull/1850) [#1852](https://github.com/xmrig/xmrig/pull/1852) General code improvements.
- [#1853](https://github.com/xmrig/xmrig/issues/1853) [#1856](https://github.com/xmrig/xmrig/pull/1856) [#1857](https://github.com/xmrig/xmrig/pull/1857) Fixed crash on old CPUs.
# v6.3.4
- [#1823](https://github.com/xmrig/xmrig/pull/1823) RandomX: added new option `scratchpad_prefetch_mode`.
- [#1827](https://github.com/xmrig/xmrig/pull/1827) [#1831](https://github.com/xmrig/xmrig/pull/1831) Improved nonce iteration performance.
- [#1828](https://github.com/xmrig/xmrig/pull/1828) RandomX: added SSE4.1-optimized Blake2b.
- [#1830](https://github.com/xmrig/xmrig/pull/1830) RandomX: added performance profiler (for developers).
- [#1835](https://github.com/xmrig/xmrig/pull/1835) RandomX: returned old soft AES implementation and added auto-select between the two.
- [#1840](https://github.com/xmrig/xmrig/pull/1840) RandomX: moved more stuff to compile time, small x86 JIT compiler speedup.
- [#1841](https://github.com/xmrig/xmrig/pull/1841) Fixed Cryptonight OpenCL for AMD 20.7.2 drivers.
- [#1842](https://github.com/xmrig/xmrig/pull/1842) RandomX: AES improvements, a bit faster hardware AES code when compiled with MSVC.
- [#1843](https://github.com/xmrig/xmrig/pull/1843) RandomX: improved performance of GCC compiled binaries.
# v6.3.3
- [#1817](https://github.com/xmrig/xmrig/pull/1817) Fixed self-select login sequence.
- Added brand new [build from source](https://xmrig.com/docs/miner/build) documentation.
- New binary downloads for macOS (`macos-x64`), FreeBSD (`freebsd-static-x64`), Linux (`linux-static-x64`), Ubuntu 18.04 (`bionic-x64`), Ubuntu 20.04 (`focal-x64`).
- Generic Linux download `xenial-x64` renamed to `linux-x64`.
- Builds without SSL/TLS support are no longer provided.
- Improved CUDA loader error reporting and fixed plugin load on Linux.
- Fixed build warnings with Clang compiler.
- Fixed colors on macOS.
# v6.3.2
- [#1794](https://github.com/xmrig/xmrig/pull/1794) More robust 1 GB pages handling.
- Don't allocate 1 GB per thread if 1 GB is the default huge page size.
- Try to allocate scratchpad from dataset's 1 GB huge pages, if normal huge pages are not available.
- Correctly initialize RandomX cache if 1 GB pages fail to allocate on a first NUMA node.
- [#1806](https://github.com/xmrig/xmrig/pull/1806) Fixed macOS battery detection.
- [#1809](https://github.com/xmrig/xmrig/issues/1809) Improved auto configuration on ARM CPUs.
- Added retrieving ARM CPU names, based on lscpu code and database.
# v6.3.1
- [#1786](https://github.com/xmrig/xmrig/pull/1786) Added `pause-on-battery` option, supported on Windows and Linux.
- Added command line options `--randomx-cache-qos` and `--argon2-impl`.
# v6.3.0
- [#1771](https://github.com/xmrig/xmrig/pull/1771) Adopted new SSE2NEON and reduced ARM-specific changes.
- [#1774](https://github.com/xmrig/xmrig/pull/1774) RandomX: Added new option `cache_qos` in `randomx` object for cache QoS support.
- [#1777](https://github.com/xmrig/xmrig/pull/1777) Added support for upcoming Haven offshore fork.
- [#1780](https://github.com/xmrig/xmrig/pull/1780) CryptoNight OpenCL: fix for long input data.
# v6.2.3
- [#1745](https://github.com/xmrig/xmrig/pull/1745) AstroBWT: fixed OpenCL compilation on some systems.
- [#1749](https://github.com/xmrig/xmrig/pull/1749) KawPow: optimized CPU share verification.

View File

@ -23,6 +23,9 @@ option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (on
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
option(WITH_PROFILING "Enable profiling for developers" OFF)
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
option(BUILD_STATIC "Build static binary" OFF)
option(ARM_TARGET "Force use specific ARM target 8 or 7" 0)
@ -143,6 +146,8 @@ elseif (XMRIG_OS_APPLE)
src/App_unix.cpp
src/crypto/common/VirtualMemory_unix.cpp
)
find_library(IOKIT_LIBRARY IOKit)
set(EXTRA_LIBS ${IOKIT_LIBRARY})
else()
list(APPEND SOURCES_OS
src/App_unix.cpp
@ -196,10 +201,6 @@ include_directories(src)
include_directories(src/3rdparty)
include_directories(${UV_INCLUDE_DIR})
if (BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS " -static")
endif()
if (WITH_DEBUG_LOG)
add_definitions(/DAPP_DEBUG)
endif()
@ -208,6 +209,11 @@ add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURC
target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB} ${ARGON2_LIBRARY} ${ETHASH_LIBRARY})
if (WIN32)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/benchmark_1M.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/benchmark_10M.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_BUILD_TYPE STREQUAL Release)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_PROJECT_NAME})
endif()

121
README.md
View File

@ -2,130 +2,35 @@
[![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub license](https://img.shields.io/github/license/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/network)
XMRig High performance, open source, cross platform RandomX, KawPow, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows.
XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner and [RandomX benchmark](https://xmrig.com/benchmark). Official binaries are available for Windows, Linux, macOS and FreeBSD.
## Mining backends
- **CPU** (x64/x86/ARM)
- **CPU** (x64/ARMv8)
- **OpenCL** for AMD GPUs.
- **CUDA** for NVIDIA GPUs via external [CUDA plugin](https://github.com/xmrig/xmrig-cuda).
<img src="doc/screenshot_v5_2_0.png" width="833" >
## Download
* Binary releases: https://github.com/xmrig/xmrig/releases
* Git tree: https://github.com/xmrig/xmrig.git
* Clone with `git clone https://github.com/xmrig/xmrig.git` :hammer: [Build instructions](https://github.com/xmrig/xmrig/wiki/Build).
* **[Binary releases](https://github.com/xmrig/xmrig/releases)**
* **[Build from source](https://xmrig.com/docs/miner/build)**
## Usage
The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The command line interface does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.
The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The [command line interface](https://xmrig.com/docs/miner/command-line-options) does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.
* **[xmrig.com/wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner.
* **[workers.xmrig.info](http://workers.xmrig.info)** helps manage your miners via HTTP API.
### Command line options
```
Network:
-o, --url=URL URL of mining server
-a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms
--coin=COIN specify coin instead of algorithm
-u, --user=USERNAME username for mining server
-p, --pass=PASSWORD password for mining server
-O, --userpass=U:P username:password pair for mining server
-x, --proxy=HOST:PORT connect through a SOCKS5 proxy
-k, --keepalive send keepalive packet for prevent timeout (needs pool support)
--nicehash enable nicehash.com support
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
--tls enable SSL/TLS support (needs pool support)
--tls-fingerprint=HEX pool TLS certificate fingerprint for strict certificate pinning
--daemon use daemon RPC instead of pool for solo mining
--daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)
-r, --retries=N number of times to retry before switch to backup server (default: 5)
-R, --retry-pause=N time to pause between retries (default: 5)
--user-agent set custom user-agent string for pool
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)
--donate-over-proxy=N control donate over xmrig-proxy feature
CPU backend:
--no-cpu disable CPU mining backend
-t, --threads=N number of CPU threads
-v, --av=N algorithm variation, 0 auto select
--cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)
--cpu-max-threads-hint=N maximum CPU threads count (in percentage) hint for autoconfig
--cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)
--cpu-no-yield prefer maximum hashrate rather than system response/stability
--no-huge-pages disable huge pages support
--asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer
--randomx-init=N thread count to initialize RandomX dataset
--randomx-no-numa disable NUMA support for RandomX
--randomx-mode=MODE RandomX mode: auto, fast, light
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
--randomx-no-rdmsr disable reverting initial MSR values on exit
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
--astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm
API:
--api-worker-id=ID custom worker-id for API
--api-id=ID custom instance ID for API
--http-host=HOST bind host for HTTP API (default: 127.0.0.1)
--http-port=N bind port for HTTP API
--http-access-token=T access token for HTTP API
--http-no-restricted enable full remote access to HTTP API (only if access token set)
OpenCL backend:
--opencl enable OpenCL mining backend
--opencl-devices=N comma separated list of OpenCL devices to use
--opencl-platform=N OpenCL platform index or name
--opencl-loader=PATH path to OpenCL-ICD-Loader (OpenCL.dll or libOpenCL.so)
--opencl-no-cache disable OpenCL cache
--print-platforms print available OpenCL platforms and exit
CUDA backend:
--cuda enable CUDA mining backend
--cuda-loader=PATH path to CUDA plugin (xmrig-cuda.dll or libxmrig-cuda.so)
--cuda-devices=N comma separated list of CUDA devices to use
--cuda-bfactor-hint=N bfactor hint for autoconfig (0-12)
--cuda-bsleep-hint=N bsleep hint for autoconfig
--no-nvml disable NVML (NVIDIA Management Library) support
TLS:
--tls-gen=HOSTNAME generate TLS certificate for specific hostname
--tls-cert=FILE load TLS certificate chain from a file in the PEM format
--tls-cert-key=FILE load TLS certificate private key from a file in the PEM format
--tls-dhparam=FILE load DH parameters for DHE ciphers from a file in the PEM format
--tls-protocols=N enable specified TLS protocols, example: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
--tls-ciphers=S set list of available ciphers (TLSv1.2 and below)
--tls-ciphersuites=S set list of available TLSv1.3 ciphersuites
Logging:
-S, --syslog use system log for output messages
-l, --log-file=FILE log all output to a file
--print-time=N print hashrate report every N seconds
--health-print-time=N print health report every N seconds
--no-color disable colored output
--verbose verbose output
Misc:
-c, --config=FILE load a JSON-format configuration file
-B, --background run the miner in the background
-V, --version output version information and exit
-h, --help display this help and exit
--dry-run test configuration and exit
--export-topology export hwloc topology to a XML file and exit
--title set custom console window title
--no-title disable setting console window title
```
* **[Wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner.
* **[Workers](http://workers.xmrig.info)** helps manage your miners via HTTP API.
## Donations
* Default donation 5% (5 minutes in 100 minutes) can be reduced to 1% via option `donate-level` or disabled in source code.
* Default donation 1% (1 minute in 100 minutes) can be increased via option `donate-level` or disabled in source code.
* XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD`
* BTC: `1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT`
## Developers
* **[xmrig](https://github.com/xmrig)**
* **[sech1](https://github.com/SChernykh)**
## Contacts
* support@xmrig.com

View File

@ -10,6 +10,11 @@ if (WITH_TLS)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()
if (BUILD_STATIC)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()
find_package(OpenSSL)
if (OPENSSL_FOUND)

View File

@ -2,9 +2,10 @@ if (NOT CMAKE_SYSTEM_PROCESSOR)
message(WARNING "CMAKE_SYSTEM_PROCESSOR not defined")
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(/DRAPIDJSON_SSE2)
else()
set(WITH_SSE4_1 OFF)
endif()
if (NOT ARM_TARGET)
@ -41,3 +42,7 @@ if (ARM_TARGET AND ARM_TARGET GREATER 6)
add_definitions(/DXMRIG_ARMv7)
endif()
endif()
if (WITH_SSE4_1)
add_definitions(/DXMRIG_FEATURE_SSE4_1)
endif()

View File

@ -45,6 +45,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif()
if (BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
add_definitions(/D_GNU_SOURCE)
if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
@ -60,6 +64,9 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Oi /DNDEBUG /GL")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Ob1 /Zi /DRELWITHDEBINFO")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ob1 /Zi /DRELWITHDEBINFO")
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
add_definitions(/D_CRT_NONSTDC_NO_WARNINGS)
add_definitions(/DNOMINMAX)
@ -89,6 +96,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
endif()
endif()
if (BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
endif()
if (NOT WIN32)

View File

@ -62,6 +62,18 @@ if (WITH_RANDOMX)
)
# cheat because cmake and ccache hate each other
set_property(SOURCE src/crypto/randomx/jit_compiler_a64_static.S PROPERTY LANGUAGE C)
else()
list(APPEND SOURCES_CRYPTO
src/crypto/randomx/jit_compiler_fallback.cpp
)
endif()
if (WITH_SSE4_1)
list(APPEND SOURCES_CRYPTO src/crypto/randomx/blake2/blake2b_sse41.c)
if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
set_source_files_properties(src/crypto/randomx/blake2/blake2b_sse41.c PROPERTIES COMPILE_FLAGS -msse4.1)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES Clang)

29
doc/BENCHMARK.md Normal file
View File

@ -0,0 +1,29 @@
# Embedded benchmark
You can run with XMRig with the following commands:
```
xmrig --bench=1M
xmrig --bench=10M
xmrig --bench=1M -a rx/wow
xmrig --bench=10M -a rx/wow
```
This will run between 1 and 10 million RandomX hashes, depending on `bench` parameter, and print the time it took. First two commands use Monero variant (2 MB per thread, best for Zen2/Zen3 CPUs), second two commands use Wownero variant (1 MB per thread, useful for Intel and 1st gen Zen/Zen+ CPUs).
Checksum of all the hashes will be also printed to check stability of your hardware: if it's green then it's correct, if it's red then there was hardware error during computation. No Internet connection is required for the benchmark.
Double check that you see `Huge pages 100%` both for dataset and for all threads, and also check for `msr register values ... has been set successfully` - without this result will be far from the best. Running as administrator is required for MSR and huge pages to be set up properly.
![Benchmark example](https://i.imgur.com/PST3BYc.png)
### Benchmark with custom config
You can run benchmark with any configuration you want. Just start without command line parameteres, use regular config.json and add `"benchmark":"1M",` on the next line after pool url.
# Stress test
You can also run continuous stress-test that is as close to the real RandomX mining as possible and doesn't require any configuration:
```
xmrig --stress
xmrig --stress -a rx/wow
```
This will require Internet connection and will run indefinitely.

View File

@ -22,6 +22,7 @@ This feature add external dependency to libhwloc (1.10.0+) (except MSVC builds).
* **`-DWITH_EMBEDDED_CONFIG=ON`** Enable [embedded](https://github.com/xmrig/xmrig/issues/957) config support.
* **`-DWITH_OPENCL=OFF`** Disable OpenCL backend.
* **`-DWITH_CUDA=OFF`** Disable CUDA backend.
* **`-DWITH_SSE4_1=OFF`** Disable SSE 4.1 for Blake2 (useful for arm builds).
## Debug options

View File

@ -0,0 +1,3 @@
@echo off
xmrig.exe --bench=10M --submit
pause

3
scripts/benchmark_1M.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
xmrig.exe --bench=1M --submit
pause

View File

@ -8,12 +8,12 @@ mkdir -p deps/lib
mkdir -p build && cd build
wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.bz2 -O hwloc-${HWLOC_VERSION}.tar.bz2
tar -xjf hwloc-${HWLOC_VERSION}.tar.bz2
wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz
tar -xzf hwloc-${HWLOC_VERSION}.tar.gz
cd hwloc-${HWLOC_VERSION}
./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2
make -j$(nproc)
cp -fr include/ ../../deps
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
cp -fr include ../../deps
cp hwloc/.libs/libhwloc.a ../../deps/lib
cd ..

19
scripts/build.hwloc1.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash -e
HWLOC_VERSION="1.11.13"
mkdir -p deps
mkdir -p deps/include
mkdir -p deps/lib
mkdir -p build && cd build
wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz
tar -xzf hwloc-${HWLOC_VERSION}.tar.gz
cd hwloc-${HWLOC_VERSION}
./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
cp -fr include ../../deps
cp src/.libs/libhwloc.a ../../deps/lib
cd ..

View File

@ -13,8 +13,8 @@ tar -xzf libressl-${LIBRESSL_VERSION}.tar.gz
cd libressl-${LIBRESSL_VERSION}
./configure --disable-shared
make -j$(nproc)
cp -fr include/ ../../deps
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
cp -fr include ../../deps
cp crypto/.libs/libcrypto.a ../../deps/lib
cp ssl/.libs/libssl.a ../../deps/lib
cd ..

View File

@ -1,6 +1,6 @@
#!/bin/bash -e
OPENSSL_VERSION="1.1.1g"
OPENSSL_VERSION="1.1.1h"
mkdir -p deps
mkdir -p deps/include
@ -13,8 +13,8 @@ tar -xzf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms
make -j$(nproc)
cp -fr include/ ../../deps
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
cp -fr include ../../deps
cp libcrypto.a ../../deps/lib
cp libssl.a ../../deps/lib
cd ..

View File

@ -1,6 +1,6 @@
#!/bin/bash -e
UV_VERSION="1.38.0"
UV_VERSION="1.40.0"
mkdir -p deps
mkdir -p deps/include
@ -14,7 +14,7 @@ tar -xzf v${UV_VERSION}.tar.gz
cd libuv-${UV_VERSION}
sh autogen.sh
./configure --disable-shared
make -j$(nproc)
cp -fr include/ ../../deps
make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu)
cp -fr include ../../deps
cp .libs/libuv.a ../../deps/lib
cd ..

View File

@ -49,7 +49,6 @@ function rx()
'../cn/algorithm.cl',
'randomx_constants_monero.h',
'randomx_constants_wow.h',
'randomx_constants_loki.h',
'randomx_constants_arqma.h',
'randomx_constants_keva.h',
'aes.cl',

27
src/3rdparty/fmt/LICENSE.rst vendored Normal file
View File

@ -0,0 +1,27 @@
Copyright (c) 2012 - present, Victor Zverovich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- Optional exception to the license ---
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into a machine-executable object form of such
source code, you may redistribute such embedded portions in such object form
without including the above copyright and permission notices.

505
src/3rdparty/fmt/README.rst vendored Normal file

File diff suppressed because it is too large Load Diff

1118
src/3rdparty/fmt/chrono.h vendored Normal file

File diff suppressed because it is too large Load Diff

602
src/3rdparty/fmt/color.h vendored Normal file

File diff suppressed because it is too large Load Diff

699
src/3rdparty/fmt/compile.h vendored Normal file

File diff suppressed because it is too large Load Diff

2129
src/3rdparty/fmt/core.h vendored Normal file

File diff suppressed because it is too large Load Diff

2801
src/3rdparty/fmt/format-inl.h vendored Normal file

File diff suppressed because it is too large Load Diff

69
src/3rdparty/fmt/format.cc vendored Normal file
View File

@ -0,0 +1,69 @@
// Formatting library for C++
//
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#include "3rdparty/fmt/format-inl.h"
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename T>
int format_float(char* buf, std::size_t size, const char* format, int precision,
T value) {
#ifdef FMT_FUZZ
if (precision > 100000)
throw std::runtime_error(
"fuzz mode - avoid large allocation inside snprintf");
#endif
// Suppress the warning about nonliteral format string.
int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
return precision < 0 ? snprintf_ptr(buf, size, format, value)
: snprintf_ptr(buf, size, format, precision, value);
}
} // namespace detail
template struct FMT_INSTANTIATION_DEF_API detail::basic_data<void>;
// Workaround a bug in MSVC2013 that prevents instantiation of format_float.
int (*instantiate_format_float)(double, int, detail::float_specs,
detail::buffer<char>&) = detail::format_float;
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
template FMT_API detail::locale_ref::locale_ref(const std::locale& loc);
template FMT_API std::locale detail::locale_ref::get<std::locale>() const;
#endif
// Explicit instantiations for char.
template FMT_API std::string detail::grouping_impl<char>(locale_ref);
template FMT_API char detail::thousands_sep_impl(locale_ref);
template FMT_API char detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<char>::append(const char*, const char*);
template FMT_API FMT_BUFFER_CONTEXT(char)::iterator detail::vformat_to(
detail::buffer<char>&, string_view,
basic_format_args<FMT_BUFFER_CONTEXT(char)>);
template FMT_API int detail::snprintf_float(double, int, detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::snprintf_float(long double, int,
detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::format_float(double, int, detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::format_float(long double, int, detail::float_specs,
detail::buffer<char>&);
// Explicit instantiations for wchar_t.
template FMT_API std::string detail::grouping_impl<wchar_t>(locale_ref);
template FMT_API wchar_t detail::thousands_sep_impl(locale_ref);
template FMT_API wchar_t detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<wchar_t>::append(const wchar_t*,
const wchar_t*);
FMT_END_NAMESPACE

3869
src/3rdparty/fmt/format.h vendored Normal file

File diff suppressed because it is too large Load Diff

78
src/3rdparty/fmt/locale.h vendored Normal file
View File

@ -0,0 +1,78 @@
// Formatting library for C++ - std::locale support
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_LOCALE_H_
#define FMT_LOCALE_H_
#include <locale>
#include "format.h"
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename Char>
typename buffer_context<Char>::iterator vformat_to(
const std::locale& loc, buffer<Char>& buf,
basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
using af = arg_formatter<typename buffer_context<Char>::iterator, Char>;
return vformat_to<af>(buffer_appender<Char>(buf), to_string_view(format_str),
args, detail::locale_ref(loc));
}
template <typename Char>
std::basic_string<Char> vformat(
const std::locale& loc, basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
detail::vformat_to(loc, buffer, format_str, args);
return fmt::to_string(buffer);
}
} // namespace detail
template <typename S, typename Char = char_t<S>>
inline std::basic_string<Char> vformat(
const std::locale& loc, const S& format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
return detail::vformat(loc, to_string_view(format_str), args);
}
template <typename S, typename... Args, typename Char = char_t<S>>
inline std::basic_string<Char> format(const std::locale& loc,
const S& format_str, Args&&... args) {
return detail::vformat(
loc, to_string_view(format_str),
fmt::make_args_checked<Args...>(format_str, args...));
}
template <typename S, typename OutputIt, typename... Args,
typename Char = enable_if_t<
detail::is_output_iterator<OutputIt>::value, char_t<S>>>
inline OutputIt vformat_to(
OutputIt out, const std::locale& loc, const S& format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
decltype(detail::get_buffer<Char>(out)) buf(detail::get_buffer_init(out));
using af =
detail::arg_formatter<typename buffer_context<Char>::iterator, Char>;
vformat_to<af>(detail::buffer_appender<Char>(buf), to_string_view(format_str),
args, detail::locale_ref(loc));
return detail::get_iterator(buf);
}
template <typename OutputIt, typename S, typename... Args,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt>::value&&
detail::is_string<S>::value)>
inline OutputIt format_to(OutputIt out, const std::locale& loc,
const S& format_str, Args&&... args) {
const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
return vformat_to(out, loc, to_string_view(format_str), vargs);
}
FMT_END_NAMESPACE
#endif // FMT_LOCALE_H_

322
src/3rdparty/fmt/os.cc vendored Normal file

File diff suppressed because it is too large Load Diff

480
src/3rdparty/fmt/os.h vendored Normal file

File diff suppressed because it is too large Load Diff

177
src/3rdparty/fmt/ostream.h vendored Normal file
View File

@ -0,0 +1,177 @@
// Formatting library for C++ - std::ostream support
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_OSTREAM_H_
#define FMT_OSTREAM_H_
#include <ostream>
#include "format.h"
FMT_BEGIN_NAMESPACE
template <typename Char> class basic_printf_parse_context;
template <typename OutputIt, typename Char> class basic_printf_context;
namespace detail {
template <class Char> class formatbuf : public std::basic_streambuf<Char> {
private:
using int_type = typename std::basic_streambuf<Char>::int_type;
using traits_type = typename std::basic_streambuf<Char>::traits_type;
buffer<Char>& buffer_;
public:
formatbuf(buffer<Char>& buf) : buffer_(buf) {}
protected:
// The put-area is actually always empty. This makes the implementation
// simpler and has the advantage that the streambuf and the buffer are always
// in sync and sputc never writes into uninitialized memory. The obvious
// disadvantage is that each call to sputc always results in a (virtual) call
// to overflow. There is no disadvantage here for sputn since this always
// results in a call to xsputn.
int_type overflow(int_type ch = traits_type::eof()) FMT_OVERRIDE {
if (!traits_type::eq_int_type(ch, traits_type::eof()))
buffer_.push_back(static_cast<Char>(ch));
return ch;
}
std::streamsize xsputn(const Char* s, std::streamsize count) FMT_OVERRIDE {
buffer_.append(s, s + count);
return count;
}
};
struct converter {
template <typename T, FMT_ENABLE_IF(is_integral<T>::value)> converter(T);
};
template <typename Char> struct test_stream : std::basic_ostream<Char> {
private:
void_t<> operator<<(converter);
};
// Hide insertion operators for built-in types.
template <typename Char, typename Traits>
void_t<> operator<<(std::basic_ostream<Char, Traits>&, Char);
template <typename Char, typename Traits>
void_t<> operator<<(std::basic_ostream<Char, Traits>&, char);
template <typename Traits>
void_t<> operator<<(std::basic_ostream<char, Traits>&, char);
template <typename Traits>
void_t<> operator<<(std::basic_ostream<char, Traits>&, signed char);
template <typename Traits>
void_t<> operator<<(std::basic_ostream<char, Traits>&, unsigned char);
// Checks if T has a user-defined operator<< (e.g. not a member of
// std::ostream).
template <typename T, typename Char> class is_streamable {
private:
template <typename U>
static bool_constant<!std::is_same<decltype(std::declval<test_stream<Char>&>()
<< std::declval<U>()),
void_t<>>::value>
test(int);
template <typename> static std::false_type test(...);
using result = decltype(test<T>(0));
public:
static const bool value = result::value;
};
// Write the content of buf to os.
template <typename Char>
void write_buffer(std::basic_ostream<Char>& os, buffer<Char>& buf) {
const Char* buf_data = buf.data();
using unsigned_streamsize = std::make_unsigned<std::streamsize>::type;
unsigned_streamsize size = buf.size();
unsigned_streamsize max_size = to_unsigned(max_value<std::streamsize>());
do {
unsigned_streamsize n = size <= max_size ? size : max_size;
os.write(buf_data, static_cast<std::streamsize>(n));
buf_data += n;
size -= n;
} while (size != 0);
}
template <typename Char, typename T>
void format_value(buffer<Char>& buf, const T& value,
locale_ref loc = locale_ref()) {
formatbuf<Char> format_buf(buf);
std::basic_ostream<Char> output(&format_buf);
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
if (loc) output.imbue(loc.get<std::locale>());
#endif
output << value;
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
buf.try_resize(buf.size());
}
// Formats an object of type T that has an overloaded ostream operator<<.
template <typename T, typename Char>
struct fallback_formatter<T, Char, enable_if_t<is_streamable<T, Char>::value>>
: private formatter<basic_string_view<Char>, Char> {
FMT_CONSTEXPR auto parse(basic_format_parse_context<Char>& ctx)
-> decltype(ctx.begin()) {
return formatter<basic_string_view<Char>, Char>::parse(ctx);
}
template <typename ParseCtx,
FMT_ENABLE_IF(std::is_same<
ParseCtx, basic_printf_parse_context<Char>>::value)>
auto parse(ParseCtx& ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
template <typename OutputIt>
auto format(const T& value, basic_format_context<OutputIt, Char>& ctx)
-> OutputIt {
basic_memory_buffer<Char> buffer;
format_value(buffer, value, ctx.locale());
basic_string_view<Char> str(buffer.data(), buffer.size());
return formatter<basic_string_view<Char>, Char>::format(str, ctx);
}
template <typename OutputIt>
auto format(const T& value, basic_printf_context<OutputIt, Char>& ctx)
-> OutputIt {
basic_memory_buffer<Char> buffer;
format_value(buffer, value, ctx.locale());
return std::copy(buffer.begin(), buffer.end(), ctx.out());
}
};
} // namespace detail
template <typename Char>
void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
basic_memory_buffer<Char> buffer;
detail::vformat_to(buffer, format_str, args);
detail::write_buffer(os, buffer);
}
/**
\rst
Prints formatted data to the stream *os*.
**Example**::
fmt::print(cerr, "Don't {}!", "panic");
\endrst
*/
template <typename S, typename... Args,
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
void print(std::basic_ostream<Char>& os, const S& format_str, Args&&... args) {
vprint(os, to_string_view(format_str),
fmt::make_args_checked<Args...>(format_str, args...));
}
FMT_END_NAMESPACE
#endif // FMT_OSTREAM_H_

Some files were not shown because too many files have changed in this diff Show More