TCP/IP (初学者必看)
2007-08-11 10:01
302 查看
使用Python开发的程序,运行速度上不太满意,碰巧看到赖勇浩CSDN博客中翻译的Cython三分钟入门。得空便开始着手尝试,半天未果。
问题一大堆,比如:
OS下设置环境变量;
Clang(/klæŋ/)安装;
OS下终端里设置临时环境变量的方法比较容易:
OS设置永久环境变量,网上搜了一篇,没太搞明白,但起作用了:Mac下设置环境变量
编译Clang需要GCC,GCC我在XCode安装目录下找到了:
/Applications/Xcode.app/Contents/Developer/usr/bin
按照《结构化编译器前端Clang介绍》折腾半天,最终也没能编译成功。
回头再去XCode安装目录:
Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
找到了,果断复制了Clang至:
/Applications/Xcode.app/Contents/Developer/usr/bin
也不知道,合不合适,但终端里输入Clang终于有反应了
cd Cython-0.17.3
python setup.py build
阻力继续:
stackoverflow上有个最佳答案:
sudo apt-get install python-dev
mac 里没有 apt-get 这个工具,傻眼。。。
其实还在Xcode目录中:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include
找到了“Python.h”,怎么让 python setup.py build 时知道呢?再傻眼。。。
没有师傅指导。。。
难免走弯路。。。
会遇到些稀奇古怪的东西,完全搞不清状况。。。
我看到了这篇文章:
《Fatal Error:studio.h File Not Found》
"Command Line Tools" 的 comment:
"Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.
Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools."
再次打开终端:输入gcc,输入clang,就这么简单,绕这么大弯。
python setup.py build 有些警告
sudo python setup.py install
结束!
问题一大堆,比如:
OS下设置环境变量;
Clang(/klæŋ/)安装;
OS下终端里设置临时环境变量的方法比较容易:
export PATH=$PATH:'app/bin'
OS设置永久环境变量,网上搜了一篇,没太搞明白,但起作用了:Mac下设置环境变量
编译Clang需要GCC,GCC我在XCode安装目录下找到了:
/Applications/Xcode.app/Contents/Developer/usr/bin
按照《结构化编译器前端Clang介绍》折腾半天,最终也没能编译成功。
回头再去XCode安装目录:
Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
找到了,果断复制了Clang至:
/Applications/Xcode.app/Contents/Developer/usr/bin
也不知道,合不合适,但终端里输入Clang终于有反应了
cd Cython-0.17.3
python setup.py build
阻力继续:
running build_py running build_ext building 'Cython.Plex.Scanners' extension clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Cython/Plex/Scanners.c -o build/temp.macosx-10.8-intel-2.7/Cython/Plex/Scanners.o clang: warning: argument unused during compilation: '-mno-fused-madd' Cython/Plex/Scanners.c:4:10: fatal error: 'Python.h' file not found #include "Python.h" ^ 1 error generated. error: command 'clang' failed with exit status 1
stackoverflow上有个最佳答案:
sudo apt-get install python-dev
mac 里没有 apt-get 这个工具,傻眼。。。
其实还在Xcode目录中:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include
找到了“Python.h”,怎么让 python setup.py build 时知道呢?再傻眼。。。
没有师傅指导。。。
难免走弯路。。。
会遇到些稀奇古怪的东西,完全搞不清状况。。。
我看到了这篇文章:
《Fatal Error:studio.h File Not Found》
"Command Line Tools" 的 comment:
"Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.
Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools."
再次打开终端:输入gcc,输入clang,就这么简单,绕这么大弯。
python setup.py build 有些警告
sudo python setup.py install
结束!
相关文章推荐
- 关于TCP/IP和HTTP之间的关系,你知道吗?
- 图解HTTP之一--网络基础(TCP/IP、DNS)
- TCP/IP的分层及功能
- TCP/IP快速了解
- C#开发之Socket网络编程TCP/IP层次模型、端口及报文等探讨
- TCP/IP与UDP 的C/S 模型
- C1000k 新思路:用户态 TCP/IP 协议栈
- 11 TCP/IP 基础与Linux的网络配置
- TCP/IP四层体系结构及每层作用
- TCP IP 学习笔记 二 链路层
- TCP/IP TIME_WAIT状态原理
- [转]Visual C#.Net网络程序开发之TCP/IP
- TCP/IP 某些最常见的错误原因码 (errno)列表
- 【转】TCP/IP ECN分析
- TCP/IP之免费arp分析
- TCP/IP、UDP、 Http、Socket的区别
- TCP/IP、OSI参考模型
- IP和TCP包头校验和的计算方法
- TCP/IP TIME_WAIT状态原理
- Linux下TCP/IP配置文件