MPI + mixed C++/Fortran library issue

MPI + mixed C++/Fortran library issue

I am trying to use MPI in a mixed C++/Fortran code. The main routine is C++ which calls Fortran subroutines. I have successfully compiled the code in VS2008 using the Microsoft C++ compiler and Intel Fortran 11.0.074. If I comment out the Fortran subroutine calls, the C++ code loads and runs. MPI nodes are reported properly by the main C++ routine. However, when I add back the Fortran subroutine calls, the code crashes during the program startup. I see the following clues.

1. When running with mpiexec, no program output at all is produced.

2. When not running with mpiexec, I get the message
'Error while loading shared libraries: ?: cannot open shared object file: No such file or directory'

3. When running from the VS IDE, I get an error box that says
"The procedure entry point for _array_copy_out. could not be located in the dynamic link library
libifcoremd.dll"
Also, VS studio shows the following libraries being loaded. I do not know why or if it matters that the
libifcoremd.dll and libmmd.dll are being pulled in from the Matlab directory instead of the Fortran
compiler directory.

'a.exe': Loaded 'C:\\Users\\jyoung\\Documents\\GEM\\x64\\Release\\a.exe', Symbols loaded.
'a.exe': Loaded 'C:\\Windows\\System32\\ntdll.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\kernel32.dll'
'a.exe': Loaded 'C:\\Program Files (x86)\\Intel\\MPI\\4.0.0.012\\em64t\\bin\\impi.dll', Binary was not built with
debug information.
'a.exe': Loaded 'C:\\Windows\\System32\\mswsock.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\msvcrt.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\advapi32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\rpcrt4.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\ws2_32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\nsi.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\mpr.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\user32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\gdi32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\crypt32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\msasn1.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\userenv.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\secur32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\IPHLPAPI.DLL'
'a.exe': Loaded 'C:\\Windows\\System32\\dhcpcsvc.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\dnsapi.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\winnsi.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\dhcpcsvc6.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\netapi32.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\psapi.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\ntdsapi.dll'
'a.exe': Loaded 'C:\\Windows\\System32\\Wldap32.dll'
'a.exe': Loaded 'C:\\Program Files\\Intel\\MKL\\10.0.5.025\\em64t\\bin\\libiomp5md.dll', Binary was not built with
debug information.
'a.exe': Loaded 'C:\\Windows\\winsxs\\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_08e3747fa83e48bc\\msvcp90.dll'
'a.exe': Loaded 'C:\\Windows\\winsxs\\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_08e3747fa83e48bc\\msvcr90.dll'
'a.exe': Loaded 'C:\\Program Files\\MATLAB\\R2008a\\bin\\win64\\libifcoremd.dll', Binary was not built with debug information.
'a.exe': Loaded 'C:\\Windows\\System32\\imagehlp.dll'
'a.exe': Loaded 'C:\\Program Files\\MATLAB\\R2008a\\bin\\win64\\libmmd.dll', Binary was not built with debug information.

4. Dependency walker lists 'for_array_copy_in' and 'for_array_copy_out' as missing libifcoremd.dll.
It also lists an error opening the file 'EISHIMS.DLL'

5. I have the following external libraries on my link line.

impi.lib impimt.lib impicxx.lib mkl_scalapack_ilp64.lib mkl_solver_ilp64.lib mkl_intel_ilp64.lib mkl_intel_thread.lib mkl_core.lib mkl_blacs_intelmpi_ilp64.lib libiomp5md.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Any help or suggestions are appreciated. Thanks.

John

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

So, I deleted the referenced dll's out of the Matlab directory and then the program loads and runs. How do I prevent the matlab directory dll's from being loaded in places of the fortran directory dll's?

Thanks,
John

It may be preferable to avoid including paths for compilers or matlab in your main windows environment settings, so that your ifort environment will include only the Visual Studio and ifort settings. If you compile from command line, the Fortran build environment shortcut window on Start menu will be set up then with just the VS, ifort, and MKL paths.

Well, Matlab set this path by itself on installation. I am hesitant to remove it from the system path because I do not know whether it will cause problems for Matlab. However, I will try it and see if any problems result. I do not compile from the command line, but from the VS IDE, so I rarely use the build environment shortcut window.

Thanks,
John

Leave a Comment

Please sign in to add a comment. Not a member? Join today