Open dmikushin opened 2 years ago
You'll need to provide a lot more information.
We'll need all of the files necessary to reproduce this issue on another machine.
I have the same issue that ninja cannot find rsp file, the log is showed:
Fatal error[Ms007]: could not open file "@CMakeFiles\erpc_matrix_multiply_rpmsg_cm33_core1.rsp" Directories searched: E:\build\55s69m3\boards\69\me\erpc_matrix_multiply_rpmsg\tmp\erpc _matrix_multiply_rpmsg_cm33_core1\iar\debug
but the CMakeFiles\erpc_matrix_multiply_rpmsg_cm33_core1.rsp just lay there. Not sure it is caused by the @ symbol or other reasons.
Seems I have the same issue that a extra @ symbol is presented in command line when linking: OS: Macos IDE: VSCode(CMake Tools) Task: Using CMake ninja build system to build a executable Libraries: CGAL-5.6 with Qt5 module
CMakeLists.txt:
find_package(CGAL 5.6 REQUIRED COMPONENTS Qt5 )
the CGAL package (CGAL_Qt5_moc_and_resource_files.cmake):
if(CGAL_Qt5_moc_and_resource_files_included)
return()
endif()
set(CGAL_Qt5_moc_and_resource_files_included TRUE)
# qrc files (resources files, that contain icons, at least)
if(EXISTS ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc)
qt5_add_resources (_CGAL_Qt5_RESOURCE_FILES_private
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Input.qrc
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/File.qrc
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Triangulation_2.qrc)
else()
# Installed version, in CMake resources
file ( COPY
${CGAL_MODULES_DIR}/demo/resources
${CGAL_MODULES_DIR}/demo/icons
DESTINATION ${CMAKE_BINARY_DIR})
qt5_add_resources (_CGAL_Qt5_RESOURCE_FILES_private
${CMAKE_BINARY_DIR}/resources/CGAL.qrc
${CMAKE_BINARY_DIR}/icons/Input.qrc
${CMAKE_BINARY_DIR}/icons/File.qrc
${CMAKE_BINARY_DIR}/icons/Triangulation_2.qrc)
endif()
qt5_wrap_ui(_CGAL_Qt5_UI_FILES ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/ImageInterface.ui)
rules.ninja in build directory:
# Rule for linking CXX static library.
rule CXX_STATIC_LIBRARY_LINKER__CGAL_Qt5_moc_and_resources_Release
command = $PRE_LINK && /usr/local/Cellar/cmake/3.28.2/bin/cmake -E rm -f $TARGET_FILE && /usr/bin/ar qc $TARGET_FILE $LINK_FLAGS @$RSP_FILE && /usr/bin/ranlib $TARGET_FILE && /usr/local/Cellar/cmake/3.28.2/bin/cmake -E touch $TARGET_FILE && $POST_BUILD
description = Linking CXX static library $TARGET_FILE
rspfile = $RSP_FILE
rspfile_content = $in_newline $LINK_PATH $LINK_LIBRARIES
restat = $RESTAT
building output:
[23/25 60% :: 13.881] Building CXX object CMakeFiles/CGAL_Qt5_moc_and_resources.dir/CGAL_Qt5_moc_and_resources_autogen/mocs_compilation.cpp.o
[24/25 64% :: 13.947] Linking CXX static library libCGAL_Qt5_moc_and_resources.a
FAILED: libCGAL_Qt5_moc_and_resources.a
: && /usr/local/Cellar/cmake/3.28.2/bin/cmake -E rm -f libCGAL_Qt5_moc_and_resources.a && /usr/bin/ar qc libCGAL_Qt5_moc_and_resources.a @CMakeFiles/CGAL_Qt5_moc_and_resources.rsp && /usr/bin/ranlib libCGAL_Qt5_moc_and_resources.a && /usr/local/Cellar/cmake/3.28.2/bin/cmake -E touch libCGAL_Qt5_moc_and_resources.a && :
ar: @CMakeFiles/CGAL_Qt5_moc_and_resources.rsp: No such file or directory
is it a result of improper configuration or something need to fix?
Looks like improper CMake generation.
Ninja doesn't do anything special here apart from passing the @build.ninja
file (generated itself by CMake).
Using @<path>
to point to a response file is an ad-hoc convention that some tools, but not all of them actually support. In this case it looks like the ar
program you are using does not support it.
Further inspection shows that the Linux ar
command does support this feature (see https://linux.die.net/man/1/ar), but the MacOS version does not (see https://www.unix.com/man-page/osx/1/ar/).
I recommend asking on CMake development lists instead, since it is likely that CMake didn't understand that subtle difference for some reason.
A last resort solution in this case is to provide an ar
wrapper script that recognizes the @<path>
argument, then expands it before calling the real ar
binary with the result of reading it, and ensure CMake uses that one by defining a variable like CMAKE_AR
. But again, I am not a CMake expert, and you'll find more relevant information elsewhere.
@digit-google , thanks for this very nice explanation! So one workaround to try would be CMAKE_AR=llvm-ar
.
In my experience an absolute <path>
instead of @<path>
works, which as you said could be indeed forwarded to CMake folks.
Here is what I get for OpenBLAS with Ninja 1.10.2_1, CMake 3.23 on MacOS X Catalina:
Although
CMakeFiles/openblas_static.rsp
exists, the '@' symbol prevents the path from being recognized correctly. Looks like the '@' "at" symbol was supposed to be expanded to a real path, but the expansion was missed out. Is it the case?