Closed jharwell closed 3 years ago
The compilation scripts changed a few months ago - check the updated examples to see how to correctly detect ARGoS in your system. Most of the configuration is done automatically now.
That was not the issue. The issue was that the argos3_simulator.py file is not generated by the ARGoS build process, not that it is generated and my code can't find it when I try to use the ARGoS cmake package in my code later.
Steps to reproduce:
$HOME/.local/lib/pkg-config
directory if it exists.cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DARGOS_INSTALL_LDSOCONF=NO ../src
from <argos>/build
make && make doc && make install
Expected result: $HOME/.local/lib/pkg-config/argos3_simulator.pc
exists after installation.
Actual result: File does not exist.
Prior to commit c0ff091e9f037b022281cec6080c78fa3bd57879 this does not happen and everything works as expected.
It looks like the following lines were deleted from src/CMakeLists.txt
by f515fbb356597ac56324c756c96578e00f0037f2:
-# Configuration file for pkg-config
-configure_file(
- ${CMAKE_SOURCE_DIR}/scripts/argos3.pc.in
- ${CMAKE_BINARY_DIR}/argos3_${ARGOS_BUILD_FOR}.pc
- @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/argos3_${ARGOS_BUILD_FOR}.pc DESTINATION lib/pkgconfig)
which seems to be the source of the issue. I think? There are present in c0ff091e9f037b022281cec6080c78fa3bd57879 and not in later commits after FindARGoS was updated.
Was this an accidental deletion, or was this the old mechanism supposed to be replaced by something new ?
As I said in my previous message: the way ARGoS is detected and compilation configured has changed. It is not based on pkg-config anymore, because that system did not allow to easily check for and configure the other dependencies. I don't plan to reinstate it, given its limitations.
In that case, the examples should be updated--they still say that if FindARGoS fails to check pkg-config settings.
I am not sure I understand the issue. Can you show me what's going wrong on your side? The correct code is what is reported in the examples here:
find_package(ARGoS REQUIRED)
include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS})
link_directories(${ARGOS_LIBRARY_DIR})
link_libraries(${ARGOS_LDFLAGS})
EDIT: The find_package()
statement needs to find the file ARGoSConfig
(see here), which is installed in /usr/local/share/argos3/cmake
or /usr/share/argos3/cmake
(this is the default behavior in cmake, as reported in the manual). In case you are using a non-standard installation prefix (not /usr
or /usr/local
), you need use the CMake option cmake -DCMAKE_MODULE_PATH=/path/to/argos3/share/cmake ...
.
The code is correct, but the README https://github.com/ilpincy/argos3-examples/blob/master/README still contains:
When you launch one of the two 'cmake' commands, you might get an error like 'package argos3_simulator' not found. This error has two possible causes:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
which is where my confusion came from--I checked the README first.
Well spotted - I forgot to update the README. Thanks, I'll change it!
:+1:
With the latest master, the pkg-config file for ARGoS does not seem to be generated, so when I try to use the ARGoS cmake module elsewhere, I get all sorts of cryptic errors.
My cmake command is just
cmake ../src
from<argos>/build
.Am I doing something wrong ?