samurai
samurai copied to clipboard
refactor: Keep only C++17 as minimal and Update Conan documentation
- [ ] I have installed pre-commit locally and use it to validate my commits.
- [x] The PR title follows the conventional commits convention. Available tags: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'
- [ ] This new PR is documented.
- [x] This new PR is tested.
Description
Hello, as we updating the Conan package for Samurai project here, I just checked the project and decided to few changes:
- Remove duplicated ways to define C++17 requirement. Using target_compile_features is the best way to say "C++17 is minimum required", to users still can pass C++20 and CMake will use C++20 instead. Both C++17 and C++20 are compatible.
- Updated requirement versions in conanfile.py. You can check latest versions available in https://conan.io/center
- Added instructions in README how to install Samurai via Conan. There is a pre-built package available in Conan Center (the official repository). The package is based on the official recipe: https://github.com/conan-io/conan-center-index/blob/master/recipes/samurai/all/conanfile.py
Related issue
No issue related, but I could open one if you wish.
How has this been tested?
I build locally in macOS M1 (armv8) with Apple Clang 15. The Apple Clang still uses C++98 by default, so CMake have to pass C++17. The build result:
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN_OPTION=OFF -DBUILD_DEMOS=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake -G Ninja 12:24:15
-- project_options: skipping msvc_toolchain as CMAKE_TOOLCHAIN_FILE is set
-- project_options: skipping msvc_toolchain as CMAKE_TOOLCHAIN_FILE is set
-- Using Conan toolchain: /Users/uilian/Development/samurai/conan/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 17 with extensions OFF
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- The C compiler identification is AppleClang 15.0.0.15000309
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Available FEATURES:
-- The default CMAKE_C_STANDARD used by external targets and tools is not set yet. Using the latest supported C standard that is 17
-- Conan: Target declared 'xtensor'
-- Conan: Target declared 'xtl'
-- Conan: Target declared 'nlohmann_json::nlohmann_json'
-- Conan: Target declared 'xsimd'
-- Conan: Target declared 'HighFive'
-- Conan: Component target declared 'hdf5::hdf5'
-- Conan: Component target declared 'hdf5::hdf5_cpp'
-- Conan: Component target declared 'hdf5::hdf5_hl'
-- Conan: Component target declared 'hdf5::hdf5_hl_cpp'
-- Conan: Target declared 'HDF5::HDF5'
-- Conan: Target declared 'ZLIB::ZLIB'
-- Conan: Including build module from '/Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib/cmake/conan-official-hdf5-variables.cmake'
-- Conan: Component target declared 'Boost::diagnostic_definitions'
-- Conan: Component target declared 'Boost::disable_autolinking'
-- Conan: Component target declared 'Boost::dynamic_linking'
-- Conan: Component target declared 'Boost::headers'
-- Conan: Component target declared 'Boost::boost'
-- Conan: Component target declared 'boost::_libboost'
-- Conan: Component target declared 'Boost::atomic'
-- Conan: Component target declared 'Boost::container'
-- Conan: Component target declared 'Boost::context'
-- Conan: Component target declared 'Boost::date_time'
-- Conan: Component target declared 'Boost::exception'
-- Conan: Component target declared 'Boost::math'
-- Conan: Component target declared 'Boost::math_c99'
-- Conan: Component target declared 'Boost::math_c99f'
-- Conan: Component target declared 'Boost::math_c99l'
-- Conan: Component target declared 'Boost::math_tr1'
-- Conan: Component target declared 'Boost::math_tr1f'
-- Conan: Component target declared 'Boost::math_tr1l'
-- Conan: Component target declared 'Boost::program_options'
-- Conan: Component target declared 'Boost::regex'
-- Conan: Component target declared 'Boost::serialization'
-- Conan: Component target declared 'Boost::stacktrace'
-- Conan: Component target declared 'Boost::stacktrace_addr2line'
-- Conan: Component target declared 'Boost::stacktrace_backtrace'
-- Conan: Component target declared 'Boost::stacktrace_basic'
-- Conan: Component target declared 'Boost::stacktrace_noop'
-- Conan: Component target declared 'Boost::system'
-- Conan: Component target declared 'Boost::test'
-- Conan: Component target declared 'Boost::test_exec_monitor'
-- Conan: Component target declared 'Boost::timer'
-- Conan: Component target declared 'Boost::url'
-- Conan: Component target declared 'Boost::wserialization'
-- Conan: Component target declared 'Boost::chrono'
-- Conan: Component target declared 'Boost::coroutine'
-- Conan: Component target declared 'Boost::filesystem'
-- Conan: Component target declared 'Boost::json'
-- Conan: Component target declared 'Boost::nowide'
-- Conan: Component target declared 'Boost::prg_exec_monitor'
-- Conan: Component target declared 'Boost::random'
-- Conan: Component target declared 'Boost::thread'
-- Conan: Component target declared 'Boost::type_erasure'
-- Conan: Component target declared 'Boost::unit_test_framework'
-- Conan: Component target declared 'Boost::wave'
-- Conan: Component target declared 'Boost::contract'
-- Conan: Component target declared 'Boost::fiber'
-- Conan: Component target declared 'Boost::fiber_numa'
-- Conan: Component target declared 'Boost::graph'
-- Conan: Component target declared 'Boost::iostreams'
-- Conan: Component target declared 'Boost::locale'
-- Conan: Component target declared 'Boost::log'
-- Conan: Component target declared 'Boost::log_setup'
-- Conan: Target declared 'boost::boost'
-- Conan: Target declared 'BZip2::BZip2'
-- Conan: Including build module from '/Users/uilian/.conan2/p/b/bzip21aadd509484ad/p/lib/cmake/conan-official-bzip2-variables.cmake'
-- Conan: Target declared 'libbacktrace::libbacktrace'
-- Conan: Target declared 'Iconv::Iconv'
-- Conan: Component target declared 'Eigen3::Eigen'
-- Conan: Target declared 'pugixml::pugixml'
-- Conan: Component target declared 'fmt::fmt'
CMake Warning at demos/CMakeLists.txt:1 (find_package):
By not providing "Findcxxopts.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "cxxopts", but
CMake did not find one.
Could not find a package configuration file provided by "cxxopts" with any
of the following names:
cxxoptsConfig.cmake
cxxopts-config.cmake
Add the installation prefix of "cxxopts" to CMAKE_PREFIX_PATH or set
"cxxopts_DIR" to a directory containing one of the above files. If
"cxxopts" provides a separate development package or SDK, be sure it has
been installed.
-- Conan: Target declared 'CLI11::CLI11'
CMake Warning at demos/from_obj/CMakeLists.txt:1 (find_package):
By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CGAL", but
CMake did not find one.
Could not find a package configuration file provided by "CGAL" with any of
the following names:
CGALConfig.cmake
cgal-config.cmake
Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
"CGAL_DIR" to a directory containing one of the above files. If "CGAL"
provides a separate development package or SDK, be sure it has been
installed.
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Checking for module 'PETSc'
-- No package 'PETSc' found
-- Checking for module 'PETSc'
-- No package 'PETSc' found
-- Checking for module 'PETSc'
-- No package 'PETSc' found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/uilian/Development/samurai/build
⋊> ~/D/samurai on feature/cppstd ⨯ cmake --build build 12:24:21
[1/54] /Library/Developer/CommandLineTools/usr/bin/c++ -DFLUX_CONTAINER_xtensor -DH5_USE_BOOST -DH5_USE_EIGEN -DH5_USE_XTENSOR -DXTENSOR_USE_XSIMD -I/Users/uilian/Development/samurai/include -isystem /Users/uilian/.conan2/p/xtens59337e87e7f72/p/include -isystem /Users/uilian/.conan2/p/highfd7569a5d958a0/p/include -isystem /Users/uilian/.conan2/p/b/pugix20983b5bbbbd4/p/include -isystem /Users/uilian/.conan2/p/b/fmtae086cf9e67e5/p/include -isystem /Users/uilian/.conan2/p/xtl7161fe009dc21/p/include -isystem /Users/uilian/.conan2/p/nlohm0567ffc90cfc1/p/include -isystem /Users/uilian/.conan2/p/xsimd74d1ab1bc476e/p/include -isystem /Users/uilian/.conan2/p/b/hdf540977634f909d/p/include -isystem /Users/uilian/.conan2/p/b/hdf540977634f909d/p/include/hdf5 -isystem /Users/uilian/.conan2/p/b/boost4d9e0dc102ada/p/include -isystem /Users/uilian/.conan2/p/eigen3d88c0279cc26/p/include/eigen3 -isystem /Users/uilian/.conan2/p/cli11387b72d23d771/p/include -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fcolor-diagnostics -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -flax-vector-conversions -fsigned-char -std=c++17 -MD -MT demos/tutorial/CMakeFiles/tutorial-interval.dir/interval.cpp.o -MF demos/tutorial/CMakeFiles/tutorial-interval.dir/interval.cpp.o.d -o demos/tutorial/CMakeFiles/tutorial-interval.dir/interval.cpp.o -c /Users/uilian/Development/samurai/demos/tutorial/interval.cpp
[2/54] /Library/Developer/CommandLineTools/usr/bin/c++ -DFLUX_CONTAINER_xtensor -DH5_USE_BOOST -DH5_USE_EIGEN -DH5_USE_XTENSOR -DXTENSOR_USE_XSIMD -I/Users/uilian/Development/samurai/include -isystem /Users/uilian/.conan2/p/xtens59337e87e7f72/p/include -isystem /Users/uilian/.conan2/p/highfd7569a5d958a0/p/include -isystem /Users/uilian/.conan2/p/b/pugix20983b5bbbbd4/p/include -isystem /Users/uilian/.conan2/p/b/fmtae086cf9e67e5/p/include -isystem /Users/uilian/.conan2/p/xtl7161fe009dc21/p/include -isystem /Users/uilian/.conan2/p/nlohm0567ffc90cfc1/p/include -isystem /Users/uilian/.conan2/p/xsimd74d1ab1bc476e/p/include -isystem /Users/uilian/.conan2/p/b/hdf540977634f909d/p/include -isystem /Users/uilian/.conan2/p/b/hdf540977634f909d/p/include/hdf5 -isystem /Users/uilian/.conan2/p/b/boost4d9e0dc102ada/p/include -isystem /Users/uilian/.conan2/p/eigen3d88c0279cc26/p/include/eigen3 -isystem /Users/uilian/.conan2/p/cli11387b72d23d771/p/include -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fcolor-diagnostics -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -flax-vector-conversions -fsigned-char -std=c++17 -MD -MT demos/tutorial/CMakeFiles/tutorial-set-operator.dir/set_operator.cpp.o -MF demos/tutorial/CMakeFiles/tutorial-set-operator.dir/set_operator.cpp.o.d -o demos/tutorial/CMakeFiles/tutorial-set-operator.dir/set_operator.cpp.o -c /Users/uilian/Development/samurai/demos/tutorial/set_operator.cpp
...
[54/54] : && /Library/Developer/CommandLineTools/usr/bin/c++ -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough demos/tutorial/CMakeFiles/tutorial-reconstruction-3d.dir/reconstruction_3d.cpp.o -o demos/tutorial/tutorial-reconstruction-3d -L/Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib -L/Users/uilian/.conan2/p/b/zlibfaa15f7ab621a/p/lib -L/Users/uilian/.conan2/p/b/boost4d9e0dc102ada/p/lib -L/Users/uilian/.conan2/p/b/pugix20983b5bbbbd4/p/lib -L/Users/uilian/.conan2/p/b/fmtae086cf9e67e5/p/lib -Wl,-rpath,/Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib -Wl,-rpath,/Users/uilian/.conan2/p/b/zlibfaa15f7ab621a/p/lib -Wl,-rpath,/Users/uilian/.conan2/p/b/boost4d9e0dc102ada/p/lib -Wl,-rpath,/Users/uilian/.conan2/p/b/pugix20983b5bbbbd4/p/lib -Wl,-rpath,/Users/uilian/.conan2/p/b/fmtae086cf9e67e5/p/lib /Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib/libhdf5_hl_cpp.a /Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib/libhdf5_hl.a /Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib/libhdf5_cpp.a /Users/uilian/.conan2/p/b/hdf540977634f909d/p/lib/libhdf5.a /Users/uilian/.conan2/p/b/zlibfaa15f7ab621a/p/lib/libz.a /Users/uilian/.conan2/p/b/pugix20983b5bbbbd4/p/lib/libpugixml.a /Users/uilian/.conan2/p/b/fmtae086cf9e67e5/p/lib/libfmt.a && :
Code of Conduct
By submitting this PR, you agree to follow our Code of Conduct
- [x] I agree to follow this project's Code of Conduct