コード例 #1
0
ファイル: xpcload.cpp プロジェクト: ahiguti/ase
static int
xpcload_main(const char *name)
{
  const char *mozhome = BOOST_PP_STRINGIZE(USE_XPCOM);
  setenv("MOZILLA_FIVE_HOME", mozhome, 0);
  nsCOMPtr<nsIServiceManager> servman;
  nsresult rv = NS_InitXPCOM2(getter_AddRefs(servman), nsnull, nsnull);
  die_unless(NS_SUCCEEDED(rv), "XPCOM init");

  nsCOMPtr<nsISupports> obj = do_CreateInstance(name, &rv);
  if (NS_SUCCEEDED(rv)) {
    fprintf(stderr, "success\n");
  } else {
    fprintf(stderr, "failed\n");
    const char *errstr = dlerror();
    fprintf(stderr, "dlerror: %s\n", errstr);
  }

  rv = NS_ShutdownXPCOM(NULL);
  return 0;
}
コード例 #2
0
bool read_block(const std::string& filename, CBlock& block)
{
    namespace fs = boost::filesystem;
    fs::path testFile = fs::current_path() / "data" / filename;
#ifdef TEST_DATA_DIR
    if (!fs::exists(testFile))
    {
        testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename;
    }
#endif
    FILE* fp = fopen(testFile.string().c_str(), "rb");
    if (!fp) return false;

    fseek(fp, 8, SEEK_SET); // skip msgheader/size

    CAutoFile filein(fp, SER_DISK, CLIENT_VERSION);
    if (filein.IsNull()) return false;

    filein >> block;

    return true;
}
コード例 #3
0
ファイル: wallet_manager.cpp プロジェクト: Whiteblock/monero
std::tuple<bool, std::string, std::string, std::string, std::string> WalletManager::checkUpdates(const std::string &software, std::string subdir)
{
#ifdef BUILD_TAG
    static const char buildtag[] = BOOST_PP_STRINGIZE(BUILD_TAG);
#else
    static const char buildtag[] = "source";
    // Override the subdir string when built from source
    subdir = "source";
#endif

    std::string version, hash;
    MDEBUG("Checking for a new " << software << " version for " << buildtag);
    if (!tools::check_updates(software, buildtag, version, hash))
      return std::make_tuple(false, "", "", "", "");

    if (tools::vercmp(version.c_str(), MONERO_VERSION) > 0)
    {
      std::string user_url = tools::get_update_url(software, subdir, buildtag, version, true);
      std::string auto_url = tools::get_update_url(software, subdir, buildtag, version, false);
      MGINFO("Version " << version << " of " << software << " for " << buildtag << " is available: " << user_url << ", SHA256 hash " << hash);
      return std::make_tuple(true, version, hash, user_url, auto_url);
    }
    return std::make_tuple(false, "", "", "", "");
}
コード例 #4
0
ファイル: lib.cpp プロジェクト: 0xDEC0DE8/mcsema
std::string shared_or_static()
{
  return std::string(BOOST_PP_STRINGIZE(SHARED_OR_STATIC));
}
コード例 #5
0
ファイル: lib.cpp プロジェクト: 0xDEC0DE8/mcsema
std::string single_or_multi()
{
  return std::string(BOOST_PP_STRINGIZE(SINGLE_OR_MULTI));
}
コード例 #6
0
ファイル: lib_info.cpp プロジェクト: xflicsu/vdjml
std::string const& Lib_info::name() {
   static const std::string s = std::string(BOOST_PP_STRINGIZE(VDJML_NAME));
   return s;
}
コード例 #7
0
ファイル: version.cpp プロジェクト: NextGenIntelligence/hpx
 std::string build_type()
 {
     return BOOST_PP_STRINGIZE(HPX_BUILD_TYPE);
 }
コード例 #8
0
        property int iterationIndex;
        property int iterationCount;
    };

    IterationListener();

    virtual Status update(UpdateMessage^ updateMessage) {return Status::Ok;}
};

public delegate IterationListener::Status IterationListenerUpdate(IterationListener::UpdateMessage^ updateMessage);


