Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2154 Discussions

$I_MPI_ROOT issue in VS after installing oneapi

Joaquin_S_
Novice
5,316 Views

I uninstalled Parallel Studio, and installed oneAPI. Tried running one of my usual MPI programs in my Windows laptop, using VS 2017.

I get this error: "error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MPI] "

Following this: https://software.intel.com/content/www/us/en/develop/documentation/mpi-developer-guide-windows/top/compiling-and-linking/configuring-a-visual-studio-project.html I realized that the directory is different with respect to Parallel Studio. I changed the "intel64" part to "2021.1.1", same error.

I changed the whole "$(I_MPI_ROOT)\intel64" to "C:\Program Files (x86)\Intel\oneAPI\mpi\2021.1.1" and the error goes away, but now says "cannot find impi.lib"

In any case, that intel resource should be updated to reflect oneAPI directory.

0 Kudos
1 Solution
Klaus-Dieter_O_Intel
5,040 Views

Hi Joaquin,


I could reproduce your issue. Please extend the PATH environment variable by setting

PATH=$(I_MPI_ONEAPI_ROOT)\bin\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\libfabric\bin;$(PATH)

in the Environment field of the Debugging Properties. Due to using $(ConfigurationName) you can do this for All Configurations (i.e. Debug and Release) in only one change.


Hint: You can also use $(ConfigurationName) in the Additional Library Directories field of the Linker-->General properties, again for All Configurations at once:

$(I_MPI_ONEAPI_ROOT)\lib\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\lib


With this setting I could run the program from inside of Visual Studio 2019 for both the Debug and Release configuration.


Regards

Klaus-Dieter


View solution in original post

19 Replies
JBHooper
Beginner
5,294 Views

If you take the information at this webpage:

Configuring a Visual Studio* Project (intel.com)

And replace:

$(I_MPI_ROOT)\intel64

with:

$(I_MPI_ONEAPI_ROOT)

(Note:  No \intel64 subpath any longer)

It should work okay.  (At least it works in VS 2019.)  

0 Kudos
Joaquin_S_
Novice
5,291 Views

It worked for the previous error, but now I get "Error The Fortran compiler (ifort.exe) cannot be found."

0 Kudos
Joaquin_S_
Novice
5,278 Views

I moved to VS 2019 and now the program compiles successfully.

But, when executed, I get: "The code execution cannot proceed because impi.dll was not found. Reinstalling the program may fix this problem" Any ideas?

0 Kudos
JBHooper
Beginner
5,240 Views

I actually managed to compile and got this, plus a couple of other fortran related .dlls not being found.  At this point you'd posted and gotten a response, so I followed the suggestion and both reinstalled the oneAPI kits as well as running repair on them, at which point VS 2019 could no longer find ifort.  So now I'm stripping it all out and starting over from base VS 2019; I'll let you know what I see.

I'm about this far >< from just going back to my VM with gfortran, though. 

0 Kudos
PrasanthD_intel
Moderator
5,258 Views

Hi Joaquin,

 

The directory structure differs between Parallel Studio and OneAPI toolkit.

So, you need to change the mpi root variable from I_MPI_ROOT to I_MPI_ONEAPI_ROOT. I will inform the internal team to update the documentation too.

Also, not all versions of Visual Studio were supported by the OneAPI toolkit. You can find the VS version requirements in this article (Intel® Compilers compatibility with Microsoft Visual Studio* and...).

 

Now coming to the "The code execution cannot proceed because impi.dll was not found. Reinstalling the program may fix this problem"

We have tried a c++ project and it is working for us.

Could you please screenshot of

i)Configuration Properties -> Fortran (Additional Include Directories)

ii) Configuration Properties -> Linker (Additional Include Directories)

iii) Configuration Properties -> Linker -> Input (Additional Dependencies)

iv)The debugging command you have set

 

Also, if possible, send us a sample vcxroj/vfproj of your project so we can debug it in our environment.

 

Regards

Prasanth

0 Kudos
Joaquin_S_
Novice
5,253 Views

Thanks for your response. Here are the screenshots and vcxroj/vfproj.

0 Kudos
Joaquin_S_
Novice
5,251 Views

For some reason, I can't upload vfproj files to the forum

