This commit is contained in:
Jay D Dee
2024-12-25 23:12:29 -05:00
parent 2b1037a7c7
commit a45a333b40
13 changed files with 1212 additions and 1102 deletions

View File

@@ -288,11 +288,24 @@ if HAVE_WINDOWS
endif endif
cpuminer_LDFLAGS = @LDFLAGS@ cpuminer_LDFLAGS = @LDFLAGS@
cpuminer_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@ -lgmp cpuminer_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@
cpuminer_CPPFLAGS = @LIBCURL_CPPFLAGS@ $(ALL_INCLUDES) cpuminer_CPPFLAGS = @LIBCURL_CPPFLAGS@ $(ALL_INCLUDES)
cpuminer_CFLAGS = -Wno-pointer-sign -Wno-pointer-to-int-cast $(disable_flags) cpuminer_CFLAGS = -Wno-pointer-sign -Wno-pointer-to-int-cast $(disable_flags)
# Linking GMP fails on MacOS
if !HAVE_APPLE
cpuminer_LDADD += -lgmp
endif
if ARCH_ARM64
cpuminer_CFLAGS += -flax-vector-conversions
endif
if HAVE_WINDOWS if HAVE_WINDOWS
# Add -U_WIN32_WINNT to command line CFLAGS to undefine
cpuminer_CFLAGS += -D_WIN32_WINNT=0x0601
# use to profile an object # use to profile an object
# gprof_cflags = -pg -g3 # gprof_cflags = -pg -g3
# cpuminer_LDFLAGS += -pg # cpuminer_LDFLAGS += -pg
@@ -306,5 +319,4 @@ cpuminer-neoscrypt.o: neoscrypt.c
@echo "CUSTOM ${@}: ${filter %.o,${^}} ${filter %.c,${^}}" @echo "CUSTOM ${@}: ${filter %.o,${^}} ${filter %.c,${^}}"
$(CC) $(common_ccflags) -g -O3 $(gprof_cflags) -MT $@ -MD -MP -c -o $@ $< $(CC) $(common_ccflags) -g -O3 $(gprof_cflags) -MT $@ -MD -MP -c -o $@ $<
endif endif

View File

@@ -75,6 +75,16 @@ If not what makes it happen or not happen?
Change Log Change Log
---------- ----------
v24.8
ARM: Apple MacOS on M series CPU is now supported compiled from source
code, see Wiki for details.
ARM: Fix incorrect compiler version display when using clang.
build.sh can now be used to compile all targets, arm_build.sh & build_msys2.sh
have been removed.
Windows: MSys2 build now enables CPU groups by default, prebuilt binaries
continue to be compiled with CPU groups disabled.
v24.7 v24.7
ARM: compile works for Windows using MSys2 & MingW, see wiki for details. ARM: compile works for Windows using MSys2 & MingW, see wiki for details.

View File

@@ -1,14 +0,0 @@
#!/bin/bash
# Linux build
make distclean || echo clean
rm -f config.status
./autogen.sh || echo done
CFLAGS="-O3 -march=native -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc)
strip -s cpuminer

View File