public ref class IterationListenerRegistry
{
    public:   System::IntPtr void_base() {return (System::IntPtr) base_;} \
    INTERNAL: IterationListenerRegistry(pwiz::util::IterationListenerRegistry* base) : base_(base) {LOG_CONSTRUCT(BOOST_PP_STRINGIZE(CLIType))} \
              virtual ~IterationListenerRegistry(); \
              !IterationListenerRegistry() {LOG_FINALIZE(BOOST_PP_STRINGIZE(CLIType)) delete this;} \
              pwiz::util::IterationListenerRegistry* base_; \
              pwiz::util::IterationListenerRegistry& base() {return *base_;}

    System::Collections::Generic::Dictionary<IterationListener^,
                                             System::Collections::Generic::KeyValuePair<IterationListenerUpdate^,
                                                                                        System::IntPtr> >^ _listeners;

    public:

    IterationListenerRegistry();

    void addListener(IterationListener^ listener, System::UInt32 iterationPeriod);
    void addListenerWithTimer(IterationListener^ listener, double timePeriod); // seconds
コード例 #9
0
 std::string get_name (void) const
 {
     return BOOST_PP_STRINGIZE (SAGA_ADAPTOR_NAME);
 }
コード例 #10
0
ファイル: module_dir.cpp プロジェクト: Fadis/harps
 const char *getModulePath() {
   static const char module_path[] = BOOST_PP_STRINGIZE( HARPS_MODULE_DIR );
   return module_path;
 }
コード例 #11
0
ファイル: version.cpp プロジェクト: NOMORECOFFEE/hpx
namespace hpx
{
    boost::uint8_t major_version()
    {
        return HPX_VERSION_MAJOR;
    }

    boost::uint8_t minor_version()
    {
        return HPX_VERSION_MINOR;
    }

    boost::uint8_t subminor_version()
    {
        return HPX_VERSION_SUBMINOR;
    }

    boost::uint32_t full_version()
    {
        return HPX_VERSION_FULL;
    }

    boost::uint8_t agas_version()
    {
        return HPX_AGAS_VERSION;
    }

    std::string tag()
    {
        return HPX_VERSION_TAG;
    }

    std::string copyright()
    {
        char const* const copyright =
            "HPX - High Performance ParalleX\n"
            "A general purpose parallel C++ runtime system for distributed applications\n"
            "of any scale.\n\n"
            "Copyright (c) 2007-2013 The STE||AR Group, Louisiana State University,\n"
            "http://stellar.cct.lsu.edu, email:[email protected]\n\n"
            "Distributed under the Boost Software License, Version 1.0. (See accompanying\n"
            "file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n";
        return copyright;
    }

    // Returns the HPX full build information string.
    std::string full_build_string()
    {
        hpx::util::osstream strm;
        strm << "{config}:\n" << configuration_string()
             << "{version}: " << build_string() << "\n"
             << "{boost}: " << boost_version() << "\n"
             << "{build-type}: " << build_type() << "\n"
             << "{date}: " << build_date_time() << "\n"
             << "{platform}: " << boost_platform() << "\n"
             << "{compiler}: " << boost_compiler() << "\n"
             << "{stdlib}: " << boost_stdlib() << "\n";

        return util::osstream_get_string(strm);
    }

    ///////////////////////////////////////////////////////////////////////////
    //
    //  HPX_THREAD_MAINTAIN_PARENT_REFERENCE=1
    //  HPX_THREAD_MAINTAIN_PHASE_INFORMATION=1
    //  HPX_THREAD_MAINTAIN_DESCRIPTION=1
    //  HPX_THREAD_MAINTAIN_BACKTRACE_ON_SUSPENSION=1
    //  HPX_THREAD_BACKTRACE_ON_SUSPENSION_DEPTH=5
    //  HPX_THREAD_MAINTAIN_TARGET_ADDRESS=1
    //  HPX_THREAD_MAINTAIN_QUEUE_WAITTIME=0
    //  HPX_UTIL_BIND
    //  HPX_UTIL_FUNCTION
    //  HPX_UTIL_TUPLE
    //  HPX_HAVE_CXX11_RVALUE_REFERENCES
    //  HPX_HAVE_CXX11_LAMBDAS
    //  HPX_HAVE_CXX11_AUTO
    //  HPX_HAVE_CXX11_DECLTYPE
    //  HPX_HAVE_CXX11_STD_UNIQUE_PTR
    //  HPX_ACTION_ARGUMENT_LIMIT=4
    //  HPX_FUNCTION_ARGUMENT_LIMIT=7

    std::string configuration_string()
    {
        hpx::util::osstream strm;

#if defined(HPX_HAVE_NATIVE_TLS)
        strm << "  HPX_HAVE_NATIVE_TLS=ON\n";
#else
        strm << "  HPX_HAVE_NATIVE_TLS=OFF\n";
#endif
#if defined(HPX_HAVE_STACKTRACES)
        strm << "  HPX_HAVE_STACKTRACES=ON\n";
#else
        strm << "  HPX_HAVE_STACKTRACES=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_BZIP2)
        strm << "  HPX_HAVE_COMPRESSION_BZIP2=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_BZIP2=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_SNAPPY)
        strm << "  HPX_HAVE_COMPRESSION_SNAPPY=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_SNAPPY=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_ZLIB)
        strm << "  HPX_HAVE_COMPRESSION_ZLIB=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_ZLIB=OFF\n";
#endif
#if defined(HPX_HAVE_PARCEL_COALESCING)
        strm << "  HPX_HAVE_PARCEL_COALESCING=ON\n";
#else
        strm << "  HPX_HAVE_PARCEL_COALESCING=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_SHMEM)
        strm << "  HPX_HAVE_PARCELPORT_SHMEM=ON\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_SHMEM=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_IBVERBS)
        strm << "  HPX_HAVE_PARCELPORT_IBVERBS=ON\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_IBVERBS=OFF\n";
#endif
#if defined(HPX_HAVE_VERIFY_LOCKS) && HPX_HAVE_VERIFY_LOCKS
        strm << "  HPX_HAVE_VERIFY_LOCKS=ON\n";
#else
        strm << "  HPX_HAVE_VERIFY_LOCKS=OFF\n";
#endif
#if defined(HPX_HAVE_HWLOC)
        strm << "  HPX_HAVE_HWLOC=ON\n";
#else
        strm << "  HPX_HAVE_HWLOC=OFF\n";
#endif
#if defined(HPX_HAVE_ITTNOTIFY) && HPX_HAVE_ITTNOTIFY
        strm << "  HPX_HAVE_ITTNOTIFY=ON\n";
#else
        strm << "  HPX_HAVE_ITTNOTIFY=OFF\n";
#endif
#if defined(BOOST_MSVC)
#if defined(HPX_HAVE_FIBER_BASED_COROUTINES)
        strm << "  HPX_HAVE_FIBER_BASED_COROUTINES=ON\n";
#else
        strm << "  HPX_HAVE_FIBER_BASED_COROUTINES=OFF\n";
#endif
#if defined(HPX_HAVE_SWAP_CONTEXT_EMULATION)
        strm << "  HPX_HAVE_SWAP_CONTEXT_EMULATION=ON\n";
#else
        strm << "  HPX_HAVE_SWAP_CONTEXT_EMULATION=OFF\n";
#endif
#endif

#if defined(HPX_LIMIT)
        strm << "  HPX_LIMIT=" << HPX_LIMIT << "\n";
#endif
#if defined(HPX_ACTION_ARGUMENT_LIMIT)
        strm << "  HPX_ACTION_ARGUMENT_LIMIT="
             << HPX_ACTION_ARGUMENT_LIMIT << "\n";
#endif
#if defined(HPX_COMPONENT_CREATE_ARGUMENT_LIMIT)
        strm << "  HPX_COMPONENT_CREATE_ARGUMENT_LIMIT="
             << HPX_COMPONENT_CREATE_ARGUMENT_LIMIT << "\n";
#endif
#if defined(HPX_FUNCTION_ARGUMENT_LIMIT)
        strm << "  HPX_FUNCTION_ARGUMENT_LIMIT="
             << HPX_FUNCTION_ARGUMENT_LIMIT << "\n";
#endif
#if defined(HPX_LOCK_LIMIT)
        strm << "  HPX_LOCK_LIMIT=" << HPX_LOCK_LIMIT << "\n";
#endif
#if defined(HPX_TUPLE_LIMIT)
        strm << "  HPX_TUPLE_LIMIT=" << HPX_TUPLE_LIMIT << "\n";
#endif
#if defined(HPX_WAIT_ARGUMENT_LIMIT)
        strm << "  HPX_WAIT_ARGUMENT_LIMIT="
             << HPX_WAIT_ARGUMENT_LIMIT << "\n";
#endif
#if defined(HPX_PARCEL_MAX_CONNECTIONS)
        strm << "  HPX_PARCEL_MAX_CONNECTIONS="
             << HPX_PARCEL_MAX_CONNECTIONS << "\n";
#endif
#if defined(HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY)
        strm << "  HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY="
             << HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY << "\n";
#endif
#if defined(HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE)
        strm << "  HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE="
             << HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE << "\n";
#endif
#if defined(HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD)
        strm << "  HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD="
             << HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD << "\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_SHMEM) && defined(HPX_PARCEL_SHMEM_DATA_BUFFER_CACHE_SIZE)
        strm << "  HPX_PARCEL_SHMEM_DATA_BUFFER_CACHE_SIZE="
             << HPX_PARCEL_SHMEM_DATA_BUFFER_CACHE_SIZE << "\n";
#endif

        strm << "  HPX_PREFIX=" << HPX_PREFIX << "\n";

        return util::osstream_get_string(strm);
    }

    std::string build_string()
    {
        return boost::str(
            boost::format("V%d.%d.%d%s (AGAS: V%d.%d), Git: %s") % //-V609
                HPX_VERSION_MAJOR % HPX_VERSION_MINOR %
                HPX_VERSION_SUBMINOR % HPX_VERSION_TAG %
                (HPX_AGAS_VERSION / 0x10) % (HPX_AGAS_VERSION % 0x10) %
                HPX_GIT_COMMIT);
    }

    std::string boost_version()
    {
        // BOOST_VERSION: 105400
        return boost::str(boost::format("V%d.%d.%d") %
            (BOOST_VERSION / 100000) % (BOOST_VERSION / 100 % 1000) %
            (BOOST_VERSION % 100));
    }

#if defined(HPX_HAVE_HWLOC)
    std::string hwloc_version()
    {
        // HWLOC_API_VERSION: 0x00010700
        return boost::str(boost::format("V%d.%d.%d") %
            (HWLOC_API_VERSION / 0x10000) % (HWLOC_API_VERSION / 0x100 % 0x100) %
            (HWLOC_API_VERSION % 0x100));
    }
#endif

    std::string boost_platform()
    {
        return BOOST_PLATFORM;
    }

    std::string boost_compiler()
    {
        return BOOST_COMPILER;
    }

    std::string boost_stdlib()
    {
        return BOOST_STDLIB;
    }

    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
#if defined(HPX_HAVE_HWLOC)
            "  Hwloc: %s\n"
#endif
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s");

        return boost::str(logo %
            build_string() %
            boost_version() %
#if defined(HPX_HAVE_HWLOC)
            hwloc_version() %
#endif
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());
    }

    std::string build_type()
    {
        return BOOST_PP_STRINGIZE(HPX_BUILD_TYPE);
    }

    std::string build_date_time()
    {
        return std::string(__DATE__)  + " " + __TIME__;
    }

    ///////////////////////////////////////////////////////////////////////////
    char const HPX_CHECK_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_VERSION);
    char const HPX_CHECK_BOOST_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_BOOST_VERSION);
}
コード例 #12
0
ファイル: lib.cpp プロジェクト: 0xDEC0DE8/mcsema
std::string libname()
{
  return std::string(BOOST_PP_STRINGIZE(LIBNAME));
}
コード例 #13
0
ファイル: lib.cpp プロジェクト: 0xDEC0DE8/mcsema
std::string single_or_multi()
{
  return std::string(BOOST_PP_STRINGIZE(TOPLEVEL_MULTI_OR_SINGLE));
}
コード例 #14
0
ファイル: lib_info.cpp プロジェクト: xflicsu/vdjml
std::string const& Lib_info::description() {
   static const std::string s = std::string(BOOST_PP_STRINGIZE(VDJML_DESCRIPTION));
   return s;
}
コード例 #15
0
ファイル: lib.cpp プロジェクト: 0xDEC0DE8/mcsema
std::string debug_or_release()
{
  return std::string(BOOST_PP_STRINGIZE(DEBUG_OR_RELEASE));
}
コード例 #16
0
ファイル: version.cpp プロジェクト: saga-project/saga-cpp
 char const* SAGA_CHECK_VERSION() 
 {
   return BOOST_PP_STRINGIZE(SAGA_CHECK_VERSION);
 }
