abolz / Drachennest

Different algorithms for converting binary to decimal floating-point numbers
Boost Software License 1.0
116 stars 7 forks source link

Issues compiling #8

Open JoshuaSBrown opened 2 years ago

JoshuaSBrown commented 2 years ago

Hi, am running into some issues compiling this library and wanted to post them in case you were not aware.

/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:177:22: error: ‘JenkinsRandom random’ redeclared as different kind of entity
  177 | static JenkinsRandom random;
      |                      ^~~~~~
In file included from /usr/include/c++/9/cstdlib:75,
                 from /usr/include/c++/9/bits/stl_algo.h:59,
                 from /usr/include/c++/9/algorithm:62,
                 from /home/brownjs/software/Drachennest/ext/google_benchmark/include/benchmark/benchmark.h:172,
                 from /home/brownjs/software/Drachennest/bench/bench_dtoa.cc:1:
/usr/include/stdlib.h:401:17: note: previous declaration ‘long int random()’
  401 | extern long int random (void) __THROW;
      |                 ^~~~~~
/home/brownjs/software/Drachennest/bench/bench_strtod.cc:144:22: error: ‘JenkinsRandom random’ redeclared as different kind of entity
  144 | static JenkinsRandom random;
      |                      ^~~~~~
In file included from /usr/include/c++/9/cstdlib:75,
                 from /usr/include/c++/9/bits/stl_algo.h:59,
                 from /usr/include/c++/9/algorithm:62,
                 from /home/brownjs/software/Drachennest/ext/google_benchmark/include/benchmark/benchmark.h:172,
                 from /home/brownjs/software/Drachennest/bench/bench_strtod.cc:1:
/usr/include/stdlib.h:401:17: note: previous declaration ‘long int random()’
  401 | extern long int random (void) __THROW;
      |                 ^~~~~~
In file included from /usr/include/c++/9/bits/stl_algo.h:66,
                 from /usr/include/c++/9/algorithm:62,
                 from /home/brownjs/software/Drachennest/ext/google_benchmark/include/benchmark/benchmark.h:172,
                 from /home/brownjs/software/Drachennest/bench/bench_dtoa.cc:1:
/usr/include/c++/9/bits/uniform_int_dist.h: In instantiation of ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = long unsigned int; std::uniform_int_distribution<_IntType>::result_type = long unsigned int]’:
/usr/include/c++/9/bits/uniform_int_dist.h:173:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = long unsigned int; std::uniform_int_distribution<_IntType>::result_type = long unsigned int]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:262:98:   required from here
/usr/include/c++/9/bits/uniform_int_dist.h:230:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  230 |    _Gresult_type;
      |    ^~~~~~~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h:233:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  233 |    __uctype;
      |    ^~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h: In instantiation of ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = unsigned int; std::uniform_int_distribution<_IntType>::result_type = unsigned int]’:
/usr/include/c++/9/bits/uniform_int_dist.h:173:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = unsigned int; std::uniform_int_distribution<_IntType>::result_type = unsigned int]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:272:97:   required from here
/usr/include/c++/9/bits/uniform_int_dist.h:230:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  230 |    _Gresult_type;
      |    ^~~~~~~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h:233:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  233 |    __uctype;
      |    ^~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h: In instantiation of ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = long int; std::uniform_int_distribution<_IntType>::result_type = long int]’:
/usr/include/c++/9/bits/uniform_int_dist.h:173:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = long int; std::uniform_int_distribution<_IntType>::result_type = long int]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:328:31:   required from here
/usr/include/c++/9/bits/uniform_int_dist.h:230:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  230 |    _Gresult_type;
      |    ^~~~~~~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h:233:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  233 |    __uctype;
      |    ^~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h: In instantiation of ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’:
/usr/include/c++/9/bits/uniform_int_dist.h:173:51:   required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:372:31:   required from here
/usr/include/c++/9/bits/uniform_int_dist.h:230:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  230 |    _Gresult_type;
      |    ^~~~~~~~~~~~~
/usr/include/c++/9/bits/uniform_int_dist.h:233:4: error: ‘long int() noexcept’ is not a class, struct, or union type
  233 |    __uctype;
      |    ^~~~~~~~
In file included from /usr/include/c++/9/random:51,
                 from /home/brownjs/software/Drachennest/bench/bench_dtoa.cc:14:
/usr/include/c++/9/bits/random.tcc: In instantiation of ‘_RealType std::generate_canonical(_UniformRandomNumberGenerator&) [with _RealType = double; long unsigned int __bits = 53; _UniformRandomNumberGenerator = long int() noexcept]’:
/usr/include/c++/9/bits/random.h:181:38:   required from ‘_DInputType std::__detail::_Adaptor<_Engine, _DInputType>::operator()() [with _Engine = long int() noexcept; _DInputType = double]’
/usr/include/c++/9/bits/random.h:1862:19:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_real_distribution<_RealType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = double; std::uniform_real_distribution<_RealType>::result_type = double]’
/usr/include/c++/9/bits/random.h:1853:51:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = double; std::uniform_real_distribution<_RealType>::result_type = double]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:404:36:   required from here
/usr/include/c++/9/bits/random.tcc:3327:63: error: request for member ‘max’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3327 |       const long double __r = static_cast<long double>(__urng.max())
      |                                                        ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3328:42: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3328 |        - static_cast<long double>(__urng.min()) + 1.0L;
      |                                   ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3337:41: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3337 |    __sum += _RealType(__urng() - __urng.min()) * __tmp;
      |                                  ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc: In instantiation of ‘_RealType std::generate_canonical(_UniformRandomNumberGenerator&) [with _RealType = float; long unsigned int __bits = 24; _UniformRandomNumberGenerator = long int() noexcept]’:
/usr/include/c++/9/bits/random.h:181:38:   required from ‘_DInputType std::__detail::_Adaptor<_Engine, _DInputType>::operator()() [with _Engine = long int() noexcept; _DInputType = float]’
/usr/include/c++/9/bits/random.h:1862:19:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_real_distribution<_RealType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = float; std::uniform_real_distribution<_RealType>::result_type = float]’
/usr/include/c++/9/bits/random.h:1853:51:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = float; std::uniform_real_distribution<_RealType>::result_type = float]’
/home/brownjs/software/Drachennest/bench/bench_dtoa.cc:430:35:   required from here
/usr/include/c++/9/bits/random.tcc:3327:63: error: request for member ‘max’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3327 |       const long double __r = static_cast<long double>(__urng.max())
      |                                                        ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3328:42: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3328 |        - static_cast<long double>(__urng.min()) + 1.0L;
      |                                   ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3337:41: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3337 |    __sum += _RealType(__urng() - __urng.min()) * __tmp;
      |                                  ~~~~~~~^~~
make[2]: *** [bench/CMakeFiles/bench_dtoa.dir/build.make:63: bench/CMakeFiles/bench_dtoa.dir/bench_dtoa.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:252: bench/CMakeFiles/bench_dtoa.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/9/random:51,
                 from /home/brownjs/software/Drachennest/bench/bench_strtod.cc:6:
/usr/include/c++/9/bits/random.tcc: In instantiation of ‘_RealType std::generate_canonical(_UniformRandomNumberGenerator&) [with _RealType = double; long unsigned int __bits = 53; _UniformRandomNumberGenerator = long int() noexcept]’:
/usr/include/c++/9/bits/random.h:181:38:   required from ‘_DInputType std::__detail::_Adaptor<_Engine, _DInputType>::operator()() [with _Engine = long int() noexcept; _DInputType = double]’
/usr/include/c++/9/bits/random.h:1862:19:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const std::uniform_real_distribution<_RealType>::param_type&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = double; std::uniform_real_distribution<_RealType>::result_type = double]’
/usr/include/c++/9/bits/random.h:1853:51:   required from ‘std::uniform_real_distribution<_RealType>::result_type std::uniform_real_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&) [with _UniformRandomNumberGenerator = long int() noexcept; _RealType = double; std::uniform_real_distribution<_RealType>::result_type = double]’
/home/brownjs/software/Drachennest/bench/bench_strtod.cc:167:52:   required from here
/usr/include/c++/9/bits/random.tcc:3327:63: error: request for member ‘max’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3327 |       const long double __r = static_cast<long double>(__urng.max())
      |                                                        ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3328:42: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3328 |        - static_cast<long double>(__urng.min()) + 1.0L;
      |                                   ~~~~~~~^~~
/usr/include/c++/9/bits/random.tcc:3337:41: error: request for member ‘min’ in ‘__urng’, which is of non-class type ‘long int() noexcept’
 3337 |    __sum += _RealType(__urng() - __urng.min()) * __tmp;
      |                                  ~~~~~~~^~~
make[2]: *** [bench/CMakeFiles/bench_strtod.dir/build.make:63: bench/CMakeFiles/bench_strtod.dir/bench_strtod.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:222: bench/CMakeFiles/bench_strtod.dir/all] Error 2
[ 95%] Linking CXX executable test_all
[ 95%] Built target test_all
make: *** [Makefile:84: all] Error 2
abolz commented 2 years ago

Thanks! Looks like renaming random to something like rng should fix the problem?