File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,22 @@ set(PYBIND11_FINDPYTHON ON)
55find_package (pybind11 CONFIG REQUIRED)
66find_package (Boost CONFIG REQUIRED)
77
8+ option (USE_MT_RNG "Use mt19937 random number generator instead of taus88" OFF )
9+
10+ if (CMAKE_SYSTEM_NAME MATCHES "Linux" )
11+ if (CMAKE_SYSTEM_VERSION MATCHES "22\\ .04" )
12+ set (USE_MT_RNG ON )
13+ endif ()
14+ endif ()
15+
16+ configure_file (FindAFactor/include /common/config.h.in ${CMAKE_CURRENT_BINARY_DIR} /include /common/config.h @ONLY)
17+
818pybind11_add_module(_find_a_factor FindAFactor/_find_a_factor.cpp FindAFactor/dispatchqueue.cpp)
919
1020if (DEFINED ENV{BOOST_ROOT})
11- target_include_directories (_find_a_factor PUBLIC FindAFactor/include $ENV{BOOST_ROOT} /include /boost)
21+ target_include_directories (_find_a_factor PUBLIC FindAFactor/include ${CMAKE_CURRENT_BINARY_DIR} / include $ ENV{BOOST_ROOT} /include /boost)
1222else (DEFINED ENV{BOOST_ROOT})
13- target_include_directories (_find_a_factor PUBLIC FindAFactor/include )
23+ target_include_directories (_find_a_factor PUBLIC FindAFactor/include ${CMAKE_CURRENT_BINARY_DIR} / include )
1424endif (DEFINED ENV{BOOST_ROOT})
1525
1626if (MSVC )
Original file line number Diff line number Diff line change 3838// See LICENSE.md in the project root or
3939// https://www.gnu.org/licenses/lgpl-3.0.en.html for details.
4040
41+ #include " common/config.h"
4142#include " dispatchqueue.hpp"
4243
4344#include < algorithm>
5859#include < pybind11/pybind11.h>
5960#include < pybind11/stl.h>
6061
61- #include < cxxabi.h>
62-
6362namespace Qimcifa {
6463
6564typedef boost::multiprecision::cpp_int BigInteger;
6665
67- #if (__GLIBCXX__ >= 20350000) && (__GLIBCXX__ <= 20360000)
66+ #if USE_MT_RNG
6867typedef std::mt19937 rngType;
6968#else
7069typedef boost::random::taus88 rngType;
Original file line number Diff line number Diff line change 1+ // Turn this on, if the build doesn't work with taus88 random number generator.
2+ #cmakedefine USE_MT_RNG 1
You can’t perform that action at this time.
0 commit comments