Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Static link

John_Hickey
Beginner
553 Views
Hello,
I want to compile my program so that it can run on other Mac OSX machines
I try:
ifort AlphaPhase.f90 -i-static -O3 -fast -m64 -o AlphaPhase1.1
But when i run on another machine I get the error:
sh-3.2$ ./AlphaPhase1.1

Fatal Error: This program was not built to run on the processor in your system.
The allowed processors are: Intel processors with SSE4.2 and POPCNT instructions support.

I have tried -staticlib but this does not compile. I get the error:
xilibtool: executing 'libtool'
libtool: warning same member name (for_main.o) in output file used for input files: /usr/bin/ifort-2011-base/compiler/lib/libifcore.a(for_main.o) and: /usr/bin/ifort-2011-base/compiler/lib/for_main.o (due to use of basename, truncation, blank padding or duplicate input files)
libtool: file: /usr/bin/ifort-2011-base/compiler/lib/libimf.a(dpml_ux_cbrt.o) has no symbols
libtool: file: /usr/bin/ifort-2011-base/compiler/lib/libimf.a(dpml_ux_inv_hyper.o) has no symbols
xilibtool: executing 'libtool'libtool: warning same member name (for_main.o) in output file used for input files: /usr/bin/ifort-2011-base/compiler/lib/libifcore.a(for_main.o) and: /usr/bin/ifort-2011-base/compiler/lib/for_main.o (due to use of basename, truncation, blank padding or duplicate input files)libtool: file: /usr/bin/ifort-2011-base/compiler/lib/libimf.a(dpml_ux_cbrt.o) has no symbolslibtool: file: /usr/bin/ifort-2011-base/compiler/lib/libimf.a(dpml_ux_inv_hyper.o) has no symbols
Any help would be appreciated.
With the lahey compiler:
lf95 AlphaPhase.f90 --staticlink -o AlphaPhase1.1
This works fine.
Regards,
John Hickey
0 Kudos
3 Replies
TimP
Honored Contributor III
553 Views
You must drop -fast and use options suitable for the target CPU. If -xSSE4.1 is supported by all your targets, that would be a good choice. Suit yourself as to whether you want -ipo.
0 Kudos
mecej4
Honored Contributor III
553 Views
If you ask yourself:

"how can the compiler, ordered to do its best optimization with the -fast option know on which target CPU I intend to run the resulting application on?"

"when a target CPU is not specified, and -fast is requested, what is the most logical assumption as to the target CPU?"

the problems may become easy to understand.
0 Kudos
Steven_L_Intel1
Employee
553 Views
-fast is actually a collection of other switches, all of which you can specify individually. One of the implied switches is -xHost, which means "use the instruction set on the processor used for compilation." As others suggest, this is not an appropriate option to use when running a program on other computers.

-fast translates to: -ipo, -O3, -no-prec-div, -static, and -xHost
0 Kudos
Reply