It looks like an issue in mingw's g++ itself, or an incompatibility
between mingw and Python.

You can try the solution at
http://stackoverflow.com/questions/28683358/error-hypot-has-not-been-dec
lared-in-cmath-while-trying-to-embed-python, there should be a way of
including cmath before Python.h everywhere, but it seems to go against
the instructions for compiling with Python (they say include Python.h
first).

On Tue, Jul 26, 2016, John Peng` wrote:
> Hi I recently read on a blog post about top Deep Learning Libraries for 
> python and Theano was at the top of the list. I decided to give it a try, 
> following these installation instructions I found on 
> Kaggle: 
> https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13973/a-few-tips-to-install-theano-on-windows-64-bits?page=2.
>  
> However, when I tried to run a simple neural network example, I got this 
> error message:
> ===============================
> 00001   #include <Python.h>
> ...
> ===============================
> Problem occurred during compilation with the command line below:
> C:\Users\johnpeng\mingw64\bin\g++.exe -shared -g -O3 -fno-math-errno 
> -Wno-unused-label -Wno-unused-variable -Wno-write-strings -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=3072 
> -mtune=haswell -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 
> -IC:\Users\johnpeng\Anaconda2\lib\site-packages\numpy\core\include 
> -IC:\Users\johnpeng\Anaconda2\include 
> -IC:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof
>  
> -o 
> C:\Users\johnpeng\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.11-64\tmpn1rlch\cdb0b986639740d2acf156f042fe37d2.pyd
>  
> C:\Users\johnpeng\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.11-64\tmpn1rlch\mod.cpp
>  
> -LC:\Users\johnpeng\Anaconda2\libs -LC:\Users\johnpeng\Anaconda2 -lpython27
> In file included from C:\Users\johnpeng\Anaconda2\include/pyport.h:1:0,
>                  from C:\Users\johnpeng\Anaconda2\include/Python.h:58,
>                  from 
> C:\Users\johnpeng\AppData\Local\Theano\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.11-64\tmpn1rlch\mod.cpp:1:
> C:/Users/johnpeng/mingw64/lib/gcc/x86_64-w64-mingw32/6.1.0/include/c++/cmath:1133:11:
>  
> error: '::hypot' has not been declared
>    using ::hypot;
>            ^~~~~
> 
> Traceback (most recent call last):
>   File 
> "C:\Users\johnpeng\Documents\Python\customer_predictions\prediction_results_nn.py",
>  
> line 53, in <module>
>     nn.train(x,y, epochs=20)
>   File 
> "C:\Users\johnpeng\Documents\Python\Random_forest\modules\neural_network.py", 
> line 74, in train
>     prediction = lasagne.layers.get_output(self.network)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\lasagne\layers\helper.py", 
> line 185, in get_output
>     all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\lasagne\layers\noise.py", 
> line 83, in get_output_for
>     dtype=theano.config.floatX)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\sandbox\rng_mrg.py",
>  
> line 1362, in binomial
>     x = self.uniform(size=size, nstreams=nstreams)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\sandbox\rng_mrg.py",
>  
> line 1322, in uniform
>     rstates = self.get_substream_rstates(nstreams, dtype)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\configparser.py",
>  
> line 112, in inner
>     return f(*args, **kwargs_)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\sandbox\rng_mrg.py",
>  
> line 1224, in get_substream_rstates
>     multMatVect(rval[0], A1p72, M1, A2p72, M2)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\sandbox\rng_mrg.py",
>  
> line 64, in multMatVect
>     [A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\compile\function.py",
>  
> line 322, in function
>     output_keys=output_keys)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\compile\pfunc.py",
>  
> line 480, in pfunc
>     output_keys=output_keys)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\compile\function_module.py",
>  
> line 1784, in orig_function
>     defaults)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\compile\function_module.py",
>  
> line 1648, in create
>     input_storage=input_storage_lists, storage_map=storage_map)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\link.py",
>  
> line 699, in make_thunk
>     storage_map=storage_map)[:3]
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\vm.py",
>  
> line 1042, in make_all
>     no_recycling))
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\op.py",
>  
> line 975, in make_thunk
>     no_recycling)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\op.py",
>  
> line 875, in make_c_thunk
>     output_storage=node_output_storage)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cc.py",
>  
> line 1189, in make_thunk
>     keep_lock=keep_lock)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cc.py",
>  
> line 1130, in __compile__
>     keep_lock=keep_lock)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cc.py",
>  
> line 1585, in cthunk_factory
>     key=key, lnk=self, keep_lock=keep_lock)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cmodule.py",
>  
> line 1145, in module_from_key
>     module = lnk.compile_cmodule(location)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cc.py",
>  
> line 1491, in compile_cmodule
>     preargs=preargs)
>   File 
> "C:\Users\johnpeng\Anaconda2\lib\site-packages\theano-0.9.0.dev1-py2.7.egg\theano\gof\cmodule.py",
>  
> line 2298, in compile_str
>     (status, compile_stderr.replace('\n', '. ')))
> Exception: ('The following error happened while compiling the node', 
> DotModulo(A, s, m, A2, s2, m2), '\n', "Compilation failed (return 
> status=1): In file included from 
> C:\\Users\\johnpeng\\Anaconda2\\include/pyport.h:1:0,\r.                 
>  from C:\\Users\\johnpeng\\Anaconda2\\include/Python.h:58,\r.               
>    from 
> C:\\Users\\johnpeng\\AppData\\Local\\Theano\\compiledir_Windows-10-10.0.10586-Intel64_Family_6_Model_69_Stepping_1_GenuineIntel-2.7.11-64\\tmpn1rlch\\mod.cpp:1:\r.
>  
> C:/Users/johnpeng/mingw64/lib/gcc/x86_64-w64-mingw32/6.1.0/include/c++/cmath:1133:11:
>  
> error: '::hypot' has not been declared\r.    using ::hypot;\r.           
>  ^~~~~\r. ", '[DotModulo(A, s, m, A2, s2, m2)]')
> 
> 
> Any help would be greatly appreciated!
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.


-- 
Pascal

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to