bitcoinjs / fast-dat-parser

Superfast blockchain parser for stats
MIT License
74 stars 27 forks source link

centos make error #12

Closed ghost closed 6 years ago

ghost commented 6 years ago
[root@localhost fast-dat-parser]# make
g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/bestchain.cpp -o src/bestchain.o
g++: error: unrecognized command line option ‘-std=c++1z’
make: *** [src/bestchain.o] Error 1
[root@localhost fast-dat-parser]# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

do i need newer version of gcc ?

running centos 7 x64 3.10.0-693.11.1.el7.x86_64

ghost commented 6 years ago

okie., updated my gcc

[root@localhost fast-dat-parser]# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-4/root/usr --mandir=/opt/rh/devtoolset-4/root/usr/share/man --infodir=/opt/rh/devtoolset-4/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-5.3.1-20160406/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)

now i get these errors.,

[root@localhost fast-dat-parser]# make
g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/bestchain.cpp -o src/bestchain.o
In file included from src/bestchain.cpp:10:0:
include/serial.hpp: In function ‘auto serial::peek(const R&)’:
include/serial.hpp:17:48: error: expected ‘,’ before ‘)’ token
   static_assert(std::is_same<T, uint8_t>::value);
                                                ^
include/serial.hpp:17:48: error: expected string-literal before ‘)’ token
include/serial.hpp:18:43: error: expected ‘,’ before ‘)’ token
   static_assert(sizeof(E) % sizeof(T) == 0);
                                           ^
include/serial.hpp:18:43: error: expected string-literal before ‘)’ token
include/serial.hpp: In function ‘void serial::place(R&, E)’:
include/serial.hpp:40:48: error: expected ‘,’ before ‘)’ token
   static_assert(std::is_same<T, uint8_t>::value);
                                                ^
include/serial.hpp:40:48: error: expected string-literal before ‘)’ token
include/serial.hpp:41:43: error: expected ‘,’ before ‘)’ token
   static_assert(sizeof(E) % sizeof(T) == 0);
                                           ^
include/serial.hpp:41:43: error: expected string-literal before ‘)’ token
make: *** [src/bestchain.o] Error 1
dcousens commented 6 years ago

@rawmaterials this is technically a duplicate of https://github.com/dcousens/fast-dat-parser/issues/11.

The repository uses C++17, but maybe if wanted I'll make a PR to revert it to C++14 or something...

ghost commented 6 years ago

i added optional message and its working now., thanks.

scriptzteam commented 6 years ago

@rawmaterials what you added and where pls :D

ghost commented 6 years ago

@scriptzteam here is my serial.hpp

https://pastebin.com/5Tgp5JE1

dcousens commented 6 years ago

@scriptzteam @rawmaterials I fixed the issue in master

https://github.com/bitcoinjs/fast-dat-parser/commit/793c5d8a9557f492c4eeb6eddfc85a6c9ffec088

scriptzteam commented 6 years ago

@rawmaterials did not works for me either ...

~/fast-dat-parser# make
g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/bestchain.cpp -o src/bestchain.o
g++ src/bestchain.o -lcrypto -O3 -o bestchain
g++ -pedantic -std=c++1z -W -Wall -Wcast-qual -Wconversion -Werror -Wextra -Wwrite-strings -O3 -Iinclude -MMD -MP -c src/parser.cpp -o src/parser.o
src/parser.cpp: In function ‘int main(int, char**)’:
src/parser.cpp:34:43: error: format ‘%lu’ expects argument of type ‘long unsigned int*’, but argument 3 has type ‘size_t* {aka unsigned int*}’ [-Werror=format=]
   if (sscanf(arg, "-t%lu", &transformIndex) == 1) {
                                           ^
src/parser.cpp:52:37: error: format ‘%lu’ expects argument of type ‘long unsigned int*’, but argument 3 has type ‘size_t* {aka unsigned int*}’ [-Werror=format=]
   if (sscanf(arg, "-j%lu", &nThreads) == 1) continue;
                                     ^
src/parser.cpp:53:40: error: format ‘%lu’ expects argument of type ‘long unsigned int*’, but argument 3 has type ‘size_t* {aka unsigned int*}’ [-Werror=format=]
   if (sscanf(arg, "-m%lu", &memoryAlloc) == 1) continue;
                                        ^
In file included from src/parser.cpp:9:0:
include/bitcoin.hpp: In instantiation of ‘auto BlockBase<S>::transactions() const [with S = __ranger::Range<unsigned char*>]’:
src/statistics.hpp:104:42:   required from ‘void dumpASM<Block>::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1:   required from here
include/bitcoin.hpp:216:41: error: conversion to ‘size_t {aka unsigned int}’ from ‘long long unsigned int’ may alter its value [-Werror=conversion]
   return TransactionRange<S>(copy, count);
                                         ^
include/bitcoin.hpp: In instantiation of ‘auto {anonymous}::readTransaction(R&) [with R = __ranger::Range<unsigned char*>]’:
include/bitcoin.hpp:169:25:   required from ‘auto TransactionRange<R>::front() [with R = __ranger::Range<unsigned char*>]’
src/statistics.hpp:106:49:   required from ‘void dumpASM<Block>::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1:   required from here
include/bitcoin.hpp:114:33: error: conversion to ‘size_t {aka unsigned int}’ from ‘long long unsigned int’ may alter its value [-Werror=conversion]
    const auto script = readRange(data, scriptLen);
                                 ^
include/bitcoin.hpp:128:33: error: conversion to ‘size_t {aka unsigned int}’ from ‘long long unsigned int’ may alter its value [-Werror=conversion]
    const auto script = readRange(data, scriptLen);
                                 ^
include/bitcoin.hpp: In instantiation of ‘auto {anonymous}::readStack(R&) [with R = __ranger::Range<unsigned char*>]’:
include/bitcoin.hpp:138:33:   required from ‘auto {anonymous}::readTransaction(R&) [with R = __ranger::Range<unsigned char*>]’
include/bitcoin.hpp:169:25:   required from ‘auto TransactionRange<R>::front() [with R = __ranger::Range<unsigned char*>]’
src/statistics.hpp:106:49:   required from ‘void dumpASM<Block>::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1:   required from here
include/bitcoin.hpp:86:32: error: conversion to ‘size_t {aka unsigned int}’ from ‘long long unsigned int’ may alter its value [-Werror=conversion]
    stack.emplace_back(readRange(r, readVI(r)));
                                ^
In file included from include/hash.hpp:8:0,
                 from include/bitcoin.hpp:9,
                 from src/parser.cpp:9:
include/ranger.hpp: In instantiation of ‘void __ranger::Range<I>::put(E) [with E = __ranger::Range<const char*>; I = unsigned char*]’:
include/bitcoin.hpp:251:44:   required from ‘void putASM(R&, const R&) [with R = __ranger::Range<unsigned char*>]’
src/statistics.hpp:110:11:   required from ‘void dumpASM<Block>::operator()(const Block&) [with Block = BlockBase<__ranger::Range<unsigned char*> >]’
src/parser.cpp:145:1:   required from here
include/ranger.hpp:86:32: error: no matching function for call to ‘put(__ranger::Range<unsigned char*>&, __ranger::Range<const char*>&)’
  void put (E e) { __ranger::put(*this, e); }
                                ^
include/ranger.hpp:23:6: note: candidate: void __ranger::put(R&, typename R::value_type) [with R = __ranger::Range<unsigned char*>; typename R::value_type = unsigned char]
 void put (R& r, typename R::value_type e) {
      ^
include/ranger.hpp:23:6: note:   no known conversion for argument 2 from ‘__ranger::Range<const char*>’ to ‘__ranger::Range<unsigned char*>::value_type {aka unsigned char}’
include/ranger.hpp:36:6: note: candidate: template<class R, class E, class V> void __ranger::put(R&, E)
 void put (R& r, E e) {
      ^
include/ranger.hpp:36:6: note:   template argument deduction/substitution failed:
include/ranger.hpp:31:2: error: no type named ‘type’ in ‘struct std::enable_if<false, __ranger::Range<const char*> >’
  typename V = typename std::enable_if<
  ^
In file included from include/bitcoin.hpp:9:0,
                 from src/parser.cpp:9:
include/hash.hpp: At global scope:
include/hash.hpp:58:7: error: ‘auto {anonymous}::toHexBE(const uint256_t&)’ defined but not used [-Werror=unused-function]
  auto toHexBE (const uint256_t& hash) {
       ^
cc1plus: all warnings being treated as errors
Makefile:28: recipe for target 'src/parser.o' failed
make: *** [src/parser.o] Error 1
dcousens commented 6 years ago

@scriptzteam compiling on a 32-bit system? Most of those errors are implicit conversions from size_t to uint64_t

include/bitcoin.hpp:86:32: error: conversion to ‘size_t {aka unsigned int}’ from ‘long long unsigned int’ may alter its value [-Werror=conversion]
dcousens commented 6 years ago

@scriptzteam probably need to lower the number of warnings, as -Werror=unused-function is unnecessarily stopping you.