39 #if defined( _WIN32 ) || defined( _WIN64 )
49 #ifdef GENESIS_PTHREADS
63 #if defined( GENESIS_OPENMP )
69 #elif defined( GENESIS_PTHREADS )
82 random_seed( std::chrono::system_clock::now().time_since_epoch().count() );
92 for (
size_t i = 0; i < command_line_.size(); ++i) {
93 std::string a = command_line_[i];
94 ret += (i==0 ?
"" :
" ") + a;
102 command_line_.clear();
103 for (
int i = 0; i < argc; i++) {
104 command_line_.push_back(argv[i]);
115 #ifdef GENESIS_PTHREADS
116 number = std::thread::hardware_concurrency();
121 number_of_threads_ = number;
123 #if defined( GENESIS_OPENMP )
126 omp_set_num_threads( number );
133 #ifdef GENESIS_PTHREADS
142 #ifdef GENESIS_OPENMP
156 random_engine_.seed( seed );
166 #if defined( _WIN32 ) || defined( _WIN64 )
167 return _isatty( _fileno( stdin ));
169 return isatty( fileno( stdin ));
175 #if defined( _WIN32 ) || defined( _WIN64 )
176 return _isatty( _fileno( stdout ));
178 return isatty( fileno( stdout ));
184 #if defined( _WIN32 ) || defined( _WIN64 )
185 return _isatty( _fileno( stderr ));
187 return isatty( fileno( stderr ));
197 static const uint16_t e = 0x1000;
198 return 0 == *
reinterpret_cast< uint8_t const*
>( &e );
203 static const uint16_t e = 0x0001;
204 return 0 == *
reinterpret_cast< uint8_t const*
>( &e );
213 #elif defined __linux__
215 #elif defined __APPLE__
217 #elif defined __unix__
226 #if defined(__clang__)
228 #elif defined(__ICC) || defined(__INTEL_COMPILER)
230 #elif defined(__GNUC__) || defined(__GNUG__)
232 #elif defined(__HP_cc) || defined(__HP_aCC)
234 #elif defined(__IBMCPP__)
236 #elif defined(_MSC_VER)
240 #elif defined(__SUNPRO_CC)
249 #if defined(__clang__)
250 return __clang_version__;
251 #elif defined(__ICC) || defined(__INTEL_COMPILER)
252 return __INTEL_COMPILER;
253 #elif defined(__GNUC__) || defined(__GNUG__)
258 #elif defined(__HP_cc) || defined(__HP_aCC)
260 #elif defined(__IBMCPP__)
262 #elif defined(_MSC_VER)
266 #elif defined(__SUNPRO_CC)
308 #elif defined( NDEBUG )
324 res +=
"Compile Time Options\n";
325 res +=
"=============================================\n\n";
326 res +=
"Platform: " +
platform() +
"\n";
330 res +=
"Endianness: " + std::string(
is_little_endian() ?
"little endian" :
"big endian" ) +
"\n";
331 res +=
"Using Pthreads: " + std::string(
using_pthreads() ?
"true" :
"false" ) +
"\n";
332 res +=
"Using OpenMP: " + std::string(
using_openmp() ?
"true" :
"false" ) +
"\n";
335 res +=
"Run Time Options\n";
336 res +=
"=============================================\n\n";
338 res +=
"Command line: " + ( cli_str.size() > 0 ? cli_str :
"(not available)" ) +
"\n";
static std::string cpp_version()
Return the CPP version that was used to compile genesis.
bool stdout_is_terminal() const
Return true iff the standard output stream is a terminal, and false if not, i.e., if it is a file or ...
static std::string compiler_version()
Return the compiler version that was used to compile genesis.
static std::string platform()
Return the platform under which genesis was compiled.
unsigned int number_of_threads() const
Returns the number of threads.
static std::string compiler_family()
Return the compiler family (name) that was used to compile genesis.
bool using_pthreads() const
Return whether the binary was compiled using Pthreads.
static bool is_debug()
Return whether the binary was compiled with build type DEBUG.
std::vector< std::string > command_line() const
Returns an array of strings containing the program's command line arguments.
std::string to_string(T const &v)
Return a string representation of a given value.
std::string command_line_string() const
Returns a string containing the program's command line arguments.
static bool is_release()
Return whether the binary was compiled with build type RELEASE.
unsigned random_seed() const
Returns the random seed that was used to initialize the engine.
bool stdin_is_terminal() const
Return true iff the standard input stream is a terminal, and false if not, i.e., if it is a file or a...
std::string info() const
Return a list with compile time and run time options with their values.
static std::string build_type()
Return the build type that was used to compile the binary, i.e., "debug" or "release".
static bool is_big_endian()
Return whether the system uses big endian memory.
bool using_openmp() const
Return whether the binary was compiled using OpenMP.
static bool is_little_endian()
Return whether the system uses little endian memory.
bool stderr_is_terminal() const
Return true iff the standard error stream is a terminal, and false if not, i.e., if it is a file or a...
Some stuff that is totally not imporatant, but nice.
std::string genesis_header()
Return the header for genesis.