Repository navigation
Bind the C library math functions of the JIT to the ones roadrunner links - #1477
Closed
matthiaskoenig wants to merge 1 commit into
Closed
matthiaskoenig wants to merge 1 commit into
matthiaskoenig wants to merge 1 commit into
Conversation
…inks The JIT resolved pow, exp, log and the other C library functions which createCLibraryFunctions declares through the search of the symbols of the process. On Windows ntdll.dll, ucrtbase.dll and msvcrt.dll all export them, LLVM returns the export of the module loaded last, and the functions of msvcrt and ucrtbase differ in the last bits for some arguments, so the results of a model depended on the load order of the process. LLJit and MCJit now bind them explicitly, as they do for the SBML support functions.
|
Subsumed this into #1489 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1476
The JIT resolved the C library functions which
Jit::createCLibraryFunctionsdeclares (pow,exp,log,fabs,floor,fmod, the trigonometric and hyperbolic functions) through the search of the symbols of the process. On Windowsntdll.dll,ucrtbase.dllandmsvcrt.dllall export them, LLVM returns the export of the module loaded last, and the functions ofmsvcrt.dllanducrtbase.dlldiffer in the last bits for some arguments, so the results of a model depended on the load order of the process.Jit::cLibraryFunctionAddressesgives the addresses of these functions in the C runtime roadrunner is linked against, and both jits bind the declarations to them, the way they bind the SBML support functions ofexternalFunctionSignatures: LLJit withabsoluteSymbols, MCJit withsys::DynamicLibrary::AddSymbol, which is searched before the loaded libraries. The process search is still there for everything else.On Linux and macOS the functions are the ones of the single C library of the process, so nothing changes there. On Windows a model now integrates with the functions of
ucrtbase.dllin every process, where before it wasmsvcrt.dllin most processes and another module in a few. Checked with a build of this branch on windows-latest: a process with a copy ofucrtbase.dllloaded before the model is compiled (which before the change bound the copy) now gives bitwise the simulation of a normal process, for a plain simulation and for a fit of a whole body model. All C++ tests (3614) pass on Linux, and the Windows release job of BuildRoadRunner passes on the branch.