大型跨平台软件项目的提示/资源 [英] Tips/Resources for Large Scale Cross-Platform Software Projects

查看:112
本文介绍了大型跨平台软件项目的提示/资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开始一个大型软件项目,涉及跨平台GUI和重数字处理。我计划在C ++和CUDA中编写大多数应用程序后端,并在Qt4中编写GUI。我计划使用Make作为我的构建系统。这将是一个只有两个开发人员的项目,一旦我得到相对远的将是一个开源项目。

I'm going to be starting a large scale software project involving a cross-platform GUI and heavy number crunching. I plan on writing most of the application back-end in C++ and CUDA, and the GUI in Qt4. I plan on using Make as my build system. This will be a project that will only have two developers, and will probably end up being an open source project once I get relatively far with it.

我的主要问题是,有没有任何人有任何提示/资源用于开发软件的架构背后。

My main question is, does anyone have any tips/resources for developing the architecture behind the software.


  • 什么是一个好的结构您的文件的方法? (数字处理代码在一个单独的文件夹而不是gui代码,它与编译的可执行文件或别的?)

  • 构建系统如何工作的跨平台软件?我需要为每个平台设置不同的构建系统,还是可以创建一个通用的makefile,根据哪个平台调用它,构建方式会有所不同?

  • 我需要做我的代码,以确保它将在所有平台上正确构建(预处理器指令等...)

  • 如何处理大型项目的修订控制,将它整合到构建系统中,这样我获得每次构建项目时更新的Version.Revision.Build数字。

  • What would be a good way to structure your files? (number crunching code in a separate folder than the gui code, which is separate from the compiled executables, or something else?)
  • How would the build system work for cross-platform software? Would I need to set-up a different build system for each platform, or could I create a common "makefile" that would build differently depending on which platform invoked it?
  • What kinds of modifications would I need to do to my code to ensure it will build properly on all platforms (pre-processor directives, etc...)?
  • How does someone handle revision control for large projects and integrate it into the build system so I get Version.Revision.Build numbers that update with each time I build my project?

我很遗憾,我的大学,我即将毕业的事实几乎没有涵盖这一点。在这一点上,我做了很多谷歌搜索与运气我需要什么。我不是要求勺子喂一切,我会完全满足与这个书籍或网站的链接。

I've been disheartened by the fact that my college that I'm about to graduate from covers almost none of this. At this point, I've done a lot of Google searches with little luck on what I need. I'm not asking to be spoon fed everything, I'd be perfectly content with links to books or websites relating to this.

我做了大部分的东西

有人会推荐 Release It !:设计和部署生产就绪软件我要询问什么?

Would anyone recommend Release It!: Design and Deploy Production-Ready Software for what I'm inquiring about?

推荐答案

1)结构可以相同,但如果你在子目录中包含文件,请确保使用'/ code> \ 。

1) The structure can be the same, but if you're including files in subdirectories, make sure you use '/ and not \. The former will also work on windows.

2)我会检查出cmake( http://www.cmake.org/ ),用于跨多个平台管理建筑。这将给你带来很多痛苦。

2) I'd check out cmake ( http://www.cmake.org/ ) for managing building across multiple platforms. This will take a lot of pain out of the process for you.

3)尽可能多地使用STL和Boost。这些库在设计时考虑到这个问题。这将覆盖你可能需要做的很大一部分。你已经选择了优秀的Qt库,所以你的GUI不是一个问题。有了这3个组合,你已经是最大的方式在那里。也就是说,你可能需要做一些与平台无关的事情,而不是由其中任何一个覆盖。为此,我建议您编写一个类,在所有平台上公开一致的接口,并在源文件中使用预处理器伪指令隐藏不确定性。必须显示一致的界面。

3) Use STL and Boost as much as you can. These libraries have been designed with this very problem in mind. This will cover a huge portion of what you might need to do. You've already chosen the excellent Qt library, so your GUI is not an issue either. With these 3 combined, you're already most of the way there. That said, you might have to do something that is platform independent and not covered by any of these. For this I suggest you write a class that exposes a consistent interface across all platforms, and hide the nitty-gritty with preprocessor directives in the source file. It is imperative to expose a consistent interface.

4)使用SVN。我不知道如何在其他编译器上做,但在Visual Studio中获取最新修订版本并将其插入到某些文件中,然后将其包含在项目中是微不足道的。你可以使用构建事件来做到这一点。对不起,我不能在其他平台上阐述。

4) Use SVN. I don't know how to do it on other compilers, but it is trivial in Visual Studio to get the latest revision and insert it in to some file that then gets included in your project. You can use build events to do this. Sorry I can't elaborate on other platforms.

此外,如果你不得不在STL,Boost,Qt等等之外,注意API的文档呼叫所有平台。我以前被一个 fseek() API调用的行为,写入字节填充到目的地在一个实现,但不是其他的行为。这些可能是头痛的主要原因,以及尝试并坚持使用如上所述的经过验证的图书馆的另一个原因。

In addition, if you have to head outside of STL, Boost, Qt etceteras, be mindful of the documentation of the API calls on all platforms. I have been bitten in the past by the behavior of a fseek() API call that wrote bytes to pad out to the destination on one implementation, but not the other. These can be a major cause of headache and another reason to try and stick to tried-and-tested libraries as mentioned above.

这篇关于大型跨平台软件项目的提示/资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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