??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产综合在线,亚洲国产婷婷,亚洲激情avhttp://www.shnenglu.com/skyscribe/category/11050.htmlzh-cnSun, 09 May 2010 17:01:21 GMTSun, 09 May 2010 17:01:21 GMT60GCC4.5的profile modehttp://www.shnenglu.com/skyscribe/archive/2010/05/09/GCC4_5ProfileMode.htmlskyscribeskyscribeSun, 09 May 2010 07:16:00 GMThttp://www.shnenglu.com/skyscribe/archive/2010/05/09/GCC4_5ProfileMode.htmlhttp://www.shnenglu.com/skyscribe/comments/114920.htmlhttp://www.shnenglu.com/skyscribe/archive/2010/05/09/GCC4_5ProfileMode.html#Feedback0http://www.shnenglu.com/skyscribe/comments/commentRss/114920.htmlhttp://www.shnenglu.com/skyscribe/services/trackbacks/114920.htmlq里Q,
q增加了一个新的profile模式Q尚处于试验阶段Q,可以ҎE序q行状态给出关于STL使用的一些优化徏议?br>
参看如下的描qͼ
  • An experimental profile mode has been added. This is an implementation of many C++ standard library constructs with an additional analysis layer that gives performance improvement advice based on recognition of suboptimal usage patterns. For example,

    #include <vector>
    int main()
    {
    std::vector<int> v;
    for (int k = 0; k < 1024; ++k)
    v.insert(v.begin(), k);
    }

    When instrumented via the profile mode, can return suggestions about the initial size and choice of the container used as follows:

    vector-to-list: improvement = 5: call stack = 0x804842c ...
    : advice = change std::vector to std::list
    vector-size: improvement = 3: call stack = 0x804842c ...
    : advice = change initial container size from 0 to 1024

    These constructs can be substituted for the normal libstdc++ constructs on a piecemeal basis, or all existing components can be transformed via the -D_GLIBCXX_PROFILE macro.

q个profile mode的主要作用就是根据代码实际运行状늻出关于STL的用优化徏议。有炚w憄是,该profileҎ是intrusive的,必须d-D_GLBCXX_PROFILE来重新编译所有的代码?br>
Profile mode的提出源?9qCGO的一?a >paperQ作者里边出C华h的名字(Ҏ拼音来判断);作者地址填的昄是Purdue大学的:
    Dept. of Comput. Sci., Purdue Univ., West?br>
GCC的Profiler对C++的支持一贯停留在和C同样的水qI׃C++模板机制和OO的存在得很多时候分析profilingl果的意义被大大削弱?br>q个针对STL的profile modeq是很值得期待的?br>



