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

How to include Intel Fortran References Statically

Bowman__Eric
Novice
1,253 Views

I have an application that I've built and is working well on the computer with the fortran compiler installed. It is a .NET application that references a fortran library that I have made.

When I deploy it to other computers I get the following error: 

Fortran_Error.png

From the searching I've done, the solution is to statically build the intel fortran references into my library, but I have looked through the project options and cannot see how to do this. 

If that is what I should do, can someone explain to me how to do it or refer me to pertinent documentation?

Thanks!

Eric

0 Kudos
7 Replies
Steve_Lionel
Honored Contributor III
1,247 Views

The preferable solution is to install the Intel Fortran redistributables on the target system.

To specify static linking, set the DLL project property Fortran > Libraries > Use Run-Time Library to "Multithreaded (/MT)". You will not be able to do this if your application uses coarrays or OpenMP.

0 Kudos
Bowman__Eric
Novice
1,235 Views

Here are the settings I have available: 

FortranLibrarySettings.png

I already had the "Runtime Library" settings set to "Multithreaded" and that did not work. 

I'm trying to allow the application to be installed without administrator privileges if possible. 

0 Kudos
Bowman__Eric
Novice
1,228 Views

I have installed the redistributable packages and now I get the following error: 

Fortran_Error_2.png

Any ideas? I'm having trouble telling which update of the intel fortran compiler I have installed, and so I'm not sure which runtime to install, how can I tell exactly which version I have installed? 

Eric

0 Kudos
Steve_Lionel
Honored Contributor III
1,216 Views

"Multithreaded" is the correct option here. Unfortunately, .NET applications provide an overly generic error when something goes wrong.  It could be a mismatch between the exported symbol name and what the .NET application is looking for.  You have shown neither the .NET code nor the Fortran code for me to offer an opinion on that.

Another thing to look at is the target CPU for the .NET application. For example:

Screenshot 2020-10-01 130613.png

(This is VS2019). In the VBCallsFortran sample, this comes up as AnyCPU with "Prefer 32-bit" checked - which goes along with the 32-bit DLL. Setting Target CPU to x86 also works.

The error you see after installing the redistributables suggests to me that you are on a 32-bit Windows system and are trying to load 64-bit DLLs.

0 Kudos
Bowman__Eric
Novice
1,205 Views

hmmm, well, I had multithreaded selected when I build the version that gave me the original error.

I'll do what you recommended at first and install the intel fortran runtime on the client computer.

I really don't think it's anything to do with the code such as a mismatched symbol because everything works fine in debug. If I am wrong about that I am more than happy to post code. 

So, my current setup: 

  • I am on completely 64-bit operating systems.
  • The application runs fine in debug and in release on the development machine. 
  • I have set the target CPU to x86 for both debug and release. 
  • I have changed the fortran library option back to Multithreaded (DLL). 
  • I have installed a few different versions of the intel fortran runtime on the client machine, but I'm really not sure which version I should install. 

Thank you for your help tracking this down, I know your time is valuable and I really appreciate it.

0 Kudos
Bowman__Eric
Novice
1,203 Views

The package ID of my fortran compiler is  w_comp_lib_2020.2.254

 

I'm guessing that's version 2 of the 2020 compiler?

0 Kudos
Steve_Lionel
Honored Contributor III
1,189 Views

You should install the latest version of the redistributables.

 

0 Kudos
Reply