- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was very happy to see in the new Release Notes a reference to an option -heap-arrays!!! This will save me a lot of trouble.
The release notes don't say what size does for the option. I presume it's some sort of threshold- smaller than size bytes will be allocated on the stack?
The release notes don't say what size does for the option. I presume it's some sort of threshold- smaller than size bytes will be allocated on the stack?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that's what it's for, but it's only when the compiler knows at compile-time what the size is, so the option isn't very useful. Note that in the current release, the -heap-arrays option is not accepted by the ifort driver - oops! That will be fixed in an update later this month. In the meantime, use:
-Qoption,f,"-heap_arrays 0"
-Qoption,f,"-heap_arrays 0"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hm. That's interesting- in VC++ ifort complained about /heap-arrays. But on my Intel iMac I used ifort -O3 -heap-arrays and it didn't complain. On OS X does it just silently do nothing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know for certain. My understanding is that in all of the current (as of today) 9.1 compilers, this option is not recognized by the ifort command. As I mentioned over in the Windows forum, you don't need this option if your program otherwise runs - that is, it doesn't die with a stack overflow error. Enabling this option will reduce performance somewhat due to the overhead of the extra allocate and deallocate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, alas, no, it doesn't "silently do nothing" ...
I'm guessing your command was actually something like:
ifort -c -O3 -heap-arrays file.f
If you don't have the "-c", the ifort driver tries to pass "-h eap-arrays" to ld.
- Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's exactly right, Lorri. I'm building a static library of Fortran code to be linked into my Company's product written in C and C++, so I'm only interested in the object files. Since I don't link with ifort, I guess the erroneous linker option just gets tossed.
I will use Steve's work-around for now.
I will use Steve's work-around for now.

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