コード例 #17
0
namespace hpx
{
    boost::uint8_t major_version()
    {
        return HPX_VERSION_MAJOR;
    }

    boost::uint8_t minor_version()
    {
        return HPX_VERSION_MINOR;
    }

    boost::uint8_t subminor_version()
    {
        return HPX_VERSION_SUBMINOR;
    }

    boost::uint32_t full_version()
    {
        return HPX_VERSION_FULL;
    }

    boost::uint8_t agas_version()
    {
        return HPX_AGAS_VERSION;
    }

    std::string tag()
    {
        return HPX_VERSION_TAG;
    }

    std::string copyright()
    {
        char const* const copyright =
            "HPX - High Performance ParalleX\n"
            "An distributed and parallel runtime system for conventional machines\n"
            "implementing (parts of) the ParalleX execution model.\n\n"
            "Copyright (C) 1998-2012 Hartmut Kaiser, Bryce Lelbach and others\n"
            "The STE||AR Group, http://stellar.cct.lsu.edu\n\n"
            "Distributed under the Boost Software License, Version 1.0. (See accompanying\n"
            "file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n";

        return copyright;
    }

    std::string build_string()
    {
        return boost::str(boost::format("V%d.%d.%d%s (AGAS: V%d.%d)") %
            HPX_VERSION_MAJOR % HPX_VERSION_MINOR %
            HPX_VERSION_SUBMINOR % HPX_VERSION_TAG %
            (HPX_AGAS_VERSION / 0x10) % (HPX_AGAS_VERSION % 0x10));
    }

    std::string boost_version()
    {
        return boost::str(boost::format("V%d.%d.%d") %
            (BOOST_VERSION / 100000) % (BOOST_VERSION / 100 % 1000) %
            (BOOST_VERSION % 100));
    }

    std::string boost_platform()
    {
        return BOOST_PLATFORM;
    }

    std::string boost_compiler()
    {
        return BOOST_COMPILER;
    }

    std::string boost_stdlib()
    {
        return BOOST_STDLIB;
    }

    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s\n");

        return boost::str(logo %
            build_string() %
            boost_version() %
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());
    }

    std::string build_type()
    {
        return HPX_BUILD_TYPE;
    }

    std::string build_date_time()
    {
        return std::string(__DATE__)  + " " + __TIME__;
    }

    ///////////////////////////////////////////////////////////////////////////
    char const HPX_CHECK_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_VERSION);
    char const HPX_CHECK_BOOST_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_BOOST_VERSION);
}
コード例 #18
0
ファイル: command_line_handling.cpp プロジェクト: eile/hpx
        std::size_t handle_num_threads(util::manage_config& cfgmap,
            boost::program_options::variables_map& vm,
            util::batch_environment& env, bool using_nodelist)
        {
            std::size_t batch_threads = env.retrieve_number_of_threads();
            if(batch_threads == std::size_t(-1)) { batch_threads = 1; }
            std::string threads_str = cfgmap.get_value<std::string>(
                "hpx.os_threads", "");

            if ("all" == threads_str) {
                cfgmap.config_["hpx.os_threads"] =
                    boost::lexical_cast<std::string>(
                        thread::hardware_concurrency());
            }

            std::size_t threads = cfgmap.get_value<std::size_t>(
                "hpx.os_threads", batch_threads);

            if ((env.run_with_pbs() || env.run_with_slurm()) &&
                using_nodelist && (threads > batch_threads))
            {
                detail::report_thread_warning(env.get_batch_name(),
                    threads, batch_threads);
            }

            if (vm.count("hpx:threads")) {
                threads_str = vm["hpx:threads"].as<std::string>();
                if ("all" == threads_str)
                    threads = thread::hardware_concurrency(); //-V101
                else
                    threads = boost::lexical_cast<std::size_t>(threads_str);

                if (threads == 0)
                {
                    throw std::logic_error("Number of --hpx:threads "
                        "must be greater than 0");
                }

                if ((env.run_with_pbs() || env.run_with_slurm()) &&
                    using_nodelist && (threads > batch_threads))
                {
                    detail::report_thread_warning(env.get_batch_name(),
                        threads, batch_threads);
                }

#if defined(HPX_MAX_CPU_COUNT)
                if (threads > HPX_MAX_CPU_COUNT) {
                    throw std::logic_error("Requested more than "
                        BOOST_PP_STRINGIZE(HPX_MAX_CPU_COUNT)" --hpx:threads "
                        "to use for this application, use the option "
                        "-DHPX_MAX_CPU_COUNT=<N> or "
                        "-DHPX_USE_MORE_THAN_64_THREADS when configuring HPX.");
                }
#elif !defined(HPX_HAVE_MORE_THAN_64_THREADS)
                if (threads > 64) {
                    throw std::logic_error("Requested more than 64 "
                        "--hpx:threads to use for this application, use the "
                        "option -DHPX_MAX_CPU_COUNT=<N> or "
                        "-DHPX_USE_MORE_THAN_64_THREADS when configuring HPX.");
                }
#endif
            }
            return threads;
        }
コード例 #19
0
bool PluginModule::load(const String &filename)
{
	unload();
	
	shared_ptr<DynLib> lib(OS_NEW DynLib());
	if(lib->load(filename))
	{
		PluginInterfaceCallback callback = reinterpret_cast<PluginInterfaceCallback>(lib->findProcedure(BOOST_PP_STRINGIZE(OS_PLUGIN_ENTRYPOINT)));
		if(callback != nullptr)
		{
			m_interface = callback();
			if(m_interface != nullptr)
			{
				m_lib = lib;
				return true;
			}
		}		
	}

	return false;
}
コード例 #20
0
ファイル: version.cpp プロジェクト: NextGenIntelligence/hpx
namespace hpx
{
    boost::uint8_t major_version()
    {
        return HPX_VERSION_MAJOR;
    }

    boost::uint8_t minor_version()
    {
        return HPX_VERSION_MINOR;
    }

    boost::uint8_t subminor_version()
    {
        return HPX_VERSION_SUBMINOR;
    }

    boost::uint32_t full_version()
    {
        return HPX_VERSION_FULL;
    }

    std::string full_version_as_string()
    {
        return boost::str(
            boost::format("%d.%d.%d") %
            HPX_VERSION_MAJOR % HPX_VERSION_MINOR %
            HPX_VERSION_SUBMINOR);
    }

    boost::uint8_t agas_version()
    {
        return HPX_AGAS_VERSION;
    }

    std::string tag()
    {
        return HPX_VERSION_TAG;
    }

#if defined(HPX_HAVE_PARCELPORT_MPI)
    std::string mpi_version()
    {
        std::ostringstream strm;

        // add type and library version
#if defined(OPEN_MPI)
        strm << "OpenMPI V" << OMPI_MAJOR_VERSION << "."
             << OMPI_MINOR_VERSION << "." << OMPI_RELEASE_VERSION;
#elif defined(MPICH)
        strm << "MPICH V" << MPICH_VERSION;
#elif defined(MVAPICH2_VERSION)
        strm << "MVAPICH2 V" << MVAPICH2_VERSION;
#else
        strm << "Unknown MPI";
#endif
        // add general MPI version
        strm << ", MPI V" << MPI_VERSION << "." << MPI_SUBVERSION;
        return strm.str();
    }
#endif

    std::string copyright()
    {
        char const* const copyright =
            "HPX - High Performance ParalleX\n"
            "A general purpose parallel C++ runtime system for distributed applications\n"
            "of any scale.\n\n"
            "Copyright (c) 2007-2015, The STE||AR Group,\n"
            "http://stellar-group.org, email:[email protected]\n\n"
            "Distributed under the Boost Software License, Version 1.0. (See accompanying\n"
            "file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n";
        return copyright;
    }

    // Returns the HPX full build information string.
    std::string full_build_string()
    {
        std::ostringstream strm;
        strm << "{config}:\n" << configuration_string()
             << "{version}: " << build_string() << "\n"
             << "{boost}: " << boost_version() << "\n"
             << "{build-type}: " << build_type() << "\n"
             << "{date}: " << build_date_time() << "\n"
             << "{platform}: " << boost_platform() << "\n"
             << "{compiler}: " << boost_compiler() << "\n"
             << "{stdlib}: " << boost_stdlib() << "\n";

        return strm.str();
    }

    ///////////////////////////////////////////////////////////////////////////
    //
    //  HPX_HAVE_THREAD_PARENT_REFERENCE=1
    //  HPX_HAVE_THREAD_PHASE_INFORMATION=1
    //  HPX_HAVE_THREAD_DESCRIPTION=1
    //  HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION=1
    //  HPX_THREAD_BACKTRACE_ON_SUSPENSION_DEPTH=5
    //  HPX_HAVE_THREAD_TARGET_ADDRESS=1
    //  HPX_HAVE_THREAD_QUEUE_WAITTIME=0

    std::string configuration_string()
    {
        std::ostringstream strm;

#if defined(HPX_HAVE_NATIVE_TLS)
        strm << "  HPX_HAVE_NATIVE_TLS=ON\n";
#else
        strm << "  HPX_HAVE_NATIVE_TLS=OFF\n";
#endif
#if defined(HPX_HAVE_STACKTRACES)
        strm << "  HPX_HAVE_STACKTRACES=ON\n";
#else
        strm << "  HPX_HAVE_STACKTRACES=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_BZIP2)
        strm << "  HPX_HAVE_COMPRESSION_BZIP2=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_BZIP2=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_SNAPPY)
        strm << "  HPX_HAVE_COMPRESSION_SNAPPY=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_SNAPPY=OFF\n";
#endif
#if defined(HPX_HAVE_COMPRESSION_ZLIB)
        strm << "  HPX_HAVE_COMPRESSION_ZLIB=ON\n";
#else
        strm << "  HPX_HAVE_COMPRESSION_ZLIB=OFF\n";
#endif
#if defined(HPX_HAVE_PARCEL_COALESCING)
        strm << "  HPX_HAVE_PARCEL_COALESCING=ON\n";
#else
        strm << "  HPX_HAVE_PARCEL_COALESCING=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_TCP)
        strm << "  HPX_HAVE_PARCELPORT_TCP=ON\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_TCP=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_MPI)
        strm << "  HPX_HAVE_PARCELPORT_MPI=ON (" << mpi_version() << ")\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_MPI=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_IPC)
        strm << "  HPX_HAVE_PARCELPORT_IPC=ON\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_IPC=OFF\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_IBVERBS)
        strm << "  HPX_HAVE_PARCELPORT_IBVERBS=ON\n";
#else
        strm << "  HPX_HAVE_PARCELPORT_IBVERBS=OFF\n";
#endif
#if defined(HPX_HAVE_VERIFY_LOCKS)
        strm << "  HPX_HAVE_VERIFY_LOCKS=ON\n";
#else
        strm << "  HPX_HAVE_VERIFY_LOCKS=OFF\n";
#endif
#if defined(HPX_HAVE_HWLOC)
        strm << "  HPX_HAVE_HWLOC=ON\n";
#else
        strm << "  HPX_HAVE_HWLOC=OFF\n";
#endif
#if defined(HPX_HAVE_ITTNOTIFY)
        strm << "  HPX_HAVE_ITTNOTIFY=ON\n";
#else
        strm << "  HPX_HAVE_ITTNOTIFY=OFF\n";
#endif
#if defined(BOOST_MSVC)
#if defined(HPX_HAVE_FIBER_BASED_COROUTINES)
        strm << "  HPX_HAVE_FIBER_BASED_COROUTINES=ON\n";
#else
        strm << "  HPX_HAVE_FIBER_BASED_COROUTINES=OFF\n";
#endif
#if defined(HPX_HAVE_SWAP_CONTEXT_EMULATION)
        strm << "  HPX_HAVE_SWAP_CONTEXT_EMULATION=ON\n";
#else
        strm << "  HPX_HAVE_SWAP_CONTEXT_EMULATION=OFF\n";
#endif
#endif
#if defined(HPX_HAVE_RUN_MAIN_EVERYWHERE)
        strm << "  HPX_HAVE_RUN_MAIN_EVERYWHERE=ON\n";
#else
        strm << "  HPX_HAVE_RUN_MAIN_EVERYWHERE=OFF\n";
#endif

#if defined(HPX_LIMIT)
        strm << "  HPX_LIMIT=" << HPX_LIMIT << "\n";
#endif
#if defined(HPX_PARCEL_MAX_CONNECTIONS)
        strm << "  HPX_PARCEL_MAX_CONNECTIONS="
             << HPX_PARCEL_MAX_CONNECTIONS << "\n";
#endif
#if defined(HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY)
        strm << "  HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY="
             << HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY << "\n";
#endif
#if defined(HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE)
        strm << "  HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE="
             << HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE << "\n";
#endif
#if defined(HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD)
        strm << "  HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD="
             << HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD << "\n";
#endif
#if defined(HPX_HAVE_PARCELPORT_IPC) && defined(HPX_PARCEL_IPC_DATA_BUFFER_CACHE_SIZE)
        strm << "  HPX_PARCEL_IPC_DATA_BUFFER_CACHE_SIZE="
             << HPX_PARCEL_IPC_DATA_BUFFER_CACHE_SIZE << "\n";
#endif
#if defined(HPX_HAVE_MALLOC)
        strm << "  HPX_HAVE_MALLOC=" << HPX_HAVE_MALLOC << "\n";
#endif

        strm << "  HPX_PREFIX (configured)=" << util::hpx_prefix() << "\n";
#if !defined(__ANDROID__) && !defined(ANDROID) && !defined(__MIC)
        strm << "  HPX_PREFIX=" << util::find_prefix() << "\n";
#endif

        return strm.str();
    }

