Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
davikrehalt opened this issue Sep 1, 2016 · 11 comments · Fixed by #6738
Closed

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

davikrehalt opened this issue Sep 1, 2016 · 11 comments · Fixed by #6738

Comments

@davikrehalt
Copy link
Contributor

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.

@nouiz
Copy link
Member

nouiz commented Sep 1, 2016

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

@davikrehalt
Copy link
Contributor Author

`Problem occurred during compilation with the command line below:
"D:\mingw-w64\x86_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}, <TensorType(int64, scalar)>), '\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}, <TensorType(int64, scalar)>)]')�
-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}, <TensorType(int64, scalar)>)]')�
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������`

@nouiz
Copy link
Member

nouiz commented Sep 2, 2016

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 notifications@github.com wrote:

`Problem occurred during compilation with the command line below:
"D:\mingw-w64\x86_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
#4926 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AALC--Zni3cgGhzYuraEHe8gHjnyGcq2ks5ql8epgaJpZM4JyPal
.

@nouiz
Copy link
Member

nouiz commented Sep 16, 2016

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

@nouiz nouiz closed this as completed Sep 16, 2016
@edmondja
Copy link

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-w64\x86_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,

@lamblin
Copy link
Member

lamblin commented Oct 5, 2016

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

@edmondja
Copy link

edmondja commented Oct 6, 2016

Sorry but my error disappeared since i rebooted my PC !

@axiqia
Copy link

axiqia commented Feb 22, 2017

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

@nouiz
Copy link
Member

nouiz commented Feb 24, 2017 via email

@aimilin6688
Copy link

Thank you! I use mingw available through Anaconda.

@kierdwyn
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants