conda-forge / manif-feedstock

A conda-smithy repository for manif.
BSD 3-Clause "New" or "Revised" License
1 stars 4 forks source link

Manif does install eigen and tl-optional #10

Closed GiulioRomualdi closed 3 years ago

GiulioRomualdi commented 3 years ago

Issue:

Hi @traversaro, I installed manif with the following command

conda install -c conda-forge manif

and I noticed that eigen and tl-optional are not installed. The two dependencies are note required to compile manif since is a template only library however they are required in the consumer application to correctly compile.

Indeed when I tried to configure a project composed by the following main

#include <manif/SE3.h>
int main()
{
    manif::SE3d c;
    return 0;
}

and the following CMakeLists.txt

project(test)

cmake_minimum_required(VERSION 3.0)
find_package(manif REQUIRED)

add_executable(test main.cpp)
target_link_libraries(test manif::MANIF)

I got the following error

CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  Could not find a configuration file for package "Eigen3" that is compatible
  with requested version "3.3.9".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/eigen3/Eigen3Config.cmake, version: 3.3.7
    /lib/cmake/eigen3/Eigen3Config.cmake, version: 3.3.7

Call Stack (most recent call first):
  /home/gromualdi/miniforge3/envs/manif-env/share/manif/cmake/manifConfig.cmake:28 (find_dependency)
  CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/gromualdi/robot-code/test-eigen/build/CMakeFiles/CMakeOutput.log".


Environment (conda list):

``` $ conda list # packages in environment at /home/gromualdi/miniforge3/envs/manif-env: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge manif 0.0.4 h9c3ff4c_2 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : manif-env active env location : /home/gromualdi/miniforge3/envs/manif-env shell level : 1 user config file : /home/gromualdi/.condarc populated config files : /home/gromualdi/miniforge3/.condarc /home/gromualdi/.condarc conda version : 4.10.3 conda-build version : not installed python version : 3.8.8.final.0 virtual packages : __linux=5.8.0=0 __glibc=2.31=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/gromualdi/miniforge3 (writable) conda av data dir : /home/gromualdi/miniforge3/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch package cache : /home/gromualdi/miniforge3/pkgs /home/gromualdi/.conda/pkgs envs directories : /home/gromualdi/miniforge3/envs /home/gromualdi/.conda/envs platform : linux-64 user-agent : conda/4.10.3 requests/2.25.1 CPython/3.8.8 Linux/5.8.0-59-generic ubuntu/20.04.2 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False ```
traversaro commented 3 years ago

Hi @GiulioRomualdi !

The problem that you spotted is indeed that eigen and tl-optional are "Build Export Dependencies" (see documentation of http://wiki.ros.org/catkin/package.xml) of manif, but they are not installed when one installs manif. Historically, there is no strict guideline on conda-forge (as far as a I know) for how "Build Export Dependencies" (i.e., packages that you need if you developed against the library) as opposed to run dependencies (i.e. libraries that need to be installed if run a program that is compiled agaist that library), so I guess it is up to the mantainers.

For example, to compile a C++ program against qt on Linux, you also need to install https://github.com/robotology/robotology-superbuild/blob/master/doc/conda-forge.md#create-an-environment-and-install-dependencies libselinux-cos6-x86_64 libxau-cos6-x86_64 libxcb-cos6-x86_64 libxdamage-cos6-x86_64 libxext-cos6-x86_64 libxfixes-cos6-x86_64 libxxf86vm-cos6-x86_64 mesalib mesa-libgl-cos6-x86_64 (see https://github.com/robotology/robotology-superbuild/blob/master/doc/conda-forge.md#create-an-environment-and-install-dependencies), but those are not run dependencies of qt as you don't need them to run a program compile against qt or use Python bindings linked with qt. By the way, this one point we were discussing during the RoboStack hackaton fyi @wolfv @Tobias-Fischer @nuclearsandwich .

As there is no strict guideline (again, as far as I know of) I think it is up to the mantainers to decice what do to. In the specific case of manif, that is header-only C++ library, if a user installs it is because he/she wants to develop against manif, so I think it just make sense to add eigen and tl-optional as run dependencies.

GiulioRomualdi commented 3 years ago

Hi @traversaro, thank you for the explanation. I can open a PR for that

traversaro commented 3 years ago

Hi @traversaro, thank you for the explanation. I can open a PR for that

Just done it, sorry: https://github.com/conda-forge/manif-feedstock/pull/11 . : )

traversaro commented 3 years ago

To clarify a bit more, not every use of an header-only library result in it being a "Build Export Dependency". This happens only if the library is used in public headers. However, as manif is a header-only library, all dependencies are included in public headers.

wolfv commented 3 years ago

yeah indeed there is a bit of a blurry line. For example, to install python packages with pip one sometimes need a compiler, but the compiler package is not a dep of python. Similar the situation for QT. Since most people are only "users" of those packages and don't need the dependencies.

However, for a header only library one could argue that the situation is different :)

traversaro commented 3 years ago

Similar the situation for QT. Since most people are only "users" of those packages and don't need the dependencies.

Yes, for that I was actually thinking of opening an issue to propose having a qt-devel package or similar, as manually documenting which packages to install whener you want to describe how to install from source something that depends on qt is a bit error-prone. However, I think I will wait for the situation on qt packaging to calm a bit.