我正在使用Sun Studio 12.5开发Solaris 11.3。当我尝试使用Cmake -out-tree进行配置时,Cmake会以配置错误完成,而不会生成makefile。树内也可能会被打破。但是我们的程序说要建一棵树,这样我就能做什么。
我几乎没有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我从源代码中构建了Cmake3.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.发布于 2016-09-13 15:21:33
所以出现了两个问题。首先是向下的Sun提供的Cmake。把它诊断为“太老”一点也不天才。
第二个问题更有趣。看来CMake Error: Could not find CMAKE_ROOT !!!是由sudo make install引起的,当我切换到sudo gmake install时,问题就消失了。
以下是有关此问题的bug报告:
https://stackoverflow.com/questions/39463746
复制相似问题