[CMake] CMake 2.8.2 with WindRiver diab compiler dcc.exe/dplus.exe on WinXP: CMake Error: Could not COPY_FILE. while detecting compiler ABI

David Cole david.cole at kitware.com
Thu Sep 16 07:04:22 EDT 2010


On Thu, Sep 16, 2010 at 3:02 AM, Molsen, Hannes
<Hannes.Molsen at draeger.com>wrote:

> Hello everyone,
>
> Currently I am trying to compile a Software for a PowerPC PPC603 running
> VxWorks. For that I use the Diab-Compilers with mingw32-make on MS Windows
> XP. The makefiles should be created by CMake MinGW Makefile generator (I use
> Version 2.8.2).
>
> Therefore I started with reading the reading and acting as described in the
> cross-compiler section of the wiki-doc (
> http://www.paraview.org/Wiki/CMake_Cross_Compiling), now having a
> toolchain file (TC_diab.cmake) and a platform-file
> (Generic-DCC-PPC603.cmake) which seem to be processed correctly.
> I already found out how CMake detects the diab compiler correctly (
> http://www.mail-archive.com/cmake@cmake.org/msg20240.html) and added the
> proposed changes to the files CMakeCXXCompilerId.cpp.in and
> CMakeCCompilerId.c.in. This worked well and the corresponding output is
>
>        -- The C compiler identification is Diab
>        -- The CXX compiler identification is Diab
>        -- Check for working C compiler:
> D:/CCView/tools/tornado/host/diab/WIN32/bin/dcc.exe
>        -- Check for working C compiler:
> D:/CCView/tools/tornado/host/diab/WIN32/bin/dcc.exe -- works
>
> Same for the CXX compiler.
>
> The problem comes in the next step, where CMake tries to find detect the
> compiler ABI. In this step CMake seems to try to copy something but does not
> find it. The output is as follows (CXX resp.):
>
>        -- Detecting C compiler ABI info
>        CMake Error: Could not COPY_FILE.
>          OutputFile: ''
>            copyFile:
> 'D:/CCView/binaries/PPC603diab/rat/Framework/CMakeFiles/CMakeDetermineCompilerABI_C.bin'
>
>        Unable to find executable for try_compile: tried
>  "D:/CCView/binaries/PPC603diab/rat/Framework/CMakeFiles/CMakeTmp/cmTryCompileExec"
> and
>  "D:/CCView/binaries/PPC603diab/rat/Framework/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec"
> and
>  "D:/CCView/binaries/PPC603diab/rat/Framework/CMakeFiles/CMakeTmp/Development/cmTryCompileExec".
>
>        -- Detecting C compiler ABI info - done
>        CMake Error at C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
>          file STRINGS file
>
>  "D:/CCView/binaries/PPC603diab/rat/Framework/CMakeFiles/CMakeDetermineCompilerABI_C.bin"
>          cannot be read.
>        Call Stack (most recent call first):
>          C:/Program Files/CMake
> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:71
>  (CMAKE_DETERMINE_COMPILER_ABI)
>          CMakeLists.txt:8 (PROJECT)
>
> As I read (http://www.cmake.org/pipermail/cmake/2010-May/037118.html) the
> problem can be "solved" by adding --debug-trycompile as parameter. This
> seems to not delete the temporary files and somehow the problem goes away.
> So I wrote myself a batch-file that contains the following lines:
>
>        cd /D "%TOOLS_SNAPSHOT_DIR_UX%\binaries\PPC603diab\rat\%SUBDIR%"
>
>        cmake -G "MinGW Makefiles"
> -DCMAKE_TOOLCHAIN_FILE="%TOOLS_SNAPSHOT_DIR_UX%\rat\%SUBDIR%\TC_diab.cmake"
>  "%TOOLS_SNAPSHOT_DIR_UX%\rat\%SUBDIR%""C:\Program Files\CMake
> 2.8\bin\cmake.exe" -G "MinGW Makefiles" -
> DCMAKE_TOOLCHAIN_FILE="%TOOLS_SNAPSHOT_DIR_UX%\rat\%SUBDIR%\TC_diab.cmake"
>    "%TOOLS_SNAPSHOT_DIR_UX%\rat\%SUBDIR%"
>
>        echo = Fixing copy error bug...
>        cmake --debug-trycompile "%TOOLS_SNAPSHOT_DIR_UX%\rat\%SUBDIR%"
>
> after that the output is
>
>        [...]
>        -- Configuring incomplete, errors occurred!
>
>        Fixing copy error bug...
>        debug trycompile on
>        -- Configuring done
>        -- Generating done
>        -- Build files have been written to:
> D:/CCView/binaries/PPC603diab/rat/Framework
>        [...]
>
> So now my real questions:
>
> What causes CMake to fail at the COPY_FILE stage?
> How can I fix this without having to run CMake a second time with
> --debug-trycompile?
> What am I doing wrong?
>
> I hope and think this problem is not caused by and/or related to the
> toolchain and platform files, if I'm wrong I can surely provide them.
>
> Thanks in advance
>
> Hannes Molsen
> ---
> This communication contains confidential information. If you are not the
> intended recipient please return this email to the sender and delete it from
> your records.
>
> Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der
> beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den
> Absender zurück und löschen Sie die E-mail aus Ihrem System.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



Is it possibly a mixed-admin/non-admin file writing / permissions issue...?
Did you ever create any of the directory structure as admin, and then write
some files into it, but then later come back and do it as non-admin....?

If so, simply delete "
%TOOLS_SNAPSHOT_DIR_UX%\binaries\PPC603diab\rat\%SUBDIR%" and try again.

If not, I'm not sure what the problem might be. Is your source code /
project available for inspection? Can you point us to it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100916/13ee3ed5/attachment.htm>


More information about the CMake mailing list