Running CMake through GUI – After identical reinstall of Ubuntu, cmake-gui throws an error and does not launch

I’ve been reinstalling Ubuntu on my server a bunch of times, as I’ve inadvertently mucked something up every time, and found it easier to just do a fresh install.

Now, for some reason, after doing a fresh install with Ubuntu 19.04 minimal, as provided by myserver host Hetzner, the cmake-gui command does not run.

The server itself does not come with a GUI, so I installed LXDE on it, and can run GUI applications just fine while remote connecting through X2Go. I’ve installed cmake, and cmake-gui, yet for some reason, it throws the following error: https://i.imgur.com/ifLX1Zn.png

From the few google results that were relevant, it’s got something to do with display drivers not interfacing well with x-server, with the solution being to downgrade the kernel. Never had to do anything like that in prior Ubuntu installs, so I assume that’s not the issue at all.

So how do I resolve this?

Cmake giving error “compute_20”, even though the architecture is explicitly unstated in the make file

I have the same error as the person in this question, however, when I tried the solution (Just delete the target for compute_20), I’m still getting the error, even after cleaning the project.

To be specific: I’m trying to install caffe by following these instructions, step by step. Even more specifically, here is my steps.

I run sudo cmake .., and I get the following information:

CMake Warning (dev) at cmake/Misc.cmake:32 (set):   implicitly converting 'BOOLEAN' to 'STRING' type. Call Stack (most recent call first):   CMakeLists.txt:24 (include) This warning is for project developers.  Use -Wno-dev to suppress it.  -- Found Boost: /usr/include (found suitable version "1.65.1", minimum required is "1.46") found components:  system thread filesystem chrono date_time atomic  -- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so) -- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so) -- Found PROTOBUF Compiler: /usr/bin/protoc -- HDF5: Using hdf5 compiler wrapper to determine C configuration -- HDF5: Using hdf5 compiler wrapper to determine CXX configuration -- Found lmdb    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so) -- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so) -- Found Snappy  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so) -- CUDA detected: 10.1 -- Automatic GPU detection failed. Building for all known architectures. -- Added CUDA NVCC flags for: sm_20 sm_21 sm_30 sm_35 sm_50 -- OpenCV found (/usr/share/OpenCV) -- Found OpenBLAS libraries: /usr/lib/x86_64-linux-gnu/libopenblas.so -- Found OpenBLAS include: /usr/include/x86_64-linux-gnu -- NumPy ver. 1.11.0 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include) -- Found Boost: /usr/include (found suitable version "1.65.1", minimum required is "1.46") found components:  python  -- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so) -- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/ --  -- ******************* Caffe Configuration Summary ******************* -- General: --   Version           :   0.15.14 --   Git               :   v0.15.14-16-g4b8d54d8-dirty --   System            :   Linux --   C++ compiler      :   /usr/bin/c++ --   Release CXX flags :   -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized --   Debug CXX flags   :   -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized --   Build type        :   Release --  --   BUILD_SHARED_LIBS :   ON --   BUILD_python      :   ON --   BUILD_matlab      :   OFF --   BUILD_docs        :   ON --   CPU_ONLY          :   OFF --   USE_OPENCV        :   ON --   USE_LEVELDB       :   ON --   USE_LMDB          :   ON --   ALLOW_LMDB_NOLOCK :   OFF --  -- Dependencies: --   BLAS              :   Yes (open) --   Boost             :   Yes (ver. 1.65) --   glog              :   Yes --   gflags            :   Yes --   protobuf          :   Yes (ver. 3.0.0) --   lmdb              :   Yes (ver. 0.9.21) --   LevelDB           :   Yes (ver. 1.20) --   Snappy            :   Yes (ver. ..) --   OpenCV            :   Yes (ver. 3.2.0) --   CUDA              :   Yes (ver. 10.1) --  -- NVIDIA CUDA: --   Target GPU(s)     :   Auto --   GPU arch(s)       :   sm_20 sm_21 sm_30 sm_35 sm_50 --   cuDNN             :   Not found --   NCCL              :   Yes --  -- Python: --   Interpreter       :   /usr/bin/python2.7 (ver. 2.7.15) --   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.15+) --   NumPy             :   /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0) --  -- Documentaion: --   Doxygen           :   /usr/bin/doxygen (1.8.13) --   config_file       :   /home/par/caffe/.Doxyfile --  -- Install: --   Install path      :   /home/par/caffe/build/install --  -- Configuring done -- Generating done -- Build files have been written to: /home/par/caffe/build 

NOTE: The configuration says specifically that it’s compiling to sm_20 compute version, which is not what I want to do. I searched all files that I have for this “sm_20” token, and the results are all in /caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/, meaning that they are not contained within a make file.

I searched the same files for a compute_20 mention, and once again, the only mentions are in the directory above. I remove them, keeping syntax in check, and then run make -j"$ (nproc)" to which I get the following error:

[  6%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_crop_layer.cu.o nvcc fatal   : Unsupported gpu architecture 'compute_20' CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:219 (message):   Error generating   /home/par/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o 

What is the cause of this, if compute_20 nor sm_20 are mentioned in any makefile?

CMake can’t find source dir when run from bash script in WSL

Im running the ubuntu version of Windows Subsystem for Linux. In there i’ve set up a simple cmake project and created a script to save me from typing out

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../../

every time i want to build. My CMakeLists.txt exists in two directories above (thus ../../). The build works fine if i type the command above manually OR run a powershell script with the exact same command and nothing else.

But running this bash script inside WSL

#!/bin/bash cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../../ 

i receive the error " does not exist.source directory "/mnt/c/dev-files/C/Practice/.

It looks like the bash script messes up the error output of cmake, so im guessing the script is executing cmake or passing the arguments incorrectly but i have no idea why.

g++ version error while using cmake

I’m trying to install (actually, in this step, clone and compile) edb-debugger with the following sequence (taken from the Hamza Megahed’s book “Penetration testing with shellcode”):

  • $ git clone --recursive https://github.com/eteran/edb-debugger.git
  • $ cd edb-debugger
  • $ mkdir build
  • $ cd build
  • $ cmake ..
  • $ make

But when I try to execute $ cmake .. shows up this error:

“CMake Error at CMakeLists.txt:19 (message):
Your g++ version is too old. At least 5.0 is required.

— Configuring incomplete, errors occurred!
See also “home/usr/edb-debugger/build/CMakeFiles/CMakeOutput.log”

It’s a pretty clear error message but the problem is that I have already tried installing a new version of g++ yet it doesn’t work (the $ cmake .. command, not the installation).

So, I check the version of g++:

  • $ g++ --version

With the output:

“g++ (Ubuntu 5.5.0-12ubuntu~14.04) 5.5.0 20171010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.”

Then, I try executing the $ cmake .. command but it shows the same error as before.

I’m running Ubuntu 14.04 64-bit on VirtualBox

I would appreciate any kind of help!

Использование консоли MSYS2 для сборки проектов CMake

Решил попробовать использовать MSYS2 в качестве единого хранилища всех тулзов для сборки и компиляции разных проектов. Простенькие проекты без зависимостей с помощью CMake собираются спокойно, но вот с зависимостями – проблемы постоянные.

Решил сделать маленький проект на SFML, соответственно взял уже скомпиленную библиотеку, слинковал в своем проекте нужные зависимости, кроме одной, которую MSYS2 в упор не может найти для CMake (может проблема и не в msys2, но Clion со своим cmake спокойно собирает проект) – opengl

Часть кода из CMakeLists.txt:

# .... set(SFML_STATIC_LIBRARIES TRUE) set(SFML_DIR "$  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/cmake/SFML")  find_package(SFML 2.5 COMPONENTS system window network graphics audio main REQUIRED) # .... target_link_libraries($  {TARGET_NAME}     sfml-system     sfml-window     sfml-network     sfml-graphics     sfml-audio     sfml-main     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libFLAC.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libfreetype.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libogg.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libopenal32.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libvorbis.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libvorbisenc.a     $  {PROJECT_EXTLIBS_DIR}/lib-SFML/lib/libvorbisfile.a     )  

В $ PATH у MSYS2 скопирован Windows $ PATH. Компиляция:

$   mkdir build $   cd build $   cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER="clang.exe" -DCMAKE_CXX_COMPILER="clang++.exe" ..  /* ... */  CMake Error at extlibs/lib-SFML/lib/cmake/SFML/SFMLConfig.cmake:139 (message):   SFML found but some of its dependencies are missing ( OpenGL) Call Stack (most recent call first):   CMakeLists.txt:37 (find_package)   CMake Error at CMakeLists.txt:37 (find_package):   Found package configuration file:      /d/Projects/testproject/extlibs/lib-SFML/lib/cmake/SFML/SFMLConfig.cmake    but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT   FOUND.   -- Configuring incomplete, errors occurred!  

Clion, соответственно, без каких либо проблем собирает этот проект.

На сколько я понял CMake не может найти что-то похожее на libopengl32.a

Итак сам вопрос: В чем может быть проблема с невозможностью нахождения OpenGL (сам .a файл я нашел в папке с msys2) и как это исправить?

CMake error while installing Bullet Physics (PYTHON_LIBRARY set to NOTFOUND)

Hello everyone I’m trying to install Bullet Physics in my Ubuntu 18.04 LTS.

I managed to install cmake successfully, but as soon as I try to run

./build_cmake_pybullet_double.sh 

it shows me the error

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: PYTHON_LIBRARY (ADVANCED) 

I already installed python3-pip and other libraries, but why is this error happening?

(In usr/lib there are the following folders python2.7, python3, python3.6, python3.7)

Thanks in advance!

TON liteclient-build cmake error 23%

debian 8 3.16.0-6-686-pae cmake –version cmake version 3.13.5 При сборке вылетает на 23% cmake –build . –target test-lite-client

[ 21%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/filesystem.cpp.o [ 21%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/find_boundary.cpp.o [ 21%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/Gzip.cpp.o [ 23%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/GzipByteFlow.cpp.o [ 23%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/Hints.cpp.o [ 23%] Building CXX object tdutils/CMakeFiles/tdutils.dir/td/utils/HttpUrl.cpp.o /root/lite-client/tdutils/td/utils/HttpUrl.cpp: In function ‘td::Result<td::HttpUrl> td::parse_url(td::MutableSlice, td::HttpUrl::Protocol)’: /root/lite-client/tdutils/td/utils/HttpUrl.cpp:108:11: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:      query = "/";            ^ In file included from /root/lite-client/tdutils/td/utils/Slice.h:3:0,                  from /root/lite-client/tdutils/td/utils/HttpUrl.h:4,                  from /root/lite-client/tdutils/td/utils/HttpUrl.cpp:1: /root/lite-client/tdutils/td/utils/Slice-decl.h:91:20: note: candidate 1: constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]    constexpr Slice &operator=(const char (&a)[N]) {                     ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:59:7: note: candidate 2: td::Slice& td::Slice::operator=(td::Slice&&)  class Slice {        ^ /root/lite-client/tdutils/td/utils/HttpUrl.cpp:108:11: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:      query = "/";            ^ In file included from /root/lite-client/tdutils/td/utils/Slice.h:3:0,                  from /root/lite-client/tdutils/td/utils/HttpUrl.h:4,                  from /root/lite-client/tdutils/td/utils/HttpUrl.cpp:1: /root/lite-client/tdutils/td/utils/Slice-decl.h:91:20: note: candidate 1: constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]    constexpr Slice &operator=(const char (&a)[N]) {                     ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:59:7: note: candidate 2: td::Slice& td::Slice::operator=(const td::Slice&)  class Slice {        ^ /root/lite-client/tdutils/td/utils/HttpUrl.cpp:108:11: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:      query = "/";            ^ In file included from /root/lite-client/tdutils/td/utils/Slice.h:3:0,                  from /root/lite-client/tdutils/td/utils/HttpUrl.h:4,                  from /root/lite-client/tdutils/td/utils/HttpUrl.cpp:1: /root/lite-client/tdutils/td/utils/Slice-decl.h:91:20: note: candidate 1: constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]    constexpr Slice &operator=(const char (&a)[N]) {                     ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:85:10: note: candidate 2: td::Slice& td::Slice::operator=(td::string&&) <deleted>    Slice &operator=(string &&s) = delete;           ^ /root/lite-client/tdutils/td/utils/Slice-decl.h: In instantiation of ‘constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]’: /root/lite-client/tdutils/td/utils/HttpUrl.cpp:108:11:   required from here /root/lite-client/tdutils/td/utils/Slice-decl.h:92:8: error: assignment of member ‘td::Slice::s_’ in read-only object      s_ = a;         ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:93:10: error: assignment of member ‘td::Slice::len_’ in read-only object      len_ = N - 1;           ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:94:13: error: invalid initialization of reference of type ‘td::Slice&’ from expression of type ‘const td::Slice’      return *this;              ^ /root/lite-client/tdutils/td/utils/Slice-decl.h:95:3: error: body of constexpr function ‘constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]’ not a return-statement    }    ^ /root/lite-client/tdutils/td/utils/Slice-decl.h: In member function ‘constexpr td::Slice& td::Slice::operator=(const char (&)[N]) const [with unsigned int N = 2u]’: /root/lite-client/tdutils/td/utils/Slice-decl.h:95:3: warning: control reaches end of non-void function [-Wreturn-type]    }    ^ tdutils/CMakeFiles/tdutils.dir/build.make:582: ошибка выполнения рецепта для цели «tdutils/CMakeFiles/tdutils.dir/td/utils/HttpUrl.cpp.o» make[3]: *** [tdutils/CMakeFiles/tdutils.dir/td/utils/HttpUrl.cpp.o] Ошибка 1 CMakeFiles/Makefile2:1773: ошибка выполнения рецепта для цели «tdutils/CMakeFiles/tdutils.dir/all» make[2]: *** [tdutils/CMakeFiles/tdutils.dir/all] Ошибка 2 CMakeFiles/Makefile2:106: ошибка выполнения рецепта для цели «CMakeFiles/test-lite-client.dir/rule» make[1]: *** [CMakeFiles/test-lite-client.dir/rule] Ошибка 2 Makefile:164: ошибка выполнения рецепта для цели «test-lite-client» make: *** [test-lite-client] Ошибка 2 

чего ему не хватает?

Can’t convert vcxproj to cmake with the cmake-converter

I am using the cmake-converter tool from this link to convert a .vcxproj file to cmake to be able to use it with Clion. I am in the folder where the vcxproj file is located and I run the following command:

cmake-converter -p in_lab.vcxproj

And I get the following error from my terminal:

usage: cmake-converter -s <path/to/file.sln> [ -h | -p | -d | -v | -w | -j | -a ] cmake-converter: error: the following arguments are required: -s/--solution 

I have tried those arguments previously and they threw index errors. How should I go about converting my file to cmake?