bibatn / special_seminar_

0 stars 0 forks source link

Собрать PCL из исходников #8

Closed bibatn closed 1 year ago

bibatn commented 1 year ago

Склонирован проект: https://github.com/Kitware/CMake
./bootstrap
make

bibatn commented 1 year ago

перешел на версию 1.9.1 flannа: HEAD detached at 1.9.1 При сборке выходит ошибка: CMake Error at src/cpp/CMakeLists.txt:32 (add_library):
No SOURCES given to target: flann_cpp

CMake Error at src/cpp/CMakeLists.txt:86 (add_library):
No SOURCES given to target: flann
Решение в следующем:

In your flann dir run

touch src/cpp/empty.cpp

In src/cpp/CMakeLists.txt replace

add_library(flann_cpp SHARED "") and add_library(flann SHARED "")

with

add_library(flann_cpp SHARED empty.cpp) and add_library(flann SHARED empty.cpp)

bibatn commented 1 year ago

git checkout pcl-1.12.1

bibatn commented 1 year ago

How to install libraries without sudo? https://superuser.com/questions/689205/how-to-install-libraries-without-sudo

bibatn commented 1 year ago

export EIGEN_ROOT=/home/m/Documents/CUSTOM_PCL/eigen/build

bibatn commented 1 year ago

git clone https://github.com/fsquillace/junest.git ~/.local/share/junest export PATH=~/.local/share/junest/bin:$PATH export PATH="$PATH:~/.junest/usr/bin_wrappers"

bibatn commented 1 year ago

https://github.com/docker/docker-install

bibatn commented 1 year ago

https://docs.docker.com/engine/install/ubuntu/

bibatn commented 1 year ago

Пакет eigen
файл Eigen3Config.cmake: PACKAGE_PREFIX_DIR
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) Местоположение директория usr

bibatn commented 1 year ago

!!! сделал checkout на tag 3.3.7 set (EIGEN3_VERSION_STRING "3.3.7")

bibatn commented 1 year ago

Про комманду find_path https://cmake.org/cmake/help/latest/command/find_path.html

bibatn commented 1 year ago

FindEigen.cmake Где выставляется переменная PROGRAMFILES?

bibatn commented 1 year ago

/usr/include/eigen3/Eigen :point_up: тут лежат файлы для подключения.

bibatn commented 1 year ago

