Giter Club home page Giter Club logo

Comments (5)

dpilger26 avatar dpilger26 commented on June 3, 2024

CMake is telling you that it was unable to find the Boost date_time, log, and log_setup libraries, which are dependencies for NumCpp. You need to either install/build those Boost libraries, or disable the parts of NumCpp that require Boost by defining the flag NUMCPP_NO_USE_BOOST, i.e:

cmake -B Build -S . -DNUMCPP_NO_USE_BOOST=ON

from numcpp.

Urbane6679 avatar Urbane6679 commented on June 3, 2024

I am experiencing a similar problem with the following error:
D:\NumCpp\build>cmake ..
-- Building for: Visual Studio 17 2022
-- Found version file: D:/NumCpp/include/NumCpp/Core/Internal/Version.hpp
-- The CXX compiler identification is MSVC 19.38.33130.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building NumCpp version 2.12.1
-- Compiling with C++ standard: 17
CMake Error at D:/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR date_time log log_setup)
(Required is at least version "1.68.0")
Call Stack (most recent call first):
D:/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
D:/CMake/share/cmake-3.28/Modules/FindBoost.cmake:2392 (find_package_handle_standard_args)
CMakeLists.txt:69 (find_package)

-- Configuring incomplete, errors occurred!

And I use the example setup: cmake -B Build -S . -DNUMCPP_NO_USE_BOOST=ON, it can be installed, but it doesn't work, please, can you suggest this problem?

CMake is telling you that it was unable to find the Boost date_time, log, and log_setup libraries, which are dependencies for NumCpp. You need to either install/build those Boost libraries, or disable the parts of NumCpp that require Boost by defining the flag NUMCPP_NO_USE_BOOST, i.e:

cmake -B Build -S . -DNUMCPP_NO_USE_BOOST=ON

from numcpp.

dpilger26 avatar dpilger26 commented on June 3, 2024

Can you provide a minimal example that produces this error? Without seeing your CMake file I don't have much to go on...

from numcpp.

Urbane6679 avatar Urbane6679 commented on June 3, 2024

Can you provide a minimal example that produces this error? Without seeing your CMake file I don't have much to go on...

I did not change the CMakeLists.txt file in the NumCpp folder, the exact CMake file is below:
cmake_minimum_required(VERSION 3.14...3.99)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(NumCppTools)
numcpp_find_version_file("" NUMCPP_VERSION_FILE)
message(STATUS "Found version file: ${NUMCPP_VERSION_FILE}")
numcpp_read_version("${NUMCPP_VERSION_FILE}" "" VERSION_STRING)

project("NumCpp"
VERSION "${VERSION_STRING}"
DESCRIPTION "A Templatized Header Only C++ Implementation of the Python NumPy Library"
HOMEPAGE_URL "https://github.com/dpilger26/NumCpp"
LANGUAGES CXX
)

enable_testing()

message(STATUS "Building ${PROJECT_NAME} version ${VERSION_STRING}")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED On)
message(STATUS "Compiling with C++ standard: ${CMAKE_CXX_STANDARD}")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") # works

option(BUILD_ALL "Build All targets" OFF)
option(BUILD_DOCS "Build the doxygen documentation" OFF)
option(BUILD_TESTS "Build the unit tests" OFF)
option(BUILD_MULTIPLE_TEST "Build the multiple translation unit test" OFF)
option(BUILD_CPPCHECK_TEST "Build the cppcheck test" OFF)
option(BUILD_EXAMPLE_ALL "Build all of the examples" OFF)
option(BUILD_EXAMPLE_GAUSS_NEWTON_NLLS "Build the Gauss-Newton NLLS example" OFF)
option(BUILD_EXAMPLE_INTERFACE_WITH_EIGEN "Build the Interface with Eigen example" OFF)
option(BUILD_EXAMPLE_INTERFACE_WITH_OPENCV "Build the Interface with OpenCV example" OFF)
option(BUILD_EXAMPLE_README "Build the README example" OFF)

option(NUMCPP_NO_USE_BOOST "Don't use the boost libraries" OFF)
option(NUMCPP_USE_MULTITHREAD "Enable multithreading" OFF)

if(BUILD_ALL)
set(BUILD_DOCS ON)
set(BUILD_TESTS ON)
set(BUILD_MULTIPLE_TEST ON)
set(BUILD_CPPCHECK_TEST ON)
set(BUILD_EXAMPLE_ALL ON)
endif()

if(BUILD_EXAMPLE_ALL)
set(BUILD_EXAMPLE_GAUSS_NEWTON_NLLS ON)
set(BUILD_EXAMPLE_INTERFACE_WITH_EIGEN ON)
set(BUILD_EXAMPLE_INTERFACE_WITH_OPENCV ON)
set(BUILD_EXAMPLE_README ON)
endif()

set(ALL_INTERFACE_TARGET compile_definitions)
add_library(${ALL_INTERFACE_TARGET} INTERFACE)

target_compile_definitions(${ALL_INTERFACE_TARGET} INTERFACE $&lt;$<CXX_COMPILER_ID:MSVC>:NOMINMAX>)

if(NUMCPP_NO_USE_BOOST)
target_compile_definitions(${ALL_INTERFACE_TARGET} INTERFACE -DNUMCPP_NO_USE_BOOST)
else()
find_package(Boost 1.68.0 REQUIRED
COMPONENTS
date_time
log
log_setup
)
set(Boost_USE_STATIC_LIBS ON)
target_link_libraries(${ALL_INTERFACE_TARGET} INTERFACE
Boost::boost
Boost::date_time
Boost::log
Boost::log_setup
)
endif()

if(NUMCPP_USE_MULTITHREAD)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
find_package(TBB REQUIRED)
endif()
target_link_libraries(${ALL_INTERFACE_TARGET} INTERFACE
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:TBB::tbb>
)
target_compile_definitions(${ALL_INTERFACE_TARGET} INTERFACE -DNUMCPP_USE_MULTITHREAD)
endif()

target_compile_options(${ALL_INTERFACE_TARGET} INTERFACE
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-W>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wall>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wextra>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Werror>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wdouble-promotion>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wunused>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wshadow>

$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wconversion>

$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wpedantic>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-pedantic-errors>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wcast-align>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wcast-qual>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wfloat-equal>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wformat=2>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wmissing-include-dirs>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wpointer-arith>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wredundant-decls>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wsequence-point>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wswitch>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wundef>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wunreachable-code>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wunused-but-set-parameter>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wwrite-strings>
$&lt;$&lt;OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wunused-parameter>
$&lt;$&lt;CXX_COMPILER_ID:MSVC>:/W4>
$&lt;$&lt;CXX_COMPILER_ID:MSVC>:/Zi>
$&lt;$&lt;CXX_COMPILER_ID:MSVC>:/sdl>
$&lt;$&lt;CXX_COMPILER_ID:MSVC>:/MP>
$&lt;$&lt;CXX_COMPILER_ID:MSVC>:/Gy>
$&lt;$&lt;AND:$<CXX_COMPILER_ID:MSVC>,$CONFIG:Release>:/Oi>
$&lt;$&lt;AND:$<CXX_COMPILER_ID:MSVC>,$CONFIG:Release>:/Ot>
$&lt;$&lt;AND:$<CXX_COMPILER_ID:MSVC>,$CONFIG:Release>:/GL>
)

target_link_options(${ALL_INTERFACE_TARGET} INTERFACE
$&lt;$&lt;AND:$<CXX_COMPILER_ID:MSVC>,$CONFIG:Release>:/LTCG>
)

get_filename_component(NUMCPP_INCLUDES ./include ABSOLUTE)
set(OUTPUT_BINARY_DIR ${PROJECT_SOURCE_DIR}/bin/$&lt;0:>)

if (BUILD_TESTS OR BUILD_MULTIPLE_TEST OR BUILD_CPPCHECK_TEST)
add_subdirectory(test)
endif()

add_subdirectory(examples)

add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

if(NOT PROJECT_IS_TOP_LEVEL)
set(WARNING_GUARD SYSTEM)
endif()

include(GNUInstallDirs)
target_include_directories(${PROJECT_NAME} ${WARNING_GUARD} INTERFACE
$&lt;BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include>
$&lt;INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_compile_features(${PROJECT_NAME} INTERFACE $&lt;INSTALL_INTERFACE:cxx_std_17>)

if (BUILD_DOCS)
set(-Wno-dev)
message(STATUS "Configuring Doxygen docs")
find_package(Doxygen QUIET)
if(DOXYGEN_FOUND)
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
message("Doxygen build started")

        set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/doxygen/Doxyfile.in)
        set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

        configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

        add_custom_target( docs
            COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
            COMMENT "Generating API documentation with Doxygen"
            VERBATIM )
    endif()
else(DOXYGEN_FOUND)
    message(WARNING "Doxygen needs to be installed to generate the doxygen documentation")
endif(DOXYGEN_FOUND)

endif(BUILD_DOCS)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}_Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

add_custom_target(format
COMMAND clang-format -i -style=file:${CMAKE_CURRENT_SOURCE_DIR}/.clang-format git ls-files *.hpp
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

add_custom_target(tidy COMMAND run-clang-tidy -p ${CMAKE_BINARY_DIR} -extra-arg=-std=c++${CMAKE_CXX_STANDARD})

include(CMakePackageConfigHelpers)
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)

configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
)

install(EXPORT ${PROJECT_NAME}_Targets
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
)

install(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include)

from numcpp.

dpilger26 avatar dpilger26 commented on June 3, 2024

Ok, so first things first, the CMakeLists.txt file in the repo is for building the various tests, examples, and documentation, so there is really no reason to use it on its own.

Please refer to the Installation and Build instructions for using the NumCpp library.

I've also cloned NumCpp on a completely fresh, bare bones, Ubuntu container with no Boost installed and configured CMake using:

cmake -B Build -S . -DNUMCPP_NO_USE_BOOST=ON

with zero issues.

root@5b6b48c05cd0:/NumCpp# cmake -B build -S . -GNinja -DNUMCPP_NO_USE_BOOST=ON
-- Found version file: /NumCpp/include/NumCpp/Core/Internal/Version.hpp
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building NumCpp version 2.13.0
-- Compiling with C++ standard: 17
-- Configuring done
-- Generating done
-- Build files have been written to: /NumCpp/build

It looks like from the commandline you posted above you did not include the NUMCPP_NO_USE_BOOST option:

D:\NumCpp\build>cmake ..

from numcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.