问题描述
试图结合ccache和colorgcc。遵循:- 我的g ++是softg链接到colorgcc
- 〜/ .colorgccrc包含行:g ++:ccache / usr / bin / g ++
运行g ++时--version接收:
不能执行ccache / usr / bin / gcc:在/usr/lib/perl5/5.8.8/IPC/Open3.pm第246行没有这样的文件或目录。
open3:ccache / usr / bin / gcc的exec --version在/ usr / local / bin / colorgcc / gcc下失败208
任何想法如何解决它?
刚刚遇到同样的问题。对我来说,可以通过仔细设置环境变量来解决问题:
#使用g ++命令调用colorgcc
export PATH =/ usr / lib / colorgcc / bin:$ PATH
#告诉ccache调用/ usr / bin中的编译器
export CCACHE_PATH =/ usr / bin
然后我只需要编辑colorgcc的配置文件( / etc / colorgcc / colorgcc
或〜/ .colorgcc
),然后告诉它调用ccache:
<$ p / usr / lib / ccache / bin / gcc
c ++:/ usr / lib / ccache / usr / lib / ccache / bin / g ++
gcc:/ usr / lib / bin / g ++
cc:/ usr / lib / ccache / bin / gcc
g77:/ usr / lib / ccache / bin / g77
f77:/ usr / lib / ccache / bin / g77
gcj:/ usr / lib / ccache / bin / gcj
这当然只有如果在 / usr / lib / colorgcc / bin
中安装了colorgcc的符号链接,并且在 / usr / lib / ccache / bin $中安装了ccache的符号链接c $ c> - 相应地调整。
Trying to combine ccache and colorgcc. Following link text:
- my g++ is soft link to colorgcc
- ~/.colorgccrc contains line: "g++: ccache /usr/bin/g++"
When running g++ --version receive:
Can't exec "ccache /usr/bin/gcc": No such file or directory at /usr/lib/perl5/5.8.8/IPC/Open3.pm line 246.
open3: exec of ccache /usr/bin/gcc --version failed at /usr/local/bin/colorgcc/gcc line 208
Any ideas how to solve it?
Just came across this same issue. For me, the problem could be solved by carefully setting environment variables:
# Make "g++" command call colorgcc
export PATH="/usr/lib/colorgcc/bin:$PATH"
# Tell ccache to invoke compilers in /usr/bin
export CCACHE_PATH="/usr/bin"
Then all I had to do was edit colorgcc's config file (/etc/colorgcc/colorgcc
or ~/.colorgcc
) and tell it to call ccache instead:
g++: /usr/lib/ccache/bin/g++
gcc: /usr/lib/ccache/bin/gcc
c++: /usr/lib/ccache/bin/g++
cc: /usr/lib/ccache/bin/gcc
g77: /usr/lib/ccache/bin/g77
f77: /usr/lib/ccache/bin/g77
gcj: /usr/lib/ccache/bin/gcj
This of course only works if you have colorgcc's symlinks installed in /usr/lib/colorgcc/bin
and ccache's symlinks in /usr/lib/ccache/bin
- adjust accordingly.
这篇关于g ++,colorgcc和ccache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!