- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a couple of questions on the usage of the math library in windows (64bit, vs2010).
In the documentation of the intel c++ compiler (12.1), in the article "Using Intel Math Library" a simple program appropriate for windows is presented and then the user is instructed to add the compilation flags /Qlong-double /Qpc80 . After adding them in the Additional Compile Options of project properties (there is no visual entry for this), I got a warning that the options are not recognized and therefore ignored . What am I doing wrong ?
Also, tried to go through the mathimf.h file and so some ppc macro __INTEL_COMPILER (or something very similar). Where is this defined ? Should I define it ? Also there seems to be __ICL etc. where can one obtain a list of the meaning of these macros ? Unfortunately the documentation shipped with the product (Parallel Studio 2011) leaves some to be desired..
Thank you in advance for your help,
Petros
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can access the .chm including description of the options you mentioned from the Start menu, in case you have difficulty with the installation of ICL documentation under the VS GUI. Start>all programs>intel parallel studio....>documentation>
The ability to support long-double as wider than double, which was always incompatible with the Microsoft library/header usage, appears to have been removed, and /Qpc80 would then apply only to the IA32 compiler in /arch:IA32 mode.
As Sergey hinted, you should check the Additional Predefined Macros category in the documentation, and maybe file an issue to request restoration of fuller documentation on __INTEL_COMPILER.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
imP and Sergey,
Thank you for your comments. However- Sergey- the documentation indeed says that the long double in printf is not supported. aturally, since MS crt does not -really-know long doubles . However this in no way means, that the option to the compiler should not be recognized ! This has nothing top do with what I use it for .Also, I do not know the page reference you are offering since I only have the chm which I view from the Help menu in vs2010.However, (if this were somewhere else, then I don't know how to get to it - I have no pdf file with the compiler reference as you seem to suggest - would though be strange since this is the place where the usage of the math library is described ).
At the end of the day, I still don't know how to use the 80bit long-double from the 12.1 intel c++ compiler within the vs2010 environment.
Also, TimP, I see in the documentation, under compiler reference, a topic named "Macros". I do not see any Additional Predefined Macros entry. Where is it ? (again, looking at the chm in vs2010)
Thank you in advance for the help (indebted that you came back to me on a Sunday!! -;)))
PS: Apologies if all this is too naive/pedantic, but the vs2010 help facility is the only documenattion I have. Is there something more that I could see on the internet ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to add that Microsoft compilers and run-time libraries provide backward compatibility for long double primitive type.This compatability is intended mainly to be used by 16-bit compiled code.
Here is the link :http://msdn.microsoft.com/en-us/library/9cx8xs15.aspx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apologies: to TimP for mis-spelling his name ( the evils of wireless keyboard ;-)).
Clarification: I only tried to compile the program that is presented in the documentation .Apparently I do not have documentation that responders refer to.
Question: Is there a more complete documentation for the intel c++ 12.1 compiler I could download ? Could it be that it is the C++ Compiler XE 2011 that supports this ? (are they different ?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
XE 2011 and 12.0/12.1 are the same thing. Current versions are 13.0, but 12.1 remains fully supported (but as you say, not strongly documented as to features which may have been dropped since earlier versions).
Perhaps you could quote a URL of documentation to which you refer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
XE 2011 and 12.0/12.1 are the same thing. Current versions are 13.0, but 12.1 remains fully supported (but as you say, not strongly documented as to features which may have been dropped since earlier versions).
Perhaps you could quote a URL of documentation to which you refer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TimP,
I use the chm documentation that comes in vs2010. I checked it against the document Sergey suggested and is pretty much identical (especially when it comes to the specific topic) maybe a bit more skewed to Linux.
Sergey,
It is pretty clear to me that printf being a function from the ms rt will have no concept of an 80 bit long double. This is besides the point, though.
The compiler tells me that the options are NOT supported. As I mentioned before, I am using the example from the documentation, where in the printf line the 80bit floater is casted down. So the printf is not the problem. And the intel documentation does a very good job to warn the user, when it says that this has to be internal to the his/hers application.
Thank you for your help TimP and Sergey .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"Note: MinGW is the only C/C++ compiler I know ( actually it could be more... ) that allocates 12 bytes ( 96-bits ) when a long double variable is declared."
As far as I know, icc for linux follows the same practices as gcc: for 32-bit compilation, 80-bit long double is padded to 96 bits; for 64-bit mode, it's padded to 128 bits for (sometimes) improved performance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>>It is pretty clear to me that printf being a function from the ms rt will have no concept of an 80 bit long double. This is besides the point, though.>>>
For what kind of mathematical calculation do you need 80-bit long double primitive precision?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Petros
If you are interested in arbitrary precision calculation(elementary functions mainly trigo) please let me know.I will kindly share with you my work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your include files are in order (by no means assured), the contents of <float.h> would enable you to figure out how much of the storage space is padding. If <float.h> is incorrect, http://homepages.cwi.nl/~steven/enquire.html would show you how to generate entries which match what your compiler actually implements for a given option set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey,
Apologies if I made your efforts more difficult. I followed your suggestion and ran the following little snippet :
(vs2010, intelc++ 12.1, win7 64bit)
#include "mathimf.h"
#include <iostream>
int main() {
long double ld = (long double)(0) ;
std::cout << sizeof( ld ) << std::endl ;
return 1;
}
The result I got was 8 - i.e. like an ordinary double. My understanding is that if the 80bit long double was used, it would be 10.
I linked with libm.lib - and, of course, during the compilation phase I got the warnings :
1> Building with Intel(R) C++ Compiler 12.1
1>ClCompile:
1> ***** ClCompile (Win32 - Intel C++)
1>icl : warning #10148: option '/Qlong-double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
Ilyapolak
Thank you very very much for your kind offer. Will not be needing it, but really thank you ! I mainly need this featutre for 2 reasons:
a) porting libraries from Linux that need a long double for their own thing
b) for reduction methods of very long arrays .
TimP
Not sure I understood.
I would like to thank everyone who has contributed to help ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>>Ilyapolak
Thank you very very much for your kind offer. Will not be needing it, but really thank you ! I mainly need this featutre for 2 reasons:
a) porting libraries from Linux that need a long double for their own thing
b) for reduction methods of very long arrays>>>
@Petros
I have forgotten to add that my arbitrary precision library is written in Java and is based on BigDecimal class.
Does Linux support long double primitive?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ilyapolak
I think so - not a Linux person, so please don't quote me - oh, I forgot I just put this in writting ;-))
Again, thank you very much for the kind offer to share your work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could it be possible that I would have to ignore one of the microsoft librray in order for libm to "pick" the right long double ?
I am thinking, maybe it is the sizeof from the ms crt that is somehow giving always 8 for long double (say was implemented as a template and this is a specialization for pod-s ). And also, if I was to use a function, say exp (for an orinary double), from libm, why the linker would not complain that there is a required function found in two different input libraries ?
Does switching to the intel compiler tools take care of it ? Am I missing something/talking nonsense ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>>Again, thank you very much for the kind offer to share your work.>>>
No problem.We are here to help each other.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page