03-03-2025 11:13 AM
For my research I write LabVIEW (2020) mixed language programs with DLL’s in Fortran. The latter are created using the Intel Visual Fortran Compiler 2020 integrated into the Microsoft Visual Studio Community 2019 development environment (Windows10). In my long-term experience this is a very fruitful combination in which the heavy number crunching is delegated to the Fortran DLL’s and the LabVIEW GUI provides the vast and extensive flexibility in the I/O especially in the graphics.
I encounter a problem when converting my programs to executable applications under the NI runtime engine. The executables run fine on the host computer. They also run fine on a second computer with the NI runtime engine installed (and no LabVIEW Development System present). However, the Fortran DLL’s are not recognized (error message: Missing external function <name>.dll) only when the Fortran code contains calls to intrinsic trigonometric (SIN, COS) or exponential (EXP) functions. Other functions (REAL, INT, ABS, SQRT, MOD) do not lead to problems.
Solved! Go to Solution.
03-03-2025 01:09 PM
This suggests to me the wrong dll (maybe incorrect version?). Have you tried explicitly including the dll in your builds?
03-03-2025 02:33 PM
@wrhagen wrote:
For my research I write LabVIEW (2020) mixed language programs with DLL’s in Fortran. The latter are created using the Intel Visual Fortran Compiler 2020 ...
Of course, Intel Fortran Compiler RunTime is already installed on the target PC, isn't?
03-04-2025 01:17 AM
Yes, I did.
03-04-2025 01:19 AM
Yes, installed.
03-04-2025 01:50 AM - edited 03-04-2025 01:54 AM
@wrhagen wrote:
Yes, I did.
Something isn't installed. If you claim that you installed the correct Intel Fortran Runtime library (bitness is also correct?) something went wrong there!
Another option:you created Debug Build DLLs. Not sure about Intel Fortran but with Visual C they link to different debug runtime libraries that you can only get installed on a system by installing the full Visual Studio package. Redustributing those debug runtime libraries is even explicitly forbidden by Microsoft. You need to install Visual Studio and have a valid license to run it. Maybe Intel Fortran works similar?
03-04-2025 02:21 AM
No, I did not create DEBUG DLLs; I created Release DLLs.
PLease note that everything works fine with DLLs containing hundreds of Fortran lines until I include one single call to, for example, intrinsic function EXP.
03-04-2025 02:26 AM
Does your fortran dll make calls on another dll? If LabVIEW makes calls to A.dll, which calls B.dll, and you make an Executable, LabVIEW will take a copy of A.dll but not know to copy B.dll. Solution is to ensure any extra dlls are explocitly included in the exe build.
03-04-2025 02:29 AM
No, the Fortran DLLs do not make calls to other DLLs.
03-04-2025 02:52 AM
I’m not sure what intrinsic means in Fortran. In C it means a function call that is almost directly translated to an assembly code or a short sequence of it. However the symptoms you describe with LoadLibrary() failing clearly hint at something that goes wrong while Windows tries to load the DLL. Usually that are missing dependencies. But it can be a number of other things such as errors in the PE header, code segment setup and more. It certainly doesn’t look LabVIEW related. LabVIEW simply shows you the error it receives from Windows when trying to load the DLL.
That’s a problem for Intel Fortran support to look into.