- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting an error while trying to compile next source:
$ cat icctest.cpp
[cpp]#include[/cpp]
[cpp]#includeint main(int argc, char *argv[]) { std::cout << std::fpclassify(7.6) << "\n"; return 0; } [/cpp]
$ icpc --versionicpc (ICC) 12.0.5 20110719$ icc -o icctest icctest.cpp/tmp/icch3LO8h.o: In function `main':icctest.cpp:(.text+0x4a): undefined reference to `__builtin_fpclassify'
GCC compiles this successfully. If I use other version of compiler I got another error(this seems to be fixed):
$ icpc --versionicpc (ICC) 11.1 20091130Copyright (C) 1985-2009 Intel Corporation. All rights reserved.$ icc -o icctest icctest.cpp
/usr/include/c++/4.4.4/cmath(500): error: identifier "__builtin_fpclassify" is undefinedreturn __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,^detected during instantiation of "__gnu_cxx::__enable_if<:__IS_ARITHMETIC><_Tp>::__value, int>::__type std::fpclassify(_Tp) [with _Tp=double]" at line 6 of "icctest.cpp"
Seems compiler didn't see that__builtin_fpclassify function is internal and trying to find it in libraries.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No it is not fixed yet. A call to __builtin_fpclassify() will still be unresolved by the linker since the Intel compiler is not yet recognizing it as an intrinsic. This is not consistent with g++ 4.4.1 and later.
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't work at all for me until I add
#include
using namespace std;
after which it works fine when either gcc 4.4.4 or 4.5.1 is on PATH.
I had to look up FAQ; even if you are used to some past version of C++, an FAQ check can't hurt.
#include
using namespace std;
after which it works fine when either gcc 4.4.4 or 4.5.1 is on PATH.
I had to look up FAQ; even if you are used to some past version of C++, an FAQ check can't hurt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a known problem when using thegcc 4.4 and later system headers. It is currently entered in our cq database as defect cq #169510.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it fixed in some version of compiler?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean by "fixed?" The behavior is consistent with the active g++, whose developers have decided this is the correct behavior. In some cases, icpc is stricter than g++ default, but this is not one of them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No it is not fixed yet. A call to __builtin_fpclassify() will still be unresolved by the linker since the Intel compiler is not yet recognizing it as an intrinsic. This is not consistent with g++ 4.4.1 and later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting bay3255
I am getting an error while trying to compile next source:
$ cat icctest.cpp
[cpp]#include[/cpp]
- #include
- intmain(intargc,char*argv[])
- {
- std::cout<<:FPCLASSIFY>"\n";
- return0;
- }
[cpp]#includeint main(int argc, char *argv[]) { std::cout << std::fpclassify(7.6) << "n"; return 0; } [/cpp]
$ icpc --versionicpc (ICC) 12.0.5 20110719$ icc -o icctest icctest.cpp/tmp/icch3LO8h.o: In function `main':icctest.cpp:(.text+0x4a): undefined reference to `__builtin_fpclassify'
GCC compiles this successfully. If I use other version of compiler I got another error(this seems to be fixed):
$ icpc --versionicpc (ICC) 11.1 20091130Copyright (C) 1985-2009 Intel Corporation. All rights reserved.$ icc -o icctest icctest.cpp
/usr/include/c++/4.4.4/cmath(500): error: identifier "__builtin_fpclassify" is undefinedreturn __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,^detected during instantiation of "__gnu_cxx::__enable_if<:__IS_ARITHMETIC><_Tp>::__value, int>::__type std::fpclassify(_Tp) [with _Tp=double]" at line 6 of "icctest.cpp"
Seems compiler didn't see that__builtin_fpclassify function is internal and trying to find it in libraries.
shv@dpd20:~> icpc --version
icpc (ICC) 12.0.5 20110719
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
i encountered a new problem when i was executing the icctest.cpp file:
The program works fine with intel64 architecture and when i ran it using the ia32 architecture i got an catastrophic error:
/usr/include/gnu/stubs.h(7): catastrophic error: cannot open source file "gnu/stubs-32.h"
# include
^
compilation aborted for fpclassify.cpp (code 4)
so i was not able to reproduce the problem with either of the architecture.
can i know which architecture you using? intel64 or ia32?
Thanks and Regards,
Sukruth.H.V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like a completely different issue.
Question: Do you have a stubs-32.h file in /usr/include/gnu? I see one on my RH5 ia32 operating system. What operating system are you using? Are you using any compilation flags?
Judy
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page