cndaqiang / dell-14-7460-hackintosh

dell燃7000 I代 黑苹果记录 如何使用MacOS Issues
2 stars 0 forks source link

mac配置开发环境 Git/Fortran #10

Open cndaqiang opened 5 years ago

cndaqiang commented 5 years ago

配置开发环境 Git Fortran

cndaqiang commented 5 years ago

Git配置

若未生成过密钥,先生成

ssh-keygen -t rsa -C "cndaqiang"

然后添加到github

git config --global user.name "cndaqiang"
git config --global user.email "chendq@aliyun.com"

升级git

brew install git

代理

  git config --global https.proxy 'socks5://127.0.0.1:1090'
  git config --global --unset https.proxy

git自动补全

brew install bash-completion
复制
#Add the following line to your ~/.bash_profile:
  [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
#  

wget https://raw.githubusercontent.com/cndaqiang/git/master/contrib/completion/git-completion.bash
cp git-completion.bash ~/.git-completion.bash
添加下面到环境
source ~/.git-completion.bash
cndaqiang commented 5 years ago

gcc 开发环境

brew安装gcc

brew install gcc@4.9

在自己的PATH目录建立下列软连接

因为alias建立的连接,makefile不识别

#打包程序
#ln -s  /usr/local/bin/gcc-ranlib-4.9 ranlib
#或者,以为ar已经集成了ranlib功能
#ln -s /bin/echo ranlib
#ln -s  /usr/local/bin/gcc-nm-4.9 nm
#ln -s  /usr/local/bin/gcc-ar-4.9 ar
#gcc 的ar在mac下不好用,使用libtool -static -o 替换
#或者[推荐]使用系统默认的ar,nm,ranlib,也就是啥都不操作
#ARCH     = libtool -static -o #ar
#ARCHFLAGS= #cr
#RANLIB   = ranlib

ln -s   /usr/local/bin/gcc-4.9 gcc
ln -s   /usr/local/bin/gfortran-4.9     gfortran
ln -s   /usr/local/bin/cpp-4.9          cpp
ln -s   /usr/local/bin/c++-4.9          c++
ln -s   /usr/local/bin/g++-4.9          g++
ln -s   /usr/local/bin/gcov-4.9 gcov

清理上面建立的软连接

rm  gcc
rm  gfortran 
rm  cpp
rm  c++
rm  g++
rm  gcov
cndaqiang commented 5 years ago

之后的openmpi,scalapack,fftw,siesta等函数库和程序的编译与linux相同,见我的博客cndaqiang