Building assimp 3.2 does not work anymore - cmake

I can't build assimp 3.2 anymore. Yesterday it worked but today it doesn't.
I am downloading assimp from here. Then I'm doing cmake CMakeLists.txt -G 'Unix Makefiles' and make as described in their INSTALL file. However when doing make I get the following error:
[ 84%] Performing configure step for 'gtest'
CMake Error at /home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest-stamp/gtest-configure.cmake:16 (message):
Command failed: 1
'/usr/bin/cmake' '-DCMAKE_BUILD_TYPE=' '-Dgtest_force_shared_crt=ON' '-Dgtest_disable_pthreads:BOOL=OFF' '-GUnix Makefiles' '/home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest'
See also
/home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest-stamp/gtest-configure-*.log
make[2]: *** [test/gtest/src/gtest-stamp/gtest-configure] Error 1
gtest-configure-out.log is empty, however gtest-configure-err.log says the following:
CMake Error: The source directory "/home/gartenriese/Documents/assimp/assimp-3.2/test/gtest/src/gtest" does not appear to contain CMakeLists.txt.
Any ideas? It worked yesterday and I did not change anything on my system globally.
EDIT:
I can build it with the option -DASSIMP_BUILD_TESTS=OFF added to the cmake command. However this is just a workaround and does not explain the issue.

Because project assimp used incorrect link to gtest repository
Currently cmake-modules/AddGTest.cmake used link to chromium repository which is deprecated and all code removed from it.
From README.md
This mirror has been deprecated.
The actual repository has moved to https://github.com/google/googletest/
So you should update link in AddGTest.cmake to point into Github repository.
UPDATE:
Pull request was already merged into assimp's master branch. So use it instead of repository from comments.

Related

cmake find_package unable to find Eigen3Config.cmake spectra Windows