@@ -15,51 +15,43 @@ rm -f config.status
./autogen.sh || echo done ./autogen.sh || echo done
CFLAGS="-O3 -march=armv9-a+crypto+sha3 -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv9-a+crypto+sha3 -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv9-crypto-sha3 mv cpuminer cpuminer-armv9-crypto-sha3
make clean || echo clean make clean || echo clean
CFLAGS="-O3 -march=armv9-a+crypto -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv9-a+crypto -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv9-crypto mv cpuminer cpuminer-armv9-crypto
make clean || echo clean make clean || echo clean
CFLAGS="-O3 -march=armv9-a -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv9-a -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv9 mv cpuminer cpuminer-armv9
# SVE2 available in armv8.5 # SVE2 available in armv8.5
make clean || echo clean make clean || echo clean
CFLAGS="-O3 -march=armv8.5-a+crypto+sha3+sve2 -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv8.5-a+crypto+sha3+sve2 -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv8.5-crypto-sha3-sve2 mv cpuminer cpuminer-armv8.5-crypto-sha3-sve2
# SHA3 available in armv8.4 # SHA3 available in armv8.4
make clean || echo clean make clean || echo clean
CFLAGS="-O3 -march=armv8.4-a+crypto+sha3 -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv8.4-a+crypto+sha3 -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv8.4-crypto-sha3 mv cpuminer cpuminer-armv8.4-crypto-sha3
make clean || echo clean make clean || echo clean
rm -f config.status rm -f config.status
CFLAGS="-O3 -march=armv8-a+crypto -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv8-a+crypto -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv8-crypto mv cpuminer cpuminer-armv8-crypto
make clean || echo clean make clean || echo clean
rm -f config.status rm -f config.status
CFLAGS="-O3 -march=armv8-a -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=armv8-a -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer
mv cpuminer cpuminer-armv8 mv cpuminer cpuminer-armv8
make clean || echo clean make clean || echo clean
rm -f config.status rm -f config.status
CFLAGS="-O3 -march=native -Wall -flax-vector-conversions" ./configure --with-curl CFLAGS="-O3 -march=native -Wall -flax-vector-conversions" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer

View File

@@ -1,10 +0,0 @@
#!/bin/bash
#
# Compile on Windows using MSYS2 and MinGW.
make distclean || echo clean
rm -f config.status
./autogen.sh || echo done
CFLAGS="-O3 -march=native -Wall -D_WIN32_WINNT=0x0601" ./configure --with-curl
make -j $(nproc)
strip -s cpuminer

View File

@@ -1,20 +1,9 @@
#!/bin/bash #!/bin/bash
#if [ "$OS" = "Windows_NT" ]; then
# ./mingw64.sh
# exit 0
#fi
# Linux build
make distclean || echo clean make distclean || echo clean
rm -f config.status rm -f config.status
./autogen.sh || echo done ./autogen.sh || echo done
#CFLAGS="-O3 -march=native -Wall" ./configure --with-curl --with-crypto=$HOME/usr
CFLAGS="-O3 -march=native -Wall" ./configure --with-curl CFLAGS="-O3 -march=native -Wall" ./configure --with-curl
make -j $(nproc) make -j $(nproc)
strip -s cpuminer #strip -s cpuminer

