m-pays / m-cpuminer-v2

Latest miner (m-minerd)
Other
89 stars 63 forks source link

Installing on an OrangePi failure #4

Open Mijntje opened 6 years ago

Mijntje commented 6 years ago

I'm trying to install the miner on an OrangePi with Debian. Did the git clone command and using the command for make and configure. But on some point I'm getting this fault:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing -I./m7 -Im7 -Ofast -march=native -flto -fuse-linker-plugin -O3 -MT m_minerd-cpu-miner.o -MD -MP -MF .deps/m_minerd-cpu-miner.Tpo -c -o m_minerd-cpu-miner.o test -f 'cpu-miner.c' || echo './'cpu-miner.c cpu-miner.c:1:0: error: unknown value 'native' for -march /* ^ Makefile:641: recipe for target 'm_minerd-cpu-miner.o' failed make[2]: [m_minerd-cpu-miner.o] Error 1 make[2]: Leaving directory '/root/m-cpuminer-v2' Makefile:760: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: Leaving directory '/root/m-cpuminer-v2' Makefile:410: recipe for target 'all' failed make: *** [all] Error 2 root@Orangepi:~/m-cpuminer-v2#

What is happening and how can I fix the problem?

schinivision commented 6 years ago

@Mijntje if you are still on that problem try this:

  1. run: ./autogen.sh
  2. run: ./configure CFLAGS="-O2 -mcpu=cortex-a7 -mfpu=neon-vfpv4"
  3. run: sed -i -- 's/-march=native/-mcpu=cortex-a7/g' Makefile
  4. run: make

It should compile now....(fingers crossed) The problem is that the Makefile that is generated by "./configure" states "-march=native" and that is the problem if you replace that with the "-mcpu=..." then the compiler knows what to do. 😃

If you want to compile it for the RPi 3 you can use "cortex-a53" I hope I am correct with the a7 for the OrangePi

Have fun mining

Mijntje commented 6 years ago

Hi Schinivision,

Thanks for your reply! Already presumed it was something about the different cpu kind of thing. Which is I could find on the internet. But had no clue what to do about it.

Looked for the specifications of the OrangePi and it has a A53 as well as the Rpi.

Now I'm getting this error. Will try a bit to fool around a bit more.

root@Orangepi:~/m-cpuminer-v2# sed -i -- 's/-march=native/-mcpu=cortex-a53/g' Makefile sed: can't read Makefile: No such file or directory root@Orangepi:~/m-cpuminer-v2# ./configure CFLAGS="-O2 -mcpu=cortex-a53 -mfpu=neon-vfpv4" checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... no configure: error: in /root/m-cpuminer-v2': configure: error: C compiler cannot create executables Seeconfig.log' for more details root@Orangepi:~/m-cpuminer-v2#

Mijntje commented 6 years ago

Did now the apt-get install build-essential commando to update the C compiler but still no result.

And now I only used this command ./configure CFLAGS="-O2 -mcpu=cortex-a53 " and it shows this result. The libcurl should be the latest version. ./configure: line 6103: syntax error near unexpected token,' ./configure: line 6103: LIBCURL_CHECK_CONFIG(, 7.15.2, ,'

schinivision commented 6 years ago

@Mijntje Hi... interesting.. Maybe you can try omitting the -mcpu flag in step 2

  1. run: ./autogen.sh
  2. run: ./configure CFLAGS="-O2 -mfpu=neon-vfpv4" #(run without the -mcpu flag)
  3. run: sed -i -- 's/-march=native/-mcpu=cortex-a7/g' Makefile
  4. run: make

It is neccesary in step 3 but might also work if you do not state the -mcpu flag in step 2..

Hope that helped Happy new Year BR Stefan

schinivision commented 6 years ago

If you want to run the miner on multiple devices you can think about using docker. Here is a dockerfile that worked for me:

FROM arm32v7/debian:jessie-slim

RUN apt-get update && apt-get install -y automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++ git libgmp-dev

WORKDIR /opt
RUN git clone https://github.com/magi-project/m-cpuminer-v2

WORKDIR /opt/m-cpuminer-v2
RUN ./autogen.sh
RUN ./configure CFLAGS="-O2 -mcpu=cortex-a7 -mfpu=neon-vfpv4"
### now correct the Makefile
RUN sed -i -- 's/-march=native/-mcpu=cortex-a7/g' Makefile
RUN make

# remove all unneeded packages
RUN apt-get purge -y automake autoconf pkg-config make git \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENTRYPOINT  ["./m-minerd"]
Mijntje commented 6 years ago

Happy New year Schinivision!

This is what I'm getting:

Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') root@Orangepi:~/m-cpuminer-v2# ./configure CFLAGS="-O2 -mfpu=neon-vfpv4" checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... no configure: error: in/root/m-cpuminer-v2': configure: error: C compiler cannot create executables See `config.log' for more details

root@Orangepi:~/m-cpuminer-v2# sed -i -- 's/-march=native/-mcpu=cortex-a7/g' Makefile sed: can't read Makefile: No such file or directory root@Orangepi:~/m-cpuminer-v2#`

schinivision commented 6 years ago

Hi. Did you install all the dependencies?

apt-get update
apt-get install -y automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++ git libgmp-dev
Mijntje commented 6 years ago

Yep I did a recheck and everything is installed. Which is a bit weird when you see the error that the C compiler doesn't work. Even it's installed to the newest version. :/

Tried to copy the config.log.

This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.

It was created by cpuminer configure 2.4, which was generated by GNU Autoconf 2.69. Invocation command line was

$ ./configure CFLAGS=-O2 -mcpu=cortex-a7

---------

Platform.

---------

hostname = Orangepi uname -m = aarch64 uname -r = 3.10.65 uname -s = Linux uname -v = #55 SMP PREEMPT Fri Nov 18 16:17:28 CST 2016

/usr/bin/uname -p = unknown /bin/uname -X = unknown

/bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown

PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /usr/sbin PATH: /usr/bin PATH: /sbin PATH: /bin

-----------

Core tests.

-----------

configure:2384: checking build system type configure:2398: result: aarch64-unknown-linux-gnu configure:2418: checking host system type configure:2431: result: aarch64-unknown-linux-gnu configure:2451: checking target system type configure:2464: result: aarch64-unknown-linux-gnu configure:2508: checking for a BSD-compatible install configure:2576: result: /usr/bin/install -c configure:2587: checking whether build environment is sane configure:2642: result: yes configure:2793: checking for a thread-safe mkdir -p configure:2832: result: /bin/mkdir -p configure:2839: checking for gawk configure:2869: result: no configure:2839: checking for mawk configure:2855: found /usr/bin/mawk configure:2866: result: mawk configure:2877: checking whether make sets $(MAKE) configure:2899: result: yes configure:2928: checking whether make supports nested variables configure:2945: result: yes configure:3075: checking whether to enable maintainer-specific portions of Makefiles configure:3084: result: no configure:3110: checking for style of include used by make configure:3138: result: GNU configure:3209: checking for gcc configure:3225: found /usr/bin/gcc configure:3236: result: gcc configure:3465: checking for C compiler version configure:3474: gcc --version >&5 gcc (Debian/Linaro 4.9.2-10) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3485: $? = 0 configure:3474: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/4.9/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian/Linaro 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libsanitizer --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-arm64 --with-arch-directory=arm64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu Thread model: posix gcc version 4.9.2 (Debian/Linaro 4.9.2-10) configure:3485: $? = 0 configure:3474: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:3485: $? = 4 configure:3474: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion' gcc: fatal error: no input files compilation terminated. configure:3485: $? = 4 configure:3505: checking whether the C compiler works configure:3527: gcc -O2 -mcpu=cortex-a7 conftest.c >&5 conftest.c:1:0: error: unknown value 'cortex-a7' for -mcpu / confdefs.h / ^ configure:3531: $? = 1 configure:3569: result: no configure: failed program was: / confdefs.h / #define PACKAGE_NAME "cpuminer" #define PACKAGE_TARNAME "cpuminer" #define PACKAGE_VERSION "2.4" #define PACKAGE_STRING "cpuminer 2.4" #define PACKAGE_BUGREPORT "" #define PACKAGE_URL "" #define PACKAGE "cpuminer" #define VERSION "2.4" / end confdefs.h. /
int
main ()
{
;
return 0;
}

configure:3574: error: in /root/m-cpuminer-v2': configure:3576: error: C compiler cannot create executables Seeconfig.log' for more details

----------------

Cache variables.

----------------

ac_cv_build=aarch64-unknown-linux-gnu ac_cv_env_CCASFLAGS_set= ac_cv_env_CCASFLAGS_value= ac_cv_env_CCAS_set= ac_cv_env_CCAS_value= ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value='-O2 -mcpu=cortex-a7' ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set= ac_cv_env_CXX_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=aarch64-unknown-linux-gnu ac_cv_path_install='/usr/bin/install -c' ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=mawk ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_make_make_set=yes ac_cv_target=aarch64-unknown-linux-gnu am_cv_make_support_nested_variables=yes

-----------------

Output variables.

-----------------

ACLOCAL='${SHELL} /root/m-cpuminer-v2/missing aclocal-1.14' ALLOCA='' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' AM_DEFAULT_VERBOSITY='1' AM_V='$(V)' ARCH_ARM_FALSE='' ARCH_ARM_TRUE='' ARCH_x86_64_FALSE='' ARCH_x86_64_TRUE='' ARCH_x86_FALSE='' ARCH_x86_TRUE='' AUTOCONF='${SHELL} /root/m-cpuminer-v2/missing autoconf' AUTOHEADER='${SHELL} /root/m-cpuminer-v2/missing autoheader' AUTOMAKE='${SHELL} /root/m-cpuminer-v2/missing automake-1.14' AWK='mawk' CC='gcc' CCAS='' CCASDEPMODE='' CCASFLAGS='' CCDEPMODE='' CFLAGS='-O2 -mcpu=cortex-a7' CPP='' CPPFLAGS='' CXX='' CXXDEPMODE='' CXXFLAGS='' CYGPATH_W='echo' DEFS='' DEPDIR='.deps' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' EXEEXT='' GREP='' HAVE_WINDOWS_FALSE='' HAVE_WINDOWS_TRUE='' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' JANSSON_LIBS='' LDFLAGS='' LIBCURL='' LIBCURL_CPPFLAGS='' LIBOBJS='' LIBS='' LTLIBOBJS='' M7M_LIBS='' MAINT='#' MAINTAINER_MODE_FALSE='' MAINTAINER_MODE_TRUE='#' MAKEINFO='${SHELL} /root/m-cpuminer-v2/missing makeinfo' MKDIR_P='/bin/mkdir -p' OBJEXT='' PACKAGE='cpuminer' PACKAGE_BUGREPORT='' PACKAGE_NAME='cpuminer' PACKAGE_STRING='cpuminer 2.4' PACKAGE_TARNAME='cpuminer' PACKAGE_URL='' PACKAGE_VERSION='2.4' PATH_SEPARATOR=':' PTHREAD_FLAGS='' PTHREAD_LIBS='' RANLIB='' SET_MAKE='' SHELL='/bin/bash' STRIP='' USE_ASM_FALSE='' USE_ASM_TRUE='' VERSION='2.4' WANT_JANSSON_FALSE='' WANT_JANSSON_TRUE='' WS2_LIBS='' _libcurl_config='' ac_ct_CC='gcc' ac_ct_CXX='' amEXEEXT_FALSE='' am__EXEEXT_TRUE='' amfastdepCCAS_FALSE='' amfastdepCCAS_TRUE='' am__fastdepCC_FALSE='' amfastdepCC_TRUE='' amfastdepCXX_FALSE='' am__fastdepCXX_TRUE='' aminclude='include' amisrc='' amleading_dot='.' am__nodep='_no' amquote='' amtar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' bindir='${exec_prefix}/bin' build='aarch64-unknown-linux-gnu' build_alias='' build_cpu='aarch64' build_os='linux-gnu' build_vendor='unknown' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' host='aarch64-unknown-linux-gnu' host_alias='' host_cpu='aarch64' host_os='linux-gnu' host_vendor='unknown' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /root/m-cpuminer-v2/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='NONE' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target='aarch64-unknown-linux-gnu' target_alias='' target_cpu='aarch64' target_os='linux-gnu' target_vendor='unknown'

-----------

confdefs.h.

-----------

/ confdefs.h /

define PACKAGE_NAME "cpuminer"

define PACKAGE_TARNAME "cpuminer"

define PACKAGE_VERSION "2.4"

define PACKAGE_STRING "cpuminer 2.4"

define PACKAGE_BUGREPORT ""

define PACKAGE_URL ""

define PACKAGE "cpuminer"

define VERSION "2.4"

configure: exit 77

schinivision commented 6 years ago

What does uname -a output?

Mijntje commented 6 years ago

Its saying this:

orangepi@Orangepi:~ uname -a Linux Orangepi 3.10.65 #55 SMP PREEMPT Fri Nov 18 16:17:28 CST 2016 aarch64 GNU/ Linux orangepi@Orangepi:~

schinivision commented 6 years ago

@Mijntje sorry I am out of suggestions now.. I got the miner running on a Tinkerboard and on the Raspberry pi 3... All of those state an architecture "armv7l"

On your side it states "aarch64"... As it seems the supplier of your distro managed it to build an real 64bit OS... which is not true for the Tinkerboard and the RPi Image that I use (they run 32bit). Maybe it has something to do with that.

You are on your own now... Hope you will find someone that can help you out.

Mijntje commented 6 years ago

The Orange Pi I have is a real 64bit according to the website. http://www.orangepi.org/orangepipc2/ :)

Any way thanks a lot still for the help! Really appreciate it 👍

jaretburkett commented 6 years ago

Any update on this. I am assuming this is for the H5 CPU.

arminmacx commented 4 years ago

the only way I could build this miner on my rp3 is to do this :

  1. run: ./autogen.sh

  2. run: ./configure CFLAGS="-O2"

  3. run: sed -i -- 's/-march=native/-mcpu=cortex-a53/g' Makefile

  4. run: make

but still, I don't see how other people get around 11kh/s on m7m with rpi3 on 64bit OS. I just get around 5.6kh/s on ubuntu server