After installing ros(melodic version), I followed the below steps one by one.
$ mkdir -p catkin_ws/src
$ cd catkin_ws/src
$ catkin_init_workspace
$ cd ..
$ catkin_make
Then error came up like this
CMake Error at CMakeLists.txt:1:
Parse error. Expected a command name, got unquoted argument with text
"/opt/ros/melodic/share/catkin/cmake/toplevel.cmake".
-- Configuring incomplete, errors occurred!
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I found that CMakeLists.txt file in 'home/catkin_ws/src' folder exists clearly, but contain only this message.
/opt/ros/melodic/share/catkin/cmake/toplevel.cmake
How can I solve this problem??
Looks like you are trying to compile an already compiled project. So delete the CMakeLists.txt file in 'home/catkin_ws/src' or for safety measures move it to another folder then run catkin_make command on your terminal.
Related
I am trying to use setuptools to install a C++ library with a Pybind11 interface using CMake. For using CMake with setuptools, I am using the code in the following answer: Extending setuptools extension to use CMake in setup.py?
I am able to build the library by hand with cmake.
Unfortunately however, when executing pip install . in the root directory of my project, the build fails.
While the first call to cmake (self.spawn(['cmake', str(cwd)] + cmake_args)) finishes without any error, executing the second call (self.spawn(['cmake', '--build', '.'] + build_args)) gives me the following error:
/users/thoerman/miniconda3/envs/postproc_np_products/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot open output file /users/thoerman/postproc_np_products/build/lib.linux-x86_64-cpython-37/postproc_ops_cpp.cpython-37m-x86_64-linux-gnu.so: Is a directory
collect2: error: ld returned 1 exit status
gmake[3]: *** [/users/thoerman/postproc_np_products/build/lib.linux-x86_64-cpython-37/postproc_ops_cpp.cpython-37m-x86_64-linux-gnu.so] Error 1
gmake[2]: *** [CMakeFiles/postproc_ops_cpp.dir/all] Error 2
gmake[1]: *** [CMakeFiles/postproc_ops_cpp.dir/rule] Error 2
gmake: *** [postproc_ops_cpp] Error 2
But when running the exact same commands on the command line inside the build_temp directory, everything works just fine.
Does anyone have a hint for me, what might be going wrong?
After further digging into the problem, I found the solution myself.
The problem was with the lines
extdir = pathlib.Path(self.get_ext_fullpath(ext.name))
extdir.mkdir(parents=True, exist_ok=True)
This created a directory for the target to be built. Building the target then failed, since there was already a directory with the same name.
I was able to solve it by replacing the second line as follows:
extdir.parent.mkdir(parents=True, exist_ok=True)
I am getting this problem when trying to cross compile OpenCV with VisualGDB
following this tutorial https://visualgdb.com/tutorials/raspberry/opencv/build/
I also get the same error when typing tar -xf b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip from command line.
Where in CMakeList is it using the command tar.exe? Is it possible to replace it with something that does not error out like 7zip? Or can this be fixed by updating tar?
I have not been able to remove or replace tar.exe from C:\windows\System32 even as administrator
Is there a workaround to this problem?
Looking around online, tar does not even support zip files, why is it trying to unzip a zip file?
Thanks
Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Success
Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Failed
Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
ADE: Download: v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: E:/Projects/temp/OpenCV/opencv/.cache/ade/b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error at cmake/OpenCVDownload.cmake:240 (message):
ADE: Unpack failed: 1
Call Stack (most recent call first):
modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
modules/gapi/cmake/init.cmake:19 (include)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
Configuring incomplete, errors occurred!
See also "E:/Projects/temp/OpenCV/opencv/VisualGDB/Debug/CMakeFiles/CMakeOutput.log".
See also "E:/Projects/temp/OpenCV/opencv/VisualGDB/Debug/CMakeFiles/CMakeError.log".
CMake Deprecation Warning:
The 'cmake-server(7)' is deprecated. Please port clients to use the
'cmake-file-api(7)' instead.
Exception reported by CMake server: Configuration failed.
wh1+x: Exception reported by CMake server: Configuration failed.
at wh1.c2[_InType,_OutType](_InType a)
at g61.x(String[] a)
at g61.l_2(Hello a)
at wh1.m1()
...
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
ADE: Download: v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: E:/Projects/opencv/.cache/ade/b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error at cmake/OpenCVDownload.cmake:240 (message):
I traced the problem to cmake\opencvdownload.cmake where on line 236
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}"
WORKING_DIRECTORY "${DL_DESTINATION_DIR}"
RESULT_VARIABLE res)
Where if I run the same command line I get this error:
opencv\.cache\ade>cmake -E tar xzf b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
Whereas if I replace it with 7zip, it works fine
7z x b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
However, CMake won't allow me to execute a 7zip command from command line
using "Cmake -E ..."
So the temporary solution until they either fix this in OpenCV or Cmake
Modify file cmake\opencvdownload.cmake on Line 236
change
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}"
to
execute_process(COMMAND 7z x "${CACHE_CANDIDATE}"
I am getting the following error :
CMake Error at CMakeLists.txt:9 (BISON_TARGET):
Unknown CMake command "BISON_TARGET".
when I run the command :
cmake .. -GNinja
Please tell me what to do. I tried searching on google a lot and thus came up with the additions and finally ran the command :
cmake .. -D LLVM_DIR=/usr/lib/llvm-5.0/cmake/ -D FLEX_EXECUTABLE=/usr/local/Cellar/flex/2.5.37/bin/ -D FLEX_INCLUDE_DIR=/usr/local/Cellar/flex/2.5.37/include/ -D BISON_EXECUTABLE=/usr/bin/bison
but it still shows the same error :(.
Please someone help.
Your error is occurring because the BISON_TARGET function definition has not yet been supplied. This method, as commented, is supplied by FindBISON. The error indicates that either Bison was not found on your system (hopefully, you have it installed), or cmake was ran from the wrong directory. Bison is included in the top-level CMake file via:
find_package(BISON REQUIRED)
This line to include Bison must be called before using the BISON_TARGET CMake function. The LLReve instructions for compiling this repository are explicit about which directory to run the build commands in:
Go to the llreve directory and run
cd reve
mkdir build
cd build
cmake .. -GNinja
ninja
This would run on the CMake file in the llreve/reve directory, not the llreve/reve/reve directory. Please ensure you are running CMake from the correct location, as not running cmake on the top-level CMake file will often yield errors.
as you know that i'm really a beginner for CodeLite and MinGW, and i don't have any idea how it's works. When i try to build the project, the output said that it's error and i don't know what should i do. I'm using Windows 10.
i simply just follow the steps based on this video for the first try. https://www.youtube.com/watch?v=LGGHxaDxSK4
when i want to apply for some installation, the bar always show up like this
http://sta.sh/015gez4rfjn0
i even try to mark mingw32-gcc-g++
let me show you my output
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ letstr - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/asu/Documents/letstry/letstr'
C:/MinGW/bin/g++.exe -o ./Debug/letstr #"letstr.txt" -L.
g++.exe: #letstr.txt: No such file or directory
g++.exe: no input files
mingw32-make.exe[1]: *** [Debug/letstr] Error 1
letstr.mk:78: recipe for target 'Debug/letstr' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/asu/Documents/letstry/letstr'
Makefile:4: recipe for target 'All' failed
mingw32-make.exe: *** [All] Error 2
====1 errors, 0 warnings====
g++.exe: #letstr.txt: No such file or directory
i think your destination file incorrect. if you create C program it must be named with .c extension instead of .txt.
For a new project we want to use CMake. We are using Eclipse CDT as IDE and Cygwin gcc.
We generated the CMakeLists.txt and followed [this tutorial (option 2)][1].
When I try to run the described Make target to generate the Makefiles with CMake, which executes
cmake -E chdir C:/projects/eclipse_ws/MyApp/Build/ cmake -G "Unix Makefiles" ../ Run CMake
I get the error
CMake Error: The source directory "C:/projects/eclipse_ws/MyApp/Build/CMake" does not exist.
If I run the command directly from a Cygwin console it works just fine, however then I have to run make also from the Cygwin console, because the Makefiles are generated with Unix paths.
EDIT:
So I fixed this issue (see my answer below).
But I'm still having problems.
When I try to run CMake as Make target in Eclipse as suggested in the tutorial I get the following errors:
cmake -E chdir Build/ cmake -G 'Unix Makefiles' ../
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
System is unknown to cmake, create:
Platform/MINGW32_NT-6.1 to use this system, please send your config file to cmake#www.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please send that file to cmake#www.cmake.org.
-- Check for working C compiler: /usr/bin/gcc.exe
System is unknown to cmake, create:
Platform/MINGW32_NT-6.1 to use this system, please send your config file to cmake#www.cmake.org so it can be added to cmake
-- Check for working C compiler: /usr/bin/gcc.exe -- broken
CMake Error at /usr/share/cmake-2.8.9/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles CMakeTmp
Run Build Command:/usr/bin/make.exe "cmTryCompileExec726566634/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec726566634.dir/build.make
CMakeFiles/cmTryCompileExec726566634.dir/build
make[1]: Entering directory
'/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp'
/usr/bin/cmake.exe -E cmake_progress_report
/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj
/usr/bin/gcc.exe -o
CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj -c
/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp/testCCompiler.c
CMakeFiles/cmTryCompileExec726566634.dir/build.make:60: recipe for target
'CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj' failed
make[1]: Leaving directory
'/cygdrive/c/projects/eclipse_ws/MyApp/Build/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec726566634.dir/testCCompiler.c.obj]
Error 1
Makefile:117: recipe for target 'cmTryCompileExec726566634/fast' failed
make: *** [cmTryCompileExec726566634/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
Seems like for some reason CMake assumes I have an MinGW environment and not Cygwin.
EDIT2
MinGW system was assumed, because a Git installation was in PATH before Cygwin and Git's uname command was used (which returns MinGW).
If you check "Make Target - Same as the target name" in Eclipse's Make dialog, Eclipse will add a
Run CMake
to the command (see question), which is misinterpreted by CMake.
I just unchecked "Same as the target name".