Open jibaneza opened 3 years ago
Thank you for your feedback. We have two separate problems here:
First problem: Compiling bvpsol
(the solver written by Deuflhard, Bader, Weimann) with GCC Version 10. Here setting std=legacy
helps. Thank you very much. I have updated the devel
branch. Your solution will soon be in master.
Second problem: Compiling the bvp_m_proxy
(a proxy for a different solver written by Boisvert, Muir, Spiteri). Here I can reproduce your problem with gfortran (x86_64-w64-mingw32
, versin 10.2.0) with Windows 7 Enterprise. Until now I have no idea why a
using Libdl
Libdl.dlopen("C:\\Users\\user\\.julia\\environmens\\v1.5\\dev\\ODEInterface\\src\\bvp_m_proxy")
results in a "The specified procedure could not be found." error.
as a workaround, would you suggest any particular version of gcc?
In the automatic Windows tests with AppVeyor I (still) use this x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64
version, which works.
I'll have to investigate further.
It's difficult to find the problem. ldd
and DependencyWalker
all show no problem. I even tried to load the dll-module the way Julia as doing it: https://github.com/JuliaLang/julia/blob/release-1.5/src/dlload.c#L94
#include <stdio.h>
#include <windows.h>
#include <winnls.h>
int main(void) {
/* char *filename = "dopri5.dll"; */
char *filename = "bvp_m_proxy.dll";
WCHAR *wfilename = NULL;
HANDLE lib=NULL;
printf("Test for %s\n", filename);
size_t len = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
if (!len) {printf("Error 1\n"); return 1;}
wfilename = (WCHAR*)alloca(len*sizeof(WCHAR));
if (!MultiByteToWideChar(CP_UTF8, 0, filename, -1, wfilename, len)) {
printf("Error 2\n");
return 1;
}
lib = LoadLibraryExW(wfilename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
printf("lib=%p\n", (void*)lib);
return 0;
}
which I compiled and run in the ODEInterface/src
directory and there is no problem. I can dynamically load the library:
Test for bvp_m_proxy.dll
lib=0000000061f80000
Have you tested other Msys2-versions?
yes, I have tested with gfortran 8.3.0 and it works, no problems!
I still have no success in narrowing down the problem. I've found similar problems (in the past), e.g. https://sourceforge.net/p/mingw/mailman/message/19787051/ where an error in a def-file of mingw caused the same error.
Unfortunately I don't know any Windows tools how to check this.
When building I get the following error:
when calling ODEInterface.loadODESolvers(), the following are not compiled correctly: colnew_i32, bvpsol, bvp_m_proxy, colnew, bvpsol_i32
If I modify the build.jl build_bvpsol function to include the flag "-std=legacy", the build runs withouth errors.
Now, when calling ODEInterface.loadODESolvers(), all seem to be ok except 'bvp_m_proxy'. The dll is generated in src but for some reason it is not found:
Julia 1.5.0 ODEInterface v0.4.7 GNU Fortran (Rev3, Built by MSYS2 project) 10.1.0 Windows 10