Compiled Fortran executable file can't run on other machines

I have a Fortran code compiled using PGI Visual Fotran 13.4 in Win 7 (64 bit) os. It can run on the laptop compiling it, but can’t run on other machines.
I didn’t expect this happen. IT seems the compiled code not portable.

Anyone can help me? Thanks a lot in advance!

It can run on the laptop compiling it, but can’t run on other machines.

Can you describe the error you get when running on the other machines? What OS are the other machines running?

IT seems the compiled code not portable.

How did they compile it?

  • Mat

It is the same as my laptop: Win 7 (64bit).
When clicking the executable file, a error message popup like An error occurred for this program and windows is checking solution…

This is a pure Fortran code without CUDA. I complied it using O-3 option and it runs well in my laptop. I don’t know what’s wrong with the compiler or the compiling settings.

Both are Intel core i7.

I used the default values for almost all the compiling settings except the option maximum speed optimization option was selected.

Previously, the same code was compiled using Compaq Fortran and the executable file could be run on both computers without any problems.

Does the second system have Win7 SP1 installed?

My best guess is that it doesn’t but the first one does. Win7 didn’t support the new Sandy-Bridge (i.e. newer Core i7) AVX instructions until SP1 and AVX binaries simply wont run. The solutions are to either update to SP1 or build your binary to target an older architecture (i.e. compile with -tp nehalem-64).

Hope this helps,
Mat

Thanks, Mat!

My desktop has win 7 (professional) sp1 installed.
Both have PGI Visual Fortran installed: my laptop (Intel Core i7-3630QM CPU) is 13.4 and desktop (Intel Core i7 CPU) is 12.1.

The strange thing is: the compiled code in my laptop can’t run on my desktop, but the compiled cod on my desktop can run on my laptop.

I’m not sure if the above information is helpful for you.
I don’t want to target some specific processor, because I want my code fully portable to different computers.

Thank you again!

Both have PGI Visual Fortran installed: my laptop (Intel Core i7-3630QM CPU) is 13.4 and desktop (Intel Core i7 CPU) is 12.1.

Ok, another possibility is that you need an updated Microsoft C/C++ runtime. In 13.x we updated to use MS Open Tools 11 which uses a newer runtime.

Under the main PGI installation directory are the Microsoft Open Tools directories. Under there, look in the “redist” directory for the MS C runtime library installation binaries. There two directives, one ofr 32-bits and one for 64. Try running the Open Tools 10 version on your laptop, and copy and run the Open Tools 11 version on your desktop.

  • Mat

Thanks, Mat!

But, it’s still not working.
In both my computers, I have VS 2008 installed.

Hmm. It really does sound like the Open Tools 11 vcredist_x64.exe and vcredist.exe just need to be run on the desktop, but let’s got back and see if we can get more information about what the actual error is.

Can you please run the exe on your desktop within a command shell and see if more errors are printed? Also, I’d like you to build on the laptop in 32-bits and then run it on the desktop (sometimes 32-bit mode gives more error messages).

In both my computers, I have VS 2008 installed.

This doesn’t matter. It’s the Open Tools version that used.

Note that any binary built with MS Open Tools 11 (i.e. PGI 13.x and above) will not run on an XP system.

  • Mat

I tried both double-clicking the executable file and using command line. They both gave the same error:

XXX has stopped working! Windows is checking solution…

You said that the code compiled by version 13.x can’t run on XP machine. What about 12.x?

THank you very much, Mat!

You said that the code compiled by version 13.x can’t run on XP machine.

Correct. It’s more that the Microsoft Open Tools 11 libraries wont run on XP, rather than anything PGI specific.

What about 12.x?

Yes since we were using Open Tools 10.

I’m asking other folks if they have any ideas, because I’m stumped.

  • Mat