E
Electrical_engineer_student
Guest
Electrical_engineer_student Asks: How to use CMake to compile SharkML library? [duplicate]
I am trying to compile some C++ code that uses SharkML library(https://www.shark-ml.org/sphinx_pages/build/html/rest_sources/installation.html#id15).
I am running Linux Ubuntu 22.04 with CMake and Boost installed. The cmake file for building this C++ file is:
When I run cmake I get the following errors:
The code sample is found here: https://github.com/PacktPublishing/...ith-CPP/tree/master/Chapter01/sharkml_samples
Can someone give me advice on how to fix this error?
I am trying to compile some C++ code that uses SharkML library(https://www.shark-ml.org/sphinx_pages/build/html/rest_sources/installation.html#id15).
I am running Linux Ubuntu 22.04 with CMake and Boost installed. The cmake file for building this C++ file is:
Code:
cmake_minimum_required(VERSION 3.0)
project(sharkml-samples)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
find_package(Boost REQUIRED serialization)
set(CMAKE_CXX_FLAGS "-std=c++17 -msse3 -fopenmp -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
include_directories("~/Documents/Hands_On_Machine_Learning/Shark/include")
link_directories("~/Documents/Hands_On_Machine_Learning/Shark/lib")
link_directories("~/Documents/Hands_On_Machine_Learning/Shark/lib64")
add_executable(linalg-shark "linalg_shark.cc")
target_link_libraries(linalg-shark shark cblas)
add_executable(linreg-shark "linreg_shark.cc")
target_link_libraries(linreg-shark shark cblas ${Boost_LIBRARIES} )
When I run cmake I get the following errors:
Code:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):
Found package configuration file:
/usr/lib/x86_64-linux-gnu/cmake/boost_serialization-1.74.0/boost_serialization-config.cmake
but it set boost_serialization_FOUND to FALSE so package
"boost_serialization" is considered to be NOT FOUND. Reason given by
package:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_serialization.so.1.74.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_serialization.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
/usr/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package)
CMakeLists.txt:8 (find_package)
The code sample is found here: https://github.com/PacktPublishing/...ith-CPP/tree/master/Chapter01/sharkml_samples
Can someone give me advice on how to fix this error?