[mlpack-git] [mlpack/mlpack] Error while compiling mlpack code in Ubuntu 16.04 (#785)

Kapil Gupta notifications at github.com
Thu Sep 15 07:13:07 EDT 2016


I am using this cmake for compilation:
```
cmake_minimum_required(VERSION 3.3)
project(hmm)
set(PROJECT_VERSION "0.0.1")

# Default configuration values. These must be before the project command or
# they won't work in Windows.
# If no build type is specified, default to "Release"
if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release CACHE STRING
            "None Debug Release RelWithDebInfo MinSizeRel"
            FORCE)
endif()
# Install to "dist" directory in Windows for testing and as a staging directory
# for the installer.
if (WIN32 AND NOT CMAKE_INSTALL_PREFIX)
    set(CMAKE_INSTALL_PREFIX dist CACHE STRING "Install path prefix.")
endif()

if (NOT MSVC)
    # Enable the C++11 standard
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
endif()

set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

find_package(Boost REQUIRED)
find_package(MLPACK REQUIRED)


include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_definitions(${Boost_DEFINITIONS})

include_directories(${MLPACK_INCLUDE_DIRS})
link_directories(${MLPACK_LIBRARY_DIRS})
add_definitions(${MLPACK_DEFINITIONS})

# Global CMake options
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

# Testing configuration
enable_testing()
#add_subdirectory(source)

file(GLOB SOURCE_FILES
        source/*.h
        source/*.cpp)

add_executable(${CMAKE_PROJECT_NAME} ${SOURCE_FILES})

MESSAGE(STATUS ${Boost_LIBRARIES})

target_link_libraries(${CMAKE_PROJECT_NAME}
        ${MLPACK_LIBRARIES}
        ${Boost_LIBRARIES} )
```
The cmake is able to detect boost. I don't know why its not linking boost libs. 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/785#issuecomment-247300399
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160915/47f6cc25/attachment-0001.html>


More information about the mlpack-git mailing list