include could not find requested file: ARGoSCheckQTOpenGL
miservilla opened this issue · 1 comments
We (small group of graduate students at the University of New Mexico) are attempting to revive the Central Placed Foraging Algorithm (CPFA), using the Argos3 robotics simulator for this purpose (https://github.com/BCLab-UNM/CPFA-ARGoS). When attempting to build the files to run the code, we get an error from the CMakeLists.txt file (see error code below).
CMake Error at CMakeLists.txt:51 (include):
include could not find requested file:
ARGoSCheckQTOpenGL
Argos3 examples run fine without any error. We believe that without this resolved we will not be able to run any simulations with CPFA. Any help or direction to solve this is much appreciated. I am including the entire CMakeLists.txt file below and the output from the build. Please let me know if more information is needed.
`cmake_minimum_required(VERSION 2.8.12)
project(CPFA-ARGoS)
For verbose output
set(CMAKE_VERBOSE_MAKEFILE ON)
#CMAKE_BUILD_TYPE(Release)
#ARGOS_BUILD_NATTIVE(ON)
Get the Git hash for this code
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
Pass the git hash to the compiler
add_definitions("-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}"")
add_definitions("-DGIT_BRANCH="${GIT_BRANCH}"")
Use C+11
if (NOT APPLE)
set(CMAKE_CXX_FLAGS "-std=c++0x")
endif()
Deactivate RPATH for MacOSX.
if (APPLE)
set(CMAKE_MACOSX_RPATH 0)
endif()
Set the path where CMake will find additional scripts.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
Find the ARGoS package.
find_package(PkgConfig)
#pkg_check_modules(ARGOS REQUIRED argos3_simulator)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake)
Check for required libraries to compile code depending on Qt and OpenGL.
include(ARGoSCheckQTOpenGL)
Find the ARGoS package
find_package(PkgConfig)
#pkg_check_modules(ARGOS REQUIRED argos3_simulator)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake)
Find the GSL package.
find_package(GSL REQUIRED)
Find the LUA package.
#find_package(Lua52 REQUIRED)
Check ARGoS
find_package(ARGoS REQUIRED)
include_directories(${ARGOS_INCLUDE_DIRS})
link_directories(${ARGOS_LIBRARY_DIR})
link_libraries(${ARGOS_LDFLAGS})
string(REPLACE "/lib/argos3" "" ARGOS_PREFIX "${ARGOS_LIBRARY_DIR}")
set(CMAKE_INSTALL_PREFIX ${ARGOS_PREFIX} CACHE STRING "Install path prefix, prepended onto install directories." FORCE)
Set ARGoS include directory.
#include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS} ${GSL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} source)
include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS} ${LUA_INCLUDE_DIR} source)
link_directories(${ARGOS_LIBRARY_DIRS} build)
Descend into the source code directory and build the CPFA libraries. This is all that's needed to run experiments.
add_subdirectory(source)
Only build the evolver program if selected.
if (BUILD_EVOLVER)
Check for the MPI package.
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
Find the boost filesystem package.
find_package( Boost REQUIRED COMPONENTS system filesystem )
include_directories( ${Boost_INCLUDE_DIRS} )
Specify the evolver program as a compile target.
add_executable(cpfa_evolver source/evolver.cpp)
Specify the libraries needed to compile the evolver.
target_link_libraries(cpfa_evolver CPFA_controller
CPFA_loop_functions
GA-MPI
${MPI_LIBRARIES}
${Boost_LIBRARIES}
argos3core_simulator)
else()
endif()`
`~/CPFA-ARGoS (master)> ./build.sh (base)
Deleting and recreating the build directory
Configuring Makefiles with CMAKE...
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
CMake Error at CMakeLists.txt:51 (include):
include could not find requested file:
ARGoSCheckQTOpenGL
-- Found ARGoS: /usr/lib/argos3/libargos3core_simulator.so
-- Found DLFCN: /usr/lib/x86_64-linux-gnu/libdl.a
-- Found Pthreads: /usr/lib/x86_64-linux-gnu/libpthread.a
-- Found FreeImage:
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindOpenGL.cmake:315 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
/usr/share/argos3/cmake/FindARGoSQTOpenGL.cmake:21 (find_package)
/usr/share/argos3/cmake/ARGoSConfig.cmake:131 (find_package)
CMakeLists.txt:67 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Checking for module 'glut'
-- No package 'glut' found
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found Qt6: version 6.2.4
-- Found Qt6Widgets: version 6.2.4
-- Found Qt6Gui: version 6.2.4
-- Found Qt6OpenGLWidgets: version 6.2.4
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.3.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.3.6")
-- Configuring incomplete, errors occurred!
See also "/home/michaelservilla/CPFA-ARGoS/build/CMakeFiles/CMakeOutput.log".
Making...
make: *** No targets specified and no makefile found. Stop.
Finished.`
Thank you.
The repository you're trying to use is using old instructions. Please leave an issue there, since the problem is not with the core of ARGoS and therefore not here. The solution is to replace the old way in which ARGoS was detected with the CMake code here: https://github.com/ilpincy/argos3-examples/blob/master/CMakeLists.txt#L21.