    std::string build_string()
    {
        return boost::str(
            boost::format("V%s%s (AGAS: V%d.%d), Git: %.10s") % //-V609
                full_version_as_string() % HPX_VERSION_TAG %
                (HPX_AGAS_VERSION / 0x10) % (HPX_AGAS_VERSION % 0x10) %
                HPX_HAVE_GIT_COMMIT);
    }

    std::string boost_version()
    {
        // BOOST_VERSION: 105400
        return boost::str(boost::format("V%d.%d.%d") %
            (BOOST_VERSION / 100000) % (BOOST_VERSION / 100 % 1000) %
            (BOOST_VERSION % 100));
    }

#if defined(HPX_HAVE_HWLOC)
    std::string hwloc_version()
    {
        // HWLOC_API_VERSION: 0x00010700
        return boost::str(boost::format("V%d.%d.%d") %
            (HWLOC_API_VERSION / 0x10000) % (HWLOC_API_VERSION / 0x100 % 0x100) %
            (HWLOC_API_VERSION % 0x100));
    }
#endif

#if defined(HPX_HAVE_MALLOC)
    std::string malloc_version()
    {
        return HPX_HAVE_MALLOC;
    }
#endif

    std::string boost_platform()
    {
        return BOOST_PLATFORM;
    }

    std::string boost_compiler()
    {
        return BOOST_COMPILER;
    }

    std::string boost_stdlib()
    {
        return BOOST_STDLIB;
    }

    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
#if defined(HPX_HAVE_HWLOC)
            "  Hwloc: %s\n"
#endif
#if defined(HPX_HAVE_PARCELPORT_MPI)
            "  MPI: %s\n"
#endif
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s\n");

        std::string version = boost::str(logo %
            build_string() %
            boost_version() %
#if defined(HPX_HAVE_HWLOC)
            hwloc_version() %
#endif
#if defined(HPX_HAVE_PARCELPORT_MPI)
            mpi_version() %
#endif
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());

#if defined(HPX_HAVE_MALLOC)
            version += "  Allocator: " + malloc_version() + "\n";
#endif

