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.
Related
I'm following this tutorial for building GLFW on Windows, and I'm getting the error when running cmake -S . -B Build:
PS ~\glfw-3.3.2\GLFW> cmake -S . -B Build
CMake Error at CMakeLists.txt:3 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the file specified
-- Configuring incomplete, errors occurred!
See also "~/glfw-3.3.2/GLFW/Build/CMakeFiles/CMakeOutput.log".
Output log is almost completely empty containing only one line with my windows version.
I haven't found any discussions or problems matching mine. And I don't even know does nmake have -? flag since it's not listed on microsoft docs site.
I've tried positioning in other folder because maybe that's the case. But with no luck.
I tried solving it with other error solution's but to no avail.
The solution was to append -G "MinGW Makefiles" to cmake -S . -B Build command. As Tsyvarev suggested I looked more into generators and found out that setting the flags doesn't imply which generator will be used. So manually setting the flags solved the problem for me.
The error is about absent nmake utility, which is a build tool for CMake projects configured with "NMake Makefiles" generator.
You need either to install nmake, or specify (with -G option) other generator, which is available on your platform (Windows) and for which you have a built tool. Possible selection of other generators includes e.g. "MinGW Makefiles" and "Visual Studio" family.
Does anyone know how to solve this?
~$ cd rpi-fbcp/
~/rpi-fbcp$ mkdir build
~/rpi-fbcp$ cd build/
~/rpi-fbcp/build$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
I am trying to git this https://github.com/tasanakorn/rpi-fbcp
I am following this tutorial
https://www.instructables.com/Connected-Round-Screen-240x240-GC9A01-Controller-t/#discuss
I have the LLVM source and I was trying to build it from source the following build script gives me errors, what is wrong with the script, It is very likely that build script has errors in it because no one place was able to give me the correct sequence. I tried making use of the syntax given by official llvm site cmake -G -DCMAKE_BUILD_TYPE= [options] ../llvm
llvm official but it doesn't help.
cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release
-DLLVM_TARGETS_TO_BUILD="X86"
-DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind'
-DLLVM_PARALLEL_COMPILE_JOBS=7
-DLLVM_PARALLEL_LINK_JOBS=1
-DLLVM_CCACHE_BUILD=ON
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ ../llvm
Error Log :
pawan31#Jay-s-Pc:~/llvm$ cmake -G "Unix Makefiles"
ase
-DLLVM_TARGETS_TO_BUILD="X86"
-DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;comCMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
CMake Error: The source directory "/home/pawan31/llvm" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
pawan31#Jay-s-Pc:~/llvm$ -DCMAKE_BUILD_TYPE=Release
piler-rt;libcxx;libcxxabi;libunwind'
-DLLVM_PARALLEL_COMPILE_JOBS=7
-DLLVM_PARALLEL_LINK_JOBS=1
-DLLVM_CCACHE_BUILD=ON
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ ../llvm-DCMAKE_BUILD_TYPE=Release: command not found
pawan31#Jay-s-Pc:~/llvm$ -DLLVM_TARGETS_TO_BUILD="X86"
-DLLVM_TARGETS_TO_BUILD=X86: command not found
pawan31#Jay-s-Pc:~/llvm$ -DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind'
-DLLVM_ENABLE_PROJECTS=clang;lldb;lld;mlir;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind: command not found
pawan31#Jay-s-Pc:~/llvm$ -DLLVM_PARALLEL_COMPILE_JOBS=7
-DLLVM_PARALLEL_COMPILE_JOBS=7: command not found
pawan31#Jay-s-Pc:~/llvm$ -DLLVM_PARALLEL_LINK_JOBS=1
-DLLVM_PARALLEL_LINK_JOBS=1: command not found
pawan31#Jay-s-Pc:~/llvm$ -DLLVM_CCACHE_BUILD=ON
-DLLVM_CCACHE_BUILD=ON: command not found
pawan31#Jay-s-Pc:~/llvm$ -DCMAKE_C_COMPILER=clang
-DCMAKE_C_COMPILER=clang: command not found
pawan31#Jay-s-Pc:~/llvm$ -DCMAKE_CXX_COMPILER=clang++ ../llvm
-DCMAKE_CXX_COMPILER=clang++: command not found
Following this post, if I run cmake .. inside my build folder with no options I get the error:
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
which I can solve by running
cmake .. -D CMAKE_MAKE_PROGRAM:PATH=/mingw64/bin/mingw32-make
However, I want to set the CMAKE_MAKE_PROGRAM from inside the CMakeLists.txt file. I tried the
if(MSYS)
set(CMAKE_MAKE_PROGRAM /mingw64/bin/mingw32-make)
endif(MSYS)
but it doesn't work. I would appreciate it if you could help me know how I can resolve this problem.
P.S.1. Here is the code.
P.S.2. I tried the
set(CMAKE_MAKE_PROGRAM /mingw64/bin/mingw32-makemingw32-make CACHE FILEPATH "" FORCE)
as suggested in the comments but it did not help.
P.S.3. My operating system is Windows 10 version 1909, and I'm running the above commands in MSYS2 terminal MSYS_NT-10.0-18363
Ok, I think I solved the problem. From here, I needed to install the MSYS2's make:
pacman -S make
This seems like a trend too me. I have recently had several problems in MSYS2 which have been resolved by removing the MinGW package and replacing it with the MSYS2 package. So it tells me that when working inside MSYS2 I should favor MSYS2 packages if they are available.
I'm trying to make Ninja work with CMake on FreeBSD 10.3:
cmake -GNinja ..
-- Configuring done
CMake Error:
The detected version of Ninja () is less than the version of Ninja required
by CMake (1.3).
-- Build files have been written to: /home/me/pj/_build
I have put a locally compiled (from Git tag v1.8.2) Ninja in ~/bin/ninja (which is in my $PATH).
$ cmake -version
cmake version 3.4.1
$ ninja --version
1.8.2
I also tried to add -DCMAKE_MAKE_PROGRAM=ninja and -DCMAKE_MAKE_PROGRAM=~/bin/ninja without effect.
I also tried to see if Ninja was really called (by putting a script writing a new file), and it looks like it's never called.
Is there a way to see which commands are used to to check the Ninja version?
By inspecting the generated CMakeCache.txt file, you should be able to tell which Ninja version is picked by CMake.
In CMakeCache.txt you should have something similar to:
// Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja
which could tell which Ninja version is picked by default and whether -DCMAKE_MAKE_PROGRAM is respected or from some reason ignored.
Also, it is worth looking into the generated CMakeOutput.log and CMakeError.log files.
I would also suggest adding ninja to your PATH, hoping CMake would pick it from there.
I came across this question while getting the same error message. What I forgot to do was delete the CMakeCache.txt file before I ran cmake with the -GNinja or -DCMAKE_GENERATOR=Ninja options. So cmake was pulling the cached variable.
You can also get this error message when forgetting to call project(my_project) before calling add_library or add_executable.