stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.85k stars 386 forks source link

CMake must show a build option summary #2455

Open jorisv opened 2 days ago

jorisv commented 2 days ago

It's sometime difficult to help users when they have issues building Pinocchio.

To win some time, CMake should display the following information:

This can help with CI build.

ViSP is a good example. It provide the following CMake output and also install a file with the following information:

│ │ -- ==========================================================
│ │ -- General configuration information for ViSP 3.6.0
│ │ -- 
│ │ --   Version control:               unknown
│ │ -- 
│ │ --   Platform:
│ │ --     Timestamp:                   2024-10-10T14:44:28Z
│ │ --     Host:                        Linux 6.5.0-1025-azure x86_64
│ │ --     CMake:                       3.30.5
│ │ --     CMake generator:             Unix Makefiles
│ │ --     CMake build tool:            $BUILD_PREFIX/bin/make
│ │ --     Configuration:               Release
│ │ -- 
│ │ --   System information:
│ │ --     Number of CPU logical cores: 2
│ │ --     Number of CPU physical cores: 2
│ │ --     Total physical memory (in MiB): 6921
│ │ --     OS name:                     Linux
│ │ --     OS release:                  6.5.0-1025-azure
│ │ --     OS version:                  #26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024
│ │ --     OS platform:                 x86_64
│ │ --     CPU name:                    Unknown P6 family
│ │ --     Is the CPU 64-bit?           yes
│ │ --     Does the CPU have FPU?       yes
│ │ --     CPU optimization:            SSE2 SSE3 SSSE3
│ │ -- 
│ │ --   C/C++:
│ │ --     Built as dynamic libs?:      yes
│ │ --     C++ Compiler:                $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++  (ver 13.3.0)
│ │ --     C++ flags (Release):         -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-st
│ │ rong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_visp_1
│ │ 728571468/work=/usr/local/src/conda/visp-3.6.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -Wall -Wextra -fopenmp -pthread -std=c++17 -fvisibil
│ │ ity=hidden -msse2 -msse3 -mssse3 -fPIC -O3 -DNDEBUG
│ │ --     C++ flags (Debug):           -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-st
│ │ rong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_visp_1
│ │ 728571468/work=/usr/local/src/conda/visp-3.6.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -Wall -Wextra -fopenmp -pthread -std=c++17 -fvisibil
│ │ ity=hidden -msse2 -msse3 -mssse3 -fPIC -g
│ │ --     C Compiler:                  $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-cc
│ │ --     C flags (Release):           -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -is
│ │ ystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_visp_1728571468/work=/usr/local/src/conda/visp-3.6.0 
│ │ -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -Wall -Wextra -fopenmp -pthread -std=c++17 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -O3 -DND
│ │ EBUG
│ │ --     C flags (Debug):             -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -is
│ │ ystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_visp_1728571468/work=/usr/local/src/conda/visp-3.6.0 
│ │ -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -Wall -Wextra -fopenmp -pthread -std=c++17 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -g
│ │ --     Linker flags (Release):      -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow
│ │ -shlib-undefined -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib
│ │ --     Linker flags (Debug):        -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow
│ │ -shlib-undefined -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib
│ │ --     Use cxx standard:            17
│ │ -- 
│ │ --   ViSP modules:
│ │ --     To be built:                 core gui imgproc io java_bindings_generator klt me sensor ar blob robot visual_features vs vision detection mbt tt tt_m
│ │ i
│ │ --     Disabled:                    -
│ │ --     Disabled by dependency:      -
│ │ --     Unavailable:                 java
│ │ -- 
│ │ --   Python (for build):            $PREFIX/bin/python
│ │ -- 
│ │ --   Java:                          
│ │ --     ant:                         no
│ │ --     JNI:                         no
│ │ -- 
│ │ --   Build options: 
│ │ --     Build deprecated:            yes
│ │ --     Build with moment combine:   no
│ │ -- 
│ │ --   OpenCV: 
│ │ --     Version:                     4.10.0
│ │ --     Modules:                     calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching video videoio alphamat ar
│ │ uco bgsegm bioinspired ccalib cvv datasets dnn_objdetect dnn_superres dpm face freetype fuzzy hdf hfs img_hash intensity_transform line_descriptor mcc optf
│ │ low phase_unwrapping plot quality rapid reg rgbd saliency shape signal stereo structured_light superres surface_matching text tracking videostab wechat_qrc
│ │ ode xfeatures2d ximgproc xobjdetect xphoto
│ │ --     OpenCV dir:                  $PREFIX/lib/cmake/opencv4
│ │ -- 
│ │ --   Mathematics: 
│ │ --     Blas/Lapack:                 yes
│ │ --     \- Use MKL:                  no
│ │ --     \- Use OpenBLAS:             no
│ │ --     \- Use Atlas:                no
│ │ --     \- Use Netlib:               yes (ver 3.9.0)
│ │ --     \- Use GSL:                  no
│ │ --     \- Use Lapack (built-in):    no
│ │ --     Use Eigen3:                  yes (ver 3.4.0)
│ │ --     Use OpenCV:                  yes (ver 4.10.0)
│ │ -- 
│ │ --   Simulator: 
│ │ --     Ogre simulator: 
│ │ --     \- Use Ogre3D:               no
│ │ --     \- Use OIS:                  no
│ │ --     Coin simulator: 
│ │ --     \- Use Coin3D:               no
│ │ --     \- Use SoWin:                no
│ │ --     \- Use SoXt:                 no
│ │ --     \- Use SoQt:                 no
│ │ --     \- Use Qt5:                  no
│ │ --     \- Use Qt4:                  no
│ │ --     \- Use Qt3:                  no
│ │ -- 
│ │ --   Media I/O: 
│ │ --     Use JPEG:                    yes (ver 80)
│ │ --     Use PNG:                     yes (ver 1.6.44)
│ │ --     \- Use ZLIB:                 yes (ver 1.3.1)
│ │ --     Use OpenCV:                  yes (ver 4.10.0)
│ │ --     Use stb_image (built-in):    yes (ver 2.27.0)
│ │ --     Use TinyEXR (built-in):      yes (ver 1.0.2)
│ │ -- 
│ │ --   Real robots: 
│ │ --     Use Afma4:                   no
│ │ --     Use Afma6:                   no
│ │ --     Use Franka:                  no
│ │ --     Use Viper650:                no
│ │ --     Use Viper850:                no
│ │ --     Use ur_rtde:                 no
│ │ --     Use Kinova Jaco:             no
│ │ --     Use aria (Pioneer):          no
│ │ --     Use PTU46:                   no
│ │ --     Use Biclops PTU:             no
│ │ --     Use Flir PTU SDK:            no
│ │ --     Use MAVSDK:                  no
│ │ --     Use Parrot ARSDK:            no
│ │ --     \-Use ffmpeg:                no
│ │ --     Use Virtuose:                no
│ │ --     Use qbdevice (built-in):     yes (ver 2.6.0)
│ │ --     Use takktile2 (built-in):    yes (ver 1.0.0)
│ │ -- 
│ │ --   GUI: 
│ │ --     Use X11:                     yes
│ │ --     Use GTK:                     no
│ │ --     Use OpenCV:                  yes (ver 4.10.0)
│ │ --     Use GDI:                     no
│ │ --     Use Direct3D:                no
│ │ -- 
│ │ --   Cameras: 
│ │ --     Use DC1394-2.x:              yes (ver 2.2.7)
│ │ --     Use CMU 1394:                no
│ │ --     Use V4L2:                    no
│ │ --     Use directshow:              no
│ │ --     Use OpenCV:                  yes (ver 4.10.0)
│ │ --     Use FLIR Flycapture:         no
│ │ --     Use Basler Pylon:            no
│ │ --     Use IDS uEye:                no
│ │ -- 
│ │ --   RGB-D sensors: 
│ │ --     Use Realsense:               no
│ │ --     Use Realsense2:              yes (ver 2.54.2)
│ │ --     Use Occipital Structure:     no
│ │ --     Use Kinect:                  no
│ │ --     \- Use libfreenect:          no
│ │ --     \- Use libusb-1:             yes (ver 1.0.27)
│ │ --     \- Use pthread:              yes
│ │ --     Use PCL:                     no
│ │ --     \- Use VTK:                  no
│ │ -- 
│ │ --   F/T sensors: 
│ │ --     Use atidaq (built-in):       no
│ │ --     Use comedi:                  no
│ │ --     Use IIT SDK:                 no
│ │ -- 
│ │ --   Mocap: 
│ │ --     Use Qualisys:                no
│ │ --     Use Vicon:                   no
│ │ -- 
│ │ --   Detection: 
│ │ --     Use zbar:                    no
│ │ --     Use dmtx:                    no
│ │ --     Use AprilTag (built-in):     yes (ver 3.1.1)
│ │ --     \- Use AprilTag big family:  no
│ │ -- 
│ │ --   Misc: 
│ │ --     Use Clipper (built-in):      yes (ver 6.4.2)
│ │ --     Use pugixml (built-in):      yes (ver 1.9.0)
│ │ --     Use libxml2:                 yes (ver 2.12.7)
│ │ --     Use json (nlohmann):         no
│ │ -- 
│ │ --   Optimization: 
│ │ --     Use OpenMP:                  yes
│ │ --     Use pthread:                 yes
│ │ --     Use pthread (built-in):      no
│ │ --     Use Simd (built-in):         yes (ver 4.9.109)
│ │ -- 
│ │ --   DNN: 
│ │ --     Use CUDA Toolkit:            no
│ │ --     Use TensorRT:                no
│ │ -- 
│ │ --   Documentation: 
│ │ --     Use doxygen:                 no
│ │ --     \- Use mathjax:              no
│ │ -- 
│ │ --   Tests and samples:
│ │ --     Use catch2 (built-in):       yes (ver 2.13.7)
│ │ --     Tests:                       yes
│ │ --     Demos:                       yes
│ │ --     Examples:                    yes
│ │ --     Tutorials:                   yes
│ │ --     Dataset found:               no
│ │ -- 
│ │ --   Library dirs:
│ │ --     Eigen3 include dir:          $PREFIX/share/eigen3/cmake
│ │ --     OpenCV dir:                  $PREFIX/lib/cmake/opencv4
│ │ -- 
│ │ --   Install path:                  $PREFIX
│ │ -- 
│ │ -- ==========================================================
nim65s commented 2 days ago

I agree, but I think this is not pinocchio-specific. This could go in jrl-cmakemodules I think.

ManifoldFR commented 2 days ago

If I may chime in, this is also something that SDL does: https://github.com/libsdl-org/SDL/blob/3733b1d5d877a8edf0b15a3158c2cb22942a0aab/CMakeLists.txt

They do this by wrapping the a call into a custom function SDL_PrintSummary() which is defined in their macros.cmake module.

The printout is very sober, very clean.