Creepsky / creepMiner

Burstcoin C++ CPU and GPU Miner
GNU General Public License v3.0
171 stars 64 forks source link

ARMv8 make: fatal error: cpuid.h: No such file or directory #368

Closed xwry closed 6 years ago

xwry commented 6 years ago

creepMiner version 1.8.0 and 1.7.16, gcc version 5 (ubuntu) and 6 (debian stretch)

Building from source on ARMv8 (RK 3328) goes fine until "make -j 4", then:

[ 11%] Building CXX object CMakeFiles/creepMiner.dir/src/gpu/impl/gpu_cuda_impl.cpp.o /home/rock64/creepMiner/src/MinerUtil.cpp:76:19: fatal error: cpuid.h: No such file or directory

compilation terminated. CMakeFiles/creepMiner.dir/build.make:86: recipe for target 'CMakeFiles/creepMiner.dir/src/MinerUtil.cpp.o' failed make[2]: [CMakeFiles/creepMiner.dir/src/MinerUtil.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/creepMiner.dir/all' failed make[1]: [CMakeFiles/creepMiner.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: [all] Error 2

Creepsky commented 6 years ago

Please use the following command and send us the output: gcc -dM -E - < /dev/null

golyalpha commented 6 years ago

@xwry Did you run cmake with -DMINIMAL_BUILD=ON? Had the same issue, that solved it.

Edit: Scratch that. There's a change required in the sources. @Creepsky it's the __arm__ not being defined on 64bit armv8 CPUs issue. Change lines with #if defined __arm__ or #ifdef __arm__ to #if defined __arm__ || defined __aarch64__

xwry commented 6 years ago

root@rock64:/home/rock64/creepMiner# gcc -dM -E - < /dev/null

define DBL_MIN_EXP (-1021)

define UINT_LEAST16_MAX 0xffff

define __ARM_SIZEOF_WCHAR_T 4

define __ATOMIC_ACQUIRE 2

define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F

define __GCC_IEC_559_COMPLEX 2

define UINT_LEAST8_TYPE unsigned char

define __INTMAX_C(c) c ## L

define __CHAR_BIT__ 8

define __UINT8_MAX__ 0xff

define __WINT_MAX__ 0xffffffffU

define ORDER_LITTLE_ENDIAN 1234

define __SIZE_MAX__ 0xffffffffffffffffUL

define __WCHAR_MAX__ 0xffffffffU

define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1

define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1

define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1

define DBL_DENORM_MIN ((double)4.94065645841246544176568792868221372e-324L)

define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1

define __GCC_ATOMIC_CHAR_LOCK_FREE 2

define __GCC_IEC_559 2

define FLT_EVAL_METHOD 0

define unix 1

define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2

define UINT_FAST64_MAX 0xffffffffffffffffUL

define SIG_ATOMIC_TYPE int

define __DBL_MIN_10_EXP__ (-307)

define FINITE_MATH_ONLY 0

define __ARM_FEATURE_UNALIGNED 1

define __GNUC_PATCHLEVEL__ 0

define UINT_FAST8_MAX 0xff

define has_include(STR) __has_include(STR)

define DEC64_MAX_EXP 385

define __INT8_C(c) c

define UINT_LEAST64_MAX 0xffffffffffffffffUL

define __SHRT_MAX__ 0x7fff

define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L

define __ARM_FEATURE_IDIV 1

define __ARM_FP 14

define UINT_LEAST8_MAX 0xff

define __GCC_ATOMIC_BOOL_LOCK_FREE 2

define __UINTMAX_TYPE__ long unsigned int

define __linux 1

define __DEC32_EPSILON__ 1E-6DF

define __CHAR_UNSIGNED__ 1

define __UINT32_MAX__ 0xffffffffU

define AARCH64_CMODEL_SMALL 1

define LDBL_MAX_EXP 16384

define __WINT_MIN__ 0U

define linux 1

define __SCHAR_MAX__ 0x7f

define __WCHAR_MIN__ 0U

define __INT64_C(c) c ## L

define __DBL_DIG__ 15

define __GCC_ATOMIC_POINTER_LOCK_FREE 2

define __SIZEOF_INT__ 4

define __SIZEOF_POINTER__ 8

define USER_LABEL_PREFIX

define __STDC_HOSTED__ 1

define LDBL_HAS_INFINITY 1

define __ARM_ALIGN_MAX_STACK_PWR 16

define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F

define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L

define STDC_UTF_16 1

define __DEC32_MAX__ 9.999999E96DF

define __ARM_SIZEOF_MINIMAL_ENUM 4

define __INT32_MAX__ 0x7fffffff

define __SIZEOF_LONG__ 8

define STDC_IEC_559 1

define STDC_ISO_10646 201605L

define __UINT16_C(c) c

define __DECIMAL_DIG__ 36

define __gnu_linux__ 1

define has_include_next(STR) has_include_next__(STR)

define __LDBL_HAS_QUIET_NAN__ 1

define GNUC 6

define pie 2

define FLT_HAS_DENORM 1

define SIZEOF_LONG_DOUBLE 16

define __BIGGEST_ALIGNMENT__ 16

define __DBL_MAX__ ((double)1.79769313486231570814527423731704357e+308L)

define INT_FAST32_MAX 0x7fffffffffffffffL

define DBL_HAS_INFINITY 1

define DEC32_MIN_EXP (-94)

define INT_FAST16_TYPE long int

define LDBL_HAS_DENORM 1

define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL

define INT_LEAST32_MAX 0x7fffffff

define __DEC32_MIN__ 1E-95DF

define DBL_MAX_EXP 1024

define __DEC128_EPSILON__ 1E-33DL

define __PTRDIFF_MAX__ 0x7fffffffffffffffL

define STDC_NO_THREADS 1

define LONG_LONG_MAX 0x7fffffffffffffffLL

define SIZEOF_SIZE_T 8

define __ARM_ALIGN_MAX_PWR 28

define SIZEOF_WINT_T 4

define __ARM_FP16_FORMAT_IEEE 1

define __GXX_ABI_VERSION 1010

define FLT_MIN_EXP (-125)

define INT_FAST64_TYPE long int

define __FP_FAST_FMAF 1

define __DBL_MIN__ ((double)2.22507385850720138309023271733240406e-308L)

define PIE 2

define LP64 1

define aarch64 1

define __ARM_FP16_ARGS 1

define __DEC128_MIN__ 1E-6143DL

define __REGISTER_PREFIX__

define __UINT16_MAX__ 0xffff

define DBL_HAS_DENORM 1

define __UINT8_TYPE__ unsigned char

define __NO_INLINE__ 1

define FLT_MANT_DIG 24

define VERSION "6.3.0 20170516"

define __UINT64_C(c) c ## UL

define _STDC_PREDEF_H 1

define __ARM_FEATURE_FMA 1

define __GCC_ATOMIC_INT_LOCK_FREE 2

define FLOAT_WORD_ORDER ORDER_LITTLE_ENDIAN

define __STDC_IEC_559_COMPLEX__ 1

define __INT32_C(c) c

define __DEC64_EPSILON__ 1E-15DD

define ORDER_PDP_ENDIAN 3412

define DEC128_MIN_EXP (-6142)

define __ARM_64BIT_STATE 1

define INT_FAST32_TYPE long int

define UINT_LEAST16_TYPE short unsigned int

define unix 1

define __INT16_MAX__ 0x7fff

define __SIZE_TYPE__ long unsigned int

define __UINT64_MAX__ 0xffffffffffffffffUL

define __INT8_TYPE__ signed char

define ELF 1

define __FLT_RADIX__ 2

define INT_LEAST16_TYPE short int

define __ARM_ARCH_PROFILE 65

define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L

define __UINTMAX_C(c) c ## UL

define __ARM_PCS_AAPCS64 1

define SIG_ATOMIC_MAX 0x7fffffff

define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2

define SIZEOF_PTRDIFF_T 8

define AARCH64EL 1

define DEC32_SUBNORMAL_MIN 0.000001E-95DF

define INT_FAST16_MAX 0x7fffffffffffffffL

define UINT_FAST32_MAX 0xffffffffffffffffUL

define UINT_LEAST64_TYPE long unsigned int

define __FLT_HAS_QUIET_NAN__ 1

define __FLT_MAX_10_EXP__ 38

define __LONG_MAX__ 0x7fffffffffffffffL

define DEC128_SUBNORMAL_MIN 0.000000000000000000000000000000001E-6143DL

define FLT_HAS_INFINITY 1

define __unix 1

define UINT_FAST16_TYPE long unsigned int

define __DEC64_MAX__ 9.999999999999999E384DD

define __CHAR16_TYPE__ short unsigned int

define __PRAGMA_REDEFINE_EXTNAME 1

define INT_LEAST16_MAX 0x7fff

define DEC64_MANT_DIG 16

define __INT64_MAX__ 0x7fffffffffffffffL

define UINT_LEAST32_MAX 0xffffffffU

define __GCC_ATOMIC_LONG_LOCK_FREE 2

define INT_LEAST64_TYPE long int

define __ARM_FEATURE_CLZ 1

define __INT16_TYPE__ short int

define INT_LEAST8_TYPE signed char

define __STDC_VERSION__ 201112L

define DEC32_MAX_EXP 97

define INT_FAST8_MAX 0x7f

define __ARM_ARCH 8

define __INTPTR_MAX__ 0x7fffffffffffffffL

define linux 1

define LDBL_MANT_DIG 113

define __DBL_HAS_QUIET_NAN__ 1

define SIG_ATOMIC_MIN (-SIG_ATOMIC_MAX - 1)

define __INTPTR_TYPE__ long int

define __UINT16_TYPE__ short unsigned int

define __WCHAR_TYPE__ unsigned int

define __SIZEOF_FLOAT__ 4

define pic 2

define __UINTPTR_MAX__ 0xffffffffffffffffUL

define __ARM_ARCH_8A 1

define DEC64_MIN_EXP (-382)

define INT_FAST64_MAX 0x7fffffffffffffffL

define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1

define __FLT_DIG__ 6

define UINT_FAST64_TYPE long unsigned int

define __INT_MAX__ 0x7fffffff

define __INT64_TYPE__ long int

define FLT_MAX_EXP 128

define ORDER_BIG_ENDIAN 4321

define DBL_MANT_DIG 53

define INT_LEAST64_MAX 0x7fffffffffffffffL

define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2

define __DEC64_MIN__ 1E-383DD

define __WINT_TYPE__ unsigned int

define UINT_LEAST32_TYPE unsigned int

define __SIZEOF_SHORT__ 2

define LDBL_MIN_EXP (-16381)

define INT_LEAST8_MAX 0x7f

define __SIZEOF_INT128__ 16

define __LDBL_MAX_10_EXP__ 4932

define __ATOMIC_RELAXED 0

define __DBL_EPSILON__ ((double)2.22044604925031308084726333618164062e-16L)

define _LP64 1

define __UINT8_C(c) c

define INT_LEAST32_TYPE int

define SIZEOF_WCHAR_T 4

define __UINT64_TYPE__ long unsigned int

define __ARM_NEON 1

define INT_FAST8_TYPE signed char

define GNUC_STDC_INLINE 1

define DBL_DECIMAL_DIG 17

define STDC_UTF_32 1

define DEC_EVAL_METHOD 2

define __UINT32_C(c) c ## U

define __INTMAX_MAX__ 0x7fffffffffffffffL

define __BYTE_ORDER ORDER_LITTLE_ENDIAN__

define FLT_DENORM_MIN 1.40129846432481707092372958328991613e-45F

define __INT8_MAX__ 0x7f

define PIC 2

define UINT_FAST32_TYPE long unsigned int

define __CHAR32_TYPE__ unsigned int

define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F

define __FP_FAST_FMA 1

define __ARM_FEATURE_NUMERIC_MAXMIN 1

define __INT32_TYPE__ int

define __SIZEOF_DOUBLE__ 8

define __FLT_MIN_10_EXP__ (-37)

define __INTMAX_TYPE__ long int

define DEC128_MAX_EXP 6145

define __ATOMIC_CONSUME 1

define __GNUC_MINOR__ 3

define __UINTMAX_MAX__ 0xffffffffffffffffUL

define DEC32_MANT_DIG 7

define __DBL_MAX_10_EXP__ 308

define LDBL_DENORM_MIN 6.47517511943802511092443895822764655e-4966L

define __INT16_C(c) c

define __ARM_ARCH_ISA_A64 1

define STDC 1

define __PTRDIFF_TYPE__ long int

define __ATOMIC_SEQ_CST 5

define __UINT32_TYPE__ unsigned int

define __UINTPTR_TYPE__ long unsigned int

define DEC64_SUBNORMAL_MIN 0.000000000000001E-383DD

define DEC128_MANT_DIG 34

define __LDBL_MIN_10_EXP__ (-4931)

define SIZEOF_LONG_LONG 8

define __GCC_ATOMIC_LLONG_LOCK_FREE 2

define __LDBL_DIG__ 33

define FLT_DECIMAL_DIG 9

define UINT_FAST16_MAX 0xffffffffffffffffUL

define __GCC_ATOMIC_SHORT_LOCK_FREE 2

define UINT_FAST8_TYPE unsigned char

define __ATOMIC_ACQ_REL 4

define __ATOMIC_RELEASE 3

root@rock64:/home/rock64/creepMiner#

xwry commented 6 years ago

I ve tried once again to compile it from the beginning and the same error appeared in other place :

root@rock64:/home/rock64/creepMiner# cmake CMakeLists.txt -DCMAKE_BUILD_TYPE=RELEASE -DMINIMAL_BUILD=ON -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Current conanbuildinfo.cmake directory: /home/rock64/creepMiner -- Conan: Compiler GCC>=5, checking major version 6 -- Conan: Checking correct version: 6 -- Conan: Using cmake global configuration -- Conan: Adjusting default RPATHs Conan policies -- Conan: Adjusting language standard -- Configuring done -- Generating done -- Build files have been written to: /home/rock64/creepMiner root@rock64:/home/rock64/creepMiner# make Scanning dependencies of target creepMiner [ 2%] Building CXX object CMakeFiles/creepMiner.dir/src/Declarations.cpp.o [ 5%] Building CXX object CMakeFiles/creepMiner.dir/src/MinerUtil.cpp.o /home/rock64/creepMiner/src/MinerUtil.cpp:76:19: fatal error: cpuid.h: No such file or directory ^ compilation terminated. CMakeFiles/creepMiner.dir/build.make:86: recipe for target 'CMakeFiles/creepMiner.dir/src/MinerUtil.cpp.o' failed make[2]: [CMakeFiles/creepMiner.dir/src/MinerUtil.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/creepMiner.dir/all' failed make[1]: [CMakeFiles/creepMiner.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

golyalpha commented 6 years ago

Seems like you didn't do the edit I mentioned. Open the src/MinerUtil.cpp file in any text editor, find any line saying #ifdef __arm__ or #if defined __arm__ and replace them with #if defined __arm__ || defined __aarch64__

There should be two different lines for you to change. One at L77 and one L942.

xwry commented 6 years ago

Thanks @golyalpha i did what you suggest and it compiled without errors.

golyalpha commented 6 years ago

No probs. By the way, does it segfault for you when you run it? @xwry

xwry commented 6 years ago

@golyalpha I had segmentation fault with mining.conf example copied from creepMiner wiki and created by me in /home/rock64/creepMiner (in my case). Then i found other mining.conf automatically created by creepMiner in /root/.creepMiner /1.8.0/ folder, I copied that one to home dir and then, there was no segfault any more. Both files were using SSE2, but there must be some difference.

mirkster commented 6 years ago

Thanks golyalpha. Your edit worked for me on a s912 android tv box running Armbian.

kush930 commented 2 years ago

Hi all,

I clone pytorch from link:- https://github.com/pytorch/pytorch.git

I am building pytorch on riscv64, I am facing issue:-

In file included from /home/root/kush/pytorch/third_party/cpuinfo/src/x86/init.c:5:
/home/root/kush/pytorch/third_party/cpuinfo/src/x86/cpuid.h:5:11: fatal error: cpuid.h: No such file or directory
    5 |  #include <cpuid.h>
      |           ^~~~~~~~~
compilation terminated.
make[2]: *** [confu-deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/build.make:121: confu-deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/src/x86/init.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1788: confu-deps/cpuinfo/CMakeFiles/cpuinfo_internals.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

if anyone know, where i am wrong, please guide me to build pytorch on riscv64.

T&R Kush

golyalpha commented 2 years ago

@kush930 wrong repo/issue?

kush930 commented 2 years ago

Hi golyalpha,

I am using master branch of pytorch https://github.com/pytorch/pytorch.git and using command python3 setup.py installfor building on riscv64 platform.

T&R Kush Kumar

golyalpha commented 2 years ago

This is not the pytorch repository. Create a new issue on the repository you linked.

BaiDXia commented 11 months ago

arm 我在rk3588安装openMVS也出现了这个问题,请问有解决办法吗?

/root/MVS/openMVS/libs/Common/Util.cpp:482:10: fatal error: cpuid.h: No such file or directory 482 | #include | ^~~~~ compilation terminated. make[2]: [libs/Common/CMakeFiles/Common.dir/build.make:167: libs/Common/CMakeFiles/Common.dir/Util.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:389: libs/Common/CMakeFiles/Common.dir/all] Error 2 make: [Makefile:130: all] Error 2

Creepsky commented 11 months ago

@BaiDXia OpenMVS does not support your CPU, nothing you can do without changing the code (or ask the owners to change it for you). Try open a ticket there.