I am using Eigen3 with spectra (https://spectralib.org/), a library built on top of Eigen. Spectra uses find_package to find Eigen, and comes up with the error:
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Looking through the directory of Eigen, I found that there were no files by those names, but rather one called Eigen3Config.cmake.in. I tried copying the file and renaming it Eigen3Config.cmake, but that gave me a different error of
find_package Error reading CMake code from "C:/Program Files
(x86)/Eigen3/cmake/Eigen3Config.cmake".
which was somewhat expected, but it does tell me that it can at least find the directory where Eigen3Config.cmake.in is. I'm assuming that either find_package is supposed to use Eigen3Config.cmake.in, or Eigen3Config.cmake.in is supposed to generate Eigen3Config.cmake, but i'm very new to cmake, so i'm not sure. How do I fix this?
There is no need to build/install Eigen to use it if you include it manually, as done in the getting started example (https://eigen.tuxfamily.org/dox/GettingStarted.html#title0)
But in order to be found by CMake, you will need to build / install it, as explained in the INSTALL file. https://gitlab.com/libeigen/eigen/-/blob/master/INSTALL
Usually, your error is followed by an hint asking you to set the variable Eigen3_DIR (or something similar) to point the build/install dir of the target project (Eigen3 here). It appears typically when you have built but not installed the project.
So:
Build Eigen
Install it (optional)
For spectra set the cmake var Eigen3_DIR to /path/to/Eigen/build . (if eigen not install or still not found)
These steps worked for me:
Install Eigen
Create a build directory for Eigen
cd into the build directory created
run "cmake ../"Your Eigen Source Directory""
After this is done, in your CMakeLists.txt of your project, you'll want to add "find_package( Eigen3 REQUIRED)" and "include_directories( ${EIGEN3_INCLUDE_DIR})".

Eclipse C/C++ lldb debugger setup macOS Catalina

I've been using Eclipse for a while now for java development and it is seamless. I considered using eclipse for C development also. I installed C/C++ IDE CDT 9.9 addon from the marketplace. I now can create a Makefile project and develop code. But, I'm not able to debug code. After some research, I understood that the native debugger CDT is integrated with, GDB is no longer shipped with macOS. So, at this point, I understood that I have two solutions:
Install GDB and everything works normally.
Install LLDB addon for Eclipse available at the marketplace and everything works normally.
I went on installing LLDB addon for Eclipse and when tried to debug, it showed me:
I checked it in the terminal and I found out that lldb is available and lldb-mi is not available. I googled it and found lldb-mi. To install lldb-mi as shown on the Github page, I needed to install CMake. When I try to generate build files for lldb-mi using CMake, it showed me:
After seeing this message, I thought I may need to install LLVM. I googled and found two ways:
Install from Homebrew
Compile and build from source code and install from it
I chose to go and compile the source code and install it. I downloaded llvm-9.0.0.src and generated build as instructed here. It took almost 2 hours and gave this error:
Now, as I understand it, I just generated build files(Makefiles) and compiled the LLVM source code. It's 19GB in size now. Should I go ahead and install it? or have I misinterpreted anything and did anything wrong?
As #Tsyvarev pointed out, using sudo, llvm got installed successfully. Now, lldb-mi needs to be installed. When I go back and cmake ., it's showing me this error:
Karthiks-MacBook-Pro:lldb-mi-master karthik$ sudo cmake .
-- Found LLVM 9.0.0
-- Using LLVMConfig.cmake in: /usr/local/lib/cmake/llvm
-- Building with -fPIC
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:
lib_lldb
linked by target "lldb-mi" in directory /Users/karthik/Downloads/lldb-mi-master/src
-- Configuring incomplete, errors occurred!
See also "/Users/karthik/Downloads/lldb-mi-master/CMakeFiles/CMakeOutput.log".
As #squareskittles pointed, I understood that lldb-mi requires lib_lldb for cmake to generate build files. I did:
$git clone https://github.com/lldb-tools/lldb-mi
$cd lldb-mi
$mkdir build
$cmake -DCMAKE_PREFIX_PATH=path/to/llvm/root/tree -S . -B build/
CMake should generate all the build files into lldb-mi/build/. It is successful.
$cd build
$make
make should compile the code. It produced:
Karthiks-MacBook-Pro:lldb-mi karthik$ cd build
Karthiks-MacBook-Pro:build karthik$ make
[ 1%] Building CXX object src/CMakeFiles/lldb-mi.dir/MICmdArgValListBase.cpp.o
In file included from /Users/karthik/buildspace/lldb-mi/src/MICmdArgValListBase.cpp:10:
/Users/karthik/buildspace/lldb-mi/src/MICmdArgValListBase.h:40:69: error: a space is required between consecutive right
angle brackets (use '> >')
: public CMICmdArgValBaseTemplate<std::vector<CMICmdArgValBase *>> {
^~
> >
1 error generated.
make[2]: *** [src/CMakeFiles/lldb-mi.dir/MICmdArgValListBase.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/lldb-mi.dir/all] Error 2
make: *** [all] Error 2
Karthiks-MacBook-Pro:build karthik$
I put space between those > >, but there are still a lot of errors in the code.
I presume there are errors in the lldb-mi repository itself.
Can anyone tell me what I should be doing now?
Thanks in advance!
The lldb-mi not longer present from Xcode 11.x, but lldb and LLDB.Framework already included in the Xcode.
Use the lldb-mi that comes bundled with previous versions of XCode( 10.x) , the location is ‘Xcode.app/Contents/Developer/usr/bin/lldb-mi’, copy it to the same location of current version XCode.
And, in Eclipse, change the lldb command location.
Fine!

Unknown CMake Command QT4_ADD_RESOURCE

Very new to make files here, so please forgive me if this is a noob question. I can't seem to find the answer on the internet.
I've forked a public repository from github, and it repository itself is supposed to be download, make and run, but I've already fixed a half dozen errors in their make files trying to get it running. Now I'm down to this one, which seems to be something to do with CMake not finding the right QT4 command.
When I'm in a build folder, the instructions (according to the owner of the repository) says to type "cmake .." - which is an obvious reference to CMakeList.txt in the parent folder. The file is hosted on Github, the line that throws the error is line 94, it says:
QT4_ADD_RESOURCES(OFFNAO_RES_SRCS ${OFFNAO_RES})
I am trying to build this program on Ubuntu 14.04.5 (because that's the OS it was originally built on, I can work on upgrading that after it is working).
The error text it spits out is:
CMake Error at CMakeLists.txt:94(QT$_ADD_RESOURCES):
Unknown CMake command "QT4_ADD_RESOURCES".
-- Configuring incomplete, errors occurred!
I have installed qt4-dev-tools (which also installs all qt4 libraries).
I can't seem to find how to get CMake to recognise QT4 and its commands.
I'm new to CMake and this is the first time I've come across QT4 so I don't know what I'm looking for. Happy to provide any more info if needed. All help is appreciated.
EDIT:
Here's the contents of the offnao CMakeList.txt:
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
PROJECT(OFFNAO)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CTC_DIR}/libnaoqi/include)
INCLUDE_DIRECTORIES(${CTC_DIR}/zlib/include)
INCLUDE_DIRECTORIES(${CTC_DIR}/../sysroot_legacy/usr/include)
SET(OFFNAO_CXX_SRCS
utils/OverlayPainter.cpp
// contents skipped for brevity
tabs/teamBallTab.cpp
)
SET(OFFNAO_MOC
readers/reader.hpp
// contents skipped for brevity
tabs/teamBallTab.hpp
)
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND OFFNAO_CXX_SRCS tabs/cameraTab.cpp)
list(APPEND OFFNAO_MOC tabs/cameraTab.hpp)
endif(CMAKE_TOOLCHAIN_FILE)
SET(OFFNAO_UI
visualiser.ui
ConnectionBar.ui
tabs/LogTab.ui
tabs/LogsTab.ui
)
SET(OFFNAO_RES
resources/visualiser_resources.qrc
)
# build cxx files for resources
QT4_ADD_RESOURCES(OFFNAO_RES_SRCS ${OFFNAO_RES})
# build ui_XXX files from the XML-style .ui files
QT4_WRAP_UI(OFFNAO_UI_SRCS ${OFFNAO_UI})
# this moc's the above variable and appends to the cxx sources
QT4_WRAP_CPP(OFFNAO_MOC_SRCS ${OFFNAO_MOC})
ADD_EXECUTABLE(offnao.bin ${OFFNAO_CXX_SRCS} ${OFFNAO_RES_SRCS} ${OFFNAO_MOC_SRCS} ${OFFNAO_UI_SRCS})
cotire(offnao.bin)
set_source_files_properties(
tabs/graphTab.cpp
tabs/plots.cpp
tabs/walkTab.cpp
tabs/zmpTab.cpp
main.cpp
visualiser.cpp
${OFFNAO_MOC_SRCS} #too lazy to split and list them
PROPERTIES COMPILE_FLAGS "-I${QWT_INCLUDE_DIR}")
find_library ( QGLVIEWER_LIBRARY NAMES QGLViewer qglviewer-qt4 )
find_package ( OpenGL REQUIRED )
find_package ( PNG REQUIRED )
TARGET_LINK_LIBRARIES(
offnao.bin
${QT_LIBRARIES}
${QWT_LIBRARY}
${QGLVIEWER_LIBRARY}
Furthermore, the README that states to build this is rather vague, it doesn't actually say what folder to run these commands from. It states:
Welcome to Off-Nao, the rUNSWift debugging toolsuite.
To build this project, either:
You get lucky and bin/build_setup.sh just works :D
(verified under Ubuntu 14.04.1 LTS both natively and in VMs;
but builds successfully then segfaults at runtime in libGL.so.1
under fresh download of 14.04.3 LTS # 15/9/2015
according to gdb - so much for Ubuntu being stable).
---OR---
You need Qt4 and probably a bunch of other things like QGLViewer to build it natively:
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./offnao
Once you have performed the steps above once, in future you only need to:
$ make
$ ./offnao
In the 'build' directory
I do get the segfault as mentioned in the README at LibGL.so.1 so I've attempted to follow the instruction below it. I can only get the the "cmake .." stage and that's where I get the error.
Reformulating my previous comment as answer:
To use macros QT4_ADD_RESOURCES, QT4_WRAP_UI, QT4_WRAP_CPP and others you need to call find_package(Qt4 REQUIRED) first in your CMakeLists.txt. See the documentation for the FindQt4.cmake module (https://cmake.org/cmake/help/v3.0/module/FindQt4.html).

eigen3 missing error during ROS installation

Hi I'm trying to install ROS on my MAC using homebrew.While installation I got this message :
CMake Error at CMakeLists.txt:7 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/Users/Jishnu/ros_catkin_ws/build_isolated/pcl_ros/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'pcl_ros':
Command '['/Users/Jishnu/ros_catkin_ws/install_isolated/env.sh', ' cmake', '/Users/Jishnu/ros_catkin_ws/src/perception_pcl/pcl_ros', '- DCATKIN_DEVEL_PREFIX=/Users/Jishnu/ros_catkin_ws/devel_isolated/pcl_ros', '-DCMAKE_INSTALL_PREFIX=/Users/Jishnu/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1
I'M a beginner in ROS, so could someone please help me out with this. I have checked if Eigen is installed, version 3.2.4 is already installed
This solved the problem for me.
It seems this has been resolved, but I'll share how I got this
working: Elsewhere in the ros build workspace I found a copy of
FindEigen3.cmake:
ros_catkin_ws$ cp
src/orocos_kinematics_dynamics/orocos_kdl/config/FindEigen3.cmake
src/perception_pcl/pcl_ros/cfg/ Then I removed the following from
CMakeLists:
find_package(Eigen 3 Required) Replacing it with these lines from the
orocos CMakeLists
find_package(Eigen 3 QUIET) if(NOT Eigen_FOUND)
include(${PROJ_SOURCE_DIR}/cfg/FindEigen3.cmake)
set(Eigen_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR}) endif()
include_directories(${Eigen_INCLUDE_DIR}) To be perfectly honest, I
didn't change config -> cfg when I did my build, but it seems to have
worked.
What I did to solve such problem was:
Finding the current value of CMAKE_ROOT by print it out using message( WARNING ${CMAKE_ROOT}) in .cmake file
Make sure Modules/FindEigen3.cmake exists in that folder
If not, download a copy from https://github.com/RainerKuemmerle/g2o/blob/master/cmake_modules/FindEigen3.cmake

CMake does not find the source directory (installing Eigen)

I was installing the library Eigen on Ubuntu. I followed the instructions by creating a "build directory" alongside the downloaded source directory. That is, I have two directories: eigen-eigen-1306d75b4a21 for source, and an empty eigen-build for build.
Then I did:
cd eigen-build
cmake ../eigen-eigen-1306d75b4a21/
sudo make install
An error occurred immediately after make install and it stops the installation:
CMake Error: The source directory "/home/username/something/eigen-eigen-1306d75b4a21" does not exist.
Obviously the directory exists. What is wrong with my CMake? (I don't know much about CMake. I observed some warnings during the second step, saying lots of things such as Qt4 are missing, but I don't think this is the cause, because of what the error message suggests.)
Probably your directory does not include the CMakeLists.txt file.