Theano: Lazylinker_c.py raises import error

Created on 29 Jul 2016  Â·  5Comments  Â·  Source: Theano/Theano

Hi, I am following the guide that is on deeplearning.net for windows install, and I got to the test phase, but when I try to run it, I get this error. I believe it is related to the lazy linker.
Thank you!

Problem occurred during compilation with the command line below:
C:\TDM-GCC-64\bin\g++.exe -shared -g -march=core2 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=core2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Python34\lib\site-packages\numpycore\include -IC:\Python34\include -Ic:\users\david\desktop\neural net\theano\theano\theano\gof -o C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp -LC:\Python34\libs -LC:\Python34 -lpython34
C:\Python34\libs/python34.lib: error adding symbols: File in wrong format

collect2.exe: error: ld returned 1 exit status

Traceback (most recent call last):
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\lazylinker_c.py", line 75, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\lazylinker_c.py", line 92, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\David\Desktop\Neural Net\Theano\test.py", line 3, in
import theano
File "c:\users\david\desktop\neural net\theano\theano\theano__init__.py", line 70, in
from theano.compile import (
File "c:\users\david\desktop\neural net\theano\theano\theano\compile__init__.py", line 10, in
from theano.compile.function_module import *
File "c:\users\david\desktop\neural net\theano\theano\theano\compile\function_module.py", line 21, in
import theano.compile.mode
File "c:\users\david\desktop\neural net\theano\theano\theano\compile\mode.py", line 12, in
import theano.gof.vm
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\vm.py", line 659, in
from . import lazylinker_c
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\lazylinker_c.py", line 127, in
preargs=args)
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\cmodule.py", line 2299, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): C:\Python34\libs/python34.lib: error adding symbols: File in wrong format
. collect2.exe: error: ld returned 1 exit status
.

Most helpful comment

Hi,

You probably missed one step of the installation process on Theano/Python.
If you use conda, this would fix it:

conda install mingw libpython

Fred

On Fri, Jul 29, 2016 at 1:24 PM David Kluszczynski [email protected]
wrote:

Hi, I am following the guide that is on deeplearning.net for windows
install, and I got to the test phase, but when I try to run it, I get this
error. I believe it is related to the lazy linker.
Thank you!

Problem occurred during compilation with the command line below:
C:\TDM-GCC-64\bin\g++.exe -shared -g -march=core2 -mmmx -mno-3dnow -msse
-msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha
-mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop
-mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1
-mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed
-mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f
-mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt
-mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl
-mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit --param
l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048
-mtune=core2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64
-IC:\Python34\lib\site-packages\numpycore\include -IC:\Python34\include
-Ic:\users\david\desktop\neural net\theano\theano\theano\gof -o
C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\lazylinker_ext.pyd
C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp
-LC:\Python34\libs -LC:\Python34 -lpython34
C:\Python34\libs/python34.lib: error adding symbols: File in wrong format

collect2.exe: error: ld returned 1 exit status

Traceback (most recent call last):
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 75, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 92, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\David\Desktop\Neural Net\Theano\test.py", line 3, in
import theano
File "c:\users\david\desktop\neural net\theano\theano\theano__init__.py",
line 70, in
from theano.compile import (
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile__init__.py", line 10, in
from theano.compile.function_module import *
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile\function_module.py", line 21, in
import theano.compile.mode
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile\mode.py", line 12, in
import theano.gof.vm
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\vm.py",
line 659, in
from . import lazylinker_c
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 127, in
preargs=args)
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\cmodule.py", line 2299, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1):
C:\Python34\libs/python34.lib: error adding symbols: File in wrong format
. collect2.exe: error: ld returned 1 exit status
.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Theano/Theano/issues/4807, or mute the thread
https://github.com/notifications/unsubscribe-auth/AALC-_A1RyFW-Z3EpymqcnTGqEzd4hUjks5qajdlgaJpZM4JYZoe
.

All 5 comments

Hi,

You probably missed one step of the installation process on Theano/Python.
If you use conda, this would fix it:

conda install mingw libpython

Fred

On Fri, Jul 29, 2016 at 1:24 PM David Kluszczynski [email protected]
wrote:

Hi, I am following the guide that is on deeplearning.net for windows
install, and I got to the test phase, but when I try to run it, I get this
error. I believe it is related to the lazy linker.
Thank you!

Problem occurred during compilation with the command line below:
C:\TDM-GCC-64\bin\g++.exe -shared -g -march=core2 -mmmx -mno-3dnow -msse
-msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha
-mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop
-mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1
-mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed
-mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f
-mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt
-mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl
-mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit --param
l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048
-mtune=core2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64
-IC:\Python34\lib\site-packages\numpycore\include -IC:\Python34\include
-Ic:\users\david\desktop\neural net\theano\theano\theano\gof -o
C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\lazylinker_ext.pyd
C:\Users\David\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp
-LC:\Python34\libs -LC:\Python34 -lpython34
C:\Python34\libs/python34.lib: error adding symbols: File in wrong format

collect2.exe: error: ld returned 1 exit status

Traceback (most recent call last):
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 75, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 92, in
raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\David\Desktop\Neural Net\Theano\test.py", line 3, in
import theano
File "c:\users\david\desktop\neural net\theano\theano\theano__init__.py",
line 70, in
from theano.compile import (
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile__init__.py", line 10, in
from theano.compile.function_module import *
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile\function_module.py", line 21, in
import theano.compile.mode
File "c:\users\david\desktop\neural
net\theano\theano\theano\compile\mode.py", line 12, in
import theano.gof.vm
File "c:\users\david\desktop\neural net\theano\theano\theano\gof\vm.py",
line 659, in
from . import lazylinker_c
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\lazylinker_c.py", line 127, in
preargs=args)
File "c:\users\david\desktop\neural
net\theano\theano\theano\gof\cmodule.py", line 2299, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1):
C:\Python34\libs/python34.lib: error adding symbols: File in wrong format
. collect2.exe: error: ld returned 1 exit status
.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Theano/Theano/issues/4807, or mute the thread
https://github.com/notifications/unsubscribe-auth/AALC-_A1RyFW-Z3EpymqcnTGqEzd4hUjks5qajdlgaJpZM4JYZoe
.

I created a new libpython with mingw based off of my python34.dll and it worked for a while, but I think I changed something in path and it isnt working again :(

Okay, I got it. Mingw was just being weird. Thank you so much though!

how can we fix the issue with TDM-GCC

Problem occurred during compilation with the command line below:
C:\TDM-GCC-64\bin\g++.exe -shared -g -march=core2 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpycore\include -IC:\Users\uid38717\AppData\Local\Continuum\Anaconda2\include -IC:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\gof -o C:\Users\uid38717\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.12-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\uid38717\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_23_Stepping_10_GenuineIntel-2.7.12-64\lazylinker_ext\mod.cpp -LC:\Users\uid38717\AppData\Local\Continuum\Anaconda2\libs -LC:\Users\uid38717\AppData\Local\Continuum\Anaconda2 -lpython27
Traceback (most recent call last):

File "", line 1, in
import theano

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano__init__.py", line 63, in
from theano.compile import (

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\compile__init__.py", line 9, in
from theano.compile.function_module import *

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\compile\function_module.py", line 22, in
import theano.compile.mode

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\compile\mode.py", line 12, in
import theano.gof.vm

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\gof\vm.py", line 638, in
from . import lazylinker_c

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\gof\lazylinker_c.py", line 126, in
preargs=args)

File "C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano-0.8.2-py2.7.egg\theano\gof\cmodule.py", line 2204, in compile_str
(status, compile_stderr.replace('\n', '. ')))

. collect2.exe: error: ld returned 1 exit status C:\Users\uid38717\AppData\Local\Continuum\Anaconda2\libs/python27.lib: error adding symbols: File in wrong format

Hey i have the same problem anujhah1003 is there anyway it can be fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ibab picture ibab  Â·  4Comments

QuantumLiu picture QuantumLiu  Â·  4Comments

dnikolayev picture dnikolayev  Â·  8Comments

colinpriest picture colinpriest  Â·  4Comments

aviveise picture aviveise  Â·  6Comments