- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - suanhwee
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - suanhwee
Hi,
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
Use ldd /path..../program function system() in your source or in shell (easy side).
see also source ldd.
Add futures in your source an parameter for name compiler main(.... argv.... better.
Kind regards
If program call money licence is Icc....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - suanhwee
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Linux, for example, I use objdump to check the compiler ... as like
$ objdump -s --section .comment /path/to/your/binary/or/library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Look up the pre-defined macros in the icc documentation, if that is your interest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - suanhwee
Hi,
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
Is there a define that intel compiler or g++ sets to inidicate that the program is compiled by the intel compiler or g++ can i detect it during runtime from the source code?
I have been looking around but i just cant find those defines.
Thanks
Forgive me if your question has already been answered, but I thought I'd add some clarification just in case. There are at least two ways I can interpret your question. If you want to tell at compile time, i.e. in the source while it's being compiled, that's pretty straightforward. The recommended macro to rely on is __INTEL_COMPILER, which is set to the compiler version (e.g. the 11.1 compiler is 1110). If that is defined, you know you're building with the Intel compiler. The other question you might be asking is if you've got an executable, can you tell if it was built with icc or gcc, that's trickier. If you're building the exceutable you can build something into it to answer that question at runtime using the above mentioned macro. If you've got a mystery executable and you're wondering how it was built, well that's a more complicated question.
Hope that helped.
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Dale Schouten (Intel)
The other question you might be asking is if you've got an executable, can you tell if it was built with icc or gcc, that's trickier. If you're building the exceutable you can build something into it to answer that question at runtime using the above mentioned macro. If you've got a mystery executable and you're wondering how it was built, well that's a more complicated question.
A dead give-away is the presence or absence of the _intel_ run-time library functions in place of standard glibc equivalents.
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