skyscribe 2010-05-09 15:16 发表评论
]]>
boost.cmake: 方便解决boost的升U问?/title><link>http://www.shnenglu.com/skyscribe/archive/2010/05/09/114919.html</link><dc:creator>skyscribe</dc:creator><author>skyscribe</author><pubDate>Sun, 09 May 2010 06:59:00 GMT</pubDate><guid>http://www.shnenglu.com/skyscribe/archive/2010/05/09/114919.html</guid><wfw:comment>http://www.shnenglu.com/skyscribe/comments/114919.html</wfw:comment><comments>http://www.shnenglu.com/skyscribe/archive/2010/05/09/114919.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/skyscribe/comments/commentRss/114919.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/skyscribe/services/trackbacks/114919.html</trackback:ping><description><![CDATA[以前常用boost的一些库Q由于项目自w用cmakel织build?br>boost每次升之后Q重新用bjam~译一ơ都很是不便Q某些^収ͼ用默认选项~译有些问题Q基本安装不成功Q?br><br>最q才发现boost的cmake版本已经独立出来了,对于使用cmake的用戯言Q这里是个不错的选择?br>目<a >主页</a>的文很是清晎ͼ最新的版本?.41 (版本号对应的基本是其upstream的boost版本??br>源代码是用gitl织的,对于Linux用户而言更加方便?br><br>引用其主上的一句话Q?br> <div style="margin-left: 40px;">Boost.<a class="reference external" >CMake</a> (or <a class="reference internal" ><em> alt.boost</em> </a>) is the boost distribution that all the cool kids are using. </div> <br>CMake + <a >GIT</a> +<a >Spinx</a> 实够酷了?br><br><span style="font-family: 微Y雅黑;">~译h可以充分利用强大的CMake了:</span><br> <div style="margin-left: 40px;"> <pre>git clone git://gitorious.org/boost/cmake.git src<br>cd src<br>git checkout <TAG>    //TAG==1.41.0.cmake0<br>mkdir bld<br>cd bld/<br>cmake ../<br></pre> </div> <pre>如果需要按需~译某些库,只需用make edit_cache修改cache卛_?br></pre> <div style="margin-left: 40px;"> </div><img src ="http://www.shnenglu.com/skyscribe/aggbug/114919.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/skyscribe/" target="_blank">skyscribe</a> 2010-05-09 14:59 <a href="http://www.shnenglu.com/skyscribe/archive/2010/05/09/114919.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CMake杂记http://www.shnenglu.com/skyscribe/archive/2009/07/04/89219.htmlskyscribeskyscribeSat, 04 Jul 2009 05:15:00 GMThttp://www.shnenglu.com/skyscribe/archive/2009/07/04/89219.htmlhttp://www.shnenglu.com/skyscribe/comments/89219.htmlhttp://www.shnenglu.com/skyscribe/archive/2009/07/04/89219.html#Feedback0http://www.shnenglu.com/skyscribe/comments/commentRss/89219.htmlhttp://www.shnenglu.com/skyscribe/services/trackbacks/89219.html
  • 1> 量使用外部build而不是内部build.
所谓的内外Q指的是make目录和CMakeLists.txt不在一个目录下?br>好处是,所有的临时文g都会生成在当前运行cmake/make的目录?br>譬如在项目根目录有一个CMakeLists.txt作ؓtop-level file, 几个代码子目录,一个build目录Q可以用Q?br>
cd build
cmake ..
make
此时中间文g不会污染目的目录结构?br>
  • 2> 可以用如下方式生成同名的静态库和动态库Q?/li>
set(libname "mylib")

add_library(libname_static STATIC src1 src2)
set_target_properties(libname_static OUTPUT_NAME ${libname})

add_library(libname SHARED src1 src2)
  • 3> 如何获取当前q行目录Qworking directoryQ?可以在根目录讄一个project_dir变量Q设|ؓ源代码目录,如下
