This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a workaround for loading of the libomp library in Linux and Mac. Since we now bundle the libomp.[so|dylib] with our simulator in the dotnet package runtimes folder, we shouldn't need the host to install that library manually. However, Linux and Mac do not automatically use the folder of the active binary as an additional dynamic library search path, meaning load of libomp was still failing on those platforms if it was not already installed. By using an explicit invocation of an operation that comes from that library, we trigger logic in dotnet that will perform the library load while including the platform specific runtimes folder. As a result, when the simulator is loaded, it will find libomp already in memory and not need to perform any additional loads.
Note that this does not work on Windows because there the library has a different name (libomp140.x86_64.dll), but the Windows load library logic already finds this library so no workaround is needed there.