Home > Blockchain >  How can I make a binary that uses openmp and compiled with intel's C compiler portable?
How can I make a binary that uses openmp and compiled with intel's C compiler portable?

Time:04-26

Normally I compile code (all in a single file main.c) with the intel oneapi command prompt like so

icl.exe main.c -o binary_name

I can then run binary_name.exe without issue from a regular command prompt. However, when I recently exploited openmp multithreading and compiled like so.

icl.exe main.c -o binary_name /Qopenmp /MD /link libiomp5md.lib

Then, when I try to run it through an ordinary command prompt, I get this message: openmp5 error

I'd ultimately like to move this simple code around (say, to another computer with the same OS). Is there some procedure through a command prompt or batch file for packaging and linking a dynamic library? It is also looking like statically linking for openmp is not supported on windows

CodePudding user response:

Either make a statically linked version, or distribute the dependency DLL file(s) along with the EXE file.

You can check the dependencies of your EXE with Dependency Walker.

  • Related