从零开始设置Mac的编译环境

今天重新安装了mac的系统,现在是brand new的状态。

我的Mac是10.10.5的OS X Yosemite系统。


1. Install XCode

Install Xcode to get Command Line tools, which is essential for scientific programming.

Normally, you get it from App store. But I can't, because it says the version not available for my system(10.10.5 is too old I guess).

So I just have to find the right version online: https://zh.wikipedia.org/zh-hans/Xcode

wiki says I need Xcode 7.1/7.1.1/7.2

I downloaded Xcode 7.2 from: 

https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.2/Xcode_7.2.dmg

open the dmg file and you will get the XCode application. Open the app to validate it then it will be installed completely. 

Then, I need to get Command Line Tools by typing this in terminal: 

xcode-select --install


2. Install X11

Choose the latest version on this site: https://www.xquartz.org/

download and open the dmg file. it is easy.


3. Install a app manager like Fink, MacPorts, Homebrew

well I chose Homebrew, it is quite popular lately so..

very easy step after installation of Xcode, simply enter :


ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

(probably you need to press return to continue and type your password of your Mac)

and it is done!


==> Cleaning up /Library/Caches/Homebrew...

==> Migrating /Library/Caches/Homebrew to /Users/Carol/Library/Caches/Homebrew..

==> Deleting /Library/Caches/Homebrew...

Already up-to-date.

==> Installation successful!


==> Homebrew has enabled anonymous aggregate user behaviour analytics.

Read the analytics documentation (and how to opt-out) here:

  https://docs.brew.sh/Analytics.html


==> Next steps:

- Run `brew help` to get started

- Further documentation: 

    https://docs.brew.sh


enter "man brew" if you want to know how to use HomeBrew

with HomeBrew, I can install many things easily, for example: 


brew install python --with-brewed-openssl

with the command line above I get python-2.7.6



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值