set(project_top_dir ${CMAKE_CURRENT_SOURCE_DIR}/")

add_subdirectory(sub1)
add_subdirectory(sub2)
此时Q各个子目录中可以应用project_top_dir.
4> 处理跨^台的W三方库Q假讄三方库不是由CMake~译得来Q但要检依赖和变动Q则可以用imported属性:
add_library(ssllib SHARED IMPORTED)
add_library(cryptolib SHARED IMPORTED)
#May have different dependent libraries
set(libsuffix ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
set_target_properties(ssllib PROPERTIES IMPORTED_LOCATION 
"${project_top_dir}contrib/openssl/lib/libssl-${libsuffix}.so")
set_target_properties(cryptolib PROPERTIES IMPORTED_LOCATION 
"${project_top_dir}contrib/openssl/lib/libcrypto-${libsuffix}.so")


........................
#other CMakeLists.txt
add_executable(myExe src1 src2)
target_link_libraries(myExe ssllib cryptolib)


skyscribe 2009-07-04 13:15 发表评论
]]>
利用cmake来搭建开发环?/title><link>http://www.shnenglu.com/skyscribe/archive/2009/07/01/89026.html</link><dc:creator>skyscribe</dc:creator><author>skyscribe</author><pubDate>Wed, 01 Jul 2009 13:51:00 GMT</pubDate><guid>http://www.shnenglu.com/skyscribe/archive/2009/07/01/89026.html</guid><wfw:comment>http://www.shnenglu.com/skyscribe/comments/89026.html</wfw:comment><comments>http://www.shnenglu.com/skyscribe/archive/2009/07/01/89026.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/skyscribe/comments/commentRss/89026.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/skyscribe/services/trackbacks/89026.html</trackback:ping><description><![CDATA[对于l常在终端下写程序的non-windowsE序员,Makefilel对是最常用的工P到一个文件的单的试E序Q大到数百个文g的商业YӞ只需要有shellQ一个make命o可得到可运行的E序QMakefilel对功不可没Q可惜世界中不是那么太^Q不但各个Posixpȝ的API千差万别Q硬件^台各异,pMakefile本n也有多个不兼容的格式Q譬如GNU Makefile 拿到Solarisq_上就没法make下去Q除非你有gmakeQ但gmake对ƈ行编译的支持没有solaris自带的dmake要好了?br><br>GNU autotools提供了一个不错的选择Q可以做到组l工具链来生成所需的MakefileQ但~陷是学习v来比较麻烦,而且模版文g写v来比较费劌Ӏ老实说我跟Makefile打了q?q的交道Q几乎没有自己写qautomake脚本Q相反的工作倒是q了不少Q譬如分析生成的Makefileq行q程Q然后模拟自己手写MakefileQ得C个轻爽的定制环境?br><br>除了autotoolsQ其实也有不其他的工具Q譬如apache的antQ基于Python的sconsQant在java界是鼎鼎大名了,可惜对c++的支持确实让我感觉很不习惯;sconsL可以嵌入Python代码Q用h也算单,但是惛_现复杂的功能很头疼了,而且q行速度让h挠头?br><br>cmake则I补了上述几个工具的诸多缺P<br>1> 易于学习Q文档易懂,只需牢记以下两个命o卛_Q?br> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">cmake </span><span style="color: #000000;">--</span><span style="color: #000000;">help<br>cmake </span><span style="color: #000000;">--</span><span style="color: #000000;">help</span><span style="color: #000000;">-</span><span style="color: #000000;">command</span><span style="color: #000000;">-</span><span style="color: #000000;">list<br>cmake </span><span style="color: #000000;">--</span><span style="color: #000000;">help</span><span style="color: #000000;">-</span><span style="color: #000000;">command xxx<br>cmake </span><span style="color: #000000;">--</span><span style="color: #000000;">help</span><span style="color: #000000;">-</span><span style="color: #000000;">variable</span><span style="color: #000000;">-</span><span style="color: #000000;">list<br>cmake </span><span style="color: #000000;">--</span><span style="color: #000000;">help</span><span style="color: #000000;">-</span><span style="color: #000000;">variable yyy</span></div> 2> 以文本文件组l,利用cache的方式,所有的自定义cache变量可直接用vim查看?br>3> 生成的Makefile文gz易?br>4> ~译器选项可自己在ccmake中编辑,利于交叉~译<br>5> 支持集成ctest/cpack,前者可以方便的做单元测试,后者则可以打包生成tgz/rpm<br>6> 支持多个生成器,可以生成eclipse/codeblocks/gmake/unix make文gQ甚臛_以生成VC各个版本的dsw/sln.<br>7> 内嵌语言Q可以自己写函数、宏{?br><br>对于l常写小试E序的h来说Q在test目录下加上个CMakeLists.txtQ里边加上几行简单的语句可以方便的以后重复使用了。对于这U情况,手工写的Makefile到依赖这U麻烦的事情往往力不从心Qautomake又太题大作Q而cmake则恰到好处了?br><br>对于大型E序Qcmake可以自己定制生成的中间文件和目标文g路径Q有效避免了automake带来的每个目录下生成一大堆文g的弊端,也不需要手工写Makefile?br>最有用的是可以生成多个知名IDE的工E文Ӟ包括Windows下的vc6-vc9.<br><br><img src ="http://www.shnenglu.com/skyscribe/aggbug/89026.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/skyscribe/" target="_blank">skyscribe</a> 2009-07-01 21:51 <a href="http://www.shnenglu.com/skyscribe/archive/2009/07/01/89026.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.qcqxzx.cn" target="_blank">ƷþþþĻһ</a>| <a href="http://www.jianfusi.cn" target="_blank">ŷҹAŴƬþ </a>| <a href="http://www.qq-info.cn" target="_blank">91Ƶ91þþ</a>| <a href="http://www.iview-inc.com.cn" target="_blank">þ޹Ʒ</a>| <a href="http://www.aylzys.cn" target="_blank">þeֻйľƷ99 </a>| <a href="http://www.eu0i.cn" target="_blank">þֻоƷ4</a>| <a href="http://www.wucaitianyuan.cn" target="_blank">99þþƷһ</a>| <a href="http://www.zzrich.cn" target="_blank">޾ҹþþþþ</a>| <a href="http://www.heizhuai.cn" target="_blank">þþɫۺϾɫ99</a>| <a href="http://www.lenticular3d.cn" target="_blank">91鶹Ʒ91þþ</a>| <a href="http://www.163sms.cn" target="_blank">ݺݺɫۺϾþ</a>| <a href="http://www.daodaoo.cn" target="_blank">ƷŮͬһþ</a>| <a href="http://www.wsnb.com.cn" target="_blank">ŷþþþþҹƷ</a>| <a href="http://www.qcb8.cn" target="_blank">þ˽˹Ʒ</a>| <a href="http://www.pz897.cn" target="_blank">һŷƬþ</a>| <a href="http://www.cqxuexi.cn" target="_blank">ƷӰӾþۺ</a>| <a href="http://www.uygp.cn" target="_blank">þþþþùƷ </a>| <a href="http://www.10000qt.cn" target="_blank">97þó˾Ʒվ</a>| <a href="http://www.goldquote.cn" target="_blank">ƷŮþþAV</a>| <a href="http://www.tphv.cn" target="_blank">ŷ˾þۺһ</a>| <a href="http://www.51uhq.cn" target="_blank">þþþþžžƷӰԺ</a>| <a href="http://www.lawyer010.cn" target="_blank">Ʒþþþþþ</a>| <a href="http://www.xsq1.cn" target="_blank">91Ʒþþþþ</a>| <a href="http://www.t8s.com.cn" target="_blank">Ʒþ777</a>| <a href="http://www.uhpd.cn" target="_blank">þþþ?V</a>| <a href="http://www.jiletu.cn" target="_blank">re99þþƷ99</a>| <a href="http://www.cpp521.cn" target="_blank">ɫۺϾþþþۺһ</a>| <a href="http://www.mashar.cn" target="_blank">þwww˳ɿƬ</a>| <a href="http://www.zzcjw.cn" target="_blank">˾þۺϾƷAVר </a>| <a href="http://www.nbhaishun.cn" target="_blank">97þþƷһ</a>| <a href="http://www.bqtao.cn" target="_blank">ƷþþþӰ</a>| <a href="http://www.chuikua.cn" target="_blank">Avþ </a>| <a href="http://www.bettertrade.cn" target="_blank">þþþƷѹĻ</a>| <a href="http://www.iscrip.cn" target="_blank">þþþƷ2019ѹۿ</a>| <a href="http://www.yk999.cn" target="_blank">Ʒþþþaaaa</a>| <a href="http://www.lzcoxag.cn" target="_blank">þþƷӰԺ</a>| <a href="http://www.ads9.cn" target="_blank">պ뾫Ʒþһ </a>| <a href="http://www.wordboy.cn" target="_blank">þþž޾Ʒ</a>| <a href="http://www.movie38.cn" target="_blank">þһѲ</a>| <a href="http://www.fzbn.net.cn" target="_blank">Ʒþþþþ</a>| <a href="http://www.nmgr.net.cn" target="_blank">ԭۺϾþô˾Ʒ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>