Compiling DRACO, a C++ program
0
0
Entering edit mode
2.4 years ago
alruta13 • 0

Hello, I am trying to install and compile DRACO but I am having quite problems when I try to compile it. I have download all the programs he needs but when I compile, something happens with dlib package so i get this error:

cmake .. -DCMAKE_BUILD_TYPE=Release -DLINK_TIME_OPTIMIZATIONS=ON -DNATIVE_BUILD=ON -DARMA_NO_WRAPPER=ON

-- Could NOT find TBB (missing: TBB_INCLUDE_DIRS TBB_LIBRARIES tbbmalloc)
CMake Error at /home/atabaz/anaconda3/envs/RNAFRAMEWORK/share/dlib/dlibConfig.cmake:21 (include):
include could not find requested file:

/home/atabaz/anaconda3/envs/RNAFRAMEWORK/share/dlib/dlib.cmake

Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)

CMake Error at /home/atabaz/anaconda3/envs/RNAFRAMEWORK/share/dlib/dlibConfig.cmake:23 (get_target_property):
get_target_property() called with non-existent target "dlib::dlib".
Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)

CMake Error at CMakeLists.txt:12 (target_link_libraries):
Cannot specify link libraries for target "MY_TARGET_NAME" which is not
built by this project.

-- Configuring incomplete, errors occurred!
See also "/home/atabaz/draco/build/CMakeFiles/CMakeOutput.log".

It looks like the file dlib.cmake is missed from dlib, the target "dlib::dlib" don't exist and "MY_TARGET_NAME" is not build. I have look for all these without results. Have you any idea what can be happening? Here is the CMakeList (so you can see the lines it indicates as error):

CMakeList

cmake_minimum_required(VERSION 3.8)
project(draco VERSION 1.0.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
subdirs(src test)

find_package(Boost 1.66 REQUIRED)
find_package(Armadillo REQUIRED)
find_package(TBB COMPONENTS tbbmalloc)
find_package(OpenMP REQUIRED)
find_package(dlib REQUIRED) 
target_link_libraries(MY_TARGET_NAMEdlib::dlib)

option(USE_TBB "Use Thread Building Blocks for parallelization if available" ON)
option(SINGLE_THREAD "Use a single thread, needs USE_TBB=OFF" OFF)
option(ARMA_NO_WRAPPER "Do not use Armadillo wrappers. Increases speed." OFF)
option(LINK_TIME_OPTIMIZATIONS "Optimize at link-time. Only set for Release building." OFF)
option(NATIVE_BUILD "Build for native arch. This will probabily let everything crash if run on other computers" OFF)
option(USE_ARMA_OPENMP "Uses Armadillo OpenMP support" OFF)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  option(USE_LIBCXX "Use libc++ instead of libstdc++" OFF)
  if (USE_LIBCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
    link_libraries(c++abi)
  else()
    link_libraries(stdc++fs)
  endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  link_libraries(stdc++fs)
endif()

FIND_PACKAGE(dlib)
if(NOT dlib_FOUND)
    message(STATUS "dlib not found using CMake packages. Trying pkgconfig.")
    find_package(PkgConfig REQUIRED)
    pkg_check_modules(dlib REQUIRED dlib-1)
    set(dlib_USES_PKGCONFIG ON)
endif()

if(TBB_FOUND AND USE_TBB)
    add_definitions(-DUSE_TBB=1)
else()
    set(TBB_LIBRARIES "")
endif()

if(SINGLE_THREAD)
    add_definitions(-DSINGLE_THREAD=1)
endif()

if(ARMA_NO_WRAPPER)
    add_definitions(-DARMA_DONT_USE_WRAPPER)
    find_library(OPENBLAS_LIB openblas)
    if(NOT OPENBLAS_LIB)
        message(SEND_ERROR "Armadillo wrappers not set OpenBlas is not found. Please provide the OpenBlas library or unset ARMA_NO_WRAPPER")
    else()
        message(STATUS "Openblas library found: ${OPENBLAS_LIB}")
        set(ARMADILLO_LIBRARIES "-lopenblas")
    endif()
endif()

if(NOT USE_ARMA_OPENMP)
    add_definitions(-DARMA_DONT_USE_OPENMP)
endif()

if(LINK_TIME_OPTIMIZATIONS)
    set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION True)

    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
    endif()
endif()

if(NATIVE_BUILD)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()

enable_testing()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED 17)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-braces ${OpenMP_CXX_FLAGS}")
include_directories("ranges-v3")

Thanks you very much.

dlib DRACO C • 1.5k views
ADD COMMENT
0
Entering edit mode

Looks like you are missing TBB library. What OS are you doing this on? Here is a link for Ubuntu's version of this library: https://packages.ubuntu.com/search?keywords=tbb

ADD REPLY
0
Entering edit mode

I am using ubuntu, yes.

ADD REPLY
0
Entering edit mode

How did you install the prerequisites?

A typical issue, when compilations against particular libraries fail is, that the respective -dev versions of the libraries are not installed on the system. Did you install both, libdlib-dev and libbtbb-dev?

ADD REPLY
0
Entering edit mode

I install the prerequisites using conda, how should I install them to be sure I have the devv stuff?

ADD REPLY
0
Entering edit mode

I think that I have solve all the errors except this last, have anyone any idea about it? THANKS! CMake Error at CMakeLists.txt:12 (target_link_libraries): Cannot specify link libraries for target "MY_TARGET_NAME" which is not built by this project.

ADD REPLY

Login before adding your answer.

Traffic: 1987 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6