在 Windows 7 上导入 Theano 时出现 g++ 错误 [英] g++ error on import of Theano on Windows 7

查看:35
本文介绍了在 Windows 7 上导入 Theano 时出现 g++ 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据 thetheano 安装指南.我以前让 theano 使用仅 python 的实现.我在 python 3.4 上使用他们的 git repo 中的 theano 的前沿版本.我尝试使用 theano 建议的 TDM-GCC-64 方法以及 MinGW,两者都导致完全相同的错误.(复制尽可能可读)

使用下面的命令行编译时出现问题:C:MinGWing++.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 --paraml1-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_64bitlibsite-packages
umpycoreincludeIC:Python34_64bitinclude -IC:Python34_64bitlibsite-packages	heanogof-o C:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extlazylinker_ext.pydC:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extmod.cpp-LC:Python34_64bitlibs -LC:Python34_64bit -lpython34在 c:mingwincludec++6.1.0math.h:36:0 包含的文件中,来自 C:Python34_64bitinclude/pyport.h:328,来自 C:Python34_64bitinclude/Python.h:50,来自 C:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extmod.cpp:1:c:mingwincludec++6.1.0cmath:1133:11: 错误: '::hypot' 尚未声明使用 ::hypot;^~~~~

可能值得注意的是,在打印此错误之前,它会打印整个文件的代码,您可以在此处找到整个错误输出

我不确定接下来要尝试什么,我已经按照指示进行了两次,对某些依赖项使用了几种不同的安装方法,并确保在每次尝试和重新启动之间清理我的系统路径.

解决方案

这对我有用:

  1. 转到您的用户文件夹:C:/Users/[用户名]
  2. 如果 .theanorc 文件不存在,则创建它
  3. 确保它包含以下行:

    <上一页>[海合会]cxxflags = -D_hypot=hypot

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:MinGWing++.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_64bitlibsite-packages
umpycoreinclude
IC:Python34_64bitinclude -IC:Python34_64bitlibsite-packages	heanogof
-o C:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extlazylinker_ext.pyd 
C:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extmod.cpp 
-LC:Python34_64bitlibs -LC:Python34_64bit -lpython34


In file included from c:mingwincludec++6.1.0math.h:36:0,
from C:Python34_64bitinclude/pyport.h:328,
from C:Python34_64bitinclude/Python.h:50,
from C:UsersJwelyAppDataLocalTheanocompiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_94_Stepping_3_GenuineIntel-3.4.4-64lazylinker_extmod.cpp:1:
c:mingwincludec++6.1.0cmath: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.

解决方案

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
    

这篇关于在 Windows 7 上导入 Theano 时出现 g++ 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