Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++ error on import of Theano on Windows 7

I'm attempting to get setup with a proper g++ installation according to the theano installation guide. I've previously had theano working with the python only implementation. I'm using the bleeding edge version of theano from their git repo on python 3.4. I've tried using the theano suggested TDM-GCC-64 method as well as MinGW, and both result in the exact same error. (copied as readable as possible)

Problem occurred during compilation with the command line below:
C:\MinGW\bin\g++.exe -shared -g -march=skylake -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 -mrtm -mhle -mrdrnd -mf16c -mfsgsbase 
-mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f 
-mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt 
-mxsavec -mxsaves -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=8192 -mtune=skylake 
-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 
-IC:\Python34_64bit\lib\site-packages\numpy\core\include
IC:\Python34_64bit\include -IC:\Python34_64bit\lib\site-packages\theano\gof
-o C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\lazylinker_ext.pyd 
C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp 
-LC:\Python34_64bit\libs -LC:\Python34_64bit -lpython34


In file included from c:\mingw\include\c++\6.1.0\math.h:36:0,
from C:\Python34_64bit\include/pyport.h:328,
from C:\Python34_64bit\include/Python.h:50,
from C:\Users\Jwely\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64\lazylinker_ext\mod.cpp:1:
c:\mingw\include\c++\6.1.0\cmath:1133:11: error: '::hypot' has not been declared
    using ::hypot;
            ^~~~~

It may be worth noting that before it prints this error, it prints an entire file worth of code, you can find the entire error output here

I'm not sure what to try next, I've followed the directions twice, used a couple different installation methods for some dependencies, and made sure to clean up my system path between each attempt and reboot.

like image 944
Jwely Avatar asked Jul 22 '16 23:07

Jwely


2 Answers

This worked for me:

  1. Go to your user folder: C:/Users/[username]
  2. Create .theanorc file if it doesn't already exist
  3. makes sure it includes the lines:

    [gcc]
    cxxflags = -D_hypot=hypot
    
like image 136
Alex Avatar answered Oct 22 '22 16:10

Alex


"Error: '::hypot' has not been declared" in cmath while trying to embed Python Error building Boost 1.49.0 with GCC 4.7.0

my solution is comment out all the

#define hypot _hypot

macro in the pyconfig.h file

like image 27
ZornLemma Avatar answered Oct 22 '22 15:10

ZornLemma