Closed mshumko closed 1 year ago
Hi mshumko,
It looks like you have a slightly different compiler to what I use. Mine comes from here: https://jmeubank.github.io/tdm-gcc/
I haven't tried using strawberryperl - would I be correct in thinking that your gfortran
and g++
compilers are installed simply by installing one of these packages: strawberryperl.com ?
One thing that might be worth trying is removing that -fallow-argument-mismatch
option from the batch file (PyGeopack/__data/libgeopackcpp/fortran/compile.bat). I just tried doing that in my W10 VM and it fails to compile due to a mismatch in the argument types for one of Tsyganenko's model functions.
If that works for the strawberryperl compiler, then perhaps I will have to figure out a way to detect the compiler being used within the batch file.
Cheers, Matt.
So I have spent this evening looking into your problem...
I fixed the C++/Fortran code which required the fallow-argument-mismatch
argument - compiling the geopack library does work now using the Strawberry Perl compilers. It also seems to work if I compile a C++ program and link to it.
I have built a new PyGeopack package using this fix: https://github.com/mattkjames7/PyGeopack/releases/tag/v1.2.1 This is probably somewhat different to the previous package you would have installed as it now does compilation during the installation, rather than when it fails to import the DLL, so errors will look a bit different.
The problem for me is, while all of the above works, I cannot import the module because ctypes
complains of missing dependencies while loading the DLL (it is a FileNotFoundError
, but the file is definitely there). I haven't figured out why this happens, because the OS seems to know where to find all of the dependencies when using C++!
It is entirely possibly that I have done something silly while installing Strawberry Perl, so you may have a little more success. Please do let me know if it works for you, or if you have any idea how to get it working correctly.
Thanks for the quick fix @mattkjames7! I'm currently on vacation so I won't be able to test the new version until I return in a week.
As for your FileNotFoundError
, I'm guessing that you need to add the directory containing that DLL to your Windows Path. I had a similar issue before and that fixed it.
Hello again, please do feel free to ignore this message while you're on vacation!
I have looked into this a bit more tonight and found that the problem was with ctypes
. I think that newer versions of Python might not be scanning $PATH
by default, so I added a function to scan for the C++ standard libs. It seems to work for me, hopefully it will for you too!
Latest release is here: https://github.com/mattkjames7/PyGeopack/releases/tag/v1.2.2
If, when you return from vacation, it doesn't work - please do reopen the issue.
The latest version successfully built, thanks!
Hello,
I can't compile the Fortran code. Looks like the gfortan compiler does not recognize the -fallow-argument-mismatch option I suspect is the culprit.
Code to reproduce the error
Error message
Environment