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:
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?
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.
I have installed the redistributable packages and now I get the following error:
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?
"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:
(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.
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.