Python 3.7 compiled Fortran PYD (DLL) not working. [WinError 1114] A dynamic link library (DLL)...












1














I'm trying to help a coworker get a Fortran module compiled and running on our server. He's able to compile/run it locally on his machine, but when I try to replicate the environment on our xenon servers, the module won't load in the script.



Environment:
WinServer 2012R2 with Intel(R) Xeon(R) CPU E5-2697 v2
Compiler: tdm64-gcc-5.1.0-2.exe (with fortran support checked at install time)
Anaconda version: 4.5.11
Python version: Python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32



Compilation command:



python C:ProgramDataAnaconda3envspython_serverScriptsf2py.py -m nnpx -c --fcompiler=gnu95 --compiler=mingw32  nnpx.f90 --f90flags="-mwindows -m64 -march='ivybridge' -fopenmp -lgomp"


NOTE: I've actually tried a number of combinations of those f90 flags, none of which seemed to be the magic combination .


The module appears to compile OK, and creates a file named "nnpx.cp37-win_amd64.pyd" that I'm placing in the same folder as the test script shown below


Test python script attempting to load module (PYD):



#### BEGIN Script Snippet#########################
import ctypes
import pdb

ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")

#; pdb.set_trace()
#############################
import nnpx as nn

#### END Script Snippet#########################


Here's the error I get when trying to load that DLL:



(python_server) e:Python_ServerFortran>python ..scriptsnnpx_test.py
Traceback (most recent call last):
File "..scriptsnnpx_test.py", line 24, in <module>
ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")
File "C:ProgramDataAnaconda3envspython_serverlibctypes__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed


Here are the associated errors thrown in the windows system event viewer:



Fault bucket 1820906866837524874, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportArchiveAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_3cf0dd9f

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 0
Hashed bucket: 19c0c60458b6bae2d9452925d6eb918a


.



Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 4
Hashed bucket:


.



Faulting application name: python.exe, version: 3.7.1150.1013, time stamp: 0x5bd5bc42
Faulting module name: libgfortran_64-3.dll, version: 0.0.0.0, time stamp: 0xa688a670
Exception code: 0xc0000005
Fault offset: 0x0000000000018ae0
Faulting process id: 0x4d14
Faulting application start time: 0x01d47de553900866
Faulting application path: C:ProgramDataAnaconda3envspython_serverpython.exe
Faulting module path: C:TDM-GCC-64binlibgfortran_64-3.dll
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Faulting package full name:
Faulting package-relative application ID:


Dependency checking:
I've also tried checking the dependencies, as suggested here but can't seem to get them ironed out perfectly (which is why I assume I can't get python to properly load the module). I had to copy the "libgcc_s_seh_64-1.dll" and "libgfortran_64-3.dll" into the same folder as the PYD file, and then they show as "correct" on the dependency explorer, but the "python37.dll" never gets a correct checksum. I don't know if that matters, but I've tried every copy of python37.dll (in every conda environment) I can find on my system, and none work. They all give me the "checksum incorrect" in dependency checker.



Any Thoughts or suggestions on how to get this FORTRAN module to load properly into python script?



WITH python37.dll in same folder as PYDWITHOUT python37.dll in same folder as PYD










share|improve this question


















  • 1




    I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
    – Steve Lionel
    Nov 16 '18 at 22:02
















1














I'm trying to help a coworker get a Fortran module compiled and running on our server. He's able to compile/run it locally on his machine, but when I try to replicate the environment on our xenon servers, the module won't load in the script.



Environment:
WinServer 2012R2 with Intel(R) Xeon(R) CPU E5-2697 v2
Compiler: tdm64-gcc-5.1.0-2.exe (with fortran support checked at install time)
Anaconda version: 4.5.11
Python version: Python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32



Compilation command:



python C:ProgramDataAnaconda3envspython_serverScriptsf2py.py -m nnpx -c --fcompiler=gnu95 --compiler=mingw32  nnpx.f90 --f90flags="-mwindows -m64 -march='ivybridge' -fopenmp -lgomp"


NOTE: I've actually tried a number of combinations of those f90 flags, none of which seemed to be the magic combination .


The module appears to compile OK, and creates a file named "nnpx.cp37-win_amd64.pyd" that I'm placing in the same folder as the test script shown below


Test python script attempting to load module (PYD):



#### BEGIN Script Snippet#########################
import ctypes
import pdb

ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")

#; pdb.set_trace()
#############################
import nnpx as nn

#### END Script Snippet#########################


Here's the error I get when trying to load that DLL:



(python_server) e:Python_ServerFortran>python ..scriptsnnpx_test.py
Traceback (most recent call last):
File "..scriptsnnpx_test.py", line 24, in <module>
ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")
File "C:ProgramDataAnaconda3envspython_serverlibctypes__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed


Here are the associated errors thrown in the windows system event viewer:



Fault bucket 1820906866837524874, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportArchiveAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_3cf0dd9f

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 0
Hashed bucket: 19c0c60458b6bae2d9452925d6eb918a


.



Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 4
Hashed bucket:


.



Faulting application name: python.exe, version: 3.7.1150.1013, time stamp: 0x5bd5bc42
Faulting module name: libgfortran_64-3.dll, version: 0.0.0.0, time stamp: 0xa688a670
Exception code: 0xc0000005
Fault offset: 0x0000000000018ae0
Faulting process id: 0x4d14
Faulting application start time: 0x01d47de553900866
Faulting application path: C:ProgramDataAnaconda3envspython_serverpython.exe
Faulting module path: C:TDM-GCC-64binlibgfortran_64-3.dll
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Faulting package full name:
Faulting package-relative application ID:


Dependency checking:
I've also tried checking the dependencies, as suggested here but can't seem to get them ironed out perfectly (which is why I assume I can't get python to properly load the module). I had to copy the "libgcc_s_seh_64-1.dll" and "libgfortran_64-3.dll" into the same folder as the PYD file, and then they show as "correct" on the dependency explorer, but the "python37.dll" never gets a correct checksum. I don't know if that matters, but I've tried every copy of python37.dll (in every conda environment) I can find on my system, and none work. They all give me the "checksum incorrect" in dependency checker.



Any Thoughts or suggestions on how to get this FORTRAN module to load properly into python script?



WITH python37.dll in same folder as PYDWITHOUT python37.dll in same folder as PYD










share|improve this question


















  • 1




    I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
    – Steve Lionel
    Nov 16 '18 at 22:02














1












1








1







I'm trying to help a coworker get a Fortran module compiled and running on our server. He's able to compile/run it locally on his machine, but when I try to replicate the environment on our xenon servers, the module won't load in the script.



Environment:
WinServer 2012R2 with Intel(R) Xeon(R) CPU E5-2697 v2
Compiler: tdm64-gcc-5.1.0-2.exe (with fortran support checked at install time)
Anaconda version: 4.5.11
Python version: Python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32



Compilation command:



python C:ProgramDataAnaconda3envspython_serverScriptsf2py.py -m nnpx -c --fcompiler=gnu95 --compiler=mingw32  nnpx.f90 --f90flags="-mwindows -m64 -march='ivybridge' -fopenmp -lgomp"


NOTE: I've actually tried a number of combinations of those f90 flags, none of which seemed to be the magic combination .


The module appears to compile OK, and creates a file named "nnpx.cp37-win_amd64.pyd" that I'm placing in the same folder as the test script shown below


Test python script attempting to load module (PYD):



#### BEGIN Script Snippet#########################
import ctypes
import pdb

ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")

#; pdb.set_trace()
#############################
import nnpx as nn

#### END Script Snippet#########################


Here's the error I get when trying to load that DLL:



(python_server) e:Python_ServerFortran>python ..scriptsnnpx_test.py
Traceback (most recent call last):
File "..scriptsnnpx_test.py", line 24, in <module>
ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")
File "C:ProgramDataAnaconda3envspython_serverlibctypes__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed


Here are the associated errors thrown in the windows system event viewer:



Fault bucket 1820906866837524874, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportArchiveAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_3cf0dd9f

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 0
Hashed bucket: 19c0c60458b6bae2d9452925d6eb918a


.



Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 4
Hashed bucket:


.



Faulting application name: python.exe, version: 3.7.1150.1013, time stamp: 0x5bd5bc42
Faulting module name: libgfortran_64-3.dll, version: 0.0.0.0, time stamp: 0xa688a670
Exception code: 0xc0000005
Fault offset: 0x0000000000018ae0
Faulting process id: 0x4d14
Faulting application start time: 0x01d47de553900866
Faulting application path: C:ProgramDataAnaconda3envspython_serverpython.exe
Faulting module path: C:TDM-GCC-64binlibgfortran_64-3.dll
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Faulting package full name:
Faulting package-relative application ID:


Dependency checking:
I've also tried checking the dependencies, as suggested here but can't seem to get them ironed out perfectly (which is why I assume I can't get python to properly load the module). I had to copy the "libgcc_s_seh_64-1.dll" and "libgfortran_64-3.dll" into the same folder as the PYD file, and then they show as "correct" on the dependency explorer, but the "python37.dll" never gets a correct checksum. I don't know if that matters, but I've tried every copy of python37.dll (in every conda environment) I can find on my system, and none work. They all give me the "checksum incorrect" in dependency checker.



Any Thoughts or suggestions on how to get this FORTRAN module to load properly into python script?



WITH python37.dll in same folder as PYDWITHOUT python37.dll in same folder as PYD










share|improve this question













I'm trying to help a coworker get a Fortran module compiled and running on our server. He's able to compile/run it locally on his machine, but when I try to replicate the environment on our xenon servers, the module won't load in the script.



Environment:
WinServer 2012R2 with Intel(R) Xeon(R) CPU E5-2697 v2
Compiler: tdm64-gcc-5.1.0-2.exe (with fortran support checked at install time)
Anaconda version: 4.5.11
Python version: Python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32



Compilation command:



python C:ProgramDataAnaconda3envspython_serverScriptsf2py.py -m nnpx -c --fcompiler=gnu95 --compiler=mingw32  nnpx.f90 --f90flags="-mwindows -m64 -march='ivybridge' -fopenmp -lgomp"


NOTE: I've actually tried a number of combinations of those f90 flags, none of which seemed to be the magic combination .


The module appears to compile OK, and creates a file named "nnpx.cp37-win_amd64.pyd" that I'm placing in the same folder as the test script shown below


Test python script attempting to load module (PYD):



#### BEGIN Script Snippet#########################
import ctypes
import pdb

ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")

#; pdb.set_trace()
#############################
import nnpx as nn

#### END Script Snippet#########################


Here's the error I get when trying to load that DLL:



(python_server) e:Python_ServerFortran>python ..scriptsnnpx_test.py
Traceback (most recent call last):
File "..scriptsnnpx_test.py", line 24, in <module>
ctypes.WinDLL("nnpx.cp37-win_amd64.pyd")
File "C:ProgramDataAnaconda3envspython_serverlibctypes__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed


Here are the associated errors thrown in the windows system event viewer:



Fault bucket 1820906866837524874, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportArchiveAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_3cf0dd9f

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 0
Hashed bucket: 19c0c60458b6bae2d9452925d6eb918a


.



Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: python.exe
P2: 3.7.1150.1013
P3: 5bd5bc42
P4: libgfortran_64-3.dll
P5: 0.0.0.0
P6: a688a670
P7: c0000005
P8: 0000000000018ae0
P9:
P10:

Attached files:
C:UsersmyuserpinAppDataLocalTempWERBAB7.tmp.appcompat.txt
C:UsersmyuserpinAppDataLocalTempWERC074.tmp.WERInternalMetadata.xml
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082memory.hdmp
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082triagedump.dmp

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_python.exe_b5aa8e775891040bdd452465e375c1e92ab7d9_c1c75637_cab_3e80c082

Analysis symbol:
Rechecking for solution: 0
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Report Status: 4
Hashed bucket:


.



Faulting application name: python.exe, version: 3.7.1150.1013, time stamp: 0x5bd5bc42
Faulting module name: libgfortran_64-3.dll, version: 0.0.0.0, time stamp: 0xa688a670
Exception code: 0xc0000005
Fault offset: 0x0000000000018ae0
Faulting process id: 0x4d14
Faulting application start time: 0x01d47de553900866
Faulting application path: C:ProgramDataAnaconda3envspython_serverpython.exe
Faulting module path: C:TDM-GCC-64binlibgfortran_64-3.dll
Report Id: 941538b8-e9d8-11e8-810d-d89d67f4dd04
Faulting package full name:
Faulting package-relative application ID:


Dependency checking:
I've also tried checking the dependencies, as suggested here but can't seem to get them ironed out perfectly (which is why I assume I can't get python to properly load the module). I had to copy the "libgcc_s_seh_64-1.dll" and "libgfortran_64-3.dll" into the same folder as the PYD file, and then they show as "correct" on the dependency explorer, but the "python37.dll" never gets a correct checksum. I don't know if that matters, but I've tried every copy of python37.dll (in every conda environment) I can find on my system, and none work. They all give me the "checksum incorrect" in dependency checker.



Any Thoughts or suggestions on how to get this FORTRAN module to load properly into python script?



WITH python37.dll in same folder as PYDWITHOUT python37.dll in same folder as PYD







python-3.x fortran mingw-w64 f2py






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 20:42









NumericOverflow

10711




10711








  • 1




    I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
    – Steve Lionel
    Nov 16 '18 at 22:02














  • 1




    I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
    – Steve Lionel
    Nov 16 '18 at 22:02








1




1




I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
– Steve Lionel
Nov 16 '18 at 22:02




I note that the Event is naming libgfortran and not your DLL (I am completely unfamiliar with using Python like this.) DLL initialization happens in a routine DllMain, if present in the DLL. Windows calls this when the DLL is loaded and then again when/if it is unloaded. If the function returns FALSE, you'll get this error. Of course, this doesn't tell you WHY it failed. The first thing I would try is, if possible, link your DLL against the static, not DLL gfortran libraries, though I'd guess there's some Python stuff in there too.
– Steve Lionel
Nov 16 '18 at 22:02












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345106%2fpython-3-7-compiled-fortran-pyd-dll-not-working-winerror-1114-a-dynamic-lin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53345106%2fpython-3-7-compiled-fortran-pyd-dll-not-working-winerror-1114-a-dynamic-lin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?