跳轉到內容

ROSE 編譯器框架/boost

來自華夏公益教科書

在 ROSE 中使用 Boost 的影響

[編輯 | 編輯原始碼]

在 ROSE 中當前使用 Boost 的方式對我們來說愛恨交加。一些開發者使用 Boost 來簡化他們的工作,但代價是

  • 對所有其他開發者(包括那些根本不使用 Boost 的開發者)來說,這是一個強制性的外部依賴項,並且
  • 存在移植性和維護問題(GCC 版本支援有限的大部分原因是 Boost 庫)。

本頁嘗試記錄 ROSE 使用的 Boost 庫。希望我們可以弄清楚為什麼我們必須擁有它們中的每一個,以及是否可以將一些庫設為可選(對於那些對庫支援的功能不感興趣的使用者來說不是必需的)。


為了清楚起見,我們感謝開源 Boost 社群提供免費且優秀的庫。問題是我們如何才能更好地在 ROSE 中使用 Boost,從而在生產力、可移植性和可維護性之間取得良好的平衡。

行動專案

[編輯 | 編輯原始碼]

將一些使用較少的庫設為可選

  • thread
  • iostream
  • wave

當前依賴庫

[編輯 | 編輯原始碼]

http://www.boost.org/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 
華夏公益教科書