I haven't been using Clion for some time and these days I tried to run an old project and it gave me this compile error (It used to work fine). Then I created a new project to test, the error still persists. I also tried to update my Clion. Here is the error message:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/ninja -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/9.2.0_1/bin/g++-9 -G Ninja /Users/yzr/Desktop/untitled
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/Cellar/gcc/9.2.0_1/bin/g++-9
-- Check for working CXX compiler: /usr/local/Cellar/gcc/9.2.0_1/bin/g++-9 - broken
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler
"/usr/local/Cellar/gcc/9.2.0_1/bin/g++-9"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/yzr/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/Applications/CLion.app/Contents/bin/ninja/mac/ninja cmTC_5a895 && [1/2] Building CXX object CMakeFiles/cmTC_5a895.dir/testCXXCompiler.cxx.o
FAILED: CMakeFiles/cmTC_5a895.dir/testCXXCompiler.cxx.o
/usr/local/Cellar/gcc/9.2.0_1/bin/g++-9 -o CMakeFiles/cmTC_5a895.dir/testCXXCompiler.cxx.o -c /Users/yzr/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
dyld: Library not loaded: /usr/local/opt/isl/lib/libisl.21.dylib
Referenced from: /usr/local/Cellar/gcc/9.2.0_1/libexec/gcc/x86_64-apple-darwin18/9.2.0/cc1plus
Reason: image not found
g++-9: internal compiler error: Abort trap: 6 signal terminated program cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/Homebrew/homebrew-core/issues> for instructions.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/Users/yzr/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/yzr/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeError.log".
Here is how my CMakeList.txt looks like:
cmake_minimum_required(VERSION 3.21)
project(untitled)
set(CMAKE_CXX_STANDARD 14)
add_executable(untitled main.cpp)
I read this post and added the environment variable but it doesn't seem to work. This is really weird, as it all worked fine. It's just I didn't touch it for some time and need to take a look now. Has anyone encountered this before? Thanks!
Maybe you can try to delete the previous generated cmake-build-debug directory. As the outside environment and version may be updated, some information generated in previous cmake-build-debug directory may no longer be useful. So delete it and Reload the make file to see whether the problem could be solved.
Related
I trying compile NGP but after cmake . -B build I get this lines:
I've installed
Visual Studio 2019
CUDA Toolkit 11.6
CMake 3.22
Python 3.10
Optix 7.6
C:\NGP\instant-ngp>cmake . -B build
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.29.30147.0
-- The CXX compiler identification is MSVC 19.29.30147.0
-- The CUDA compiler identification is NVIDIA 11.6.124
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- **Obtained CUDA architectures automatically from installed GPUs**
**CMake Error: The source directory "SOURCES/CMakeFiles/CMakeTmp" does not exist.**
Specify --help for usage, or press the help button on the CMake GUI.
CMake Error at dependencies/tiny-cuda-nn/CMakeLists.txt:107 (try_run):
Failed to configure test project build system.
Call Stack (most recent call first):
dependencies/tiny-cuda-nn/CMakeLists.txt:146 (TCNN_AUTODETECT_CUDA_ARCHITECTURES)
-- Configuring incomplete, errors occurred!
See also "C:/NGP/instant-ngp/build/CMakeFiles/CMakeOutput.log".
I am not coder I just want to try NERF. It ss possible download somewhere compiled NGP or it doesn't work that way?
EDIT: Noticed that OP is using the -S flag implicitly the issue seems to be elsewhere, hence the updated answer:
UPDATED ANSWER
Please bare in mind that with the limited information at my disposal. This is again only a wild guess, based on what I tried.
After re-examining the output of CMake I've noticed that the issue is within one of the dependencies i.e.
CMake Error at dependencies/tiny-cuda-nn/CMakeLists.txt:107 (try_run):
I was not able to completely replicate the problem, however I do believe I know how to debug these issues. My wild guess here is that either:
The individual dependencies were incorrectly pulled or
The CMake files were poorly generated due to some issue and you didn't clean them.
I would recommend trying the following:
Delete the build folder, and run cmake -S. -Bbuild again. And if that fails you can try the second option.
Remove the git repository (folder called instant-ngp) and clone it again using exactly this command:
git clone --recursive https://github.com/nvlabs/instant-ngp
Please note that the --recursive option is very important due to the fact that you need to pull the dependant repositories as well.
Now if all of that fails. You still have one more option and that is to go to the folder dependencies/tiny-cuda-nn/ and generate the CMake files yourself, however I do not recommend that due to the fact that if you have limited experience you may not know what exactly to do.
I've also checked the variables you wanted to set, and you may do that by running this in Powershell
$Env:CMAKE_CUDA_ARCHITECTURES=YOUR_VALUE_HERE (in my case it is 75 because I have a RTX2080). However bare in mind that
You shouldn't need it, because the architecture is discovered for you
You need to delete the build folder in order to clean up the cached CMake files
Hope it helps!
Scenario
I'm in the process of debugging a CMake script.
In order to produce usable output for me to inspect, I use the following invocation:
cmake -S . -B build -DENABLE_MODULE_A=OFF -DENABLE_MODULE_B=OFF -DENABLE_MODULE_C=OFF --trace-source=CMakeLists.txt --trace-expand |& grep VARIABLE_IM_INTERESTED_IN > build/testout.utf8
Problem
This approach is sub-par, because I'm really only interested in one variable that is expanded in the CMake script in question. grep-ing for that after running it in trace-mode seems to be quite cumbersome, especially since the variable gets expanded multiple times, however I'm interested only in the last, full expansion of said variable.
Desired result
Ideally, there is a command line option for CMake, to print/expand only the one variable I'm interested in. I can filter for the last occurrence of that variable with external tools (for instance tail), but grepping the entire trace output for just one file, seems excessive. In essence I'm looking for a command line option to inspect an arbitrary variable, instead of tracing the entirety of the CMake script.
It is however, not an option to change the CMakeFiles.txt such that this one variable is printed. That is for external reasons, of which I have no control of.
Use variable_watch and CMAKE_PROJECT_INCLUDE_BEFORE as a debugging tool. Create a file called watch_var.cmake with the following contents:
cmake_minimum_required(VERSION 3.24)
variable_watch("${watch_var}")
Now here's an example project:
cmake_minimum_required(VERSION 3.24)
project(example)
set(VARIABLE_IM_INTERESTED_IN foo)
string(APPEND VARIABLE_IM_INTERESTED_IN " bar")
At the command line:
$ cmake -G Ninja -S . -B build -DCMAKE_PROJECT_INCLUDE_BEFORE=$PWD/watch_var.cmake -Dwatch_var=VARIABLE_IM_INTERESTED_IN
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Debug Log at CMakeLists.txt:4 (set):
Variable "VARIABLE_IM_INTERESTED_IN" was accessed using MODIFIED_ACCESS
with value "foo".
CMake Debug Log at CMakeLists.txt:5 (string):
Variable "VARIABLE_IM_INTERESTED_IN" was accessed using READ_ACCESS with
value "foo".
CMake Debug Log at CMakeLists.txt:5 (string):
Variable "VARIABLE_IM_INTERESTED_IN" was accessed using MODIFIED_ACCESS
with value "foo bar".
-- Configuring done
-- Generating done
-- Build files have been written to: /home/reinking/test2/build
Docs: https://cmake.org/cmake/help/latest/command/variable_watch.html
I'm trying to learn cmake and do some basic stuff. It's not going well.
This output seems completely bizarre and broken:
-- The C compiler identification is GNU 10.2.0
-- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc.exe
-- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
PLATFORM_DIR: /home/dtrombley/src/p0/platform/x86_64-pc-cygwin Building on x86_64-pc-cygwin
Including contrib-src/glad...
CMake Error at contrib-src/glad/CMakeLists.txt:19 (project): The CMAKE_C_COMPILER:
x86_64-w64-mingw32-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred! See also "/home/dtrombley/src/p0/build/CMakeFiles/CMakeOutput.log". See also "/home/<user>/src/p0/build/CMakeFiles/CMakeError.log".
I have a CMakeLists.txt in the top directory of my project, that finds my compiler just fine - as you can see about. The compiler is on the system path:
$ which x86_64-w64-mingw32-gcc
/usr/bin/x86_64-w64-mingw32-gcc
Then I include a subdirectory with add_subdirectory(), and it complains that it can't find the C compiler. Which the parent project has found. Shouldn't CMAKE_C_COMPILER be set and inherited by the child directory?
Why would the parent directory be able to find it, but the child directory cannot?
Additionally, setting the CC environment variable as suggested has zero effect.
What is going on here? Setting CMAKE_C_COMPILER explicitly results in the same output.
I tried to compile this OpenVino sample project: https://github.com/intel-iot-devkit/intruder-detector
When I do the cmake, I don't know why it is asking for feature_def, I don't understand what that means.
I'm also troubled at how /opt/intel//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/samples/extension is said to be a non-existent directory. It indeed does not exist. i tried reinstalling OpenVino several times, and that did not solve the problem. Please help, any advice will be appreciated. Thanks in advance.
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:11 (include):
include could not find load file:
feature_defs
CMake Error at CMakeLists.txt:13 (add_subdirectory):
add_subdirectory given source
"/opt/intel//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/samples/extension"
which is not an existing directory.
-- Configuring incomplete, errors occurred!
See also "/home/user/intruder- detector/application/build/CMakeFiles/CMakeOutput.log".
This seems like quite a complete problem as the repo isn't maintained properly. I do not have a full, direct solution to your problem but hopefully this will guide you in the right direction (if you don't want to wait for the owners to do the changes).
This fairly recent git issue asked for fixes for essentially the same exact problem you have, except on another project in that repo. That being said, it seems it has been fixed there.
Sadly, the fix commits are a massive reupload of the whole project with new, updated files; the CMakeLists included. The new CMakeLists.txt (found here) of that project is your best bet at fixing the issue yourself, by comparing it to yours and figuring out the changes here and there. However, since the whole thing was modified, it's possible that the dependencies and such aren't too similar but hopefully not missing.
That being said, I think that's a good starting point and you should also post an issue on that git so that the owner can do something about it asap.
Recently I've started using cmake instead of creating make-files manually. Moreover I use kdevelop as an IDE. So, I created simple cmake project with kdevelop. It builds and executes successfully. But the thing is that when I try to run cmake from terminal (without kdevelop involved in the process) I see that cmake just loads the cpu as high as possible and there is no result for about half an hour. I couldn't wait more so I've just kill the process.
Here is my cmake file:
project(robot)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Debug)
include_directories(include)
add_library(mylib SHARED mylibsrc/mylib.cpp)
Here is how kdevelop starts runs cmake:
/home/sergey/projects/project-test/build> /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug /home/sergey/projects/project-test/
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /home/sergey/bin/gcc
-- Check for working C compiler: /home/sergey/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/sergey/bin/c++
-- Check for working CXX compiler: /home/sergey/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sergey/projects/project-test/build
I try to run cmake in same way but all I receive is the highest possible cpu load.
kdevelop version - 4.8.4
cmake version - 2.8.9
Can you advice anything about that?
Sorry for my broken English.
You can try adding the --trace option to the cmake call. The problem will still exist, but at least you should see then what is taking so long and can then further investigate. The --debug-output option might also help.
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug --trace --debug-output /home/sergey/projects/project-test/