Theano: error: '::hypot' has not been declared when compiling with MingGW64

Created on 1 Sep 2016  Â·  11Comments  Â·  Source: Theano/Theano

Basically the error I get is very similar to this: http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708

I've fixed it with adding "-D_hypot=hypot" to the cxxflags in ccompile. I'm wondering if you think a similar fix should be included in the theano code, to check for this possibility.

Most helpful comment

Basically the error I get is very similar to this: http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708

I've fixed it with adding "-D_hypot=hypot" to the cxxflags in ccompile. I'm wondering if you think a similar fix should be included in the theano code, to check for this possibility.

Thank you! This saved my day! Got the exactly same problem with Theano 1.0.2 and MingW64. Solved by adding THEANO_FLAGS='gcc.cxxflags="-D_hypot=hypot"' to the environment variables.

All 11 comments

Give your full error. Even if similar, it could give us useful information.

thanks

On Wed, Aug 31, 2016 at 10:00 PM, Andy Jiang [email protected]
wrote:

Basically the error I get is very similar to this:
http://stackoverflow.com/questions/10660524/error-
building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708

I've fixed it with adding "-D_hypot=hypot" to the cxxflags in ccompile.
I'm wondering if you think a similar fix should be included in the theano
code, to check for this possibility.

—
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/4926, or mute the thread
https://github.com/notifications/unsubscribe-auth/AALC-12H3FRCcUNdtRrTOAX_Gdj4qcFmks5qljG0gaJpZM4JyPal
.

`Problem occurred during compilation with the command line below:
"D:\mingw-w64x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\g++.exe" -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-
mx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -m
-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave
avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifm
no-pcommit -mno-mwaitx -mno-clzero -mno-pku --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=20480 -mtune=sandybridge -DNP
I_VERSION -m64 -DMS_WIN64 -I"D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\lib\site-packages\numpy\core\include" -I"D:\winpython\WinPython-6
4\include" -I"d:\winpython\theano\theano\gof" -L"D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\libs" -L"D:\winpython\WinPython-64bit-2.7.9.4
rs\Administrator\AppData\Local\Theano\compiledir_Windows-2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.7.9-64\tmp2j_pu
4d67.pyd C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_GenuineIntel-2.
hon27
In file included from D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/math.h:36:0,
from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\include/pyport.h:325,
from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\include/Python.h:58,
from C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_Ge
mod.cpp:1:
D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hypot' has not been decla
using ::hypot;
^~~~~

Traceback (most recent call last):
File "logistic_sgd.py", line 494, in
sgd_optimization_mnist()
File "logistic_sgd.py", line 333, in sgd_optimization_mnist
y: test_set_y[index * batch_size: (index + 1) * batch_size]
File "d:\winpython\theano\theano\compile\function.py", line 326, in function
output_keys=output_keys)
File "d:\winpython\theano\theano\compile\pfunc.py", line 484, in pfunc
output_keys=output_keys)
File "d:\winpython\theano\theano\compile\function_module.py", line 1789, in orig_function
defaults)
File "d:\winpython\theano\theano\compile\function_module.py", line 1653, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "d:\winpython\theano\theano\gof\link.py", line 699, in make_thunk
storage_map=storage_map)[:3]
File "d:\winpython\theano\theano\gof\vm.py", line 1051, in make_all
no_recycling))
File "d:\winpython\theano\theano\gof\op.py", line 975, in make_thunk
no_recycling)
File "d:\winpython\theano\theano\gof\op.py", line 875, in make_c_thunk
output_storage=node_output_storage)
File "d:\winpython\theano\theano\gof\cc.py", line 1190, in make_thunk
keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cc.py", line 1131, in compile
keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cc.py", line 1586, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cmodule.py", line 1145, in module_from_key
module = lnk.compile_cmodule(location)
File "d:\winpython\theano\theano\gof\cc.py", line 1492, in compile_cmodule
preargs=preargs)
File "d:\winpython\theano\theano\gof\cmodule.py", line 2301, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: ('The following error happened while compiling the node', Elemwise{mul,no_inplace}(TensorConstant{600}, tatus=1): In file included from D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/math.h:36:0,\r.
hon\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\include/pyport.h:325,\r. from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.
from C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Steppi
p2j_pu8\mod.cpp:1:\r. D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hy
using ::hypot;\r. ^~~\r. ", '[Elemwise{mul,no_inplace}(TensorConstant{600}, -Intel64_Family_6_Model_45_Steppi
p2j_pu8\mod.cpp:1:\r. D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hy
using ::hypot;\r. ^
~~\r. ", '[Elemwise{mul,no_inplace}(TensorConstant{600}, `

Search in Theano mailing list and issues. I already saw this.

From memory, it could be mixed compiler in your environment.

On Fri, Sep 2, 2016 at 2:52 AM, Andy Jiang [email protected] wrote:

