Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrew #14

Open
cndaqiang opened this issue Jun 8, 2019 · 3 comments
Open

Homebrew #14

cndaqiang opened this issue Jun 8, 2019 · 3 comments

Comments

@cndaqiang
Copy link
Owner

cndaqiang commented Jun 8, 2019

改源安装
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
@cndaqiang cndaqiang changed the title HomeBrew Homebrew Jun 8, 2019
@cndaqiang
Copy link
Owner Author

cndaqiang commented Jun 8, 2019

Homebrew

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

添加PATH

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
PATH=/usr/local/bin:$PATH

之后安装的程序都在/usr/local/bin里,包括各版本的python等

@cndaqiang
Copy link
Owner Author

cndaqiang commented Jun 8, 2019

找软件包

~/soft/gcc $ brew search gcc
==> Formulae
gcc                 gcc@5               gcc@7               i386-elf-gcc
[email protected] ✔           gcc@6               gcc@8
~/soft/gcc $ 

安装软件包

brew install [email protected]

安装之后

~/soft/gcc $ gcc
gcc             gcc-ar-4.9      gcc-ranlib-4.9  
gcc-4.9         gcc-nm-4.9    
~/soft/gcc $ gcc-4.9 --version
gcc-4.9 (Homebrew GCC 4.9.4_1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

需要建立索引,把系统默认的gcc提成gcc-4.9

gcc默认也安装了gfortran,👍

关于gcc的更多设置,见mac配置开发环境

查询如何使用软件包

~ $ brew info [email protected]
[email protected]: stable 2.4.6 (bottled) [keg-only]
Powerful, clean, object-oriented scripting language
https://www.ruby-lang.org/
/usr/local/Cellar/[email protected]/2.4.6 (13,890 files, 33MB)
  Poured from bottle on 2019-06-09 at 19:10:17
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/[email protected]
==> Dependencies
Build: pkg-config ✘
Required: libyaml ✔, openssl ✔, readline ✔
==> Caveats
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/2.4.0/bin

You may want to add this to your PATH.

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

==> Analytics
install: 455 (30 days), 2,089 (90 days), 4,269 (365 days)
install_on_request: 456 (30 days), 2,089 (90 days), 4,271 (365 days)
build_error: 0 (30 days)

@cndaqiang
Copy link
Owner Author

gcc 找不到头文件stdio.h

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant