跳转到内容

ROSE 编译器框架/boost

来自维基教科书,开放世界中的开放书籍

在 ROSE 中使用 Boost 的影响

[编辑 | 编辑源代码]

在 ROSE 中当前使用 Boost 的方式对我们来说爱恨交加。一些开发者使用 Boost 来简化他们的工作,但代价是

  • 对所有其他开发者(包括那些根本不使用 Boost 的开发者)来说,这是一个强制性的外部依赖项,并且
  • 存在移植性和维护问题(GCC 版本支持有限的大部分原因是 Boost 库)。

本页尝试记录 ROSE 使用的 Boost 库。希望我们可以弄清楚为什么我们必须拥有它们中的每一个,以及是否可以将一些库设为可选(对于那些对库支持的功能不感兴趣的用户来说不是必需的)。


为了清楚起见,我们感谢开源 Boost 社区提供免费且优秀的库。问题是我们如何才能更好地在 ROSE 中使用 Boost,从而在生产力、可移植性和可维护性之间取得良好的平衡。

行动项目

[编辑 | 编辑源代码]

将一些使用较少的库设为可选

  • thread
  • iostream
  • wave

当前依赖库

[编辑 | 编辑源代码]

https://boost.ac.cn/doc/libs/ 列出了截至 2015 年 1 月 24 日的 113 个库。幸运的是,我们不需要全部使用它们!

预期完整列表 -- Boost 版本:1.45.0 -- 找到以下 Boost 库

--   date_time
--   filesystem
--   iostreams
--   program_options
--   regex
--   system
--   wave
--   thread

包含 boost 的代码

[编辑 | 编辑源代码]
demo@ubuntu:~/rose-edg4x.git/src$ grep -r  "<boost/" *