59
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for cpuminer-opt 24.7. # Generated by GNU Autoconf 2.71 for cpuminer-opt 24.8.
# #
# #
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='cpuminer-opt' PACKAGE_NAME='cpuminer-opt'
PACKAGE_TARNAME='cpuminer-opt' PACKAGE_TARNAME='cpuminer-opt'
PACKAGE_VERSION='24.7' PACKAGE_VERSION='24.8'
PACKAGE_STRING='cpuminer-opt 24.7' PACKAGE_STRING='cpuminer-opt 24.8'
PACKAGE_BUGREPORT='' PACKAGE_BUGREPORT=''
PACKAGE_URL='' PACKAGE_URL=''
@@ -657,10 +657,12 @@ JANSSON_LIBS
LIBCURL_CPPFLAGS LIBCURL_CPPFLAGS
LIBCURL_CFLAGS LIBCURL_CFLAGS
LIBCURL LIBCURL
HAVE_APPLE_FALSE
HAVE_APPLE_TRUE
MINGW_FALSE MINGW_FALSE
MINGW_TRUE MINGW_TRUE
ARCH_ARM_FALSE ARCH_ARM64_FALSE
ARCH_ARM_TRUE ARCH_ARM64_TRUE
ARCH_x86_64_FALSE ARCH_x86_64_FALSE
ARCH_x86_64_TRUE ARCH_x86_64_TRUE
ARCH_x86_FALSE ARCH_x86_FALSE
@@ -1360,7 +1362,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures cpuminer-opt 24.7 to adapt to many kinds of systems. \`configure' configures cpuminer-opt 24.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1432,7 +1434,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of cpuminer-opt 24.7:";; short | recursive ) echo "Configuration of cpuminer-opt 24.8:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@@ -1538,7 +1540,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
cpuminer-opt configure 24.7 cpuminer-opt configure 24.8
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1985,7 +1987,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by cpuminer-opt $as_me 24.7, which was It was created by cpuminer-opt $as_me 24.8, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@@ -3593,7 +3595,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='cpuminer-opt' PACKAGE='cpuminer-opt'
VERSION='24.7' VERSION='24.8'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -6509,8 +6511,8 @@ case $target in
x86_64-*-*|amd64-*-*) x86_64-*-*|amd64-*-*)
have_x86_64=true have_x86_64=true
;; ;;
arm*-*-*) aarch64*-*-*|arm64*-*-*)
have_arm=true have_aarch64=true
;; ;;
powerpc*-*-*) powerpc*-*-*)
have_ppc=true have_ppc=true
@@ -6526,6 +6528,9 @@ case $target in
PTHREAD_FLAGS="" PTHREAD_FLAGS=""
WS2_LIBS="-lws2_32" WS2_LIBS="-lws2_32"
;; ;;
*-apple-*)
have_apple=true
;;
esac esac
@@ -6941,12 +6946,12 @@ else
ARCH_x86_64_FALSE= ARCH_x86_64_FALSE=
fi fi
if test x$have_arm = xtrue; then if test x$have_aarch64 = xtrue; then
ARCH_ARM_TRUE= ARCH_ARM64_TRUE=
ARCH_ARM_FALSE='#' ARCH_ARM64_FALSE='#'
else else
ARCH_ARM_TRUE='#' ARCH_ARM64_TRUE='#'
ARCH_ARM_FALSE= ARCH_ARM64_FALSE=
fi fi
if test "x$OS" = "xWindows_NT"; then if test "x$OS" = "xWindows_NT"; then
@@ -6957,6 +6962,14 @@ else
MINGW_FALSE= MINGW_FALSE=
fi fi
if test x$have_apple = xtrue; then
HAVE_APPLE_TRUE=
HAVE_APPLE_FALSE='#'
else
HAVE_APPLE_TRUE='#'
HAVE_APPLE_FALSE=
fi
if test x$request_jansson = xtrue ; then if test x$request_jansson = xtrue ; then
JANSSON_LIBS="compat/jansson/libjansson.a" JANSSON_LIBS="compat/jansson/libjansson.a"
@@ -7188,14 +7201,18 @@ if test -z "${ARCH_x86_64_TRUE}" && test -z "${ARCH_x86_64_FALSE}"; then
as_fn_error $? "conditional \"ARCH_x86_64\" was never defined. as_fn_error $? "conditional \"ARCH_x86_64\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${ARCH_ARM_TRUE}" && test -z "${ARCH_ARM_FALSE}"; then if test -z "${ARCH_ARM64_TRUE}" && test -z "${ARCH_ARM64_FALSE}"; then
as_fn_error $? "conditional \"ARCH_ARM\" was never defined. as_fn_error $? "conditional \"ARCH_ARM64\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${MINGW_TRUE}" && test -z "${MINGW_FALSE}"; then if test -z "${MINGW_TRUE}" && test -z "${MINGW_FALSE}"; then
as_fn_error $? "conditional \"MINGW\" was never defined. as_fn_error $? "conditional \"MINGW\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${HAVE_APPLE_TRUE}" && test -z "${HAVE_APPLE_FALSE}"; then
as_fn_error $? "conditional \"HAVE_APPLE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: "${CONFIG_STATUS=./config.status}" : "${CONFIG_STATUS=./config.status}"
ac_write_fail=0 ac_write_fail=0
@@ -7586,7 +7603,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by cpuminer-opt $as_me 24.7, which was This file was extended by cpuminer-opt $as_me 24.8, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@@ -7654,7 +7671,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
cpuminer-opt config.status 24.7 cpuminer-opt config.status 24.8
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@@ -1,4 +1,4 @@
AC_INIT([cpuminer-opt], [24.7]) AC_INIT([cpuminer-opt], [24.8])
AC_PREREQ([2.59c]) AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
@@ -48,8 +48,8 @@ case $target in
x86_64-*-*|amd64-*-*) x86_64-*-*|amd64-*-*)
have_x86_64=true have_x86_64=true
;; ;;
arm*-*-*) aarch64*-*-*|arm64*-*-*)
have_arm=true have_aarch64=true
;; ;;
powerpc*-*-*) powerpc*-*-*)
have_ppc=true have_ppc=true
@@ -65,6 +65,9 @@ case $target in
PTHREAD_FLAGS="" PTHREAD_FLAGS=""
WS2_LIBS="-lws2_32" WS2_LIBS="-lws2_32"
;; ;;
*-apple-*)
have_apple=true
;;
esac esac
@@ -135,8 +138,9 @@ AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
AM_CONDITIONAL([USE_ASM], [test x$enable_assembly != xno]) AM_CONDITIONAL([USE_ASM], [test x$enable_assembly != xno])
AM_CONDITIONAL([ARCH_x86], [test x$have_x86 = xtrue]) AM_CONDITIONAL([ARCH_x86], [test x$have_x86 = xtrue])
AM_CONDITIONAL([ARCH_x86_64], [test x$have_x86_64 = xtrue]) AM_CONDITIONAL([ARCH_x86_64], [test x$have_x86_64 = xtrue])
AM_CONDITIONAL([ARCH_ARM], [test x$have_arm = xtrue]) AM_CONDITIONAL([ARCH_ARM64], [test x$have_aarch64 = xtrue])
AM_CONDITIONAL([MINGW], [test "x$OS" = "xWindows_NT"]) AM_CONDITIONAL([MINGW], [test "x$OS" = "xWindows_NT"])
AM_CONDITIONAL([HAVE_APPLE], [test x$have_apple = xtrue])
if test x$request_jansson = xtrue ; then if test x$request_jansson = xtrue ; then
JANSSON_LIBS="compat/jansson/libjansson.a" JANSSON_LIBS="compat/jansson/libjansson.a"

2093
configure~

File diff suppressed because it is too large Load Diff

View File

@@ -206,7 +206,7 @@ static uint32_t last_block_height = 0;
static double highest_share = 0; // highest accepted share diff static double highest_share = 0; // highest accepted share diff
static double lowest_share = 9e99; // lowest accepted share diff static double lowest_share = 9e99; // lowest accepted share diff
static double last_targetdiff = 0.; static double last_targetdiff = 0.;
#if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32)) #if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32) || defined(__APPLE__))
static uint32_t hi_temp = 0; static uint32_t hi_temp = 0;
static uint32_t prev_temp = 0; static uint32_t prev_temp = 0;
#endif #endif
@@ -992,19 +992,19 @@ void report_summary_log( bool force )
if ( rejected_share_count > 10 ) if ( rejected_share_count > 10 )
{ {
if ( rejected_share_count > ( submitted_share_count * .5 ) ) if ( rejected_share_count > ( submitted_share_count / 2 ) )
{ {
applog(LOG_ERR,"Excessive rejected share rate, exiting..."); applog(LOG_ERR,"Excessive rejected share rate, exiting...");
exit(1); exit(1);
} }
else if ( rejected_share_count > ( submitted_share_count * .1 ) ) else if ( rejected_share_count > ( submitted_share_count / 10 ) )
applog(LOG_WARNING,"High rejected share rate, check settings."); applog(LOG_WARNING,"High rejected share rate, check settings.");
} }
gettimeofday( &now, NULL ); gettimeofday( &now, NULL );
timeval_subtract( &et, &now, &five_min_start ); timeval_subtract( &et, &now, &five_min_start );
#if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32)) #if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32) || defined(__APPLE__))
// Display CPU temperature and clock rate. // Display CPU temperature and clock rate.
int curr_temp = cpu_temp(0); int curr_temp = cpu_temp(0);
@@ -1013,8 +1013,9 @@ void report_summary_log( bool force )
if ( !opt_quiet || ( curr_temp >= 80 ) ) if ( !opt_quiet || ( curr_temp >= 80 ) )
{ {
int wait_time = curr_temp >= 90 ? 5 : curr_temp >= 80 ? 30 : int wait_time = curr_temp >= 90 ? 5
curr_temp >= 70 ? 60 : 120; : curr_temp >= 80 ? 30
: curr_temp >= 70 ? 60 : 120;
timeval_subtract( &diff, &now, &cpu_temp_time ); timeval_subtract( &diff, &now, &cpu_temp_time );
if ( ( diff.tv_sec > wait_time ) if ( ( diff.tv_sec > wait_time )
|| ( ( curr_temp > prev_temp ) && ( curr_temp >= 75 ) ) ) || ( ( curr_temp > prev_temp ) && ( curr_temp >= 75 ) ) )
@@ -1912,7 +1913,7 @@ static bool wanna_mine(int thr_id)
{ {
bool state = true; bool state = true;
#if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32)) #if !(defined(__WINDOWS__) || defined(_WIN64) || defined(_WIN32) || defined(__APPLE__))
if (opt_max_temp > 0.0) if (opt_max_temp > 0.0)
{ {
@@ -2400,7 +2401,7 @@ static void *miner_thread( void *userdata )
{ {
scale_hash_for_display( &hashrate, hr_units ); scale_hash_for_display( &hashrate, hr_units );
sprintf( hr, "%.2f", hashrate ); sprintf( hr, "%.2f", hashrate );
#if (defined(_WIN64) || defined(__WINDOWS__) || defined(_WIN32)) #if (defined(_WIN64) || defined(__WINDOWS__) || defined(_WIN32) || defined(__APPLE__))
applog( LOG_NOTICE, "Total: %s %sH/s", hr, hr_units ); applog( LOG_NOTICE, "Total: %s %sH/s", hr, hr_units );
#else #else
float lo_freq = 0., hi_freq = 0.; float lo_freq = 0., hi_freq = 0.;
@@ -2974,23 +2975,25 @@ static bool cpu_capability( bool display_only )
printf( "CPU: %s\n", cpu_brand ); printf( "CPU: %s\n", cpu_brand );
printf("SW built on " __DATE__ printf("SW built on " __DATE__
#ifdef _MSC_VER #if defined(__clang__)
" with VC++ 2013\n"); " with CLANG-%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
#elif defined(__GNUC__) #elif defined(__GNUC__)
" with GCC-"); " with GCC-%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
printf("%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#else
printf("\n");
#endif #endif
#if defined(__linux) #if defined(__linux)
printf(" Linux\n"); printf(" Linux\n");
#elif defined(WIN32) #elif defined(WIN32)
printf(" Windows\n"); printf(" Windows");
#if defined(__MINGW64__)
printf(" MinGW-w64\n");
#else
printf("\n");
#endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
printf(" MacOS\n"); printf(" MacOS\n");
#elif defined(__unix__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) #elif defined(__bsd__) || defined(__unix__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
printf(" Unix\n"); printf(" BSD/Unix\n");
#else #else
printf("\n"); printf("\n");
#endif #endif
@@ -3050,7 +3053,7 @@ static bool cpu_capability( bool display_only )
if ( !display_only ) if ( !display_only )
{ {
printf("\nAlgo features: "); printf("\nAlgo features:");
if ( algo_features == EMPTY_SET ) printf( " None" ); if ( algo_features == EMPTY_SET ) printf( " None" );
else else
{ {
@@ -3058,7 +3061,7 @@ static bool cpu_capability( bool display_only )
else if ( algo_has_avx2 ) printf( " AVX2 " ); else if ( algo_has_avx2 ) printf( " AVX2 " );
else if ( algo_has_sse42 ) printf( " SSE4.2" ); else if ( algo_has_sse42 ) printf( " SSE4.2" );
else if ( algo_has_sse2 ) printf( " SSE2 " ); else if ( algo_has_sse2 ) printf( " SSE2 " );
if ( algo_has_neon ) printf( " NEON " ); if ( algo_has_neon ) printf( " NEON" );
if ( algo_has_vaes ) printf( " VAES" ); if ( algo_has_vaes ) printf( " VAES" );
else if ( algo_has_aes ) printf( " AES" ); else if ( algo_has_aes ) printf( " AES" );
if ( algo_has_sha512 ) printf( " SHA512" ); if ( algo_has_sha512 ) printf( " SHA512" );
@@ -3691,9 +3694,6 @@ int main(int argc, char *argv[])
{ {
int cpus = GetActiveProcessorCount( i ); int cpus = GetActiveProcessorCount( i );
num_cpus += cpus; num_cpus += cpus;
// if (opt_debug)
// applog( LOG_INFO, "Found %d CPUs in CPU group %d", cpus, i );
} }
#else #else

10
miner.h
View File

@@ -3,10 +3,7 @@
#include <cpuminer-config.h> #include <cpuminer-config.h>
#if !( defined(__SSE2__) || ( defined(__aarch64__) && defined(__ARM_NEON) ) ) // CPU architecture
#warning "Unknown or unsupported CPU, requires x86_64 with SSE2 or AArch64 with NEON."
#endif
#if defined(__x86_64__) #if defined(__x86_64__)
#define USER_AGENT_ARCH "x64" // Intel, AMD x86_64 #define USER_AGENT_ARCH "x64" // Intel, AMD x86_64
#elif defined(__aarch64__) #elif defined(__aarch64__)
@@ -17,14 +14,15 @@
#define USER_AGENT_ARCH #define USER_AGENT_ARCH
#endif #endif
// Operating system
// __APPLE__ includes MacOS & IOS, no MacOS only macros found.
#if defined(__linux) #if defined(__linux)
#define USER_AGENT_OS "L" // GNU Linux #define USER_AGENT_OS "L" // GNU Linux
#elif defined(WIN32) #elif defined(WIN32)
#define USER_AGENT_OS "W" // MS Windows #define USER_AGENT_OS "W" // MS Windows
#elif defined(__APPLE__) #elif defined(__APPLE__)
#define USER_AGENT_OS "M" // Apple MacOS #define USER_AGENT_OS "M" // Apple MacOS
// is there a generic BSD macro? #elif defined(__bsd__) || defined(__unix__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#elif defined(__unix__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#define USER_AGENT_OS "U" // BSD unix #define USER_AGENT_OS "U" // BSD unix
#else #else
#define USER_AGENT_OS #define USER_AGENT_OS

View File

@@ -16,8 +16,8 @@
#include "miner.h" #include "miner.h"
#include "simd-utils.h" #include "simd-utils.h"
// missing on mingw on arm // Missing on MinGW, MacOS
#if defined(__aarch64__) && !defined(WIN32) #if defined(__aarch64__) && !defined(WIN32) && !defined(__APPLE__)
#define ARM_AUXV #define ARM_AUXV
#endif #endif
@@ -28,7 +28,7 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#endif #endif
#ifndef WIN32 #if !(defined(WIN32) || defined(__APPLE__))
// 1035g1: /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input // 1035g1: /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input
// 1035g1: /sys/class/hwmon/hwmon1/temp1_input wrong temp // 1035g1: /sys/class/hwmon/hwmon1/temp1_input wrong temp
@@ -152,7 +152,7 @@ static inline void linux_cpu_hilo_freq( float *lo, float *hi )
static inline float cpu_temp( int core ) static inline float cpu_temp( int core )
{ {
#ifdef WIN32 #if defined(WIN32) || defined(__APPLE__)
return 0.; return 0.;
#else #else
return linux_cputemp( core ); return linux_cputemp( core );
@@ -161,7 +161,7 @@ static inline float cpu_temp( int core )
static inline uint32_t cpu_clock( int core ) static inline uint32_t cpu_clock( int core )
{ {
#ifdef WIN32 #if defined(WIN32) || defined(__APPLE__)
return 0; return 0;
#else #else
return linux_cpufreq( core ); return linux_cpufreq( core );
@@ -280,8 +280,8 @@ static inline int cpu_fanpercent()
#define FMA3_mask (FMA3_Flag|AVX_mask) #define FMA3_mask (FMA3_Flag|AVX_mask)
#define AVX512_mask (AVX512_VL_Flag|AVX512_BW_Flag|AVX512_DQ_Flag|AVX512_F_Flag) #define AVX512_mask (AVX512_VL_Flag|AVX512_BW_Flag|AVX512_DQ_Flag|AVX512_F_Flag)
#if defined(__x86_64__) #if defined(__x86_64__)
static inline void cpuid( unsigned int leaf, unsigned int subleaf, static inline void cpuid( unsigned int leaf, unsigned int subleaf,
unsigned int output[4] ) unsigned int output[4] )
{ {
@@ -965,7 +965,7 @@ static inline unsigned int avx10_vector_length()
return 0; return 0;
} }
// ARM SVE vector register length // ARM SVE vector register length, converted from bytes to bits.
static inline int sve_vector_length() static inline int sve_vector_length()
{ {
#if defined(ARM_AUXV) #if defined(ARM_AUXV)

View File

@@ -11,18 +11,18 @@
export LOCAL_LIB="$HOME/usr/lib" export LOCAL_LIB="$HOME/usr/lib"
export CONFIGURE_ARGS="--with-curl=$LOCAL_LIB/curl --host=x86_64-w64-mingw32" export CONFIGURE_ARGS="--with-curl=$LOCAL_LIB/curl --host=x86_64-w64-mingw32"
#export CONFIGURE_ARGS="--with-curl=$LOCAL_LIB/curl --with-crypto=$LOCAL_LIB/openssl --host=x86_64-w64-mingw32"
export MINGW_LIB="/usr/x86_64-w64-mingw32/lib" export MINGW_LIB="/usr/x86_64-w64-mingw32/lib"
# set correct gcc version # set correct gcc version
export GCC_MINGW_LIB="/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32" export GCC_MINGW_LIB="/usr/lib/gcc/x86_64-w64-mingw32/9.3-win32"
# used by GCC # used by GCC
export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs" export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs"
#export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs -L$LOCAL_LIB/openssl"
# Support for Windows 7 CPU groups, AES sometimes not included in -march # Support for Windows 7 CPU groups, AES sometimes not included in -march
# CPU groups disabled due to incompatibilities between Intel and AMD CPUs. # CPU groups disabled due to incompatibilities between Intel and AMD CPUs.
#export DEFAULT_CFLAGS="-maes -O3 -Wall -D_WIN32_WINNT=0x0601" # CPU groups are enabled by default in Makefile, use -U to disable.
export DEFAULT_CFLAGS="-maes -O3 -Wall" export DEFAULT_CFLAGS="-maes -O3 -Wall -U_WIN32_WINNT"
export DEFAULT_CFLAGS_OLD="-O3 -Wall" export DEFAULT_CFLAGS_OLD="-O3 -Wall -U_WIN32_WINNT"
#export DEFAULT_CFLAGS="-maes -O3 -Wall"
#export DEFAULT_CFLAGS_OLD="-O3 -Wall"
# make link to local gmp header file. # make link to local gmp header file.
ln -s $LOCAL_LIB/gmp/gmp.h ./gmp.h ln -s $LOCAL_LIB/gmp/gmp.h ./gmp.h
@@ -40,7 +40,6 @@ cp $MINGW_LIB/zlib1.dll release/
cp $MINGW_LIB/libwinpthread-1.dll release/ cp $MINGW_LIB/libwinpthread-1.dll release/
cp $GCC_MINGW_LIB/libstdc++-6.dll release/ cp $GCC_MINGW_LIB/libstdc++-6.dll release/
cp $GCC_MINGW_LIB/libgcc_s_seh-1.dll release/ cp $GCC_MINGW_LIB/libgcc_s_seh-1.dll release/
#cp ./../libcrypto-1_1-x64.dll release/
cp $LOCAL_LIB/curl/lib/.libs/libcurl-4.dll release/ cp $LOCAL_LIB/curl/lib/.libs/libcurl-4.dll release/
# Start building... # Start building...