0 Kudos
PrasanthD_intel
Moderator
5,211 Views

Hi Joaquin,

The forum may not accept all file types. Could you please make it zip or tar and send us?

Are you able to compile and run the Fortran file through the command line? (Note: Run the setvars.bat in cmd before using intel compilers)

 

Regards

Prasanth

0 Kudos
Joaquin_S_
Novice
5,204 Views

Here's the zipped vfproj.

I compiled and ran the program through the command file. Builds just fine, but when I execute, same error as with VS2019

0 Kudos
JBHooper
Beginner
5,179 Views

Joaquin,

When you do the command line build do you go to $(I_MPI_ONEAPI_ROOT) and run the setvars.bat command first?

I have the same issue via visual studio that you do, where if I compile via visual studio and try to run the compilation will go fine but the run will complain about not being able to find impi.dll.  However, if I drop out to a command shell and run setvars.bat, I can compile via command line (mpiifort) and run just fine.  I thought for a while that it wasn't working, but it turns out that powershell apparently is not the same as cmd.exe for windows, and if I run setvars in powershell nothing gets set, but if I do it in an actual windows command prompt (cmd.exe) it's okay.

(Windows is not a CLI experience for me normally, so this may be known to others but was a surprise to me.)

 

0 Kudos
Joaquin_S_
Novice
5,168 Views

Yes, I did it in that order, and same error with the dll file. 

0 Kudos
PrasanthD_intel
Moderator
5,145 Views

Hi Joaquin,

 

Thanks for providing the file.

We have tested a sample hello world Fortran file (you can find samples at C:\Program Files (x86)\Intel\oneAPI\mpi\latest\test) with the project you have provided. We haven't faced any errors during execution with the same settings. I am attaching a screenshot.

It seems that there is a problem with your environment as you cannot run the exe even in the command prompt. Is your installation of OneAPI is successful?

Please run the sample code test.f90 at (C:\Program Files (x86)\Intel\oneAPI\mpi\latest\test) in the command prompt as follows:

1) Open Command prompt

2) Go to C:\Program Files (x86)\Intel\oneAPI and run setvars.bat

3) Compile the test.f90 as mpiifort test.f90

4) Run the exe with I_MPI_DEBUG=10 mpirun -n 2 -ppn 2 test.exe

 

Please take screenshots and attach them with the errors.

 

Regards

Prasanth

0 Kudos
Joaquin_S_
Novice
5,138 Views

I followed your steps and it worked. The only thing is that I had to change "mpirun" for "mpiexec". If I do mpirun it gives the error: 'mpirun' is not recognized as an internal or external command, operable program or batch file.

If I use VS2019, I still get the error, I'm attaching the screenshot.

Installation of both oneAPI and VS 2019 were successful.

0 Kudos
Joaquin_S_
Novice
5,114 Views

Any ideas on the "impi.dll was not found" and "libifcoremd.dll was not found" errors, within VS 2019? What part of the environment is failing to get these errors? 

0 Kudos
PrasanthD_intel
Moderator
5,084 Views

Hi Joaquin,


Sorry for the delay in response.

We are unable to reproduce the issue and hence escalating the issue to the internal team who can better understand the issue and provide a solution.


Regards

Prasanth


0 Kudos
Klaus-Dieter_O_Intel
5,041 Views

Hi Joaquin,


I could reproduce your issue. Please extend the PATH environment variable by setting

PATH=$(I_MPI_ONEAPI_ROOT)\bin\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\libfabric\bin;$(PATH)

in the Environment field of the Debugging Properties. Due to using $(ConfigurationName) you can do this for All Configurations (i.e. Debug and Release) in only one change.


Hint: You can also use $(ConfigurationName) in the Additional Library Directories field of the Linker-->General properties, again for All Configurations at once:

$(I_MPI_ONEAPI_ROOT)\lib\$(ConfigurationName);$(I_MPI_ONEAPI_ROOT)\lib


With this setting I could run the program from inside of Visual Studio 2019 for both the Debug and Release configuration.


Regards

Klaus-Dieter


fambri
Beginner
4,849 Views

this solution worked also on my system, but for some reasons the $(ConfigurationName) didn't work. I had to explicitly write "debug" or "release".

thanks

0 Kudos
Reply