个别Boost库编译,无需安装升压 [英] Compiling with individual Boost libraries, Without installing Boost

查看:92
本文介绍了个别Boost库编译,无需安装升压的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我采取了一些C ++ code,我想使尽可能便携。我想的避免需要root权限才能安装库的依赖关系。此外,我想preFER避免饲养大型图书馆拷贝在我的仓库,我也想preFER不要做图书馆的用户级安装(仅仅是因为我不得不在多个手动安装计算机。)

I'm implementing on some C++ code that I would like to make as portable as possible. I would like to avoid dependencies on libraries that require root access to install. Further, I'd prefer to avoid keeping copies of large libraries in my repository, and I would also prefer not to do user-level installations of libraries (simply because I'd have to manually install them on multiple computers.)

我想在我的项目使用 normal_distribution 功能的提升。据我所知,安装升压的典型方式要求 sudo易于得到须藤百胜命令的类型,但我没有在哪里这个code将运行系统的root访问权限。为了解决这个问题,我想知道如果我可以简单地把Boost的副本<一个href=\"http://www.boost.org/doc/libs/1_50_0/doc/html/boost/random/normal_distribution.html\">normal_distribution.cpp和<一个href=\"http://www.boost.org/doc/libs/1_50_0/doc/html/boost_random/reference.html#header.boost.random.normal_distribution_hpp\">normal_distribution.hpp在我的code目录和编译/链接到我的code。与这些文件。将这项工作?

I would like to use the normal_distribution functionality from Boost in my project. I understand that the typical way to install Boost requires a sudo apt-get or sudo yum type of command, but I don't have root access on the systems where this code will run. To get around this, I'm wondering if I could simply place a copy of Boost's normal_distribution.cpp and normal_distribution.hpp in my code directory and compile/link my code with these files. Would this work?

读者可能会问,为什么我不只是使用 normal_distribution 实施TR1或C ++ 11。答案是,我需要保持与一些大学管理集群仍运行G ++ 4.1.x的,这(在我的经验至少)不支持兼容性&LT; TR1 /随机&GT;

Readers may wonder why I'm not just using the normal_distribution implementation in TR1 or C++11. The answer is that I need to maintain compatibility with some university-managed clusters that still run g++ 4.1.x, which (at least in my experience) doesn't support <TR1/random>.

推荐答案

我想象 BCP (升压复制)是pcisely书面$ p $在考虑你的情况。

I imagine that BCP (Boost Copy) was written precisely with your situation in mind.

这篇关于个别Boost库编译,无需安装升压的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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