【问题标题】:cmake error while running on a mounted directory在已挂载的目录上运行时出现 cmake 错误
【发布时间】:2012-04-12 02:25:43
【问题描述】:

我在安装文件夹中的包上运行 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:50 (MESSAGE):
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp



Run Build Command:/usr/bin/make "cmTryCompileExec/fast"

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

make: Warning: File `Makefile' has modification time 0.38 s in the future

make[1]: Entering directory
`/home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp'

make[1]: Warning: File `CMakeFiles/cmTryCompileExec.dir/flags.make' has
modification time 0.35 s in the future

/usr/bin/cmake -E cmake_progress_report
/home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp/CMakeFiles 1

Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

/usr/bin/gcc -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
/home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp/testCCompiler.c

cc1: error:
/home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp/testCCompiler.c:
Value too large for defined data type

make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o] Error 1

make[1]: Leaving directory
`/home/X/win_tmp/cmake/build/CMakeFiles/CMakeTmp'

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


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


-- Configuring incomplete, errors occurred!

当我将包复制到我的 linux 文件系统时,Cmake 似乎运行良好。

谢谢, 预测

【问题讨论】:

  • 那些未来的时间戳看起来很可怕;你在运行一个固定this bug 的内核吗?

标签: windows linux cmake mount


【解决方案1】:

根据this link,错误Value too large for defined data typegcc 在挂载Samba 的文件系统上执行stat() 有关。对于这些文件系统,返回的 inode 显然相当大。

解决方案是确保您的挂载命令在选项列中有nounix,noserverino(在/etc/fstab 或等效项中)。

有关详细信息,请参阅mount.cifs 手册页。

【讨论】:

  • @gudge,顺便说一句,我不是在批评你,至少不是直接批评你:-) 但我在谷歌搜索大约四分钟后发现了这个。现在诚然,我经常被告知我的 Google-fu 很强大,但你真的应该先花一些时间搜索。而且,如果您进行了搜索,我最诚挚的歉意。但是,在这种情况下,您应该告诉我们您搜索不成功,并且您不必忍受昨晚没有睡够的老笨蛋的咆哮:-)
  • 我很抱歉。我确实搜索过,但我可能应该注意一下。
【解决方案2】:

挂载文件夹的问题也可能表现为 cmake 命令“file(GLOB VAR PATTERNS)”无法找到任何内容。在我的情况下,后续命令“add_library”最终将没有源文件并失败并出现以下错误:

您为库调用了 ADD_LIBRARY ... 没有任何源文件。这通常表明您的 CMakeLists.txt 文件存在问题。

我希望通过在这里提到这一点,可以将其他人的搜索时间从 4 分钟缩短到 2 分钟。

【讨论】:

    猜你喜欢
    • 2015-02-09
    • 1970-01-01
    • 2018-02-02
    • 2016-04-19
    • 1970-01-01
    • 2014-09-05
    • 1970-01-01
    • 2020-04-23
    • 1970-01-01
    相关资源
    最近更新 更多