`Problem occurred during compilation with the command line below:
"D:\mingw-w64x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\g++.exe"
-shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable
-Wno-write-
mx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf
-mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma
-mno-fma4 -m
-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle
-mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr
-mxsave
avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt
-mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl
-mno-avx512ifm
no-pcommit -mno-mwaitx -mno-clzero -mno-pku --param l1-cache-size=32
--param l1-cache-line-size=64 --param l2-cache-size=20480
-mtune=sandybridge -DNP
I_VERSION -m64 -DMS_WIN64 -I"D:\winpython\WinPython-
64bit-2.7.9.4\python-2.7.9.amd64\lib\site-packages\numpy\core\include"
-I"D:\winpython\WinPython-6
4\include" -I"d:\winpython\theano\theano\gof" -L"D:\winpython\WinPython-
64bit-2.7.9.4\python-2.7.9.amd64\libs" -L"D:\winpython\WinPython-
64bit-2.7.9.4
rs\Administrator\AppData\Local\Theano\compiledir_
Windows-2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_
Stepping_7_GenuineIntel-2.7.9-64\tmp2j_pu
4d67.pyd C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-
2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_
Stepping_7_GenuineIntel-2.
hon27
In file included from D:/mingw-w64/x86_64-6.2.0-
posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.
2.0/include/c++/math.h:36:0,
from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\
include/pyport.h:325,
from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\
include/Python.h:58,
from C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-
2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Stepping_7_Ge
mod.cpp:1:
D:/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev0/mingw64/
lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error:
'::hypot' has not been decla
using ::hypot;
^~~~~

Traceback (most recent call last):
File "logistic_sgd.py", line 494, in
sgd_optimization_mnist()
File "logistic_sgd.py", line 333, in sgd_optimization_mnist
y: test_set_y[index * batch_size: (index + 1) * batch_size]
File "d:\winpython\theano\theano\compile\function.py", line 326, in
function
output_keys=output_keys)
File "d:\winpython\theano\theano\compile\pfunc.py", line 484, in pfunc
output_keys=output_keys)
File "d:\winpython\theano\theano\compile\function_module.py", line 1789,
in orig_function
defaults)
File "d:\winpython\theano\theano\compile\function_module.py", line 1653,
in create
input_storage=input_storage_lists, storage_map=storage_map)
File "d:\winpython\theano\theano\gof\link.py", line 699, in make_thunk
storage_map=storage_map)[:3]
File "d:\winpython\theano\theano\gof\vm.py", line 1051, in make_all
no_recycling))
File "d:\winpython\theano\theano\gof\op.py", line 975, in make_thunk
no_recycling)
File "d:\winpython\theano\theano\gof\op.py", line 875, in make_c_thunk
output_storage=node_output_storage)
File "d:\winpython\theano\theano\gof\cc.py", line 1190, in make_thunk
keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cc.py", line 1131, in _compile_
keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cc.py", line 1586, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "d:\winpython\theano\theano\gof\cmodule.py", line 1145, in
module_from_key
module = lnk.compile_cmodule(location)
File "d:\winpython\theano\theano\gof\cc.py", line 1492, in compile_cmodule
preargs=preargs)
File "d:\winpython\theano\theano\gof\cmodule.py", line 2301, in
compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: ('The following error happened while compiling the node',
Elemwise{mul,no_inplace}(TensorConstant{600}, ), '\n',
tatus=1): In file included from D:/mingw-w64/x86_64-6.2.0-
posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.
2.0/include/c++/math.h:36:0,\r.
hon\WinPython-64bit-2.7.9.4\python-2.7.9.amd64\include/pyport.h:325,\r.
from D:\winpython\WinPython-64bit-2.7.9.4\python-2.7.9.
from C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-
2008ServerR2-6.1.7601-SP1-Intel64_Family_6_Model_45_Steppi
p2j_pu8\mod.cpp:1:\r. D:/mingw-w64/x86_64-6.2.0-
posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11:
error: '::hy
using ::hypot;\r. ^\r. ", '[Elemwise{mul,no_inplace}(TensorConstant{600},
)]')
-Intel64_Family_6_Model_45_Steppi
p2j_pu8\mod.cpp:1:\r. D:/mingw-w64/x86_64-6.2.0-
posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11:
error: '::hy
using ::hypot;\r. ^
\r. ", '[Elemwise{mul,no_inplace}(TensorConstant{600},
)]')
`

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Theano/Theano/issues/4926#issuecomment-244297404, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AALC--Zni3cgGhzYuraEHe8gHjnyGcq2ks5ql8epgaJpZM4JyPal
.

No news, so closing as I think it is a user installation problem.

No its not.

I have the same problem.