backend/asmUnparser/AsmFunctionIndex.C:#include <boost/shared_ptr.hpp>
backend/asmUnparser/unparseM68kAsm.C:#include <boost/foreach.hpp>
backend/asmUnparser/unparsePowerpcAsm.C:#include <boost/lexical_cast.hpp>
backend/unparser/JavaCodeGeneration/unparseJava_statements.C:#include <boost/foreach.hpp>
backend/unparser/unparser.C:#include <boost/algorithm/string.hpp>
backend/unparser/unparser.C:// #include <boost/test/unit_test.hpp>
backend/unparser/PythonCodeGeneration/unparsePython.C:#include <boost/foreach.hpp>
backend/unparser/X10CodeGeneration/unparseX10_statements.C:#include <boost/foreach.hpp>
frontend/ECJ_ROSE_Connection/jni_JavaSourceCodePosition.C:#include <boost/algorithm/string.hpp>
frontend/Partitioner2/Modules.C:#include <boost/algorithm/string/predicate.hpp>
frontend/Partitioner2/Modules.C:#include <boost/algorithm/string/replace.hpp>
frontend/Partitioner2/AddressUsageMap.h:#include <boost/foreach.hpp>
frontend/Partitioner2/Attribute.h:#include <boost/any.hpp>
frontend/Partitioner2/Partitioner.C:#include <boost/algorithm/string/predicate.hpp>
frontend/Partitioner2/Partitioner.C:#include <boost/foreach.hpp>
frontend/Partitioner2/ModulesM68k.C:#include <boost/foreach.hpp>
frontend/Partitioner2/ModulesPe.C:#include <boost/foreach.hpp>
frontend/Partitioner2/AddressUsageMap.C:#include <boost/foreach.hpp>
frontend/Partitioner2/ModulesElf.C:#include <boost/foreach.hpp>
frontend/Partitioner2/BasicBlock.C:#include <boost/foreach.hpp>
frontend/SageIII/rose_attributes_list.C:#include <boost/wave.hpp>
frontend/SageIII/rose_attributes_list.C:// #include <boost/wave/grammars/cpp_xpression_grammar.hpp> //as_string
frontend/SageIII/rose_graph_support.C:#include <boost/graph/adjacency_list.hpp>
frontend/SageIII/rose_graph_support.C:#include <boost/graph/kruskal_min_spanning_tree.hpp>
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/wave.hpp>
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/wave/cpplexer/cpp_lex_token.hpp>    // token class
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/filesystem.hpp>         // exsits()
frontend/SageIII/sage_support/sage_support.cpp:#include <boost/algorithm/string/join.hpp>
frontend/SageIII/sage_support/sage_support.cpp:#include <boost/filesystem.hpp>
frontend/SageIII/sage_support/sage_support.cpp:#include <boost/foreach.hpp>
frontend/SageIII/sage_support/cmdline.cpp:#include <boost/foreach.hpp>
frontend/SageIII/sage_support/cmdline.cpp:#include <boost/algorithm/string/replace.hpp>
frontend/SageIII/rose_attributes_list.h:    #include <boost/preprocessor/iteration/iterate.hpp> // Liao, 7/10/2009, required by GCC 4.4.0 for a #define line of BOOST_PP_ITERATION_DEPTH
frontend/SageIII/rose_attributes_list.h:      #include <boost/wave.hpp> // CH (4/7/2010): Put this header here to avoid compiling error about mismatch between definition and declaration
frontend/SageIII/rose_attributes_list.h:    #include <boost/wave/cpplexer/cpp_lex_token.hpp>    // token class
frontend/SageIII/rose_attributes_list.h:    #include <boost/wave/cpplexer/cpp_lex_iterator.hpp>   // lexer type
frontend/SageIII/advanced_preprocessing_hooks.h:#include <boost/assert.hpp>
frontend/SageIII/advanced_preprocessing_hooks.h:#include <boost/config.hpp>
frontend/SageIII/advanced_preprocessing_hooks.h:#include <boost/wave/token_ids.hpp>
frontend/SageIII/advanced_preprocessing_hooks.h:#include <boost/wave/util/macro_helpers.hpp>
frontend/SageIII/advanced_preprocessing_hooks.h:#include <boost/wave/preprocessing_hooks.hpp>
frontend/SageIII/sageInterface/sageBuilder_untypedNodes.C:#include <boost/algorithm/string/trim.hpp>
frontend/SageIII/sageInterface/sageBuilder.C:   #include <boost/algorithm/string/trim.hpp>
frontend/SageIII/sageInterface/sageBuilder.C:   #include <boost/foreach.hpp>
frontend/SageIII/sageInterface/sageBuilder.C:   #include <boost/algorithm/string/trim.hpp>
frontend/SageIII/sageInterface/sageBuilder.C:   #include <boost/foreach.hpp>
frontend/SageIII/sageInterface/sageBuilderAsm.C:#include <boost/foreach.hpp>
frontend/SageIII/sageInterface/sageInterface_type.C:#include <boost/foreach.hpp>
frontend/SageIII/sageInterface/sageBuilder_fortran.C:#include <boost/algorithm/string/trim.hpp>
frontend/SageIII/sageInterface/integerOps.h:#include <boost/static_assert.hpp>
frontend/SageIII/sageInterface/integerOps.h:#include <boost/optional.hpp>
frontend/SageIII/sageInterface/sageInterface.C:#include <boost/lexical_cast.hpp>
frontend/SageIII/sageInterface/sageInterface.C:#include <boost/foreach.hpp>
frontend/SageIII/rtiHelpers.h:#include <boost/lexical_cast.hpp>
frontend/SageIII/virtualCFG/staticCFG.C:#include <boost/foreach.hpp>
frontend/SageIII/virtualCFG/customFilteredCFG.C:#include <boost/foreach.hpp>
frontend/SageIII/virtualCFG/memberFunctions.C:#include <boost/foreach.hpp>
frontend/SageIII/virtualCFG/interproceduralCFG.C:#include <boost/foreach.hpp>
frontend/SageIII/astTokenStream/doCompleteMapping.h:#include <boost/tuple/tuple.hpp>
frontend/SageIII/astTokenStream/linearizeAST.C:#include <boost/lexical_cast.hpp>
frontend/SageIII/astTokenStream/tokenStreamMapping.C:// #include <boost/icl/interval_map.hpp>
frontend/SageIII/attributeListMap.h:#include <boost/wave.hpp>
frontend/SageIII/attributeListMap.h:#include <boost/wave/cpplexer/cpp_lex_token.hpp>    // token class
frontend/SageIII/attributeListMap.h:#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class
frontend/BinaryDisassembly/RoseBin_file.cpp:#include <boost/lexical_cast.hpp>
frontend/BinaryDisassembly/RoseBin_support.h:#include <boost/unordered_map.hpp>
frontend/BinaryDisassembly/RoseBin_support.h:#include <boost/unordered_set.hpp>
frontend/Disassemblers/PStatistics.C:#include <boost/graph/adjacency_list.hpp>
frontend/Disassemblers/PStatistics.C:#include <boost/graph/connected_components.hpp>
frontend/Disassemblers/PStatistics.C:#include <boost/math/special_functions/erf.hpp> // for erf
frontend/Disassemblers/BinaryDebugger.C:#include <boost/algorithm/string/case_conv.hpp>
frontend/Disassemblers/BinaryDebugger.C:#include <boost/config.hpp>
frontend/BinaryLoader/BinaryLoaderElf.C:#include <boost/regex.hpp>
frontend/BinaryLoader/BinaryLoaderElf.C:#include <boost/filesystem.hpp>
frontend/BinaryFormats/GenericFile.C:#include <boost/math/common_factor.hpp>
frontend/BinaryFormats/MemoryMap.C:#include <boost/filesystem.hpp>
frontend/BinaryFormats/MemoryMap.C:#include <boost/foreach.hpp>
frontend/BinaryFormats/MemoryMap.C:#include <boost/config.hpp>
frontend/BinaryFormats/ExtentMap.C:#include <boost/foreach.hpp>
frontend/BinaryFormats/SRecord.C:#include <boost/foreach.hpp>
frontend/BinaryFormats/WorkLists.h:#include <boost/logic/tribool.hpp>
midend/astDiagnostics/AstPerformance.C:#include <boost/thread.hpp>     // sleep()
midend/astSnippet/Snippet.h:#include <boost/shared_ptr.hpp>
midend/astSnippet/Snippet.h:#include <boost/enable_shared_from_this.hpp>
midend/astSnippet/Snippet.C:#include <boost/algorithm/string/erase.hpp>
midend/astSnippet/Snippet.C:#include <boost/algorithm/string/predicate.hpp>
midend/astSnippet/Snippet.C:#include <boost/algorithm/string/replace.hpp>
midend/astSnippet/Snippet.C:#include <boost/algorithm/string/split.hpp>
midend/astSnippet/Snippet.C:#include <boost/algorithm/string/trim.hpp>
midend/astSnippet/Snippet.C:#include <boost/filesystem.hpp>
midend/astSnippet/Snippet.C:#include <boost/foreach.hpp>
midend/astSnippet/Snippet.C:#include <boost/lexical_cast.hpp>
midend/astSnippet/Snippet.C:#include <boost/regex.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentInterprocedural.C:#include <boost/timer.hpp>
midend/programAnalysis/staticSingleAssignment/iteratedDominanceFrontier.h:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/iteratedDominanceFrontier.h:#include <boost/graph/adjacency_list.hpp>
midend/programAnalysis/staticSingleAssignment/iteratedDominanceFrontier.h:#include <boost/graph/topological_sort.hpp>
midend/programAnalysis/staticSingleAssignment/reachingDef.C:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/reachingDef.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/staticSingleAssignment/reachingDef.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/staticSingleAssignment/controlDependence.h:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignment.h:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignment.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentQueries.C:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/graph/adjacency_list.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/bind.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/graph/dominator_tree.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/graph/reverse_graph.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/graph/transpose_graph.hpp>
midend/programAnalysis/staticSingleAssignment/boostGraphCFG.h:#include <boost/algorithm/string.hpp>
midend/programAnalysis/staticSingleAssignment/uniqueNameTraversal.C:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentCalculation.C:#include <boost/timer.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentCalculation.C:#include <boost/foreach.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentCalculation.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/staticSingleAssignment/staticSingleAssignmentCalculation.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/staticSingleAssignment/reachingDef.h:#include <boost/shared_ptr.hpp>
midend/programAnalysis/staticSingleAssignment/defsAndUsesTraversal.C:#include <boost/foreach.hpp>
midend/programAnalysis/sideEffectAnalysis/sideEffect.C:#include <boost/unordered_map.hpp>
midend/programAnalysis/sideEffectAnalysis/sideEffect.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/sideEffectAnalysis/sideEffect.C:#include <boost/config.hpp>
midend/programAnalysis/sideEffectAnalysis/SqliteDatabaseGraph.h:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/ssaUnfilteredCfg/reachingDefUnfilteredCfg.C:#include <boost/foreach.hpp>
midend/programAnalysis/ssaUnfilteredCfg/reachingDefUnfilteredCfg.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/ssaUnfilteredCfg/reachingDefUnfilteredCfg.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfgQueries.C:#include <boost/foreach.hpp>
midend/programAnalysis/ssaUnfilteredCfg/defsAndUsesUnfilteredCfg.C:#include <boost/foreach.hpp>
midend/programAnalysis/ssaUnfilteredCfg/reachingDefUnfilteredCfg.h:#include <boost/shared_ptr.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfgCalculation.C:#include <boost/timer.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfgCalculation.C:#include <boost/foreach.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfgCalculation.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfgCalculation.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfg.h:#include <boost/foreach.hpp>
midend/programAnalysis/ssaUnfilteredCfg/ssaUnfilteredCfg.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/CallGraphAnalysis/CallGraphDB.C:#include <boost/lexical_cast.hpp>
midend/programAnalysis/CallGraphAnalysis/CallGraph.C:#include <boost/foreach.hpp>
midend/programAnalysis/CallGraphAnalysis/CallGraph.h:#include <boost/foreach.hpp>
midend/programAnalysis/CallGraphAnalysis/CallGraph.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/CallGraphAnalysis/ClassHierarchyGraph.h:#include <boost/unordered_set.hpp>
midend/programAnalysis/CallGraphAnalysis/ClassHierarchyGraph.C:#include <boost/foreach.hpp>
midend/programAnalysis/CallGraphAnalysis/ClassHierarchyGraph.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/defUseAnalysis/DefUseAnalysis.cpp:#include <boost/config.hpp>
midend/programAnalysis/defUseAnalysis/DefUseAnalysis.cpp:#include <boost/bind.hpp>
midend/programAnalysis/defUseAnalysis/DefUseAnalysis.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/defUseAnalysis/DefUseAnalysis.h:#include <boost/unordered_set.hpp>
midend/programAnalysis/defUseAnalysis/LivenessAnalysis.cpp:#include <boost/config.hpp>
midend/programAnalysis/defUseAnalysis/LivenessAnalysis.cpp:#include <boost/bind.hpp>
midend/programAnalysis/pointerAnal/PtrAnal.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/EditDistance/TreeEditDistance.C:#include <boost/graph/dijkstra_shortest_paths.hpp>
midend/programAnalysis/EditDistance/TreeEditDistance.h:#include <boost/graph/adjacency_list.hpp>
midend/programAnalysis/EditDistance/TreeEditDistance.h:#include <boost/graph/graph_traits.hpp>
midend/programAnalysis/genericDataflow/simpleAnalyses/divAnalysis.C:#include <boost/bind.hpp>
midend/programAnalysis/genericDataflow/simpleAnalyses/divAnalysis.C:#include <boost/mem_fn.hpp>
midend/programAnalysis/genericDataflow/analysis/dataflow.h:#include <boost/shared_ptr.hpp>
midend/programAnalysis/genericDataflow/analysis/dataflow.C:#include <boost/mem_fn.hpp>
midend/programAnalysis/variableRenaming/VariableRenaming.C:#include <boost/foreach.hpp>
midend/programAnalysis/variableRenaming/VariableRenaming.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/variableRenaming/VariableRenaming.h:#include <boost/foreach.hpp>
midend/programAnalysis/variableRenaming/VariableRenaming.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.h:#include <boost/function.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/systemDependenceGraph/newDDG.C:#include <boost/bind.hpp>
midend/programAnalysis/systemDependenceGraph/newDDG.C:#include <boost/lambda/lambda.hpp>
midend/programAnalysis/systemDependenceGraph/newDDG.C:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/systemDependenceGraph/newDDG.C:#include <boost/unordered_set.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/algorithm/string.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/bind.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/foreach.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/lambda/lambda.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/graph/depth_first_search.hpp>
midend/programAnalysis/systemDependenceGraph/SDG.C:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/systemDependenceGraph/cong_staticCFG.h:#include <boost/function.hpp>
midend/programAnalysis/systemDependenceGraph/cong_staticCFG.h:#include <boost/graph/adjacency_list.hpp>
midend/programAnalysis/systemDependenceGraph/cong_staticCFG.h:#include <boost/shared_ptr.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/algorithm/string.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/bind.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/foreach.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/graph/dominator_tree.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/graph/reverse_graph.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/graph/transpose_graph.hpp>
midend/programAnalysis/systemDependenceGraph/staticCFG.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/systemDependenceGraph/util.C:#include <boost/foreach.hpp>
midend/programAnalysis/systemDependenceGraph/util.C:#include <boost/graph/strong_components.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/bind.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/foreach.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/graph/graph_utility.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/graph/strong_components.hpp>
midend/programAnalysis/systemDependenceGraph/newCDG.C:#include <boost/tuple/tuple.hpp>
midend/programAnalysis/systemDependenceGraph/PDG.C:#include <boost/bind.hpp>
midend/programAnalysis/systemDependenceGraph/PDG.C:#include <boost/foreach.hpp>
midend/programAnalysis/systemDependenceGraph/PDG.C:#include <boost/lambda/lambda.hpp>
midend/programAnalysis/systemDependenceGraph/PDG.C:#include <boost/graph/graphviz.hpp>
midend/programAnalysis/systemDependenceGraph/defUseChains.C:#include <boost/foreach.hpp>
midend/programAnalysis/VirtualFunctionAnalysis/IntraProcAliasAnalysis.h:#include <boost/foreach.hpp>
midend/programAnalysis/VirtualFunctionAnalysis/IntraProcAliasAnalysis.h:#include <boost/shared_ptr.hpp>
midend/programAnalysis/VirtualFunctionAnalysis/IntraProcAliasAnalysis.h:#include <boost/unordered_map.hpp>
midend/programAnalysis/VirtualFunctionAnalysis/InterProcDataFlowAnalysis.C:#include <boost/foreach.hpp>
midend/programTransformation/astOutlining/PragmaInterface.cc:#include <boost/algorithm/string/trim.hpp>
midend/programTransformation/extractFunctionArgumentsNormalization/ExtractFunctionArguments.C:#include <boost/foreach.hpp>
midend/programTransformation/extractFunctionArgumentsNormalization/ExtractFunctionArguments.C:#include <boost/tuple/tuple.hpp>
midend/astQuery/nodeQuery.C:#include <boost/bind.hpp>
midend/astProcessing/SgGraphTemplate.h:#include <boost/graph/adjacency_list.hpp>
midend/astProcessing/SgGraphTemplate.h:#include <boost/graph/astar_search.hpp>
midend/astProcessing/AstAttributeMechanism.C:#include <boost/numeric/conversion/cast.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/graph/adjacency_list.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/bind.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/foreach.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/tuple/tuple.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/graph/graphviz.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/graph/dominator_tree.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/graph/reverse_graph.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/graph/transpose_graph.hpp>
midend/astProcessing/graphTemplate.h:#include <boost/algorithm/string.hpp>
midend/astProcessing/graphProcessingSgIncGraph.h:#include <boost/regex.hpp> 
midend/astProcessing/graphProcessing.h:#include <boost/regex.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/graph/adjacency_list.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/bind.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/foreach.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/tuple/tuple.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/graph/graphviz.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/graph/dominator_tree.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/graph/reverse_graph.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/graph/transpose_graph.hpp>
midend/astProcessing/graphProcessing.h:#include <boost/algorithm/string.hpp>
midend/abstractLayer/VariableIdMapping.h:#include <boost/unordered_set.hpp>
midend/binaryAnalyses/BinaryControlFlow.h:#include <boost/foreach.hpp>
midend/binaryAnalyses/BinaryControlFlow.h:#include <boost/graph/adjacency_list.hpp>
midend/binaryAnalyses/BinaryControlFlow.h:#include <boost/graph/reverse_graph.hpp>
midend/binaryAnalyses/BinaryControlFlow.h:#include <boost/graph/depth_first_search.hpp>
midend/binaryAnalyses/BinaryTaintedFlow.h:#include <boost/foreach.hpp>
midend/binaryAnalyses/BinaryTaintedFlow.h:#include <boost/shared_ptr.hpp>
midend/binaryAnalyses/BinaryReturnValueUsed.C:#include <boost/algorithm/string/erase.hpp>
midend/binaryAnalyses/BinaryReturnValueUsed.C:#include <boost/algorithm/string/predicate.hpp>
midend/binaryAnalyses/BinaryReturnValueUsed.C:#include <boost/foreach.hpp>
midend/binaryAnalyses/BinaryDominance.h:#include <boost/graph/depth_first_search.hpp>
midend/binaryAnalyses/BinaryDominance.h:#include <boost/graph/reverse_graph.hpp>
midend/binaryAnalyses/BinaryDataFlow.h:#include <boost/foreach.hpp>
midend/binaryAnalyses/BinaryDataFlow.h:#include <boost/lexical_cast.hpp>
midend/binaryAnalyses/BinaryControlFlow.C:#include <boost/graph/depth_first_search.hpp>
midend/binaryAnalyses/instructionSemantics/DispatcherM68k.C:#include <boost/foreach.hpp>
midend/binaryAnalyses/instructionSemantics/findConstants.h:#include <boost/lexical_cast.hpp>
midend/binaryAnalyses/instructionSemantics/BaseSemantics2.h:#include <boost/shared_ptr.hpp>
midend/binaryAnalyses/instructionSemantics/BaseSemantics2.h:#include <boost/enable_shared_from_this.hpp>
midend/binaryAnalyses/instructionSemantics/BaseSemantics2.h:#include <boost/optional.hpp>
midend/binaryAnalyses/instructionSemantics/DataFlowSemantics2.h:#include <boost/foreach.hpp>
midend/binaryAnalyses/binary_analysis.C:#include <boost/lexical_cast.hpp>
midend/binaryAnalyses/libraryIdentification/functionIdentification.C:#include <boost/lexical_cast.hpp>
roseExtensions/roseHPCToolkit/src/profir/profir.cc:#include <boost/lexical_cast.hpp> // DXN: converting int to string
roseExtensions/roseHPCToolkit/src/gprof/gprof_info.cc:#include <boost/version.hpp>
roseExtensions/roseHPCToolkit/src/gprof/gprof_info.cc: #include <boost/spirit/include/classic_core.hpp>
roseExtensions/roseHPCToolkit/src/gprof/gprof_info.cc: #include <boost/spirit.hpp>
roseExtensions/sqlite3x/sqlite3x.h:#include <boost/utility.hpp>
roseExtensions/qtWidgets/util/LCS.cpp:#include <boost/algorithm/string.hpp>
roseExtensions/qtWidgets/util/LCS.h:#include <boost/smart_ptr.hpp>
roseSupport/SqlDatabase.h:#include <boost/enable_shared_from_this.hpp>
roseSupport/SqlDatabase.h:#include <boost/shared_ptr.hpp>
roseSupport/SqlDatabase.C:#include <boost/regex.hpp>
roseSupport/SqlDatabase.C:#include <boost/algorithm/string.hpp>
roseSupport/SqlDatabase.C:#include <boost/algorithm/string/regex.hpp>
ROSETTA/Grammar/Support.code:#include <boost/graph/adjacency_list.hpp>
ROSETTA/Grammar/Support.code:#include <boost/graph/kruskal_min_spanning_tree.hpp>
ROSETTA/Grammar/Node.code:#include <boost/unordered_map.hpp>
ROSETTA/Grammar/Node.code:#include <boost/unordered_set.hpp>
util/stringSupport/string_functions.cpp:#include <boost/foreach.hpp>
util/stringSupport/string_functions.cpp:#include <boost/lexical_cast.hpp>
util/stringSupport/FileNameClassifier.C:#include <boost/foreach.hpp>
util/stringSupport/FileNameClassifier.C:#include <boost/filesystem.hpp>
util/stringSupport/FileNameClassifier.C:#include <boost/version.hpp>
util/ParallelSort.h:#include <boost/thread.hpp>
util/commandlineProcessing/sla++.C: #include <boost/regex.h>
util/commandlineProcessing/commandline_processing.C:# include <boost/lexical_cast.hpp>
util/Map.h:#include <boost/optional.hpp>
Binary file util/support/.FileHelper.h.swp matches
util/support/FileHelper.h:#include <boost/filesystem.hpp>
util/sawyer/BitVector.h:#include <boost/cstdint.hpp>
util/sawyer/IntervalSet.h:#include <boost/integer_traits.hpp>
util/sawyer/IntervalSet.h:#include <boost/iterator/iterator_facade.hpp>
util/sawyer/Markup.C:#include <boost/foreach.hpp>
util/sawyer/Markup.C:#include <boost/lexical_cast.hpp>
util/sawyer/Stopwatch.C:#   include <boost/chrono/duration.hpp>
util/sawyer/Stopwatch.C:#   include <boost/chrono/system_clocks.hpp>
util/sawyer/IndexedList.h:#include <boost/range/iterator_range.hpp>
util/sawyer/GraphBoost.h:#include <boost/graph/graph_traits.hpp>
util/sawyer/GraphBoost.h:#include <boost/graph/properties.hpp>
util/sawyer/CommandLine.C:#include <boost/algorithm/string/case_conv.hpp>
util/sawyer/CommandLine.C:#include <boost/algorithm/string/join.hpp>
util/sawyer/CommandLine.C:#include <boost/algorithm/string/predicate.hpp>
util/sawyer/CommandLine.C:#include <boost/algorithm/string/regex.hpp>
util/sawyer/CommandLine.C:#include <boost/algorithm/string/trim.hpp>
util/sawyer/CommandLine.C:#include <boost/config.hpp>
util/sawyer/CommandLine.C:#include <boost/foreach.hpp>
util/sawyer/CommandLine.C:#include <boost/numeric/conversion/cast.hpp>
util/sawyer/CommandLine.C:#include <boost/regex.hpp>
util/sawyer/ProgressBar.C:#include <boost/numeric/conversion/cast.hpp>
util/sawyer/AllocatingBuffer.h:#include <boost/lexical_cast.hpp>
util/sawyer/AddressSegment.h:#include <boost/cstdint.hpp>
util/sawyer/MappedBuffer.h:#include <boost/iostreams/device/mapped_file.hpp>
util/sawyer/MappedBuffer.h:#include <boost/lexical_cast.hpp>
util/sawyer/IntervalMap.h:#include <boost/cstdint.hpp>
util/sawyer/Stopwatch.h:# include <boost/chrono/duration.hpp>
util/sawyer/Stopwatch.h:# include <boost/chrono/system_clocks.hpp>
util/sawyer/Graph.h:#include <boost/range/iterator_range.hpp>
util/sawyer/Message.C:#include <boost/algorithm/string/case_conv.hpp>
util/sawyer/Message.C:#include <boost/algorithm/string/classification.hpp>
util/sawyer/Message.C:#include <boost/algorithm/string/find.hpp>
util/sawyer/Message.C:#include <boost/algorithm/string/predicate.hpp>
util/sawyer/Message.C:#include <boost/config.hpp>
util/sawyer/Message.C:#include <boost/foreach.hpp>
util/sawyer/Message.C:#   include <boost/chrono.hpp>
util/sawyer/AddressMap.h:#include <boost/algorithm/string/predicate.hpp>
util/sawyer/AddressMap.h:#include <boost/cstdint.hpp>
util/sawyer/AddressMap.h:#include <boost/foreach.hpp>
util/sawyer/AddressMap.h:#include <boost/integer_traits.hpp>
util/sawyer/AddressMap.h:#include <boost/lexical_cast.hpp>
util/sawyer/DistinctList.h:#include <boost/foreach.hpp>
util/sawyer/Sawyer.h:#include <boost/cstdint.hpp>
util/sawyer/Sawyer.h://     BOOST_WINDOWS    The Windows API is present.  This is defined (or not) by including <boost/config.hpp>.
util/sawyer/Map.h:#include <boost/range/iterator_range.hpp>
util/sawyer/BitVectorSupport.h:#include <boost/cstdint.hpp>
util/sawyer/BitVectorSupport.h:#include <boost/lexical_cast.hpp>
util/sawyer/PoolAllocator.h:#include <boost/foreach.hpp>
util/sawyer/PoolAllocator.h:#include <boost/static_assert.hpp>
util/sawyer/PoolAllocator.h:#include <boost/cstdint.hpp>
util/sawyer/MarkupPod.C:#include <boost/foreach.hpp>
util/sawyer/Message.h:#include <boost/config.hpp>
util/sawyer/Message.h:#include <boost/logic/tribool.hpp>
util/sawyer/Interval.h:#include <boost/integer_traits.hpp>
util/sawyer/CommandLine.h:#include <boost/algorithm/string/case_conv.hpp>
util/sawyer/CommandLine.h:#include <boost/any.hpp>
util/sawyer/CommandLine.h:#include <boost/cstdint.hpp>
util/sawyer/CommandLine.h:#include <boost/foreach.hpp>
util/sawyer/CommandLine.h:#include <boost/lexical_cast.hpp>
util/sawyer/CommandLine.h:#include <boost/numeric/conversion/cast.hpp>
util/GraphUtility.h:#include <boost/cstdint.hpp>

iostreams

[编辑 | 编辑源代码]

boost::iostreams 目前仅在 ROSE 的二进制分析部分使用,并且仅用于其可移植的(Windows + Unix)内存映射实现。但是,默认的 boost 安装过程可能不会安装它,因为存在一些未满足的依赖项。

使用 iostreams 的代码

  • util/sawyer/MappedBuffer.h:#include <boost/iostreams/device/mapped_file.hpp>

找不到错误

[编辑 | 编辑源代码]

如果您看到有关缺少 iostreams 的错误,您可以

  • 选项 1:在没有二进制分析支持的情况下配置 ROSE,重新运行您刚刚使用的配置命令,但这次添加 "--enable-binary-analysis=no" 开关。这个库以后就不会再烦你了。
  • 选项 2:安装 iostreams:需要 libbz2 和 zlib 来安装,否则它将无法构建。
    • sudo apt-get install zlibc zlib1g zlib1g-dev libbz2-dev
    • 仍然在没有 bz2 和 zlib 的情况下安装了 iostreams:当您编译 boost 并且您的系统没有安装所有 boost 的先决条件时,您需要通过将 -sNO_BZIP2=1 -sNO_ZLIB=1 添加到 boost 的配置命令行来告诉它这一点。我认为 "-sNO_COMPRESSION=1" 也能起到作用。


更多信息

demo@ubuntu:~/rose-edg4x.git/src$ grep -r  wave.hpp *
frontend/SageIII/rose_attributes_list.C:#include <boost/wave.hpp>
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/wave.hpp>
frontend/SageIII/rose_attributes_list.h:      #include <boost/wave.hpp> // CH (4/7/2010): Put this header here to avoid compiling error about mismatch between definition and declaration
frontend/SageIII/attributeListMap.h:#include <boost/wave.hpp>

filesystem

[编辑 | 编辑源代码]

grep -r filesystem.hpp *

frontend/OpenFortranParser_SAGE_Connection/FortranModuleInfo.C:#include "boost/filesystem.hpp"
frontend/SageIII/attachPreprocessingInfo.C:#include <boost/filesystem.hpp>         // exsits()
frontend/SageIII/sage_support/sage_support.cpp:#include <boost/filesystem.hpp>
frontend/SageIII/sage_support/sage_support.h:#include "boost/filesystem.hpp"
frontend/BinaryLoader/BinaryLoaderElf.C:#include <boost/filesystem.hpp>
frontend/BinaryFormats/MemoryMap.C:#include <boost/filesystem.hpp>
midend/astSnippet/Snippet.C:#include <boost/filesystem.hpp>
midend/programTransformation/astOutlining/Outliner.cc:#include "boost/filesystem.hpp"
util/stringSupport/FileNameClassifier.C:#include <boost/filesystem.hpp>
Binary file util/support/.FileHelper.h.swp matches
util/support/FileHelper.h:#include <boost/filesystem.hpp>

示例用法 src/util/support/FileHelper.h

412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  16) #include <boost/filesystem.hpp>
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  17) 
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  18) #include <string>

没有名为 generic_string 的成员

[编辑 | 编辑源代码]

相关错误消息

In file included from ../../../../../rose-edg4x.git/src/frontend/SageIII/includeDirectivesProcessing/CompilerOutputParser.C:10:0:
../../../../../rose-edg4x.git/src/util/support/FileHelper.h: In static member function 'static std::string FileHelper::getFileName(const string&)':
../../../../../rose-edg4x.git/src/util/support/FileHelper.h:70:37: error: 'boost::filesystem2::basic_path<std::basic_string<char>, boost::filesystem2::path_traits>::string_type' has no member named 'generic_string'
         return boostPath.filename().generic_string();
                                     ^
../../../../../rose-edg4x.git/src/util/support/FileHelper.h: In static member function 'static std::string FileHelper::getRelativePath(const string&, const string&)':
../../../../../rose-edg4x.git/src/util/support/FileHelper.h:140:45: error: 'const class std::basic_string<char>' has no member named 'generic_string'
             relativePath += toPathIterator->generic_string(); //The first path element comes without the leading path delimiter
                                             ^
../../../../../rose-edg4x.git/src/util/support/FileHelper.h:155:65: error: 'const class std::basic_string<char>' has no member named 'generic_string'
                 relativePath += pathDelimiter + toPathIterator->generic_string();
                                                                 ^
In file included from /home/demo/opt/boost_1.45.0_inst/include/boost/system/system_error.hpp:14:0,
                 from /home/demo/opt/boost_1.45.0_inst/include/boost/filesystem/v2/path.hpp:21,
                 from /home/demo/opt/boost_1.45.0_inst/include/boost/filesystem.hpp:26,
                 from ../../../../../rose-edg4x.git/src/util/support/FileHelper.h:16,
                 from ../../../../../rose-edg4x.git/src/frontend/SageIII/includeDirectivesProcessing/CompilerOutputParser.C:10:


相关代码 src/util/support/FileHelper.h

// DQ (3/8/2014): Adding use of BACKEND_CXX_IS_INTEL_COMPILER to support Intel compiler for backend use.
// DQ (2/10/2014): I have fixed boost filesystem 3 issues so we now want to avoid specifying this explicitly if possible.
// Non-windows support should used boost filesystem 2 if using GNU version less than 4.7.
#ifndef _MSC_VER
// #if ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7))
#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
  #define BOOST_FILESYSTEM_VERSION 2
#endif
#else
// Windows support should be using boost file system 2 (for now).
  #define BOOST_FILESYSTEM_VERSION 2
#endif


412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  16) #include <boost/filesystem.hpp>
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  17) 
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  18) #include <string>
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  19) 
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  20) using namespace std;
412795ae (Stanislav Negara 2011-07-15 15:13:34 -0700  21) using namespace boost::filesystem;


#ifndef _MSC_VER
// DQ (3/8/2014): Adding use of BACKEND_CXX_IS_INTEL_COMPILER to support Intel compiler for backend use.
// #if ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7))
#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
         // DQ (2/10/2014): I think this is the older BOOST_FILESYSTEM_VERSION 2 specific code.
            relativePath += *toPathIterator; //The first path element comes without the leading path delimiter
#else
         // DQ (2/10/2014): I think this is the BOOST_FILESYSTEM_VERSION 3 fix.
            relativePath += toPathIterator->generic_string(); //The first path element comes without the leading path delimiter
#endif
#else
         // DQ (2/10/2014): I think this is the older BOOST_FILESYSTEM_VERSION 2 specific code.
            relativePath += *toPathIterator; //The first path element comes without the leading path delimiter
#endif

boost thread 1.45-1.47 无法使用 gcc 4.7 及更高版本安装。需要一些补丁。


使用 boost thread 的代码

[编辑 | 编辑源代码]

demo@ubuntu:~/rose-edg4x.git/src$ grep -r thread.hpp *

 midend/astDiagnostics/AstPerformance.C:#include <boost/thread.hpp>     // sleep()
 util/ParallelSort.h:#include <boost/thread.hpp>


xtime.hpp 错误 TIME_UTC