            return version;
    }

    std::string build_type()
    {
        return BOOST_PP_STRINGIZE(HPX_BUILD_TYPE);
    }

    std::string build_date_time()
    {
        return std::string(__DATE__)  + " " + __TIME__;
    }

    ///////////////////////////////////////////////////////////////////////////
    std::string runtime_configuration_string(
        util::command_line_handling const& cfg)
    {
        std::ostringstream strm;

        // runtime mode
        strm << "  {mode}: " << get_runtime_mode_name(cfg.mode_) << "\n";

        if (cfg.num_localities_ != 1)
            strm << "  {localities}: " << cfg.num_localities_ << "\n";

        // default scheduler used for this run
        strm << "  {scheduler}: " << cfg.queuing_ << "\n";

        // amount of threads and cores configured for this run
        strm << "  {os-threads}: " << cfg.num_threads_ << "\n";
        strm << "  {cores}: " << cfg.num_cores_ << "\n";

        return strm.str();
    }

    ///////////////////////////////////////////////////////////////////////////
    char const HPX_CHECK_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_VERSION);
    char const HPX_CHECK_BOOST_VERSION[] = BOOST_PP_STRINGIZE(HPX_CHECK_BOOST_VERSION);
}
コード例 #21
0
ファイル: agoapp.cpp プロジェクト: mce35/agocontrol
int AgoApp::parseCommandLine(int argc, const char **argv) {
    po::options_description options;
    options.add_options()
        ("help,h", "produce this help message")
        ("log-level", po::value<std::string>(),
         (std::string("Log level. Valid values are one of\n ") +
          boost::algorithm::join(log_container::getLevels(), ", ")).c_str())
        ("log-method", po::value<std::string>(),
         "Where to log. Valid values are one of\n console, syslog")
        ("log-syslog-facility", po::value<std::string>(),
         (std::string("Which syslog facility to log to. Valid values are on of\n ") +
          boost::algorithm::join(log_container::getSyslogFacilities(), ", ")).c_str())
        ("debug,d", po::bool_switch(),
         "Shortcut to set console logging with level DEBUG")
        ("trace,t", po::bool_switch(),
         "Shortcut to set console logging with level TRACE")
        ("config-dir", po::value<std::string>(),
         "Directory with configuration files")
        ("state-dir", po::value<std::string>(),
         "Directory with local state files")
        ;

    appCmdLineOptions(options);
    try {
        po::variables_map &vm (cli_vars);
        po::store(po::parse_command_line(argc, argv, options), vm);
        po::notify(vm);

        if(vm.count("config-dir")) {
            std::string dir = vm["config-dir"].as<std::string>();
            try {
                AgoClientInternal::setConfigDir(dir);
            } catch(const fs::filesystem_error& error) {
                std::cout << "Could not use " << dir << " as config-dir: "
                    << error.code().message()
                    << std::endl;
                return 1;
            }
        }

        if(vm.count("state-dir")) {
            std::string dir = vm["state-dir"].as<std::string>();
            try {
                AgoClientInternal::setLocalStateDir(dir);
            } catch(const fs::filesystem_error& error) {
                std::cout << "Could not use " << dir << " as state-dir: "
                    << error.code().message()
                    << std::endl;
                return 1;
            }
        }

        // Init dirs before anything else, so we at least show correct in help output
        if (vm.count("help")) {
            initDirectorys();
            std::cout << "usage: " << argv[0] << std::endl
                << options << std::endl
                << std::endl
                << "Paths:" << std::endl
                << "  Default config dir: "
                <<  BOOST_PP_STRINGIZE(DEFAULT_CONFDIR) << std::endl
                << "  Default state dir : "
                <<  BOOST_PP_STRINGIZE(DEFAULT_LOCALSTATEDIR) << std::endl
                << "  Active config dir : "
                << getConfigPath().string() << std::endl
                << "  Active state dir  : "
                << getLocalStatePath().string() << std::endl
                << std::endl
                << "System configuration file      : "
                << getConfigPath("conf.d/system.conf").string() << std::endl
                << "App-specific configuration file: "
                << getConfigPath("conf.d/" + appShortName + ".conf").string() << std::endl
                ;
            return 1;
        }

        options_validator<std::string>(vm, "log-method")
            ("console")("syslog")
            .validate();

        options_validator<std::string>(vm, "log-syslog-facility")
            (log_container::getSyslogFacilities())
            .validate();

        options_validator<std::string>(vm, "log-level")
            (log_container::getLevels())
            .validate();
    }
    catch(std::exception& e)
    {
        std::cout << "Failed to parse command line: " << e.what() << std::endl;
        return 1;
    }

    return 0;
}
コード例 #22
0
ファイル: sample.hpp プロジェクト: patefacio/codegen
    void serialize(Archive & ar, const unsigned int version)
    {
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s1_, "sample::s1");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s1_), s1_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s2_, "sample::s2");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s2_), s2_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s3_, "sample::s3");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s3_), s3_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s4_, "sample::s4");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s4_), s4_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s5_, "sample::s5");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s5_), s5_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s6_, "sample::s6");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s6_), s6_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s7_, "sample::s7");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s7_), s7_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s8_, "sample::s8");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s8_), s8_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, s9_, "sample::s9");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(s9_), s9_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i1_, "sample::i1");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i1_), i1_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i2_, "sample::i2");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i2_), i2_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i3_, "sample::i3");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i3_), i3_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i4_, "sample::i4");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i4_), i4_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i5_, "sample::i5");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i5_), i5_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i6_, "sample::i6");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i6_), i6_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i7_, "sample::i7");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i7_), i7_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i8_, "sample::i8");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i8_), i8_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, i9_, "sample::i9");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(i9_), i9_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, iA_, "sample::iA");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(iA_), iA_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, nl_, "sample::nl");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(nl_), nl_);
      // TODO: LOGGING_BOOST_SERIALIZATION_NVP(ar, nm_, "sample::nm");
      ar & boost::serialization::make_nvp(BOOST_PP_STRINGIZE(nm_), nm_);

    }
コード例 #23
0
ファイル: lib_info.cpp プロジェクト: xflicsu/vdjml
std::string const& Lib_info::version_e() {
   static const std::string s = std::string(BOOST_PP_STRINGIZE(VDJML_VERSION_EXTRA));
   return s;
}