2016-09-13 172 views
3

我正在使用Sun Studio 12.5處理Solaris 11.3。當我嘗試使用Cmake out-of-tree進行配置時,Cmake完成配置錯誤並且不會生成makefile。樹內也可能被破壞。但是我們的程序說要建立一個樹木,所以;「我做的事。CMake無法使用Sun Studio 12.5生成Makefiles

我幾乎沒有Cmake的經驗。其他人貢獻了CMake文件,並且我努力處理與它們有關的任務。我不知道我是否做錯了什麼,如果我們的Cmake文件被破壞,或者Cmake在Solaris下沒有很好的測試。

CMake正在發生什麼,我該如何解決這個問題?


以下是指向Cmake文件的鏈接。我可以複製/粘貼它們,但它只佔用一堆空間。這些文件託管在GitHub上,以便它們始終可用。

這是Solaris的CMake的版本,我在安裝3.6.2之前:

$ cmake --version 
cmake version 2.8.6 

下面是從的Solaris版本的CMake 2.8。 6。

cryptopp-build$ export CXX=/opt/developerstudio12.5/bin/CC 
cryptopp-build$ export CXXFLAGS="-DNDEBUG -g2 -O2 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__RDSEED__ -D__AVX__ -D__AVX2__ -D__BMI__ -D__BMI2__ -D__ADX__ -xarch=avx2_i" 

cryptopp-build$ cmake ../cryptopp 
-- The CXX compiler identification is unknown 
-- Check for working CXX compiler: /bin/c++ 
-- Check for working CXX compiler: /bin/c++ -- broken 
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:45 (MESSAGE): 
    The C++ compiler "/bin/c++" is not able to compile a simple test program. 

    It fails with the following output: 

    Change Dir: /export/home/test/cryptopp-build/CMakeFiles/CMakeTmp 

    Run Build Command:/bin/gmake "cmTryCompileExec/fast" 

    /bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make 
    CMakeFiles/cmTryCompileExec.dir/build 

    gmake[1]: Entering directory 
    `/export/home/test/cryptopp-build/CMakeFiles/CMakeTmp' 

    /usr/bin/cmake -E cmake_progress_report 
    /export/home/test/cryptopp-build/CMakeFiles/CMakeTmp/CMakeFiles 1 

    Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o 

    /bin/c++ -DNDEBUG -g2 -O2 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ 
    -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__RDSEED__ -D__AVX__ 
    -D__AVX2__ -D__BMI__ -D__BMI2__ -D__ADX__ -xarch=avx2_i -o 
    CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o -c 
    /export/home/test/cryptopp-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx 

    c++: error: language arch=avx2_i not recognized 

    c++: error: language arch=avx2_i not recognized 

    gmake[1]: Leaving directory 
    `/export/home/test/cryptopp-build/CMakeFiles/CMakeTmp' 

    gmake[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.o] Error 
    1 

    gmake: *** [cmTryCompileExec/fast] Error 2 

    CMake will not be able to correctly generate this project. 
Call Stack (most recent call first): 
    CMakeLists.txt:9 (project) 

-- Configuring incomplete, errors occurred! 

和:

$ /opt/developerstudio12.5/bin/CC -V 
CC: Studio 12.5 Sun C++ 5.14 SunOS_i386 2016/05/31 

我建的CMake 3.6.2從資源並安裝在/usr/local攻擊CXX compiler identification is unknown問題,但它似乎有一些麻煩。正如我剛纔所說,我不是Cmake專家(我不確定如何能搞砸make && sudo make install)。

cryptopp-build$ cmake ../cryptopp 
CMake Error: Could not find CMAKE_ROOT !!! 
CMake has most likely not been installed correctly. 
Modules directory not found in 
/usr/local/bin 
CMake Error: Error executing cmake::LoadCache(). Aborting. 

清除緩存由@AndrewHenle結果表明:

# The project GNUmakefile clears all Cmake artifacts because Cmake cannot seem to do it on its own 
$ cd cryptopp 
$ git status -s 
$ 

$ cd .. 
$ rm -rf cryptopp-build 
$ mkdir cryptopp-build 
$ cd cryptopp-build 

# Using 3.6.2 now 
$ cmake ../cryptopp 
CMake Error: Could not find CMAKE_ROOT !!! 
CMake has most likely not been installed correctly. 
Modules directory not found in 
/usr/local/bin 
CMake Error: Error executing cmake::LoadCache(). Aborting. 
+0

哪些C++編譯器是您使用?看起來像它不喜歡你給它的'-xarch = avx2_i'選項。 –

+0

嘗試從'CXXFLAGS'的末尾刪除'-xarch = avx2'。 –

+2

你會發現在輸出中CMake使用'/ bin/C++'作爲編譯器,而不是你在'CXX'中指定的那個。這可能由於CMake緩存而發生。如果您運行CMake生成一個全新的空白目錄,結果是否相同? – Angew

回答

2

所以好像還有兩個問題。首先是Sun提供的低級Cmake。將它診斷爲「太舊」沒有什麼天才。

第二個問題更有意思。它出現CMake Error: Could not find CMAKE_ROOT !!!是由sudo make install原因一旦我切換到sudo gmake install問題就消失了。

以下是關於這個問題的錯誤報告:

相關問題