[编辑 | 编辑源代码]

来自 /home/demo/development/priv-rose-codethorn/src/frontend/SageIII/attachPreprocessingInfo.C:30

/home/demo/development/install/gcc-4.4.7/boost-1.45.0/include/boost/thread/xtime.hpp:23: 错误:在数字常量之前预期标识符

解决方法:在文件 boost/thread/xtime.hpp 中,适用于 THREAD 和 WAVE 的解决方法

仅取消定义 C11 宏:(以下 3 行是新添加的,后面是该文件中现有的问题枚举)

#ifdef TIME_UTC
#undef TIME_UTC
#endif

enum xtime_clock_types
{
    TIME_UTC=1
};

PS:您还会发现人们通过重命名变量来修复它。这会导致以后在某些库中出现错误。因此,我使用了上述解决方法。

针对 gcc 4.7 及更高版本自行禁用

[编辑 | 编辑源代码]

线程支持不可用:它已使用 BOOST_DISABLE_THREADS 显式禁用。

  • 我幸运地捕捉到了这条消息。它被埋藏在早期的屏幕输出过程中,并且很快消失。在屏幕输出停止时显示它会更有帮助!!

http://stackoverflow.com/questions/8297652/error-boost-disable-threads

GCC 不会“禁用”任何东西,Boost.Threads 1.47 无法在编译器中正确检测到线程支持,因为 Boost 依赖的未记录的实现细节发生了变化。这与实验版和发布版无关,所有 4.7 版本都会出现同样的问题。

要定义“threads”支持,

GCC <= 4.6 定义 _GLIBCXX__PTHREADS,而 GCC >= 4.7 定义 _GLIBCXX_HAS_GTHREADS。因此,为了使用比 4.6 更新的 GCC 编译旧的 Boost,您需要该票证中附带的 libstdcpp3.hpp.patch 补丁。另一个可能阻止 Boost 与现代编译器一起工作的问题是票证 6940(TIME_UTC 在 C11 中具有特殊含义,因此 Boost >= 1.50 使用 TIME_UTC_ 代替)。

针对 boost/config/stdlib/libstdcpp3.hpp 的补丁

33	33	 
34	34	#ifdef __GLIBCXX__ // gcc 3.4 and greater: 
35	35	#  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ 
36	 	        || defined(_GLIBCXX__PTHREADS) 
 	36	        || defined(_GLIBCXX__PTHREADS) \ 
 	37	        || defined(_GLIBCXX_HAS_GTHREADS) 
37	38	      // 
38	39	      // If the std lib has thread support turned on, then turn it on in Boost 
39	40	      // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT 
华夏公益教科书