如何在 Xcode 中调试以下程序
我在 OSX 10.6.8 上使用 Xcode 3.2.1,我想通过调试其源代码来研究 Avogadro 的工作原理。这里有一个 CMake 指南:
https://web.archive.org/web/20160816105549/http://avogadro.cc/wiki/Compiling_on_Linux_and_Mac_OS_X
解释了如何做到这一点(并提供了来源),但我不是非常熟悉调试。如何将源文件组织到新的 Xcode 项目中并逐步执行编译版本?
这是 git clone 命令:
git clone --recursive git://github.com/cryos/avogadro-squared.git
我发现一个名为 /Users/Eric/Desktop/avogadro-squared/avogadro/avogadro/src 的文件夹,但我不确定如何继续设置标志等,因为该项目最初是编译的在 Cmake 中。
I'm using Xcode 3.2.1 on OSX 10.6.8, and I want to study how Avogadro works by debugging its source code. There is a CMake guide here:
https://web.archive.org/web/20160816105549/http://avogadro.cc/wiki/Compiling_on_Linux_and_Mac_OS_X
that explains how to do it (and the sources are provided), but I am not very familiar with debugging. How do I organize the source files into a new Xcode project and step through a compiled version?
Here is the git clone command:
git clone --recursive git://github.com/cryos/avogadro-squared.git
I spot a folder called /Users/Eric/Desktop/avogadro-squared/avogadro/avogadro/src but I'm unsure as to how to proceed with setting flags etc., since the project is originally compiled in Cmake.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不熟悉 Avogadro,但我刚刚下载了源代码。我找不到任何 xcode 项目。因此,如果您想使用 Xcode 进行调试,您将需要创建必要的项目。你是怎么做到的?嗯,Avogadro 似乎是由其他几个子模块构建的,特别是 openqube、openbabel 和 eigen。因此,您还需要为他们创建 xcode 项目(如果他们还没有)。
这不是一项小工作,您需要阅读 makefile 并查看他们需要哪些库等...
但是,并且这是个好消息,一旦完成,您将了解很多关于 Avogadro 是如何构建的,这将帮助您了解 Avogadro 的工作原理,这就是您的目标。
完成后,您可以向社区提供您的更改,毕竟,这就是开源的全部内容,对吧?
I'm not familiar with Avogadro but I just downloaded the source. There are not any xcode projects that I could find. So if you want to use Xcode to debug it you will need to create the necessary projects. How do you do that? Well, Avogadro seems to be built up with several other sub modules, openqube, openbabel, and eigen in particular. So you will need to create xcode projects for them also (if they don't have them already.)
This is not a small job, you'll need to read the makefiles and see what libraries they need etc...
But, and this is the good news, once it is done you will have learn a lot about how Avogadro is built which will help you learn how Avogadro works, which was your goal.
And when you are done, you can then offer up your changes to the community, after all, that is what open source is all about, right?
Avogadro 使用 CMake,而 CMake 是一个构建系统生成器(我们选择它的部分原因)。所以你可以使用它的生成器机制来请求 Xcode 构建系统。 StackOverflow 上有一个通用答案:使用 CMake 生成 Xcode 项目 。您正在查看收集/构建所有依赖项的超级构建 - 您确实想进入 avogadro 子文件夹并在 Xcode 中打开它。
Avogadro uses CMake, and CMake is a build system generator (part of the reason we chose it). So you can use its generator mechanism to request an Xcode build system. There is a general answer on StackOverflow to generate an Xcode project using CMake. You are looking at the superbuild which gathers/builds all dependencies - you really want to go into the avogadro subfolder and open that in Xcode.