01060
01061 static PyMethodDef lazylinker_ext_methods[] = {
01062 {"get_version", get_version, METH_VARARGS, "Get extension version."},
01063 {NULL, NULL, 0, NULL} /* Sentinel _/
01064 };
01065
01066 #if defined(NPY_PY3K)
01067 static struct PyModuleDef moduledef = {
01068 PyModuleDef_HEAD_INIT,
01069 "lazylinker_ext",
01070 NULL,
01071 -1,
01072 lazylinker_ext_methods,
01073 NULL,
01074 NULL,
01075 NULL,
01076 NULL
01077 };
01078 #endif
01079 #if defined(NPY_PY3K)
01080 #define RETVAL m
01081 PyMODINIT_FUNC
01082 PyInit_lazylinker_ext(void) {
01083 #else
01084 #define RETVAL
01085 PyMODINIT_FUNC
01086 initlazylinker_ext(void)
01087 {
01088 #endif
01089 PyObject_ m;
01090
01091 lazylinker_ext_CLazyLinkerType.tp_new = PyType_GenericNew;
01092 if (PyType_Ready(&lazylinker_ext_CLazyLinkerType) < 0)
01093 return RETVAL;
01094 #if defined(NPY_PY3K)
01095 m = PyModule_Create(&moduledef);
01096 #else
01097 m = Py_InitModule3("lazylinker_ext", lazylinker_ext_methods,
01098 "Example module that creates an extension type.");
01099 #endif
01100 Py_INCREF(&lazylinker_ext_CLazyLinkerType);
01101 PyModule_AddObject(m, "CLazyLinker", (PyObject *)&lazylinker_ext_CLazyLinkerType);
01102
01103 return RETVAL;
01104 }
01105
Problem occurred during compilation with the command line below:
"C:\Program Files\mingw-w64x86_64-6.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++.exe" -shared -g -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -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 -mno-mwaitx -mno-clzero -mno-pku --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -I"C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\numpy\core\include" -I"C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\include" -I"C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\gof" -L"C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\libs" -L"C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2" -o C:\Users\EJ3D053N\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.12-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\EJ3D053N\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.12-64\lazylinker_ext\mod.cpp -lpython27
Traceback (most recent call last):

File "", line 1, in
import theano

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano__init__.py", line 70, in
from theano.compile import (

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\compile__init__.py", line 10, in
from theano.compile.function_module import *

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\compile\function_module.py", line 21, in
import theano.compile.mode

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\compile\mode.py", line 10, in
import theano.gof.vm

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\gof\vm.py", line 659, in
from . import lazylinker_c

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in
preargs=args)

File "C:\Users\EJ3D053N\AppData\Local\Continuum\Anaconda2\lib\site-packages\theano\gof\cmodule.py", line 2301, in compile_str
(status, compile_stderr.replace('\n', '. ')))

. ^~~~~;mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hypot' has not been declaredxt\mod.cpp:1:++/math.h:36:0,

Can you try with the mingw available through Anaconda, rather than the one you installed, which might be too recent?

Sorry but my error disappeared since i rebooted my PC !

I have the same problem when I compile my code, and I've tried different version of mingw already, but it still didn't work. After read the post http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708, I almost know why there's a problem, but i don't know how to solve it. how to add "-D_hypot=hypot" to the cxxflags in ccompile? I really need help.Thank you so much. @davikrehalt

You can use the Theano flags gcc.cxxflags. Gice it the value you want to
pass to the compiler.

On Wed, Feb 22, 2017 at 9:51 AM axiqia notifications@github.com wrote:

I have the same problem when I compile my code, and I've tried different
version of mingw already, but it still didn't work. After read the post
http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708,
I almost know why there's a problem, but i don't know how to solve it. how
to add "-D_hypot=hypot" to the cxxflags in ccompile? I really need
help.Thank you so much. @davikrehalt https://github.com/davikrehalt

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/Theano/Theano/issues/4926#issuecomment-281690626, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AALC-9-c7AHhXKK-YwCsheslSFw2CyY7ks5rfEtrgaJpZM4JyPal
.

Thank you! I use mingw available through Anaconda.

Basically the error I get is very similar to this: http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708

I've fixed it with adding "-D_hypot=hypot" to the cxxflags in ccompile. I'm wondering if you think a similar fix should be included in the theano code, to check for this possibility.

Thank you! This saved my day! Got the exactly same problem with Theano 1.0.2 and MingW64. Solved by adding THEANO_FLAGS='gcc.cxxflags="-D_hypot=hypot"' to the environment variables.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aditsanghvi94 picture aditsanghvi94  Â·  3Comments

dnikolayev picture dnikolayev  Â·  8Comments

kaare-mikkelsen picture kaare-mikkelsen  Â·  5Comments

9thDimension picture 9thDimension  Â·  3Comments

liorshk picture liorshk  Â·  3Comments