CMAKE error project files invalid ; does not contain cmakelists.txt - c++

I am trying to compile the code from the following website on a 64 bit windows computer..
https://dms.sztaki.hu/en/project/gaussian-mixture-modeling-gmm-es-fisher-vector-toolkit
I am getting the following errors:
1) error configuration.. project files may be invalid
2) CMake Error: The source directory "/GMM_Fisher_toolkit/GMM_CUDA_src" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
How can I compile it?

To create an out-of-source build:
Extract your source code to ~/src/test
Create a folder ~/build/test
Goto: ~/build/test
Run: cmake ../../src/test
Run: make

Related

Can someone expand what is meant by 'configure' and 'build' with CMake files

I am downloading this code from GitHub (subdivision-regression), and am getting stuck following the instructions:
To build doosabin_regression:
Run CMake with an out of source build.
Set COMMON_CPP_INCLUDE_DIR to the full path to rstebbing/common/cpp.
Set DOOSABIN_INCLUDE_DIR to the full path to rstebbing/subdivision/cpp/doosabin/include.
Set Ceres_DIR to the directory containing CeresConfig.cmake.
Set GFLAGS_INCLUDE_DIR, GFLAGS_LIBRARY and RAPID_JSON_INCLUDE_DIR. (Add -std=c++11 to CMAKE_CXX_FLAGS if compiling with gcc.)
Configure.
Build.
I have edited the CMakeLists.txt file to put the correct paths in. I then created a new directory called subdivision-regression-bin and ran:
cmake ../subdivision-regression/src
It completes this and displays:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hert5584/RStebbing/subdivision-regression-bin
However, when I try and run the example code, it cannot find the files listed in CMakeLists.txt (I know they are the right paths as otherwise CMake does not run).
I have tried running:
sudo make install
But get the following error:
make: *** No rule to make target 'install'. Stop.
Any ideas why this isn't working? Have the above steps Configured and Built the files?
The ordered CMake idiom to understand is:
The Configure step
The Generate step (This is often subsumed in the Configure step, and not mentioned explicitly, as in this case.)
The Build step (in which you actually compile/link your code into libraries/executables)
Take a look at this resource for information about the configure and generate stages.
You didn't appear to perform the steps to set CMake cache variables. For these you have to use CMake command line options (-D specifically). So run CMake as something like this instead to set all six variables:
cmake -DCOMMON_CPP_INCLUDE_DIR=/rstebbing/common/cp -DDOOSABIN_INCLUDE_DIR=...[More CMake Cache variables]... ../subdivision-regression/src
For building, try just running make without sudo or install:
make

cmake error "CMake Error: The source directory ".../p4c/build/[-DCMAKE_BUILD_TYPE=RELEASE" does not exist

I'm getting the cmake error when installing p4c. Below is the cmake command to be run
cmake .. [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_INSTALL_PREFIX=<path>] [-DENABLE_DOCS=ON (default off)] [-DENABLE_P4RUNTIME_TO_PD=OFF (default on)]
I'm getting the below error
CMake Error: The source directory "/home/users/phani/p4c/build/[-DCMAKE_BUILD_TYPE=RELEASE" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
DEBUG]: command not found
source files, CmakeLists.txt are in path "/home/users/phani/p4c", build is done is seperate subdirectory as shown in the link. Please help me to resolve the error
The syntax:
cmake .. [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_INSTALL_PREFIX=<path>] [-DENABLE_DOCS=ON (default off)] [-DENABLE_P4RUNTIME_TO_PD=OFF (default on)]
is commonly used to quickly describe what options can be added or not to a command line.
To perform a simple build, do
cmake ..
If you want to specify the build type, you do:
cmake .. -DCMAKE_BUILD_TYPE=RELEASE
or
cmake .. -DCMAKE_BUILD_TYPE=DEBUG
etc.
In other words, when you see
command [option] [option=val1|val2]
arguments under [] are optional, and char | means "or". You should not write these characters in the real command line you type in your terminal

Build folder and makefile

The question comes from my puzzlement when compiling a makefile for Deep Learning framework Caffe on Ubuntu, but it relates, I believe, to a more general phenomenon of the nature of compiling a C++ makefile.
After "make all", the resulting files from the compilation were put in a hidden folder: .build_release, not in the respective folders where the cpp files are.
Then when I tried to run the following lines:
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh
I was getting an error that the system does not find the file:
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
But the file actually existed in the .build_release folder.
What happened and how to fix this problem?
The issue is not with make, you simply need to follow the instructions carefully. The BUILD_DIR is specified by Makefile.config. By default this folder is named build. Once you followed the compilation instructions:
cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python)
make all
make test
make runtest
Navigate to build:
cd build
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh

fPIC compiling error: no such file or directory

I am running elementary OS 64-bit and have the source code for the following project on github:
https://github.com/pellegre/libcrafter
I however get the following error when trying to configure it via the ./configure command:
After that I check the config.log file:
Anyone know why this could be? I've compiled with fPIC before without hassle.
Example from the configure file in the folder:
Update for Peter in comments:

Compiling clang-llvm examples

I am trying to compile the Hello example in directory lib/Transforms/Hello, which is basically a Hello World of LLVM pass, but I get the following error when I try to compile it using make.
../../../Makefile.common:61: ../../../Makefile.config: No such file or directory
../../../Makefile.common:69: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
Any idea what is the problem and how to fix it?
If you built LLVM + Clang according to instructions, the Hello sample should have already been built. Go to lib/Transforms/Hello in the build directory (where you ran configure and then make). There should be a Debug+Asserts (or whatever configuration you compiled) there. And you can also run make from there again.
In general, you always make from the build directory, not the source directory. The build directory has all the Makefiles properly set up.