-shared-intel command

-shared-intel command

Hello,
I had problems for compiling and executing some big programs (stack size and "relocation truncated..." error messages, among others) and I solved it thanx to this forum.
I used the comands "ifort -O4 -mcmodel=large -shared-intel -o foo foo.f -lmkl -lguide -lg2c" and it was possible to compile and run my programs. And the best part is that the executable size was so small! I do not know which kind of machine was it, but the version of the compiler is 11.0.069
However, I have now a Mac OS X machine with a newer version 11.1.??? in which the instructions -mcmodel=large -shared-intel are not recognized.
So, I use the commands -i-dynamic and I also have to increase the stack size during copilation (instructions also taken from this forum). Eventhough I can compile and run my programs, the executables are much larger (like a hundred of times) than the ones I generated with -mcmodel=large...
So, can someone tell me how to use the -mcmodel=large -shared-intel commands in this newer version and/or how to get smaller executables with -i-dynamic???
Thank you in advance!

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I don't know how we could guess what ifort -O4 would do, as I don't believe that ever was a supported option. -O1 would usually be recommended for reducing executable size. You might check the options to avoid inline functions except in the case where the function has only one call site, and to turn off loop unrolling.
I don't see how -mcmodel=large could have reduced size; the default model ought to be more suitable for that purpose. -i-dynamic is simply a different spelling for -shared-intel. MKL would prefer shared libraries anyway for the link, but you would avoid/modify any of the suggestions on the MKL forum which recommend static libraries, if you want the shared ones. -lg2c would normally be incompatible with ifort, although it's possible nothing was picked up from that library.
Does MacOS have a command such as ldd which would verify whether all the shared objects you expect are linked to your executable? You should also be able to see which dynamic and static libraries are chosen at link time by adding -# option.

Hi,
The thing is that the -mcmodel=large is, literal, "not supported" (warning #10152) in the Mac OS whereas it is in another computer wich I guess that runs on linux.
How could I use the -mcmodel instruction in a MAc OS? is it posible?
Thanks!

Quoting - princess_sophie

Hi,
The thing is that the -mcmodel=large is, literal, "not supported" (warning #10152) in the Mac OS whereas it is in another computer wich I guess that runs on linux.
How could I use the -mcmodel instruction in a MAc OS? is it posible?
Thanks!

You can certainly use

-mcmodel=medium -shared-intel on Mac OS to get 64 bit data pointers.

ron

Quoting - Ronald W. Green (Intel)

You can certainly use

-mcmodel=medium -shared-intel on Mac OS to get 64 bit data pointers.

ron

Hi Ron, thanks a lot for your answer, but I do not get to use that instruction.
I am working on two machines, in one of them (compiler version 11.1.058) the message is the previos I posted: "ifort: command line warning #10152: option '-mcmodel medium' not supported" whereas for a version 10.5.8 it is wors, the message is: : "catastrophic error: **Internal compiler error: internal abort** Please report
this error along with the circumstances in which it occurred in a Software Probl
em Report."
So, how could I use the instruction? It should be great if you could help me.
Thanks in advance

Login to leave a comment.