如何编辑和重新构建GCC libstdc ++ C ++标准库源代码? [英] How to edit and re-build the GCC libstdc++ C++ standard library source?

查看:562
本文介绍了如何编辑和重新构建GCC libstdc ++ C ++标准库源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一些研究,并希望编辑libstdc ++库中的某些源代码以进行实验.我特别对尝试并行排序算法感兴趣.我可以在哪里找到可以轻松编辑和构建源代码的文档?

I am working on some research and would like to edit some of the source code in the libstdc++ library for experimentation. I am, specifically, interested in experimenting with the parallel sorting algorithms. Is there a place I can find documentation to easily edit and build the source code?

我尝试构建libstdc ++库的各种版本均未成功.似乎大多数新版本都需要构建整个gcc软件包,这是一个漫长的过程,特别是如果我要在libstdc ++中编辑和试验一些文件的话.

I have tried, unsuccessfully, to build various versions of the libstdc++ library. It seems like most new versions require building the entire gcc package, which is a much more lengthy process, especially if I am going to be editing and experimenting with a few files in libstdc++.

我也无法找到包含并行排序算法的源文件.我似乎只能找到定义函数的头文件,而不是源代码本身.任何建议或与文档的链接将不胜感激.

I have also been unable to find the source files that contain the parallel sorting algorithms. I can only seem to find the header files that define the functions, and not the source code itself. Any advice or links to documentation would be greatly appreciated.

推荐答案

是的,您必须构建整个GCC,但是一旦完成,您只需要重建libstdc ++部分即可.

Yes, you have to build the whole of GCC, but once you've done that you only need to rebuild the libstdc++ part.

http://gcc.gnu.org/wiki/InstallingGCC 中描述了构建GCC.

Building GCC is described at http://gcc.gnu.org/wiki/InstallingGCC

libstdc ++源位于libstdc++-v3目录中.并行算法在libstdc++-v3/include/parallel中,它们是模板,因此所有代码都在标头中.少量的非标头代码在libstdc++-v3/src/c++98/parallel-settings.cc

The libstdc++ sources are in the libstdc++-v3 directory. The parallel algorithms are in libstdc++-v3/include/parallel, they are templates so all the code is in headers. The small amount of non-header code is in libstdc++-v3/src/c++98/parallel-settings.cc

要从顶级构建目录重建libstdc ++,请进入$TARGET/libstdc++-v3目录(其中$TARGET类似于x86_64-unknown-linux-gnu),然后运行make.

To rebuild libstdc++ from the top-level build dir go into the $TARGET/libstdc++-v3 directory (where $TARGET is something like x86_64-unknown-linux-gnu) and run make.

这篇关于如何编辑和重新构建GCC libstdc ++ C ++标准库源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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