изменены строчки 28 29
set (EIGEN3_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include/eigen3")
set (EIGEN3_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/eigen3")
на путь где лежит папка Eigen

bibatn commented 1 year ago

Возможно потребуется поменять строчку set (EIGEN3_ROOT_DIR "${PACKAGE_PREFIX_DIR}") а также переменную PACKAGE_PREFIX_DIR если она где-то используется

bibatn commented 1 year ago

CMAKE_MODULE_PATH переменная cmake https://cmake.org/cmake/help/latest/variable/CMAKE_MODULE_PATH.html

bibatn commented 1 year ago

Поменял 304 строку файла CmakeLists.txt пакета PCL
find_package(Eigen 3.1 REQUIRED PATHS /home/m/Documents/CUSTOM_PCL/eigen/build)
305 строка под вопросом

bibatn commented 1 year ago

внес правку в строку Eigen -> Eigen3 find_package(Eigen3 3.1 REQUIRED PATHS /home/m/Documents/CUSTOM_PCL/eigen/build)

bibatn commented 1 year ago

Поменял название файла Eigen3Config.cmake на EigenConfig.cmake вернул строку find_package(Eigen 3.1 REQUIRED PATHS /home/m/Documents/CUSTOM_PCL/eigen/build)

bibatn commented 1 year ago

Заменил 32 строку в файле FindEigen.cmake set(EIGEN_INCLUDE_DIRS /home/m/Documents/CUSTOM_PCL/eigen/Eigen)

bibatn commented 1 year ago

Этап с FLANN

bibatn commented 1 year ago

export CMAKE_PREFIX_PATH=/home/m/Documents/CUSTOM_PCL/flann/build/cmake

bibatn commented 1 year ago

export PKG_CONFIG_PATH=/home/m/Documents/CUSTOM_PCL/flann/build/cmake

bibatn commented 1 year ago

:point_up: Модуль Flann подтягивается двумя основными командами: find_path(FLANN_INCLUDE_DIR NAMES flann/flann.hpp HINTS ${PC_FLANN_INCLUDE_DIRS} ${FLANN_ROOT} $ENV{FLANN_ROOT} PATHS $ENV{PROGRAMFILES}/Flann $ENV{PROGRAMW6432}/Flann PATH_SUFFIXES include ) message(STATUS "marat ${FLANN_INCLUDE_DIR}")

find_library(FLANN_LIBRARY_SHARED NAMES flann_cpp HINTS ${PC_FLANN_LIBRARY_DIRS} ${FLANN_ROOT} $ENV{FLANN_ROOT} PATHS $ENV{PROGRAMFILES}/Flann $ENV{PROGRAMW6432}/Flann PATH_SUFFIXES lib )

bibatn commented 1 year ago

Рабочие комманды :point_down: : find_path(FLANN_INCLUDE_DIR NAMES flann/flann.hpp PATHS /home/m/Documents/CUSTOM_PCL/flann/src/cpp NO_DEFAULT_PATH ) message(STATUS "marat ${FLANN_INCLUDE_DIR}")

find_library(FLANN_LIBRARY_SHARED NAMES flann_cpp PATHS /home/m/Documents/CUSTOM_PCL/flann/build/lib PATH_SUFFIXES lib NO_DEFAULT_PATH )

bibatn commented 1 year ago

Замена для Eigen: find_path(EIGEN_INCLUDE_DIR Eigen/Core PATHS /home/m/Documents/CUSTOM_PCL/eigen NO_DEFAULT_PATH ) message(STATUS "marat ${EIGEN_INCLUDE_DIR}")

bibatn commented 1 year ago

BOOST :point_down:

define BOOST_LIB_VERSION "1_71"

bibatn commented 1 year ago

Минимальная приемлемая версия boost - 1.65. Какая версия стоит на POLUS? Ответ: 1.53 /usr/include/boost

bibatn commented 1 year ago

https://www.boost.org/doc/libs/1_68_0/more/getting_started/unix-variants.html

bibatn commented 1 year ago

git clone --recursive git@github.com:boostorg/boost.git

bibatn commented 1 year ago

--with-libraries=list build only a particular set of libraries, describing using either a comma-separated list of library names or "all"

More precise control over installation directories: --libdir=DIR install libraries here [EPREFIX/lib] --includedir=DIR install headers here [PREFIX/include]

bibatn commented 1 year ago

/bootstrap.sh --with-libraries=serialization, mpi, filesystem, date_time, iostreams, system --libdir=/home/m/Documents/CUSTOM_PCL/boost/build/lib --includedir=/home/m/Documents/CUSTOM_PCL/boost/build/include

bibatn commented 1 year ago

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

/home/m/Documents/CUSTOM_PCL/boost

The following directory should be added to linker library paths:

/home/m/Documents/CUSTOM_PCL/boost/stage/lib
bibatn commented 1 year ago

git clone -b boost-1.71.0 --recursive [git@github.com:boostorg/boost.git](https://github.com/boostorg/boost.git)

bibatn commented 1 year ago

https://gitlab.com/libeigen/eigen.git

bibatn commented 1 year ago

/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/CMake/bin/cmake

bibatn commented 1 year ago

Замена для Eigen: find_path(EIGEN_INCLUDE_DIR Eigen/Core PATHS /home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/eigen NO_DEFAULT_PATH ) message(STATUS "marat ${EIGEN_INCLUDE_DIR}")

bibatn commented 1 year ago

find_path(FLANN_INCLUDE_DIR NAMES flann/flann.hpp PATHS /home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/flann/src/cpp NO_DEFAULT_PATH ) message(STATUS "marat ${FLANN_INCLUDE_DIR}")

find_library(FLANN_LIBRARY_SHARED NAMES flann_cpp PATHS /home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/flann/build/lib PATH_SUFFIXES lib NO_DEFAULT_PATH )

bibatn commented 1 year ago

The following directory should be added to compiler include paths:

/polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost

The following directory should be added to linker library paths:

/polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/stage/lib
bibatn commented 1 year ago

`find_path(Boost_INCLUDE_DIR NAMES serialization/access.hpp PATHS /home/m/Documents/CUSTOM_PCL/boost/boost NO_DEFAULT_PATH ) message(STATUS "marat ${Boost_INCLUDE_DIR}")

find_library(Boost_LIBRARY_SHARED NAMES boost_atomic PATHS /home/m/Documents/CUSTOM_PCL/boost/stage/lib PATH_SUFFIXES lib NO_DEFAULT_PATH )

find_library(Boost_LIBRARY_STATIC NAMES boost_atomic PATHS /home/m/Documents/CUSTOM_PCL/boost/stage/lib PATH_SUFFIXES lib NO_DEFAULT_PATH )

Optional boost modules

message(STATUS "marat1 ${Boost_INCLUDE_DIR}") message(STATUS "marat1 ${Boost_LIBRARY_SHARED}") message(STATUS "marat1 ${Boost_LIBRARY_STATIC}")`

bibatn commented 1 year ago

`find_path(Boost_INCLUDE_DIR NAMES serialization/access.hpp PATHS /home/m/Documents/CUSTOM_PCL/boost/boost NO_DEFAULT_PATH ) message(STATUS "marat ${Boost_INCLUDE_DIR}")

find_library(Boost_LIBRARY_SHARED NAMES boost_atomic PATHS /home/m/Documents/CUSTOM_PCL/boost/stage/lib PATH_SUFFIXES lib NO_DEFAULT_PATH )

find_library(Boost_LIBRARY_STATIC NAMES boost_atomic PATHS /home/m/Documents/CUSTOM_PCL/boost/stage/lib PATH_SUFFIXES lib NO_DEFAULT_PATH ) `

bibatn commented 1 year ago

Optional boost modules

find_package(Boost 1.65.0 QUIET COMPONENTS serialization mpi PATHS /home/m/Documents/CUSTOM_PCL/boost/tools/boost_install) if(Boost_SERIALIZATION_FOUND) set(BOOST_SERIALIZATION_FOUND TRUE) endif()

message(STATUS "marat1 ${Boost_INCLUDE_DIR}")

Required boost modules

set(BOOST_REQUIRED_MODULES filesystem date_time iostreams system) find_package(Boost 1.65.0 REQUIRED COMPONENTS ${BOOST_REQUIRED_MODULES} PATHS /home/m/Documents/CUSTOM_PCL/boost/tools/boost_install)

bibatn commented 1 year ago

find_path(Boost_INCLUDE_DIR NAMES iostreams/detail/iostream.hpp date_time.hpp filesystem.hpp system/config.hpp PATHS /polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/boost NO_DEFAULT_PATH ) message(STATUS "marat ${Boost_INCLUDE_DIR}")

find_library(Boost_LIBRARY_SHARED NAMES filesystem date_time iostreams system PATHS /polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/stage/lib PATH_SUFFIXES libboost NO_DEFAULT_PATH )

bibatn commented 1 year ago

./bootstrap.sh --libdir=/home/m/projects/code_from_source/boost/build/lib --includedir=/home/m/projects/code_from_source/boost/build/include

./bootstrap.sh --libdir=/home/m/Documents/CUSTOM_PCL/boost/build/lib --includedir=/home/m/Documents/CUSTOM_PCL/boost/build/include

./bootstrap.sh --libdir=/polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/build/lib --includedir=/polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/build/include

:point_up: ./b2 install

bibatn commented 1 year ago

message(STATUS "marat: ${BOOST_INCLUDE_DIR}") message(STATUS "marat: ${Boost_LIBRARY_DIR_RELEASE}") message(STATUS "marat: ${Boost_filesystem_LIBRARY_RELEASE}")

bibatn commented 1 year ago

PATHS /polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/boost /polusfs/home_edu/edu-cmc-sqi19/edu-cmc-sqi19-24/PCL/boost/stage/lib

bibatn commented 1 year ago

message(STATUS "marat1 ${Boost_FOUND}") message(STATUS "marat1 ${Boost_INCLUDE_DIRS}") message(STATUS "marat1 ${Boost_LIBRARY_DIRS}") message(STATUS "marat1 ${Boost_LIBRARIES}") message(STATUS "marat1 ${Boost_FILESYSTEM_LIBRARY}") message(STATUS "marat1 ${Boost_DATE_TIME_LIBRARY}") message(STATUS "marat1 ${Boost_IOSTREAMS_LIBRARY}") message(STATUS "marat1 ${Boost_SYSTEM_LIBRARY}") message(STATUS "marat1 ${Boost_VERSION_MACRO}") message(STATUS "marat1 ${Boost_VERSION_STRING}") message(STATUS "marat1 ${Boost_VERSION}") message(STATUS "marat1 ${Boost_LIB_VERSION}")

bibatn commented 1 year ago

https://cliutils.gitlab.io/modern-cmake/chapters/packages/Boost.html

bibatn commented 1 year ago

Boost-1.71.0

bibatn commented 1 year ago
199711L C++98
201103L C++11
201402L C++14
bibatn commented 1 year ago

pcl-1.9.1