2013-05-14 29 views
2

我有一個僞編譯運行在buildbot從站。 當buildbot用戶運行我得到:cmake不爲其他用戶工作

-- The C compiler identification is unknown 
-- The CXX compiler identification is unknown 
-- Check for working C compiler: /usr/bin/gcc 
-- Check for working C compiler: /usr/bin/gcc -- broken 
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE): 
    The C compiler "/usr/bin/gcc" is not able to compile a simple test program. 
... 
cc1: error: /usr/local/include/x86_64-linux-gnu: Permission denied 

在/ usr /本地/包括/ x86_64的Linux的GNU的不存在,但如果我手動運行它作爲蘇我得到:

-- The C compiler identification is GNU 
-- The CXX compiler identification is GNU 
-- Check for working C compiler: /usr/bin/gcc 
-- Check for working C compiler: /usr/bin/gcc -- works 
-- Detecting C compiler ABI info 
-- Detecting C compiler ABI info - done 
-- Check for working CXX compiler: /usr/bin/c++ 
-- Check for working CXX compiler: /usr/bin/c++ -- works 
-- Detecting CXX compiler ABI info 
-- Detecting CXX compiler ABI info - done 

和等等,我以後可以製作並運行生成的可執行文件 我假設與項目文件權限無關,因爲所有文件都屬於buildbot用戶

命令運行只是cmake。 OS是Ubuntu的LTS 12.04.1服務器版

感謝

+1

/usr/local/include的權限和誰擁有它? – SethMMorton 2013-05-14 17:22:59

+0

drwx ------ 3 root root 4096 5月9日08:45包括 – hithwen 2013-05-14 17:25:14

+0

好吧,爲/ usr/local/include添加讀取和執行權限,修復了這個問題謝謝! – hithwen 2013-05-14 17:27:44

回答

2

當CMake的檢查gcc作品,它會創建一個臨時文件,並試圖對其進行編譯。根據我的經驗,這總是在當地的CMakeFiles文件目錄中完成。它看起來像某些原因,它試圖在/usr/local/include這樣做(它至少是試圖做東西在該文件夾中,因此cc1: error: /usr/local/include/x86_64-linux-gnu: Permission denied)。

問題是,如您所示只有根有權訪問讀取寫入該文件夾。這對我來說似乎有點奇怪,因爲其他人至少應該被允許在那裏閱讀。無論如何,你的buildbot沒有訪問權限,所以配置失敗。

你有三個選擇。

  1. 挖成當它試圖訪問該文件,並改變它做什麼它是在你自己的位置,做什麼CMake的是做。
  2. 變化/usr/local/include的權限,以使每個人都可以寫/usr/local/include
  3. 創建buildbot屬於一個新的小組,並改變/usr/local/include到該組的所有權。請確保您將權限更改爲770.

就個人而言,我會嘗試做第一個,因爲我更喜歡CMake做本地的事情,而不是在我的系統的腸子裏。 CMakeFiles目錄中有一些日誌文件可供您參考。