Comments (5)
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.
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
, andlog_setup
libraries, which are dependencies forNumCpp
. You need to either install/build those Boost libraries, or disable the parts ofNumCpp
that require Boost by defining the flagNUMCPP_NO_USE_BOOST
, i.e:cmake -B Build -S . -DNUMCPP_NO_USE_BOOST=ON
from numcpp.
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.
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(
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
)
target_compile_definitions(${ALL_INTERFACE_TARGET} INTERFACE -DNUMCPP_USE_MULTITHREAD)
endif()
target_compile_options(${ALL_INTERFACE_TARGET} INTERFACE
$<$ <OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Wconversion>
)
target_link_options(${ALL_INTERFACE_TARGET} INTERFACE
)
get_filename_component(NUMCPP_INCLUDES ./include ABSOLUTE)
set(OUTPUT_BINARY_DIR
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
)
target_compile_features(
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.
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)
- How do I change this python expression? HOT 3
- any plan to adapt mdspan in maybe c++23?
- NUMCPP_NO_USE_BOOST is not respected in NumCppConfig.cmake HOT 1
- `a > 0` io `a > 5` in README.md HOT 1
- Digitize is not a member of nc HOT 3
- The formula gives an error, how can I change it? HOT 1
- Function: NdArrayConstIterator Line: 70 Error: NdArray has not been initialized. HOT 1
- reshape() should return a new copy instead of modifying HOT 1
- nc::append should be able to operate empty NdArray<> too. HOT 2
- nc::stack, hstack, vstack operates on std::initialier_list<> only. HOT 1
- How to convert a 4-dimensional array in CV::Mat into a data format available in NumCpp? HOT 1
- nc.reshape not support 3-dimension array, can you add an overloading function? HOT 2
- `np.searchsorted` not support
- numcpp 2.12.0 build failure HOT 5
- Memory Leak in NdArray HOT 2
- [Doubt] How are various dtypes handled in NumCpp HOT 8
- Doesn't Shape support 4D data processing in NumCpp? HOT 1
- Installation of Numcpp ignores -DNUMCPP_NO_USE_BOOST=ON HOT 2
- Building programs with Numcpp with Xcode produces thousands of @param errors. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numcpp.