在Mac上使用gcc 4.6,我该如何使用它? [英] gcc 4.6 on mac, how do I get it to work?

查看:91
本文介绍了在Mac上使用gcc 4.6,我该如何使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使gcc 4.6在Mac 10.8.5上运行时遇到问题.

I am having problems getting gcc 4.6 to run on Mac 10.8.5.

我在此类问题上的经验非常有限,我一直在寻找并尝试不同的方法来使它起作用,但无济于事.如果对这个问题的答案真的很简单,我感到很抱歉(我实际上希望是这样!)

My experience with such matters is very limited and I have been searching around and trying different things to get this to work, but to no avail. I am sorry if the answer to this problem is really simple (I actually hope that it is!)

这是我的问题:

我需要运行一些软件来进行分析,称为贝叶斯坎(Bayescan).这一点软件需要在gcc4.6中找到的库才能在MacOSX上运行.他们在发布页面上这样说( http://cmpg.unibe.ch/software/BayeScan /download.html )

I need to run a bit of software to do an analysis, called Bayescan. This bit of software requires a library found as part of gcc4.6 to run on a MacOSX. They say so on their distribution pages (http://cmpg.unibe.ch/software/BayeScan/download.html)

我现在已经使用自制软件*安装了gcc4.6.

I have now installed gcc4.6 using homebrew*.

但是,这不能解决我的问题.当我尝试运行该软件时,仍然收到以下错误消息:

However, this does not solve my problem. As I still get the following error message when I try to run the software:

dyld:未加载库:/usr/local/lib/libgomp.1.dylib

dyld: Library not loaded: /usr/local/lib/libgomp.1.dylib

Google告诉我libgomp.1.dylib是gcc46的一部分.

Google tells me that libgomp.1.dylib is part of gcc46.

当我输入:gcc --version时,我得到:

When I type: gcc --version, I get:

使用以下命令配置--prefix =/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir =/usr/include/c ++/4.2.1 Apple LLVM版本5.0(clang-500.2.79)(基于LLVM 3.3svn) 目标:x86_64-apple-darwin12.5.0

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin12.5.0

这使我相信,当我的计算机正在寻找gcc时,它将寻找缺少所需库的旧版本.或gcc4.6安装不正确.

This leaves me to believe that when my computer is looking for gcc, it looks for the old version which lacks the required library. Or gcc4.6 is not installed correctly.

所以我有两个问题:

1)我的假设/结论正确吗?

1) Is my assumption/conclusion correct?

2)如何使我的计算机指向gcc4.6?

2) How do get my computer to point to gcc4.6?

在此先感谢您提供的任何帮助.这个问题使我有些疯狂.

Thank you in advance for any help that you can provide. This issue is driving me a little crazy.

因为这是我经常遇到的问题,是否有很好的资源来学习如何构建环境和组织依赖项?

Is there a good resource for learning how to build environments and organise dependencies, as it is a problem that I often encounter?

(*建议我使用自制软件,但我认为这对我来说是浪费时间,因为我的计算知识不足以使其成为有用的工具,因为文档非常有限.)

(*I was advised to use homebrew but I think its a bit of a waste of time for me as my computing knowledge is not sufficient for it to be a useful tool for me as the documentation is pretty limited).

推荐答案

感谢您的回答.

我设法找出问题并运行了软件.我做了两件事:

I managed to find out the problem and have the software running. I did two things:

1)按照建议,更改$ PATH使其指向正确的gcc编译器,这是查找自制程序将链接usr/local/lib/放置在何处的问题,因此我将其推到了$ PATH的前面

1) As suggested, alter my $PATH so that it pointed at the correct gcc compiler, which was a matter of finding where homebrew had placed the link usr/local/lib/ so I pushed that to the front of $PATH

2)另外,我必须找到自制软件在哪里安装了库libgomp.1.dylib,然后在usr/local/lib中建立了指向该库的链接

2) Also, I had to locate where homebrew had installed the library libgomp.1.dylib, and I then made a link to that within usr/local/lib

再次感谢!

这篇关于在Mac上使用gcc 4.6,我该如何使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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