Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

c++11 numeric_limits lowest function

Mikael_G_
Beginner
591 Views

Hi,

I try to compile exabayes software with icpc. When I run make, first error reported is :

error: class "std::numeric_limits<double>" has no member "lowest"
      result._val = std::numeric_limits<double>::lowest();

So I try a simple code :

// numeric_limits example
#include <iostream>     // std::cout
#include <limits>       // std::numeric_limits

int main () {
  std::cout << std::boolalpha;
  std::cout << "Minimum value for int: " << std::numeric_limits<int>::min() << '\n';
  std::cout << "Maximum value for int: " << std::numeric_limits<int>::max() << '\n';
  std::cout << "int is signed: " << std::numeric_limits<int>::is_signed << '\n';
  std::cout << "Non-sign bits in int: " << std::numeric_limits<int>::digits << '\n';
  std::cout << "int has infinity: " << std::numeric_limits<int>::has_infinity << '\n';
  std::cout << "lowest: " << std::numeric_limits<int>::lowest() << '\n';
  return 0;
}

I get the same error :

$ icpc -std=c++11 -o limit numeric_limits.cpp
numeric_limits.cpp(12): error: class "std::numeric_limits<int>" has no member "lowest"
    std::cout << "lowest: " << std::numeric_limits<int>::lowest() << '\n';

I use this icpc version :

$ icpc -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.1.150 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

Thanks for help.

0 Kudos
3 Replies
TimP
Honored Contributor III
591 Views

Does the g++ on path support this?

0 Kudos
Mikael_G_
Beginner
591 Views

No, it doesn't.

I load a new version of gcc and it works !

I didn't know icpc used gcc ...

Thanks

0 Kudos
Kittur_G_Intel
Employee
591 Views

Hi Mikael.
ICC is actually GNU based in that it uses the GNU assembler, linker and headers (ex: stdio.h etc.) for ensuring that it's compatible with GNU. For example, if you have GNU version say 4.4 on your system, then ICC will emulate GCC 4.6 for compatibility. ICC will try to figure out which version of GNU you have installed by looking at the gcc or g++ in your PATH. Hence it worked after you installed the correct version of GCC.

Regards,
Kittur

0 Kudos
Reply