定义运行时环境 [英] Defining a runtime environment

查看:181
本文介绍了定义运行时环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我的开发定义一个运行时环境。第一个想法当然不是重塑轮子。我下载了macports,用easy_install,试了fink。我一直都有问题。现在,例如,我无法编译scipy,因为MacPorts安装程序想要下载并安装gcc43,但是这并不能在Snow Leopard上编译。对于这个问题,一个错误是开放的,但是我基本上是将它们绑定到我的运行时间上。

I need to define a runtime environment for my development. The first idea is of course not to reinvent the wheel. I downloaded macports, used easy_install, tried fink. I always had problems. Right now, for example, I am not able to compile scipy because the MacPorts installer wants to download and install gcc43, but this does not compile on Snow Leopard. A bug is open for this issue, but I am basically tied to them for my runtime to be usable.

我之前学到的一个技巧是写一个makefile下载并构建具有明确指定版本的库和实用程序的运行时/库。这比MacPorts / fink / apt方法早,但是您可以更多地控制它,尽管您必须手动完成所有操作。当然,如果运行时间增长,这可能会成为一个噩梦,但如果您发现问题,可以使用补丁修复下载的软件包上的问题,建立它。

A technique I learned some time ago, was to write a makefile to download and build the runtime/libs with clearly specified versions of libraries and utilities. This predates the MacPorts/fink/apt approach, but you have much more control on it, although you have to do everything by hand. Of course, this can become a nightmare on its own if the runtime grows, but if you find a problem, you can use patch and fix the issue on the downloaded package, then build it.

我有多个问题:


  • 你的技术是什么为您的开发准备一个定义良好的运行时/库集合?

  • MacPorts / fink /无论是否出现错误,是否允许我重新启用相同的灵活性?

  • 考虑到我的makefile解决方案,当我的软件终于出来下载时,有什么建议可以解决我的用户机器上的开发环境和实际平台之间的潜在问题? >
  • What is your technique to prepare a well-defined runtime/library collection for your development?
  • Does MacPorts/fink/whatever allows me the same flexibility of rehacking if something goes wrong ?
  • Considering my makefile solution, when my software is finally out for download, what are your suggestions about solving the potential troubles between my development environment and the actual platform on my user's machines ?

编辑:我不明白的是其他项目不给我提示。例如,我刚刚下载了scipy,这是一个具有很多依赖关系的复杂库。开发人员在处理之前必须先设置所有的deps。尽管如此,svn中没有任何创造这种环境的东西。

Edit: What I don't understand in particular is that other projects don't give me hints. For example, I just downloaded scipy, a complex library with lots of dependencies. Developers must have all the deps setup before working on it. Despite this, there's nothing in the svn that creates this environment.

修改:为问题添加了一个赏金。我认为这是一个重要的问题,值得得到更多的答案。我会用真实世界的例子来考虑最好的答案,特别注意任何出现的问题及其解决方案。

Edit: Added a bounty to the question. I think this is an important issue and it deserves to get more answers. I will consider best those answers with real world examples with particular attention towards any arisen issues and their solution.

其他问题可激发赏金:


  • 您是否对您的环境(检查正确的安装,例如在集成机上)?

  • 如何在运输时包括您的环境?如果是C,您是否静态链接或运送动态库,在运行可执行文件之前修改LD_LIBRARY_PATH? python,perl和其他的同样的问题呢?

  • 你是否坚持运行时,或者随着时间的推移更新?您是否下载了依赖库或固定版本的trunk包?

  • 如何处理如下情况:library foo需要python 2.5,但是您需要在python 2.4中开发,因为图书馆栏不适用于python 2.5?

  • Do you perform testing on your environment (to check proper installation, e.g. on an integration machine) ?
  • How do you include your environment at shipping time ? If it's C, do you statically link it, or ship the dynamic library, tinkering the LD_LIBRARY_PATH before running the executable? What about the same issue for python, perl, and other ?
  • Do you stick to the runtime, or update it as time passes? Do you download "trunk" packages of your dependency libraries or a fixed version?
  • How do you deal with situations like: library foo needs python 2.5, but you need to develop in python 2.4 because library bar does not work with python 2.5 ?

推荐答案

我们使用一个生成Makefile的CMake脚本那个下载(主要是通过SVN)/配置/构建我们所有的依赖项。为什么CMake?多。这个工作很好,我们支持调用scons / autopain / cmake。当我们在几个平台(Windows,MacOSX,一堆Linux版本)上构建时,我们还支持基于操作系统的不同的编译标志等。通常,库具有默认配置,如果遇到需要特殊配置的系统,则配置将替换为专门的配置。这个效果很好。我们没有找到符合我们目标的任何准备好的解决方案。

We use a CMake script that generates Makefiles that download (mainly through SVN)/configure/build all our dependencies. Why CMake? Multiplatform. This works quite well, and we support invocation of scons/autopain/cmake. As we build on several platforms (Windows, MacOSX, a bunch of Linux variants) we also support different compile flags etc based on the operating system. Typically a library has a default configuration, and if we encounter a system that needs special configuration the configuration is replaced with a specialized configuration. This works quite well. We did not really find any ready solution that would fit our purpose.

据说,这是一个PITA来实现和运行 - 有很多旋钮当您需要支持多个操作系统时转动。我不认为这将成为维护噩梦,因为依赖是相当固定的(图书馆定期升级,但我们很少引入新的)。

That being said, it is a PITA to get it up and running - there's a lot of knobs to turn when you need to support several operating systems. I don't think it will become a maintainance-nightmare as the dependencies are quite fixed (libraries are upgraded regularly, but we rarely introduce new one).

这篇关于定义运行时环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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