简体   繁体   中英

How to check which components are compiled by which server when using distcc

I've got a distccd daemon running on two servers. One (call it A, .12) serves as the master, while the other (call it B, .11) serves as a slave:

Settings on A:
vim ~/.distcc/hosts
    # contents of ~/.distcc/hosts
    localhost
    192.168.1.11,cpp,lzo

Settings on B:
distccd --daemon --allow 192.168.1.12 --log-file /home/nhlee/distcc.log
"ps aux | grep distcc" to check that it's running

Then I build something with:

pump make -j xxx

And it tells me that:

__________Using distcc-pump from /usr/bin
__________Using 2 distcc servers, of which only 1 support(s) pump mode
...
__________Shutting down distcc-pump include server

However, the time spent is nearly the same. I'm not sure if there is way to check which components were compiled by which host.

I turned on the monitor with:

 distccmon-text 1

I tried this on both machines, and both show me empty lines only.

I looked in /var/look/messages , but there is nothing related to distcc.

I checked in the log file, which is also empty.

How can I see how my files are being compiled?

#

So I checked with top on both machines, and it turns out that all files were compiled on the master's local (A). I'm not sure why there isn't any error, though.

I also tried removing 'localhost' from ~/.distcc/hosts, but the results are still the same.

OK, so I tried a few things and solved the problem. And I ran into some new issues that I'd like to share as well.

  1. First, I did

     export CC=/usr/bin/distcc export CXX=/usr/bin/distcc 

    to let CMake know that I wanted to use distcc instead of gcc/g++.

    This was the main problem. After I did this things were showing up in the monitor.

  2. I had two versions of gcc/g++ installed on my machine, an older version under /usr/bin/ that did not support C++11, and a newer one that did. Though my LD_LIBRARY_PATH had the new one's path in the front, somehow distcc wasn't finding the older one first. Thus I ran into some compile errors saying that -std=c++11 wasn't recognized.

     ## The following solved this issue: sudo yum remove /usr/bin/g++ sudo yum remove /usr/bin/gcc 
  3. There were linking errors when I used distcc, but not when I used g++ directly:

     # Add a simple one-line script (mine was called /usr/bin/distg++) distcc g++ "$@" 

    Then add "-DCMAKE_CXX_COMPILER=distg++" to your CMake command:

     cmake ... -DCMAKE_CXX_COMPILER=distg++ 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM