使用自制软件和安装程序安装gfortran是否会产生冲突? [英] Does installing gfortran with homebrew and with an installer create a conflict?

查看:141
本文介绍了使用自制软件和安装程序安装gfortran是否会产生冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注在线教程,以使用自制软件安装一些Python模块,而第一步是使用brew install gfortran安装gfortran.后来,我尝试使用另一个第三方安装脚本来安装一些Python模块,然后我意识到该脚本所做的部分是下载并运行酿造gfortran的公式,看来brew使用的是与att.com不同的版本.将来会导致问题吗?我再次做了brew uninstall gfortranbrew install gfortran,到目前为止看起来好像是一样的(我尝试重新编译以前编译的旧代码),但是我不确定att.com pkg的全部功能. (如果有的话,我有OS X 10.8.2和XCode 4.2).

I was following an online tutorial to install some Python modules using homebrew and one step was to install gfortran with brew install gfortran. Later on, I tried using another third-party installation script to install some Python modules and after the fact I realized that part of what the script did was download and run http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg. I don't know that much about gfortran, but looking at the brew formula for gfortran it appears that brew uses a different version from the att.com one. Will that lead to problems in the future? I did brew uninstall gfortran and brew install gfortran again, and so far it seems like things are the same (I tried recompiling the old code that I had compiled before), but I am not sure what all the att.com pkg did. (I have OS X 10.8.2 and XCode 4.2 if that matters).

推荐答案

这取决于其他gfortran安装程序的安装位置.一般而言,不会冲突. * Homebrew旨在与第三方gfortran安装兼容-它定义对通用"fortran"编译器的依赖,而不是对特定gfortran Homebrew公式的依赖. Homebrew驻留在/usr/local下,将主要安装保持在/usr/local/Cellar中,并明智地符号链接到/usr/local/lib.其他安装到/usr/local的安装程序将仅阻止Homebrew链接其自身的编译器,但将与使用fortran编译器的其他公式一起使用. (假设gfortran构建选项兼容.)

It depends on where the other gfortran installer goes to. In general, no, it won't conflict. * Homebrew is designed to be compatible with third-party gfortran installs - it defines dependencies on a generic "fortran" compiler, and not on the specific gfortran Homebrew formula. Homebrew stays under /usr/local, sticking the main install in /usr/local/Cellar, and symlinking judiciously in to /usr/local/lib. Other installers that install to /usr/local will just prevent Homebrew from linking its own compiler in, but will work with other formulas that use a fortran compiler. (Assuming the gfortran build options are compatible.)

您链接到的那个特定gcc-42安装程序将安装到/usr,而不是/usr/local.**并且其二进制文件后缀有"-4.2";也就是说,它将安装cpp-4.2g++-4.2gfortran-4.2等.因此,a)与Homebrew gfortran没有直接冲突,b)它不会直接遮盖Homebrew安装的/usr/local/bin/gfortran.

That particular gcc-42 installer you linked to installs to /usr, not to /usr/local.** And its binaries are suffixed with "-4.2"; that is, it installs cpp-4.2, g++-4.2, gfortran-4.2, and so on. So a) there's no direct conflict with the Homebrew gfortran, and b) it won't directly shadow the /usr/local/bin/gfortran installed by Homebrew.

在安装了这两种gfortrans的情况下,编译器会被您选择的编译方式所依赖,但取决于编译的方式,但是大多数编译器会寻找普通的gfortran,因此会找到Homebrew,除非您明确将其定向到由AT& T提供的一种.您没有指定构建方式,但是由于您使用的是brew,因此我假设它是通过brew或命令行工具进行的,在这种情况下,我认为他们可能都看到了Homebrew gfortran并忽略了这个.查看他们的构建过程中的详细输出,以确保确定.

Which compiler will get picked up by things you build with both these gfortrans installed will depend on how the build works, but most will be looking for plain gfortran and so will find the Homebrew one, unless you explicitly direct them to the AT&T-provided one. You don't specify how you're building things, but since you're using brew, I'm assuming it's via brew or command line tools, in which case I think they're all probably seeing the Homebrew gfortran and ignoring this one. Look at the verbose output from their build processes to find out for sure.

*当然取决于您所指的冲突".

*Depending, of course on what you mean by "conflict".

**注意:AFAIK没有简单的方法可以通过查看软件包或安装管理器来解决.在运行该安装程序之前和之后,我只是做了一个find /usr,并且在输出中做了一个diff:

**Side note: AFAIK there's no easy way to figure this out by looking at the package or an installation manager. I just did a find /usr before and after running that installer, and did a diff on the output:

$ diff usr_before_any_installs.txt usr_after_att_install.txt | grep '^[<>]'
> /usr/bin/c++-4.2
> /usr/bin/cpp-4.2
> /usr/bin/g++-4.2
> /usr/bin/gcc-4.2
> /usr/bin/gfortran-4.2
> /usr/bin/i686-apple-darwin11-cpp-4.2.1
> /usr/bin/i686-apple-darwin11-g++-4.2.1
> /usr/bin/i686-apple-darwin11-gcc-4.2.1
> /usr/bin/i686-apple-darwin11-gfortran-4.2.1
> /usr/include/gcc
> /usr/include/gcc/darwin
> /usr/include/gcc/darwin/4.2
...

这篇关于使用自制软件和安装程序安装gfortran是否会产生冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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