Compiling blender ended in incomplete configuration - build

I am trying to compile the blender sources and follow the instruction from here: http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Generic_Distro/CMake
I am in the step "Automatic CMake Setup", but when I call "make" the compilation ended with the following result:
...
used as include directory in directory/home/miguellissimo/git/blender/intern/cycles/kernel
used as include directory in directory/home/miguellissimo/git/blender/intern/cycles/render
used as include directory in directory/home/miguellissimo/git/blender/intern/cycles/subd
used as include directory in directory/home/miguellissimo/git/blender/intern/cycles/util
-- Configuring incomplete, errors occurred!
make: *** [all] Error 1
Does anybody know why it is not compiling?

Related

Make can't find .hpp file in Boost

I'm using an Ubuntu virtual machine and am encountering the following error message when running the 'make' command:
Scanning dependencies of target AIToolboxMDP
[ 1%] Building CXX object src/CMakeFiles/AIToolboxMDP.dir/Impl/Seeder.cpp.o
[ 1%] Building CXX object src/CMakeFiles/AIToolboxMDP.dir/Impl/CassandraParser.cpp.o
In file included from /home/ben/AI/AI-Toolbox-master/include/AIToolbox/Impl/CassandraParser.hpp:4,
from /home/ben/AI/AI-Toolbox-master/src/Impl/CassandraParser.cpp:1:
/home/ben/AI/AI-Toolbox-master/include/AIToolbox/Types.hpp:7:10: fatal error: boost/multi_array.hpp: No such file or directory
7 | #include <boost/multi_array.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/AIToolboxMDP.dir/build.make:76: src/CMakeFiles/AIToolboxMDP.dir/Impl/CassandraParser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1140: src/CMakeFiles/AIToolboxMDP.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
I ran cmake right before make, and cmake was able to find Boost; I can also see that the multi_array.hpp file is in the folder /home/ben/AI/boost_1_77_0/boost, so I'm not sure why make can't find the file. I tried adding variations of the line target_link_libraries(program ${Boost_LIBRARIES}) into the CMakeLists.txt file and using variations of the -L/-l options with the make call, and neither method worked (although I wasn't sure which program name to use with target_link_libraries so I tried a bunch of guesses but maybe I didn't use the right one; I'm trying to build AI-Toolbox if that helps).
I also have to add several options to the cmake command I run right before make in order to get rid of any errors with that; here's what I enter in case that would do anything or if I need to add something else in there:
cmake .. -DBOOST_ROOT=/home/ben/AI/boost_1_77_0 -DLPSOLVE_INCLUDE_PATH=/home/ben/AI/lpsolve -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=/home/ben/AI/vcpkg/scripts/buildsystems/vcpkg.cmake
My CMakeLists.txt file contains the following lines (among others, but these seem like the most relevant) just in case that helps as well:
find_package(Boost ${BOOST_VERSION_REQUIRED} REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
Would anyone have any ideas as to how I can get past the make error?
I ended up solving it by deleting my Boost folder and reinstalling it using the command sudo apt-get install libboost-all-dev; I just reran cmake and took out all the options I had been using except for the lpsolve one, and then when I ran make afterward I encountered no issues.

How can I run many C++ source files in one CLion project?

I am using CLion as an IDE. When I create a project a main.cpp is automatically added. I would like to add 30-40 cpp files in a project and keep them as one project. Basically, I just wanna create many .cpp files in one folder and make CLion run them. I can do this in Pycharm by simply creating a project and add as many .py files as I want. But when I want to do this on CLion I got an error. Is it possible to add many .cpp files in a project in CLion, if yes, how can I do that?
An error could be seen in the below. I added a second.cpp to the project and run and this error message appears.
====================[ Build | trial | Debug ]===================================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/mertsaner/CLionProjects/trial/cmake-build-debug --target trial -- -j 6
Scanning dependencies of target trial
[ 66%] Building CXX object CMakeFiles/trial.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/trial.dir/second.cpp.o
[100%] Linking CXX executable trial
duplicate symbol '_main' in:
CMakeFiles/trial.dir/main.cpp.o
CMakeFiles/trial.dir/second.cpp.o
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [trial] Error 1
make[2]: *** [CMakeFiles/trial.dir/all] Error 2
make[1]: *** [CMakeFiles/trial.dir/rule] Error 2
make: *** [trial] Error 2
Clion uses Cmake. If you want to create multiple executable files for eg with names (ex1.cpp, ex2.cpp. ex3.cpp) in one directory, you will do something like this in the CMake file of your directory.
cmake_minimum_required(VERSION 3.18)
project(some_project)
set(CMAKE_CXX_STANDARD 20)
add_executable(executable1 ex1.cpp)
add_executable(executable2 ex2.cpp)
add_executable(executable3 ex3.cpp)
and so on..

"'MinGW/bin/gcc.exe' is not able to compile a simple test program."

I am currently learning CMake. Right now I am trying to configure CMake to build an example program to learn the basics, but I can't get past what seems like something that should be really easy. It seems that CMake does not agree with my gcc and g++ compilers. I have installed them through CodeBlocks, and they work fine there. However, when I go to configure a project in the CMake GUI I get the following:
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: C:/CodeBlocks/MinGW/bin/gcc.exe
Check for working C compiler: C:/CodeBlocks/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/CodeBlocks/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/MinGW/bin/mingw32-make.exe cmTC_52744/fast && C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_52744.dir\build.make CMakeFiles/cmTC_52744.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj
C:\CodeBlocks\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_52744.dir\testCCompiler.c.obj -c C:\Users\Bank\Desktop\Introductions-to-Libraries-with-CMake\Build\CMakeFiles\CMakeTmp\testCCompiler.c
CMakeFiles\cmTC_52744.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_52744.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_52744/fast' failed
mingw32-make.exe: *** [cmTC_52744/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Bank/Desktop/Introductions-to-Libraries-with-CMake/Build/CMakeFiles/CMakeError.log".
Here is my CMakeLists file:
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_C_COMPILER "C:/CodeBlocks/MinGW/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/CodeBlocks/MinGW/bin/g++.exe")
project("Foo")
add_subdirectory("foo")
And if it helps, here is what the Path variable in my Environment Variables looks like:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git;C:\Program Files\Git\cmd;C:\Users\Bank\AppData\Local\Android\Sdk\tools;C:\Users\Bank\AppData\Local\Android\Sdk\platform-tools;C:\Users\Bank\Desktop\sfAnd\android-ndk-r20;C:\Program Files\CMake\bin;C:\Program Files\Java\jdk1.8.0_231;C:\MinGW\msys\1.0\bin;C:\Program Files\Java\jdk1.8.0_231\jre;C:\Gradle\gradle-6.0-all\gradle-6.0\bin;C:\Gradle\gradle-6.0-all\gradle-6.0;C:\Program Files (x86)\GnuWin32\bin;I:\Storage\Programs\apache-ant-1.9.14-bin\apache-ant-1.9.14\bin;C:\Python27;C:\ninja-win;C:\Program Files\dotnet\;C:\CodeBlocks\MinGW
What could the problem be?
C:\CodeBlocks\MinGW probably doesn't contain the DLL's to gcc or g++. You should add C:\CodeBlocks\MinGW\bin and/or C:\CodeBlocks\MinGW\lib to your path instead, depending on how MinGW was installed. I use MSys2 and use the provided environment for 32bit and 64bit tools. I try to get rid of the pre-packaged versions of MinGW to avoid confusion on my own computers (I noticed msys 1.0 in your path).
I figured it out, finally, thanks to this post:
Cmake build error for c++
I read some posts that said "[your_path]\MinGW" needed to be in your PATH variable, but it's actually "[your_path]\MinGW\bin." I am still not sure why adding the following in CMakeLists did not work:
set(CMAKE_C_COMPILER "C:/CodeBlocks/MinGW/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/CodeBlocks/MinGW/bin/g++.exe")
but that's for another time. Thank you for your help.

How can I solve this compiling error on CLion?

I use as the main directory one called CLionProjects, on it I have several directories. Recently I added those directories so to organize my files. I used since the first time I installed CLion a directory called "Boletin1" that it's inside the main directory, later when I created "Boletin2" (In these directories I have the projects called Ejercicio1, Ejercicio2 and so on) the problems started showing up, I get this error message:
I got to make clear that the compiler problem is only on "Boletin2" directory and the one called "Boletin1" works alright.
I type the debug:
"C:\Program Files\JetBrains\Nueva carpeta\CLion 2020.2.3\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\usuario\Desktop\CLionProjects\Boletín2\Ejercicio1
-- The C compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/JetBrains/Nueva carpeta/CLion 2020.2.3/bin/cmake/win/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/usuario/Desktop/CLionProjects/Boletín2/Ejercicio1/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/mingw64/bin/mingw32-make.exe cmTC_a9874/fast && C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_a9874.dir\build.make CMakeFiles/cmTC_a9874.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/usuario/Desktop/CLionProjects/Bolet�n2/Ejercicio1/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a9874.dir/testCCompiler.c.obj
C:\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_a9874.dir\testCCompiler.c.obj -c C:\Users\usuario\Desktop\CLionProjects\Boletín2\Ejercicio1\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\usuario\Desktop\CLionProjects\Boletín2\Ejercicio1\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_a9874.dir\build.make:85: CMakeFiles/cmTC_a9874.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/usuario/Desktop/CLionProjects/Bolet�n2/Ejercicio1/cmake-build-debug/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:140: cmTC_a9874/fast] Error 2
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 "C:/Users/usuario/Desktop/CLionProjects/Boletín2/Ejercicio1/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/usuario/Desktop/CLionProjects/Boletín2/Ejercicio1/cmake-build-debug/CMakeFiles/CMakeError.log".
[Failed to reload]
Thanks 4 the support or even reading this.
Try to rename your directory to Boletin1 and Boletin2
REMOVE ALL ACCENTS and write it with the boring i letter, even if the spelling is then wrong in your language.
This is an encoding problem and it occurs because in this case you have 3 programs (here cmake, gcc.exe and mingw64-make.exe) that parse the same character with different results (which are Bolet�n2, Bolet├¡n2 and Boletín2).
You might also have to reset clion's cache and/or remove projects from the IDE and re-import them. It may have kept some path in cache and might try to feed them to cmake.

certain headers arent being found, even though I've included them. Aside from using quotes, how can I fix this?

Ive downloaded the SDL2 library using brew install SDL2 but when I am trying to compile melonDS for Mac, I keep banging my head against the wall of the annoying error of
bash-3.2$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bigman/melonDS/build
[ 1%] Building CXX object CMakeFiles/melonDS.dir/src/libui_sdl/main.cpp.o
/Users/bigman/melonDS/src/libui_sdl/main.cpp:24:10: fatal error:
'SDL2/SDL.h' file not found
#include <SDL2/SDL.h>
^~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/melonDS.dir/src/libui_sdl/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/melonDS.dir/all] Error 2
make: *** [all] Error 2
bash-3.2$
I've uninstalled, reinstalled, tried to use compiler flags in the makefile (which did't work because the project uses cmake) but to no avail. Any other reccomendations would be great.