<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3136325786002442223</id><updated>2012-01-21T10:22:38.468-03:00</updated><category term='GPU'/><category term='Complexity'/><category term='installation'/><category term='documentation'/><category term='news'/><category term='books'/><category term='C'/><category term='BGL'/><category term='upgrade'/><category term='latest versio'/><category term='Rcpp'/><category term='advanced programming'/><category term='ESS'/><category term='Doxygen'/><category term='Sweave'/><category term='linear algebra'/><category term='tips'/><category term='classes'/><category term='useful links'/><category term='S4'/><category term='basics'/><category term='Neural Networks'/><category term='Bibliography'/><category term='numerical integration'/><category term='packages'/><category term='LAPACK'/><category term='dendrograms'/><category term='web tools'/><category term='Complex Systems'/><category term='Extensions'/><category term='LGL'/><category term='Forums'/><category term='ideas'/><category term='logbook'/><category term='mailing-lists'/><category term='igraph'/><category term='Fortran'/><category term='Learning'/><category term='pseudorandom'/><category term='STL'/><category term='property map'/><category term='concepts'/><category term='Eclipse'/><category term='Boost C++ Library'/><category term='OOP'/><category term='Roxygen'/><category term='Emacs'/><category term='methods'/><category term='ubuntu'/><category term='examples'/><category term='Armadillo'/><category term='cluster analysis'/><category term='inline'/><category term='work-in'/><category term='debugging'/><category term='syntactic sugar'/><category term='Eigen'/><category term='graph'/><category term='Clustering Coefficient'/><category term='IDE'/><category term='buying'/><category term='Tutorials'/><category term='Libraries'/><category term='high performance computing'/><category term='GUI'/><category term='codelite'/><category term='C++'/><category term='setting-up'/><category term='xmgrace'/><category term='system manteinance'/><category term='Resources'/><category term='CUDA'/><category term='programming languages'/><category term='J.P.Crutchfield'/><category term='hardware'/><category term='generic programming'/><category term='repositories'/><category term='tricks'/><category term='advanced programming Algorithms'/><category term='random'/><category term='CRAN Task Views'/><category term='RBGL'/><category term='S3'/><category term='Algorithms'/><category term='utils'/><category term='databases'/><category term='experiences'/><category term='data structures'/><category term='netbook'/><category term='CULA'/><category term='StatET'/><category term='bandurria'/><category term='computational resources'/><category term='Complex Networks'/><category term='Rcpp modules'/><category term='Analysis'/><category term='R'/><title type='text'>delirios de rayohauno</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default?start-index=101&amp;max-results=100'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>111</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-1324535205884719236</id><published>2011-05-22T16:51:00.009-03:00</published><updated>2011-05-22T22:44:46.187-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CUDA'/><category scheme='http://www.blogger.com/atom/ns#' term='Eigen'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='LAPACK'/><category scheme='http://www.blogger.com/atom/ns#' term='linear algebra'/><category scheme='http://www.blogger.com/atom/ns#' term='CULA'/><category scheme='http://www.blogger.com/atom/ns#' term='Armadillo'/><title type='text'>Linear Algebra Libraries - n.2</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/search/label/linear%20algebra"&gt;previous post&lt;/a&gt; I discuss some some options about linear algebra libraries. Especifically I'm looking for a tool to eigenvalue (and maybe eigenvectors) calculation. In the previous post I have mentioned &lt;a href="http://eigen.tuxfamily.org/index.php?title=Main_Page"&gt;Eigen&lt;/a&gt; which is a (free) C++ template library so is easily to "install" (just copy the files somewhere) and use (just include the headers). With Eigen you can calculate eigenvalues (and eigenvectors), and is very easily (intuitive) to use. So Eigen is very appropriate for prototyping some program that requires linear algebra tools at some point. The people that develop Eigen says that Eigen is very fast (in some cases even fastest that other non template libraries). But I think (I have not tested it yet) that Eigen may be fast in basic linear algebra operations. In the case of eigenvalue problems it gives to me the sensation that is slow. So I'm looking for an alternative to it, and found about &lt;a href="http://www.culatools.com/"&gt;CULA&lt;/a&gt;, which basically is an implementation of &lt;a href="http://www.netlib.org/lapack/"&gt;LAPACK&lt;/a&gt; for GPGPU (graphic cards accelerators) &lt;/br&gt;.&lt;/br&gt;I'm just very new about this. I have several questions. &lt;/br&gt;&lt;/br&gt;1) In my laptop I think that I do not have a GPGPU card. So: ¿I will need to work directly with the machines of the cluster where I work (machines that have a GPGPU card on it)? ¿Are there some kind of GPGPU simulator?2) ¿What need to be installed and how do you install it in order to start doing some trials with CULA?3) ¿Does CUDA need to be installed also?&lt;/br&gt;In order to answer this questions, in the getting started section of the CULA home page one can find some relevant info. It seems that CUDA need to be installed, and also a (nvidia) GPGPU card is needed. &lt;/br&gt;&lt;/br&gt;I think that, as CULA is a GPGPU implementation of LAPACK, maybe I can use LAPACK on my program in the laptop, and then, with relative ease adapt the code to run CULA. So, maybe, starting a try with LAPACK will be useful in the first place. Also playing with LAPACK will give to me an idea of the performance of Eigen.&lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.cplusplus.com/forum/articles/14441/"&gt;Here&lt;/a&gt; I found that it seems not so much directly to use LAPACK from a C++ code. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00032.html"&gt;Here&lt;/a&gt; another example of using LAPACK from C++ code. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://matrixprogramming.com/2011/04/using-lapack-from-c"&gt;Here&lt;/a&gt; another example of using LAPACK from C++. I like the style of this blog. &lt;/br&gt;&lt;/br&gt;So, it seems that deal with LAPACK is a "crap". But I remember that &lt;a href="http://arma.sourceforge.net/"&gt;Armadillo&lt;/a&gt; may be a convenient way of using LAPACK from C++ (but it will not serve to the purpose of learning LAPACK in order to after learn CULA). Note that Armadillo not necesarilty requires LAPACK and some BLAS library. But Armadillo can be linked to LAPACK (and some BLAS library) in order to achieve better performance and bigger functionality. &lt;/br&gt;&lt;/br&gt;The latest version of LAPACK is 3.3.1, but my ubuntu comes with version 3.2.1 previously installed, so I will try first without installing the latest version of LAPACK. On the other hand, for the BLAS support, my ubuntu hasn't got installed ATLAS. F...k, &lt;a href="http://math-atlas.sourceforge.net/atlas_install/atlas_install.html#SECTION00030000000000000000"&gt;here&lt;/a&gt; says that the installation process of ATLAS is a f...ng crap. It says that it may take several hours.&lt;/br&gt;&lt;/br&gt;TODO ... finish this. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-1324535205884719236?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/1324535205884719236/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=1324535205884719236' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1324535205884719236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1324535205884719236'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/05/linear-algebra-libraries-n2.html' title='Linear Algebra Libraries - n.2'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7057767857600135375</id><published>2011-04-21T13:58:00.004-03:00</published><updated>2011-04-21T18:57:53.824-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='property map'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><title type='text'>Learning - BGL and property map</title><content type='html'>So, when reading about BGL I found difficult to grasp the idea behind property maps. Luckily, in &lt;a href="http://www.mail-archive.com/boost@lists.boost.org/msg00188.html"&gt;this post&lt;/a&gt; there is a nice series of questions and answers that helps to clarify the matter. &lt;/br&gt;&lt;/br&gt;Here, &lt;a href="http://stackoverflow.com/questions/671714/modifying-vertex-properties-in-a-boostgraph"&gt;another post&lt;/a&gt; that shows some simple examples about property map's on graphs. &lt;/br&gt;&lt;/br&gt;In &lt;a href="http://stackoverflow.com/questions/1362689/boost-bgl-reducing-memory-requirements-for-adjacency-list"&gt;this post&lt;/a&gt;, it is discussed about a compressed graph representation for static graphs. &lt;a href="http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/compressed_sparse_row.html"&gt;Here&lt;/a&gt; the corresponding link to the BGL home page. &lt;/br&gt;&lt;/br&gt;Salut !&lt;/br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7057767857600135375?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7057767857600135375/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7057767857600135375' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7057767857600135375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7057767857600135375'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/04/learning-bgl-and-property-map.html' title='Learning - BGL and property map'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8892737661002767065</id><published>2011-04-14T21:22:00.003-03:00</published><updated>2011-04-14T22:31:08.728-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='R'/><category scheme='http://www.blogger.com/atom/ns#' term='dendrograms'/><title type='text'>R statistics - Dendrograms in R</title><content type='html'>The idea here, is to explore how to plot dendrograms using R. &lt;/br&gt;&lt;/br&gt;For the moment I just will put a list of links: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=79"&gt;http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=79&lt;/a&gt; &lt;/br&gt;&lt;a href="http://rwiki.sciviews.org/doku.php?id=rdoc:stats:dendrogram"&gt;http://rwiki.sciviews.org/doku.php?id=rdoc:stats:dendrogram&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Keywords : &lt;/br&gt;&lt;/br&gt;dendrogram &lt;/br&gt;heatmap &lt;/br&gt;hclust &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8892737661002767065?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8892737661002767065/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8892737661002767065' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8892737661002767065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8892737661002767065'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/04/r-statistics-dendrograms-in-r.html' title='R statistics - Dendrograms in R'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6739328112500770024</id><published>2011-04-06T11:14:00.000-03:00</published><updated>2011-04-06T11:14:49.314-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='buying'/><category scheme='http://www.blogger.com/atom/ns#' term='netbook'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Buying a netbook 2011</title><content type='html'>So, I'm planning to buy a netbook. &lt;/br&gt;&lt;/br&gt;I had an offer in a local store that ask for $2285 for a BGH MT10. In mercadolibrethere is an offer about $2199 (se &lt;a href="http://articulo.mercadolibre.com.ar/MLA-108941120-netbook-bgh-mt-10dc-2gb-disco-250-10-led-envio-gratis-e-nova-_JM"&gt;here&lt;/a&gt;). It seems a nicemachine. &lt;/br&gt;&lt;/br&gt;Also, &lt;a href="http://www.cpubenchmark.net/low_end_cpus.html"&gt;here&lt;/a&gt; one can see that it has a relatively nice processor (for being a netbook). &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6739328112500770024?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6739328112500770024/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6739328112500770024' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6739328112500770024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6739328112500770024'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/04/buying-netbook-2011.html' title='Buying a netbook 2011'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8712508125583522190</id><published>2011-03-27T18:04:00.004-03:00</published><updated>2011-05-27T08:42:03.593-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Complex Systems'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='Complexity'/><title type='text'>Resources - Complex Systems</title><content type='html'>Here a list of resources about Complex Systems and Complexity. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;: Institutions, Organizations&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.complexitynet.eu/Pages/default.aspx"&gt;:: Complexity-NET&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.york.ac.uk/res/yccsa/"&gt;York Centre for Complex Systems Analysis&lt;/a&gt; &lt;/br&gt;&lt;a href="http://bccs.bristol.ac.uk/"&gt;Bristol Centre for Complexity Sciences&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.icss.soton.ac.uk/"&gt;Institute of complex system symulation (ICSS)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www2.warwick.ac.uk/fac/cross_fac/comcom/dtcsite/"&gt;Warwick Complexity Science Doctoral Training Center&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.santafe.edu/"&gt;Santa Fe Institute&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.cscs.umich.edu/"&gt;Center for the study of complex systems&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.brookings.edu/dynamics.aspx"&gt;Brooking Center on Social Dynamics and Policy&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.northwestern.edu/nico/"&gt;Northwestern University on Complex System&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.nwo.nl/nwohome.nsf/pages/NWOA_7BUJ6J"&gt;Nederlantse Organizatie voor Wetenschappelijk Onderzoek&lt;/a&gt; &lt;/br&gt;&lt;a href="http://ifisc.uib-csic.es/"&gt;IFISC (españa)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://rnsc.fr/tiki-index.php"&gt;Reseau National des Systemes Complexes (Francia)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.acefinmod.com/"&gt;Agent Based Computational Economics  and Financial Modelling (Essex University)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www3.imperial.ac.uk/complexityandnetworks"&gt;Complexity and Networks Group (Imperial College, London)&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;: Blogs&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://nirmukta.com/2009/08/18/complexity-explained-1-what-is-complexity/"&gt;:: Nirkmukta (Promoting Science and Free Thought in India) - COMPLEXITY EXPLAINED&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;: Books&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.2think.org/cosmicevolution.shtml"&gt;:: Cosmic Evolution: The Rise of Complexity in Nature - Eric J. Chaisson&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8712508125583522190?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8712508125583522190/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8712508125583522190' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8712508125583522190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8712508125583522190'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/resources-complex-systems.html' title='Resources - Complex Systems'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-9073630361633278409</id><published>2011-03-20T02:04:00.001-03:00</published><updated>2011-03-20T12:40:11.189-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='Neural Networks'/><title type='text'>Neural Networks - Resources</title><content type='html'>So, as maybe neural networks will be one of the topics in which I will work in, I use this post to collect resources about neural networks. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;sources of answers to FAQs about NN&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://vision.eng.shu.ac.uk/neural/FAQ/FAQ.html#questions"&gt;monthly posting to the Usenet newsgroup comp.ai.neural-nets&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;databases&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.face-rec.org/"&gt;Face Recognition Home Page&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-9073630361633278409?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/9073630361633278409/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=9073630361633278409' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/9073630361633278409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/9073630361633278409'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/neural-networks-resources.html' title='Neural Networks - Resources'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-1639488895726050927</id><published>2011-03-18T18:23:00.002-03:00</published><updated>2011-03-18T20:09:12.838-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='numerical integration'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Numerical integration methods of ODEs - n.1</title><content type='html'>So, in this post, I will collect information about methods for numerical integration of ODEs (ordinary differential equations). &lt;/br&gt;&lt;/br&gt;For the moment, I'm not looking for something very precise, but it is preferred some method that can deals with &lt;a href="http://en.wikipedia.org/wiki/Numerical_ordinary_differential_equations#Stability_and_stiffness"&gt;stability and stiff problems&lt;/a&gt;.&lt;/br&gt;&lt;b&gt;A list of links:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.damtp.cam.ac.uk/lab/people/sd/lectures/nummeth98/odes.htm"&gt;First order ordinary differential equations&lt;/a&gt; &lt;/br&gt;&lt;a href="http://eprints.ecs.soton.ac.uk/12148/"&gt;QUAM- A novel algorithm for the numerical integration of stiff ordinary differential equations&lt;/a&gt; (In this "paper" there is a definition of stiffness) &lt;/br&gt;&lt;/br&gt;&lt;b&gt;What is stability and stiffness?&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;: Stiffness &lt;/br&gt;&lt;/br&gt;A problem is &lt;i&gt;stiff&lt;/i&gt; if its &lt;i&gt;jacobian matrix&lt;/i&gt; has at least one eigenvalue with a large magnitude and a wide spread of eigenvalue magnitudes. (source &lt;a href="http://eprints.ecs.soton.ac.uk/12148/"&gt;here&lt;/a&gt;) &lt;/br&gt;&lt;/br&gt;: Stability &lt;/br&gt;&lt;/br&gt;TODO ... &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-1639488895726050927?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/1639488895726050927/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=1639488895726050927' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1639488895726050927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1639488895726050927'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/numerical-integration-methods-of-odes.html' title='Numerical integration methods of ODEs - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-5695306280345897618</id><published>2011-03-10T22:26:00.001-03:00</published><updated>2011-03-10T23:29:21.263-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='web tools'/><title type='text'>Resources on web tools</title><content type='html'>This post is dedicated to list web tools. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.joomla.org/"&gt;Joomla&lt;/a&gt; (see &lt;a href="http://en.wikipedia.org/wiki/Joomla"&gt;here&lt;/a&gt;) &lt;/br&gt;&lt;a href="http://www.dropbox.com/"&gt;dropbox&lt;/a&gt; (see &lt;a href="http://en.wikipedia.org/wiki/Dropbox_(service)"&gt;here&lt;/a&gt;) &lt;/br&gt;&lt;a href="http://www.4shared.com/"&gt;4share&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.zotero.org/"&gt;zotero&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;TODO ... classify the content of this post. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-5695306280345897618?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/5695306280345897618/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=5695306280345897618' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5695306280345897618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5695306280345897618'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/resources-on-web-tools.html' title='Resources on web tools'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3014226701541625913</id><published>2011-03-06T21:22:00.010-03:00</published><updated>2011-03-14T08:58:23.659-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='high performance computing'/><category scheme='http://www.blogger.com/atom/ns#' term='linear algebra'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Linear algebra libraries - C++</title><content type='html'>So, in this post, the idea is to write a little about linear algebra libraries, and the possibility of use them in C++. In &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/algorithms-data-structures.html"&gt;this post&lt;/a&gt; I pick an important number of "names" related to linear algebra libraries (I need to improve the list with &lt;a href="http://gpgpu.org/"&gt;GPGPU&lt;/a&gt; possibilities). &lt;/br&gt;&lt;/br&gt;So, the "root" seems to be &lt;a href="http://en.wikipedia.org/wiki/LAPACK"&gt;LAPACK&lt;/a&gt; (Linear Algebra PACKage) and &lt;a href="http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms"&gt;BLAS&lt;/a&gt; (Basic Linear Algebra Subprograms). In fact, LAPACK is the successor of the combination of &lt;a href="http://en.wikipedia.org/wiki/LINPACK"&gt;LINPACK&lt;/a&gt; (linear equations, least-squares, etc...) and &lt;a href="http://en.wikipedia.org/wiki/EISPACK"&gt;EISPACK&lt;/a&gt; (eigenvalues, eigenvectors, etc ...). LAPACK depends on (make uses of) BLAS in order to effectively exploit the caches on modern cache-based architectures. &lt;/br&gt;&lt;/br&gt;BLAS can be used by itself as a way of doing basic linear matrix operations (like matrix multiplication). In fact, there are several highly optimized implementations of the BLAS interface have been developed by hardware vendors such as Intel (see &lt;a href="http://en.wikipedia.org/wiki/Math_Kernel_Library"&gt;here&lt;/a&gt;) and AMD (see &lt;a href="http://en.wikipedia.org/wiki/AMD_Core_Math_Library"&gt;here&lt;/a&gt;), as well as by other authors, e.g. Goto BLAS and &lt;a href="http://math-atlas.sourceforge.net/"&gt;ATLAS&lt;/a&gt; (I'm a little bit confused here, because it seems that this options provides more than BLAS, for example, ATLAS provides some LAPACK functions, etc.). &lt;/br&gt;&lt;/br&gt;LAPACK is originally written in &lt;a href="http://en.wikipedia.org/wiki/Fortran"&gt;FORTRAN 77&lt;/a&gt; (and now is also written in FORTRAN 90). As is stated in the Wiki (&lt;a href="http://en.wikipedia.org/wiki/LAPACK"&gt;LAPACK&lt;/a&gt;), there are some options that allows the usage of LAPACK from &lt;a href="http://en.wikipedia.org/wiki/C%2B%2B"&gt;C++&lt;/a&gt;. Probably the main options are: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://en.wikipedia.org/wiki/LAPACK%2B%2B"&gt;LAPACK++&lt;/a&gt; &lt;/br&gt;&lt;a href="http://en.wikipedia.org/wiki/Armadillo_(C%2B%2B_library)"&gt;Armadillo (C++ Library)&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;(I pick the following info from LAPACK++ on facebook) LAPACK++ seems to be the official way, but Armadillo seems to be newer. The original LAPACK++ (up to v1.1a) was written by R. Pozo et al. at the University of Tennessee and Oak Ridge National Laboratory. In 2000, R. Pozo et al. left the project, with the projects' web page stating LAPACK++ would be superseded by the Template Numerical Toolkit (&lt;a href="http://math.nist.gov/tnt/history.html"&gt;TNT&lt;/a&gt;). The current LAPACK++ (versions 1.9 onwards) started off as a fork from the original LAPACK++. There are extensive fixes and changes, such as more wrapper functions for LAPACK and BLAS routines. &lt;/br&gt;&lt;/br&gt;So, I don't know which is the official (LAPACK++ or TNT). &lt;a href="http://lapackpp.sourceforge.net/"&gt;Here&lt;/a&gt; (in the new official page of LAPACK++)is said that the project TNT never really took off. &lt;/br&gt;&lt;/br&gt;There still remains to know if Armadillo is best option than LAPACK++ or not. Due to its approach, Armadillo is related to the uBLAS library, but has a more accessible syntax. Furthermore, as Armadillo has an efficient wrapper of ATLAS and LAPACK functions, it provides machine-dependent optimisations and functionality not present in uBLAS (a template implementation of BLAS in the Boost C++ Library). &lt;/br&gt;&lt;/br&gt;Also, there is an important option not mentioned yet. This is &lt;a href="http://eigen.tuxfamily.org/index.php?title=Main_Page"&gt;Eigen&lt;/a&gt;, which is a template library so there is not need of installation (just copy the headers in some path and include them in your C++ code). TNT is also a template library. The template libraries frequently are slower than the precompiled (¿?) implementations, but Eigen seems to be very fast (See &lt;a href="http://eigen.tuxfamily.org/index.php?title=Benchmark"&gt;here&lt;/a&gt; for a comparison benchmark. Just Hessenber (the one that I used to calculate eigenvalues) seems to be a bit slow). Also &lt;a href="http://stackoverflow.com/questions/1067821/ublas-vs-matrix-template-library-mtl4"&gt;here&lt;/a&gt; says that Eigen is fast for basics matrix operations but slower (than for example uding ATLAS) when more complex operations (for example LU decomposition) are required. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.osl.iu.edu/research/mtl/"&gt;MTL&lt;/a&gt; is also a template library, but (as stated &lt;a href="http://osdir.com/ml/lib.mtl.devel/2003-01/msg00003.html"&gt;here&lt;/a&gt;) this does not support (directly) the calculation of eigenvalues. MTL is a kind of (better ¿?) uBLAS. &lt;/br&gt;&lt;/br&gt;In the end, I must say that Eigen seems to be a nice option (it is a template library, so I only need to copy the headers), but Armadillo is a good option too (but I have to install it) because it relies on LAPACK which is extensively tested and developed, so there are a lot of available functionalities. I think I will try first (if I need it) with Eigen, and then with Armadillo. Maybe &lt;a href="http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2010/02/msg00132.html"&gt;this post&lt;/a&gt; could be useful.&lt;/br&gt;&lt;/br&gt;I ask myself which one (Eigen or Armadillo) is best suited to the Boost Graph Library (conversion of matrix to graph and vice-versa). Note also that Armadillo is available on &lt;a href="http://www.r-project.org/"&gt;R&lt;/a&gt; (see &lt;a href="http://cran.r-project.org/web/packages/RcppArmadillo/index.html"&gt;here&lt;/a&gt;).&lt;/br&gt;&lt;/br&gt;&lt;a href="http://software.intel.com/sites/products/documentation/hpc/mkl/webhelp/lse/lse_crnsep.html"&gt;Here&lt;/a&gt; you can read about how you can solve eigenvalues problems with LAPACK. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3014226701541625913?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3014226701541625913/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3014226701541625913' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3014226701541625913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3014226701541625913'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/linear-algebra-libraries-c.html' title='Linear algebra libraries - C++'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-1196426827991701895</id><published>2011-03-01T14:34:00.016-03:00</published><updated>2011-03-08T16:55:53.364-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Clustering Coefficient'/><category scheme='http://www.blogger.com/atom/ns#' term='Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Analysis - Clustering Coefficient calculation on BGL - n.3</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/03/analysis-clustering-coefficient.html"&gt;previous post&lt;/a&gt; I implement the calculation of the clustering coefficient in a C++ program that uses the &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;BGL&lt;/a&gt;. This implementation uses the functions provided in &lt;b&gt;boost/graph/&lt;/b&gt;&lt;i&gt;clustering_coefficient.hpp&lt;/i&gt;. In this post, I will implement an algorithm proposed (by me, but surely I'm not its inventor) in this other &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/analysis-clustering-coefficient_28.html"&gt;previous post&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;So, before the implementation of the code I need to discuss some things. Notice that the algorithm requires that each edge carries a flag that states if it was already visited or not. So part of the problem is how to implement this flags using boost. &lt;/br&gt;&lt;/br&gt;So, how to implement that each visited edge carry a flag? So, the main (an appropriate) option seems to be using &lt;a href="http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/using_property_maps.html"&gt;property maps&lt;/a&gt;. It seems that there are two "ways" that &lt;i&gt;property maps&lt;/i&gt; can be used: &lt;i&gt;Interior properties&lt;/i&gt; and &lt;i&gt;Exterior properties&lt;/i&gt;. In this case I need to use &lt;i&gt;Exterior properties&lt;/i&gt; because I pass to the function (that calculates Cc) a graph that no contains the &lt;i&gt;flags&lt;/i&gt; property in the nodes (I think this is the best, interior properties are only "useful" if they participates trough the process of graph construction). So, how do I use &lt;i&gt;exterior properties&lt;/i&gt; by mean of &lt;i&gt;property maps&lt;/i&gt;? &lt;/br&gt;&lt;/br&gt;&lt;!--It seems that it is easier to use &lt;i&gt;internal properties&lt;/i&gt; (the reason is maybe because it hides what is done behind the scene), so lets take a look at this first in order to ease the understanding of the &lt;i&gt;external properties&lt;/i&gt;. &lt;a href="http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/using_adjacency_list.html#sec:adjacency-list-properties"&gt;Here&lt;/a&gt; explains how to use &lt;i&gt;adjacency_list&lt;/i&gt; and in particular how to attach &lt;i&gt;internal properties&lt;/i&gt; to the vertex or edges of the corresponding graph. There its said that there are two ways of specifying internal properties: &lt;a href="http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/bundles.html"&gt;bundled properties&lt;/a&gt; and property list (The former is the recommended, the later is maintained by matters of compatibilities. I think that (maybe) the former is a kind of interface to the later). Also &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/quick_tour.html"&gt;here&lt;/a&gt; (in the section &lt;b&gt;Adding Some Color to your Graph&lt;/b&gt;) is a good place to start (I think...).&lt;(br&gt;&lt;/br&gt;--&gt;When trying to understand how to attach properties to graphs, vertex and edges, at first sight there is some confusion (at least to me), because there are several "things" with similar names and it is not clear which is the role that each of this things play. &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/quick_tour.html"&gt;here&lt;/a&gt; (in the section &lt;b&gt;Adding Some Color to your Graph&lt;/b&gt;) is a simple explanation of what is and (expect to do...) does each thing. I will follow its lines...&lt;/br&gt;&lt;/br&gt;So, in first place there are &lt;i&gt;internally stored properties&lt;/i&gt; and &lt;i&gt;externally stored properties&lt;/i&gt; for graphs, vertex, and edges "objects". The former are created when the object is created and has the same life span that the object. The later can be attached and removed at any time in the life span of the object. So the former is internally stored in the object, and the later is stored externally. &lt;/br&gt;&lt;/br&gt;BGL uses a uniform  mechanism to access both kinds of properties inside its graph algorithms called the property map interface, described in &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/property_map.html"&gt;Section Property Map Concepts&lt;/a&gt;. In addition, the &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/PropertyGraph.html"&gt;PropertyGraph&lt;/a&gt; concept defines the interface for obtaining a property map object for an internally stored property. &lt;/br&gt;&lt;/br&gt;In this case, the idea is to use externally stored properties, because my intention is to eventually build graph trough some algorithm and then, only at the end to attach properties to its components (vertex and edges). &lt;/br&gt;&lt;/br&gt;The BGL &lt;a href="http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/adjacency_list.html"&gt;adjacency_list&lt;/a&gt; class (see also &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/using_adjacency_list.html"&gt;here&lt;/a&gt;) allows users to specify internally stored properties through plug-in template parameters of the graph class. How to do this is discussed in detail in &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/using_adjacency_list.html#sec:adjacency-list-properties"&gt;Section Internal Properties&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Externally stored properties can be created in many different ways, although they are ultimately passed as separate arguments to the graph algorithms. One straightforward way to store properties is to create an array indexed by vertex or edge index. In the adjacency_list with vecS specified for the VertexList template parameter, vertices are automatically assigned indices, which can be accessed via the property map for the vertex_index_t. Edges are not automatically assigned indices. However the property mechanism can be used to attach indices to the edges which can be used to index into other externally stored properties. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Remarks and Questions:&lt;/b&gt; So it seems that the idea when "building" external properties to vertex (or edges) is to "build" vectors an access its "elements" trough indices attached to each vertex (or edge) by mean of an (internally?) property that must be initialized (except in the case that the VertexList is of type vecS, so then the vertex_index property is initialized automatically (this is (I think) because each vecS element has an index by default)). &lt;/br&gt;&lt;/br&gt;In the case of "my algorithm" for the calculation of $Cc$, the flags are properties of the edges. As (it seems that) the edges does not has automatically initialized edge_index's, I must to provide this tho the Graph definition (Is this the case?). &lt;/br&gt;&lt;/br&gt;TODO... solve this questions. For that matter I'm reading &lt;a href="http://www.amazon.com/Boost-Graph-Library-Reference-Manual/dp/0201729148"&gt;&lt;b&gt;The Boost Graph Library - User Guide and Reference Manual&lt;/b&gt;&lt;/a&gt; (I'm going by pag. 51)&lt;/br&gt;&lt;/br&gt;So, finally I implemented something that work. It is not "perfect" (it has a lot of naive things that can be easily improved) but it works. The important thing here is that I have implemented my algorithm, it works, and I learned (at least basically) to implement internal and external properties. &lt;/br&gt;&lt;/br&gt;What I have done has four files: &lt;i&gt;main.cpp&lt;/i&gt;, &lt;i&gt;main.h&lt;/i&gt;, &lt;i&gt;cc.hpp&lt;/i&gt;, &lt;i&gt;edge_indexing.hpp&lt;/i&gt; (I'm still does not known when is appropriate to use .h or .hpp). The first is the main program where the graph is constructed. The second is a simple header that assist the first. The third contains the main functions that are used to calculate the clustering coefficient. The fourth provides a function that "initializes" (set to countable numbers) the &lt;i&gt;edge_index&lt;/i&gt; property. &lt;/br&gt;&lt;/br&gt;Here are the files: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/**&lt;br /&gt; * @file main.cpp&lt;br /&gt; * @author --&lt;br /&gt; * @email --&lt;br /&gt; * @date $(Date)&lt;br /&gt; * @brief Program that uses the BGL to calculate the Clustering&lt;br /&gt; * Coefficient by a own implementation of a own algorithm.&lt;br /&gt; **/&lt;br /&gt; &lt;br /&gt;#include &amp;quot;main.h&amp;quot;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * \brief This is the main program function&lt;br /&gt; * \param argc&lt;br /&gt; * \param argv&lt;br /&gt; * \return 0&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;cout &amp;lt;&amp;lt; &amp;quot;List of: (vertex_index,Cc_{vertex_index})&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;// create a typedef for the Graph type&lt;br /&gt;//typedef adjacency_list&amp;lt;vecS, vecS, undirectedS&amp;gt; Graph;&lt;br /&gt;typedef property&amp;lt;edge_index_t, std::size_t&amp;gt; EdgeIndexProperty;&lt;br /&gt;typedef adjacency_list&amp;lt;vecS, vecS, undirectedS, no_property, EdgeIndexProperty&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;// Make convenient labels for the vertices&lt;br /&gt;enum { A, B, C, D, E, N };&lt;br /&gt;const int num_vertices = N;&lt;br /&gt;const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;// writing out the edges in the graph&lt;br /&gt;typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;Edge edge_array[] = &lt;br /&gt;{ Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;  Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;// declare a graph object&lt;br /&gt;Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;// add the edges to the graph object&lt;br /&gt;for (std::size_t i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;  add_edge(edge_array[i].first, edge_array[i].second, g);    &lt;br /&gt;&lt;br /&gt;// add the index to the edges&lt;br /&gt;set_edge_index(g);&lt;br /&gt;&lt;br /&gt;// get the property map for vertex indices&lt;br /&gt;typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;IndexMap index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;// print the list of: ( vertex_index , Cc_{vertex_index} )&lt;br /&gt;typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;for (vp = vertices(g); vp.first != vp.second; ++vp.first) {&lt;br /&gt;  //cout &amp;lt;&amp;lt; &amp;quot;vertex = &amp;quot; &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot;, Cc = &amp;quot; &amp;lt;&amp;lt; clustering_coefficient(g,*vp.first) &amp;lt;&amp;lt; std::endl;        &lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot;,&amp;quot; &amp;lt;&amp;lt; clustering_coefficient(g,*vp.first) &amp;lt;&amp;lt; &amp;quot;)&amp;quot;;          &lt;br /&gt;}&lt;br /&gt;cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/**&lt;br /&gt; * @file main.h&lt;br /&gt; * @author --&lt;br /&gt; * @email --&lt;br /&gt; * @date $(Date)&lt;br /&gt; * @brief Simple header that assist main.cpp&lt;br /&gt; **/&lt;br /&gt; &lt;br /&gt;#ifndef MAIN_H&lt;br /&gt;#define MAIN_HPP&lt;br /&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;#include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;#include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;#include &amp;quot;cc.hpp&amp;quot;&lt;br /&gt;#include &amp;quot;edge_indexing.hpp&amp;quot;&lt;br /&gt;&lt;br /&gt;//#include &amp;lt;boost/graph/properties.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;  &lt;br /&gt;using namespace boost;&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;/**&lt;br /&gt; * @file main.h&lt;br /&gt; * @author --&lt;br /&gt; * @email --&lt;br /&gt; * @date $(Date)&lt;br /&gt; * @brief This file is intended to write a small program that&lt;br /&gt; * that uses the BGL to calculate the Clustering&lt;br /&gt; * Coefficient by a own implementation of a own algorithm.&lt;br /&gt; * &lt;br /&gt; * In particular in this file I implement my own algorithm.&lt;br /&gt; * &lt;br /&gt; * I start by imititating most of /boost/graph/clustering_coefficient.hpp&lt;br /&gt; * &lt;br /&gt; * NOTE: &lt;br /&gt; *  - In this first try it will only support undirected graphs.&lt;br /&gt; *  - One thing that can be improved is the usage of the bool edge flag.&lt;br /&gt; * &lt;br /&gt;**/&lt;br /&gt;&lt;br /&gt;#ifndef CC_HPP&lt;br /&gt;#define CC_HPP&lt;br /&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;#include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;#include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;//#include &amp;lt;boost/utility.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/graph_concepts.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/lookup_edge.hpp&amp;gt;  &lt;br /&gt;&lt;br /&gt;//#include &amp;lt;boost/graph/properties.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;namespace boost&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;namespace detail&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;template &amp;lt;class Graph&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;possible_edges(const Graph&amp;amp; g, std::size_t k, directed_tag)&lt;br /&gt;{&lt;br /&gt;    function_requires&amp;lt; GraphConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;    typedef typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type T;&lt;br /&gt;    return T(k) * (T(k) - 1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;template &amp;lt;class Graph&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;possible_edges(const Graph&amp;amp; g, size_t k, undirected_tag)&lt;br /&gt;{&lt;br /&gt;    // dirty little trick...&lt;br /&gt;    return possible_edges(g, k, directed_tag()) / 2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This template matches directedS and bidirectionalS.&lt;br /&gt;template &amp;lt;class Graph&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;count_edges(const Graph&amp;amp; g,&lt;br /&gt;            typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor u,&lt;br /&gt;            typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor v,&lt;br /&gt;            directed_tag)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;    function_requires&amp;lt; AdjacencyMatrixConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;    return (lookup_edge(u, v, g).second ? 1 : 0) +&lt;br /&gt;            (lookup_edge(v, u, g).second ? 1 : 0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This template matches undirectedS&lt;br /&gt;template &amp;lt;class Graph&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;count_edges(const Graph&amp;amp; g,&lt;br /&gt;            typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor u,&lt;br /&gt;            typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor v,&lt;br /&gt;            undirected_tag)&lt;br /&gt;{&lt;br /&gt;    function_requires&amp;lt; AdjacencyMatrixConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;    return lookup_edge(u, v, g).second ? 1 : 0;&lt;br /&gt;}&lt;br /&gt;} /* namespace detail */&lt;br /&gt;&lt;br /&gt;template &amp;lt;typename Graph, typename Vertex&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;num_paths_through_vertex(const Graph&amp;amp; g, Vertex v)&lt;br /&gt;{&lt;br /&gt;function_requires&amp;lt; AdjacencyGraphConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::directed_category Directed;&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::adjacency_iterator AdjacencyIterator;&lt;br /&gt;&lt;br /&gt;// TODO: There should actually be a set of neighborhood functions&lt;br /&gt;// for things like this (num_neighbors() would be great).&lt;br /&gt;&lt;br /&gt;AdjacencyIterator i, end;&lt;br /&gt;boost::tie(i, end) = adjacent_vertices(v, g);&lt;br /&gt;std::size_t k = std::distance(i, end);&lt;br /&gt;return detail::possible_edges(g, k, Directed());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* This is the function that I need to modify.&lt;br /&gt;*/&lt;br /&gt;template &amp;lt;typename Graph, typename Vertex&amp;gt;&lt;br /&gt;inline typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type&lt;br /&gt;num_triangles_on_vertex(const Graph&amp;amp; g, Vertex v, undirected_tag)&lt;br /&gt;{&lt;br /&gt;function_requires&amp;lt; IncidenceGraphConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;function_requires&amp;lt; AdjacencyGraphConcept&amp;lt;Graph&amp;gt; &amp;gt;();&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::degree_size_type Degree;&lt;br /&gt;&lt;br /&gt;// bool flag external edge property&lt;br /&gt;/* Notice that I'm calculating the Cc of just one vertex, and&lt;br /&gt; * the following vector is created (and destroyed) each time.&lt;br /&gt; * This is not the best way of doing this. The best way is to&lt;br /&gt; * create this just once, and then pass it as an argument by reference&lt;br /&gt; * to this function. For simplicity I choose this way.&lt;br /&gt; * Also, notice that the clustering coefficient can only be calculated&lt;br /&gt; * to undirected graphs.&lt;br /&gt; */&lt;br /&gt;std::vector&amp;lt;bool&amp;gt; edge_flag(num_edges(g));&lt;br /&gt;&lt;br /&gt;// get the property map for edge indices&lt;br /&gt;typedef typename property_map&amp;lt;Graph, edge_index_t&amp;gt;::const_type edgeindex_map_t;&lt;br /&gt;edgeindex_map_t edgeindex_map = get(edge_index,g);&lt;br /&gt;&lt;br /&gt;// set flags to false of the edges of the neighbors of v&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::adjacency_iterator adj_iter;&lt;br /&gt;std::pair&amp;lt;adj_iter,adj_iter&amp;gt; vip;&lt;br /&gt;&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::out_edge_iterator out_edge_iter;&lt;br /&gt;std::pair&amp;lt;out_edge_iter,out_edge_iter&amp;gt; eip;&lt;br /&gt;&lt;br /&gt;for(vip=adjacent_vertices(v,g);vip.first!=vip.second;++vip.first){&lt;br /&gt;    for(eip=out_edges(*vip.first,g);eip.first!=eip.second;++eip.first){&lt;br /&gt;        edge_flag[edgeindex_map(*eip.first)] = false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// count the number of times that the edges of the neighbors of v are visited more than once&lt;br /&gt;Degree count(0);&lt;br /&gt;for(vip=adjacent_vertices(v,g);vip.first!=vip.second;++vip.first){&lt;br /&gt;    for(eip=out_edges(*vip.first,g);eip.first!=eip.second;++eip.first){&lt;br /&gt;        if(edge_flag[edgeindex_map(*eip.first)] == true){&lt;br /&gt;            count++;&lt;br /&gt;        }else{&lt;br /&gt;            edge_flag[edgeindex_map(*eip.first)] = true;    &lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// return &amp;quot;that&amp;quot; number&lt;br /&gt;return count;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;template &amp;lt;typename T, typename Graph, typename Vertex&amp;gt;&lt;br /&gt;inline T&lt;br /&gt;clustering_coefficient(const Graph&amp;amp; g, Vertex v)&lt;br /&gt;{&lt;br /&gt;typedef typename graph_traits&amp;lt;Graph&amp;gt;::directed_category Directed;&lt;br /&gt;T zero(0);&lt;br /&gt;T routes = T(num_paths_through_vertex(g, v));&lt;br /&gt;return (routes &amp;gt; zero) ?&lt;br /&gt;    T(num_triangles_on_vertex(g, v, Directed())) / routes : zero;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;template &amp;lt;typename Graph, typename Vertex&amp;gt;&lt;br /&gt;inline double&lt;br /&gt;clustering_coefficient(const Graph&amp;amp; g, Vertex v)&lt;br /&gt;{ return clustering_coefficient&amp;lt;double&amp;gt;(g, v); }&lt;br /&gt;&lt;br /&gt;} /* namespace boost */&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and finally: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/**&lt;br /&gt; * @file edge_indexing.hpp&lt;br /&gt; * @author --&lt;br /&gt; * @email --&lt;br /&gt; * @date $(Date)&lt;br /&gt; * @brief Here is provided a function that set the edge index&lt;br /&gt; **/&lt;br /&gt;&lt;br /&gt;#ifndef EDGE_INDEXING_H&lt;br /&gt;#define EDGE_INDEXING_HPP&lt;br /&gt;&lt;br /&gt;//#include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;#include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;//#include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;#include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;#include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;//#include &amp;lt;boost/graph/properties.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;  &lt;br /&gt;using namespace boost;&lt;br /&gt;&lt;br /&gt;template&amp;lt;typename Graph&amp;gt;&lt;br /&gt;void set_edge_index(Graph&amp;amp; g)&lt;br /&gt;{&lt;br /&gt;    typedef typename property_map&amp;lt;Graph, edge_index_t&amp;gt;::type edgeindex_map_t;&lt;br /&gt;    edgeindex_map_t edgeindex_map = get(edge_index,g);&lt;br /&gt;&lt;br /&gt;    typedef typename graph_traits&amp;lt;Graph&amp;gt;::edge_iterator edge_iter;&lt;br /&gt;    std::pair&amp;lt;edge_iter,edge_iter&amp;gt; eip;&lt;br /&gt;&lt;br /&gt;    typedef typename property_map&amp;lt;Graph, edge_index_t &amp;gt;::type EdgeIndexPropertyMap;&lt;br /&gt;    typedef typename property_traits&amp;lt;EdgeIndexPropertyMap&amp;gt;::value_type EdgeIndexPropertyValue;&lt;br /&gt;    EdgeIndexPropertyValue n=0;&lt;br /&gt;    for(eip=edges(g);eip.first!=eip.second;++eip.first){&lt;br /&gt;        put(edgeindex_map,*eip.first,n++);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;The program works as can be seen (look &lt;a href="http://deliriosderayohauno.blogspot.com/2011/03/analysis-clustering-coefficient.html"&gt;previous post&lt;/a&gt; to check that the numbers are right): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ./CcInBGL_ownAlgo &lt;br /&gt;List of: (vertex_index,Cc_{vertex_index})&lt;br /&gt;(0,0.666667)(1,1)(2,0.666667)(3,0.5)(4,1)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-1196426827991701895?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/1196426827991701895/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=1196426827991701895' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1196426827991701895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/1196426827991701895'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/analysis-clustering-coefficient_01.html' title='Analysis - Clustering Coefficient calculation on BGL - n.3'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8023233153577456785</id><published>2011-03-01T10:59:00.001-03:00</published><updated>2011-03-01T11:49:55.383-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Clustering Coefficient'/><category scheme='http://www.blogger.com/atom/ns#' term='Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Analysis - Clustering Coefficient calculation on BGL - n.2</title><content type='html'>Now, in this post (following a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/analysis-clustering-coefficient_28.html"&gt;previous post&lt;/a&gt;) Firstly, will try to make a simple program that uses the standard implementation of the calculation of the clustering coefficient in the &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;BGL&lt;/a&gt;, secondly I will try to implement the algorithm that I propose (at the end of the &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/analysis-clustering-coefficient_28.html"&gt;previous post&lt;/a&gt;). &lt;/br&gt;&lt;/br&gt;So, I start a new project in &lt;a href="http://www.codelite.org/"&gt;Codelite&lt;/a&gt;, with the following files: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.cpp&lt;br /&gt; * &lt;br /&gt; * Program that uses the BGL to calculate the Clustering&lt;br /&gt; * Coefficient of the nodes of a Graph.&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;#include &amp;quot;main.h&amp;quot;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt;    &lt;br /&gt;    cout &amp;lt;&amp;lt; &amp;quot;List of: (vertex_index,Cc_{vertex_index})&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    &lt;br /&gt;    // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, undirectedS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] = &lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);    &lt;br /&gt;    &lt;br /&gt;    // get the property map for vertex indices&lt;br /&gt;    typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;    IndexMap index = get(vertex_index, g);&lt;br /&gt;    &lt;br /&gt;    // print the list of: ( vertex_index , Cc_{vertex_index} )&lt;br /&gt;    typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;    pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;    for (vp = vertices(g); vp.first != vp.second; ++vp.first) {&lt;br /&gt;      cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot;,&amp;quot; &amp;lt;&amp;lt; clustering_coefficient(g,*vp.first) &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; std::endl;    &lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.h&lt;br /&gt; * &lt;br /&gt; * This file is intended to write a small program that&lt;br /&gt; * uses BGL to calculate the Clustering Coefficient.&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt; &lt;br /&gt;#ifndef MAIN_H&lt;br /&gt;#define MAIN_HPP&lt;br /&gt; &lt;br /&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/clustering_coefficient.hpp&amp;gt;&lt;br /&gt;  &lt;br /&gt;  using namespace std;  &lt;br /&gt;  using namespace boost;&lt;br /&gt;    &lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;The graph that it implements is this: &lt;/br&gt;&lt;/br&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0KfiTWsHxk4/TWz3ah87swI/AAAAAAAAATk/MnYHWrp3kZM/s1600/graph.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="319" width="320" src="http://4.bp.blogspot.com/-0KfiTWsHxk4/TWz3ah87swI/AAAAAAAAATk/MnYHWrp3kZM/s320/graph.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/br&gt;When I tried to compile the program, it returns an error, &lt;b&gt;boost/graph/&lt;/b&gt;&lt;i&gt;clustering_coefficient.hpp&lt;/i&gt; is not in the boost C++ library that my ubuntu installed. So, I have a boost C++ library downloaded from &lt;a href="http://www.boost.org/users/download/"&gt;here&lt;/a&gt; (in fact, from there I will to &lt;a href="http://sourceforge.net/projects/boost/files/boost/1.46.0/"&gt;here&lt;/a&gt; and downloaded &lt;i&gt;boost_1_46_0.zip&lt;/i&gt;, the uncompressed it in a directory), and pass to the compiler the option: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;-I/home/my_user/some_extra_path/boost_1_46_0/&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and then it compiled right. Then I run the program and obtain: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;List of: (vertex_index,Cc_{vertex_index})&lt;br /&gt;(0,0.666667) (1,1) (2,0.666667) (3,0.5) (4,1)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it works right. In the next post I will try "my" algorithm to calculate the clustering coefficient.&lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8023233153577456785?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8023233153577456785/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8023233153577456785' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8023233153577456785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8023233153577456785'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/03/analysis-clustering-coefficient.html' title='Analysis - Clustering Coefficient calculation on BGL - n.2'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-0KfiTWsHxk4/TWz3ah87swI/AAAAAAAAATk/MnYHWrp3kZM/s72-c/graph.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3036342474400062624</id><published>2011-02-28T17:09:00.015-03:00</published><updated>2011-03-01T11:48:20.595-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Clustering Coefficient'/><category scheme='http://www.blogger.com/atom/ns#' term='Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Analysis - Clustering Coefficient calculation on BGL - n.1</title><content type='html'>Analysis is a series of post that works as an auxiliary to other posts. In this case I want to analyze the algorithm that calculates the &lt;a href="http://en.wikipedia.org/wiki/Clustering_coefficient"&gt;clustering coefficient&lt;/a&gt; (the local version of Watts-Strogatz) of the node of a graph that is implemented on the &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;BGL&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;So, I will not enter fully into the details of the code that has to do with the Boost C++ way of coding. Instead I want to analyze the "essential" structure of the algorithm. I will consider only the "directed graph version" of this algorithm. In what follows &lt;i&gt;n&lt;/i&gt; is the numberof nodes and &lt;i&gt;d&lt;/i&gt; is the "typical" degree. So counting the neighbors of a node is of Complexity &lt;i&gt;O(d)&lt;/i&gt;, and so on...&lt;/br&gt;&lt;/br&gt;There is a function named &lt;i&gt;clustering_coefficient(g,v)&lt;/i&gt; that takes as arguments a graph &lt;i&gt;g&lt;/i&gt; and a node &lt;i&gt;v&lt;/i&gt;, its pseudo code is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;// Pseudo code&lt;br /&gt;double clustering_coefficient(g,v) {&lt;br /&gt;  return triangles_on_vertex(g,v) / num_paths_trough_vertex(g,v)&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;so, it calls two other functions. The first is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;// Pseudo code&lt;br /&gt;int num_paths_trough_vertex(g,v) {&lt;br /&gt;   iterators ini,end;&lt;br /&gt;   tie(ini,end) = adjacent_vertices(g,v)&lt;br /&gt;   k = std::distance(ini,end); // Complexity: O(1) constant time &lt;br /&gt;                               // if adjacent_vertices&lt;br /&gt;                               // is a container as &lt;br /&gt;                               // vector&amp;lt;&amp;gt;. Linear &lt;br /&gt;                               // time O(d) if it is&lt;br /&gt;                               // a container as list.&lt;br /&gt;   return k*(k-1);   &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;The second is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;// Pseudo code&lt;br /&gt;// Cycling in the two nested loops is of Complexity O(d^2) if&lt;br /&gt;// inside it there are something of constant Complexity O(1).&lt;br /&gt;// But, inside it, there is something of Complexity O(d), so&lt;br /&gt;// the total Complexity (of the function) is O(d^3).&lt;br /&gt;//&lt;br /&gt;int num_triangles_on_vertex(g,v) {&lt;br /&gt;   iterators i,j,end;&lt;br /&gt;   int count = 0&lt;br /&gt;   for( tie(i,end) = adjacent_vertices(g,v) ; i!=end ; i++ ) {&lt;br /&gt;      for ( j = next(i) ; j!=end ; j++ ) {&lt;br /&gt;         count += num_edges(g,*i,*j); // This returns 1 &lt;br /&gt;                                      // iff vertexs *i and *j&lt;br /&gt;                                      // are connected, 0 in o.c.&lt;br /&gt;                                      // Complexity: Constant &lt;br /&gt;                                      // time O(1) if &lt;br /&gt;                                      // graph is like and &lt;br /&gt;                                      // adjacency matrix. &lt;br /&gt;                                      // Linear time O(d) if graph &lt;br /&gt;                                      // is like &lt;br /&gt;                                      // adjacency list.&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;   return count;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, in this implementation, in the case of a graph represented by an adjacency list the Complexity for the calculation of the Clustering Coefficient of a node is order &lt;i&gt;O(d^3)&lt;/i&gt;. &lt;/br&gt;Is there an efficient way? In the following papers I found that there is a way that uses matrix multiplication to determine the Clustering Coefficient of each node of the graph: &lt;/br&gt;&lt;/br&gt;Approximating clustering-coefficient and transitivity, Schank, T. and Wagner, D., (2004) &lt;/br&gt;Finding and counting given length cycles, Alon, N. and Yuster, R. and Zwick, U., (1997) &lt;/br&gt;&lt;/br&gt;In particular, in the first paper (of this short list) provides a cheaper way to estimate the Clustering Coefficient. The efficiency of the matrix multiplication method is of Complexity $O(m^{\frac{2\gamma}{(\gamma+1)}})$, where $m$ is the number of links of the network, and $\gamma \simeq 1.5$. &lt;/br&gt;&lt;/br&gt;I was thinking in the following possibility. If one iterates trough the neighbors $j$ of a node $i$, and for each $j$ one iterates for its adjacent edges. Then, it happens that some edges will be visited one time (the edges that connect a neighbor of $i$ with a node non neighbor of $i$), and others visited two times (the edges that connect two neighbors of $i$). The number of edges visited two times is $T_i$, and then: &lt;/br&gt;&lt;/br&gt;$Cc_i = \frac{T_i}{\frac{k_i(k_i-1)}{2}}$&lt;/br&gt;(note that in the iteration trough the adjacent edges one also iterates trough the edges that goes from the neighbors of $i$ to $i$ itself, but those edges are visited just only one time so they do not are counted in $T_i$). So, in this way one can calculate $Cc_i$ on Complexity $\bigO(d^2)$ (essentially the same Complexity that is calculated $T_i$). So, the problem now is how to implement this, but this is a problem that I will treat in a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/03/analysis-clustering-coefficient.html"&gt;following post&lt;/a&gt;.&lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3036342474400062624?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3036342474400062624/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3036342474400062624' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3036342474400062624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3036342474400062624'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/analysis-clustering-coefficient_28.html' title='Analysis - Clustering Coefficient calculation on BGL - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6644816884890017302</id><published>2011-02-28T12:19:00.040-03:00</published><updated>2011-05-22T22:13:32.321-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='data structures'/><category scheme='http://www.blogger.com/atom/ns#' term='linear algebra'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='advanced programming Algorithms'/><title type='text'>Algorithms, data structures, libraries</title><content type='html'>In this post, the idea, is to list several algorithms (data structures) useful for some purpose. The algorithms (data structures) may be in "plain" text description, or maybe implemented in some particular platform (language). The list of algorithms (data structures) will be separated by titles that specify the "goals" of those algorithms (data structures). &lt;/br&gt;&lt;/br&gt;Before keep going, what is a data structure (to me)? Well, take for example a graph, there are several ways of represent a graph in a computer, for example, the adjacency matrix, or the adjacencies lists. So, here, besides algorithms also I will list "data structures". &lt;/br&gt;&lt;/br&gt;Also, I will list links to sites where one can found algorithms, codes, etc. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;: Algorithms&lt;/b&gt; &lt;/br&gt;&lt;b&gt;:: Graph/Networks&lt;/b&gt; &lt;/br&gt;&lt;b&gt;::: Clustering Coefficient&lt;/b&gt; &lt;/br&gt;:::: In &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;BGL&lt;/a&gt; there is a file inside &lt;b&gt;boost/graph/&lt;/b&gt; named &lt;i&gt;clustering_coefficient.hpp&lt;/i&gt;. In &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/analysis-clustering-coefficient_28.html"&gt;this post&lt;/a&gt; I analyze the efficiency of the implementation.&lt;/br&gt;&lt;/br&gt;&lt;b&gt;: Libraries (or sources of code)&lt;/b&gt; &lt;/br&gt;&lt;b&gt;:: General&lt;/b&gt; &lt;/br&gt;&lt;a href="http://www.boost.org/"&gt;::: Boost C++&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.gnu.org/software/gsl/"&gt;::: GSL (GNU Scientific Library)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.nr.com/"&gt;::: Numerical Recipes&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/"&gt;::: MATLAB file exchange&lt;/a&gt; &lt;/br&gt;&lt;a href="http://pamoran.stu.cofc.edu/CppLibs.html"&gt;::: C++ Libraries&lt;/a&gt; &lt;/br&gt;&lt;a href="http://math.nist.gov/tnt/index.html"&gt;::: TNT (Template Numerical Toolkit)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://netlib.org/"&gt;::: Netlib Repository&lt;/a&gt; &lt;/br&gt;&lt;a href="http://math.nist.gov/"&gt;::: NIST&lt;/a&gt; (National Institute of Standards and Technology) &lt;/br&gt;&lt;a href="http://www.nhse.org/rib/repositories/nhse/catalog/#Numerical_Programs_and_Routines"&gt;::: NHSE&lt;/a&gt; &lt;/br&gt;&lt;a href="http://codecogs.com/"&gt;::: codecogs&lt;/a&gt; (code for engineers) &lt;/br&gt;&lt;b&gt;:: Graph/Networks&lt;/b&gt; &lt;/br&gt;&lt;a href="http://math.nist.gov/~RPozo/ngraph/ngraph_index.html"&gt;::: NGraph&lt;/a&gt; &lt;/br&gt;&lt;a href="http://lemon.cs.elte.hu/trac/lemon"&gt;::: Lemon Graph Library&lt;/a&gt; &lt;/br&gt;&lt;a href="http://igraph.sourceforge.net/"&gt;::: Igraph&lt;/a&gt; &lt;/br&gt;&lt;b&gt;:: Linear Algebra&lt;/b&gt; &lt;/br&gt;&lt;a href="http://www.netlib.org/lapack/"&gt;::: LAPACK&lt;/a&gt; &lt;/br&gt;&lt;a href="http://lapackpp.sourceforge.net/"&gt;::: LAPACK++&lt;/a&gt; (&lt;a href="http://math.nist.gov/lapack++/"&gt;old LAPACK++&lt;/a&gt;)&lt;/br&gt;&lt;a href="http://www.caam.rice.edu/software/ARPACK/"&gt;::: ARPACK&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.netlib.org/napack/"&gt;::: NAPACK&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.cs.utexas.edu/~plapack/"&gt;::: PLAPACK&lt;/a&gt; (parallel LAPACK) &lt;/br&gt;&lt;a href="http://www.netlib.org/scalapack/scalapack_home.html"&gt;::: ScaLAPACK&lt;/a&gt; (also parallel LAPACK) &lt;/br&gt;&lt;a href="http://www.netlib.org/eispack/"&gt;::: EISPACK&lt;/a&gt; &lt;/br&gt;&lt;a href="http://en.wikipedia.org/wiki/UMFPACK"&gt;::: UMFPACK&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.netlib.org/blas/"&gt;::: BLAS&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/numeric/ublas/doc/index.htm"&gt;::: uBLAS&lt;/a&gt; &lt;/br&gt;&lt;a href="http://math-atlas.sourceforge.net/"&gt;::: ATLAS&lt;/a&gt; &lt;/br&gt;&lt;a href="http://math.nist.gov/tnt/index.htm"&gt;::: TNT&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arma.sourceforge.net/"&gt;::: Armadillo C++&lt;/a&gt; &lt;/br&gt;&lt;a href="http://z.cs.utexas.edu/wiki/flame.wiki/FrontPage"&gt;::: FLAME&lt;/a&gt; (Or &lt;i&gt;libflame&lt;/i&gt;. Seems to support GPU) &lt;/br&gt;&lt;a href="http://eigen.tuxfamily.org/index.php?title=Main_Page"&gt;::: Eigen&lt;/a&gt; &lt;/br&gt;&lt;a href="http://download.gna.org/getfem/html/homepage/gmm.html"&gt;::: Gmm++&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.osl.iu.edu/research/mtl/"&gt;::: MTL&lt;/a&gt; &lt;/br&gt;&lt;a href="http://cache-www.intel.com/cd/00/00/22/97/229716_229716.pdf"&gt;::: MKL&lt;/a&gt; &lt;/br&gt;&lt;a href="http://flens.sourceforge.net/"&gt;::: FLENS&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.oonumerics.org/blitz/index.html"&gt;::: Blitz++&lt;/a&gt; (it also serves for more than linear algebra) &lt;/br&gt;&lt;a href="http://itpp.sourceforge.net/current/index.html"&gt;::: IT++&lt;/a&gt; (it also serves for more than linear algebra) &lt;/br&gt;&lt;b&gt;:::: Useful posts or articles&lt;/b&gt; &lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/4575482/lapackpp-vs-boost-blas"&gt;::::: Lapackpp vs Boost BLAS&lt;/a&gt; (check answers, some one give a general view) &lt;/br&gt;&lt;a href="http://ews.uiuc.edu/~mrgates2/research/blas-benchmark.pdf"&gt;::::: Linear Algebra Benchmarks&lt;/a&gt; &lt;/br&gt;&lt;a href="http://mail.scipy.org/pipermail/scipy-user/2009-January/019253.html"&gt;::::: Discussion about possibilities&lt;/a&gt; &lt;/br&gt;&lt;a href="http://projects.opencascade.org/btl/"&gt;::::: More benchmarks&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.netlib.org/utk/people/JackDongarra/la-sw.html"&gt;::::: FREELY AVAILABLE SOFTWARE FOR LINEAR ALGEBRA ON THE WEB (April 2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/713878/how-expensive-is-it-to-compute-the-eigenvalues-of-a-matrix"&gt;::::: How expensive is it to compute the eigenvalues of a matrix?&lt;/a&gt; &lt;/br&gt;&lt;a href="http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms"&gt;::::: Basic linear algebra sub programs on Wiki&lt;/a&gt; (overview of possibilities) &lt;/br&gt;&lt;a href="http://geekeeway.blogspot.com/2009/11/scientific-computing-linear-algebra.html"&gt;::::: Scientific Computing / Linear Algebra Library Survey&lt;/a&gt; &lt;/br&gt;&lt;b&gt;:: Miscelaneous&lt;/b&gt; &lt;/br&gt;&lt;a href="http://glaros.dtc.umn.edu/gkhome/"&gt;::: Karypis Lab&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;:Very general sources (algorithms, papers, libraries, code, etc...)&lt;/b&gt; &lt;/br&gt;&lt;a href="http://allwebhunt.com/dir-wiki.cfm/Top/Computers/Algorithms"&gt;:: All Web Hunt, Computer Algoritmhs&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.dcs.gla.ac.uk/research/algorithms/links.html"&gt;:: Algorithms and Complexity Resources&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6644816884890017302?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6644816884890017302/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6644816884890017302' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6644816884890017302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6644816884890017302'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/algorithms-data-structures.html' title='Algorithms, data structures, libraries'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-709949626744268638</id><published>2011-02-28T00:14:00.002-03:00</published><updated>2011-02-28T00:28:28.085-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='utils'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><title type='text'>Interesting Libraries on Boost C++ Libraries</title><content type='html'>Here I will posting the list of interesting (to me) libraries on the &lt;a href="http://www.boost.org/"&gt;Boost C++ Libraries&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/doc/html/accumulators.html"&gt;Accumulators&lt;/a&gt;: Useful to calculate statistical quantities as means or variances, etc... &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_45_0/doc/html/boost_random.html"&gt;Random&lt;/a&gt;: Pseudo-random number generators. &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/doc/html/foreach.html"&gt;foreach&lt;/a&gt;: this may easy coding in the Boost C++ Libraries &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/gil/doc/index.html"&gt;Generic Image Library&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/math/doc/sf_and_dist/html/index.html"&gt;Math/Statistical distributions&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/spirit/doc/html/index.html"&gt;Parsing&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-709949626744268638?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/709949626744268638/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=709949626744268638' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/709949626744268638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/709949626744268638'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/interesting-libraries-on-boost-c.html' title='Interesting Libraries on Boost C++ Libraries'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7556331483641517764</id><published>2011-02-26T15:52:00.025-03:00</published><updated>2011-03-24T17:19:48.770-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bibliography'/><category scheme='http://www.blogger.com/atom/ns#' term='J.P.Crutchfield'/><category scheme='http://www.blogger.com/atom/ns#' term='Complexity'/><title type='text'>Complexity - Bibliography</title><content type='html'>So I wan't to collect bibliography about Complexity in this post. I will also "repost" some bibliography previously posted in this blog, now with the advantage of the usage of tags. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;The J. P. Crutchfield approach: &lt;/b&gt;&lt;/br&gt;&lt;/br&gt;&lt;a href="http://arxiv.org/abs/0708.0654"&gt;Structure or Noise? (2007)&lt;/a&gt;, &lt;a href="http://www.archive.org/details/Redwood_Center_2008_10_15_Jim_Crutchfield"&gt;Talk (2008)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0708.1580"&gt;Optimal Causal Inference: Estimating Stored Information and Approximating Causal Architecture (2007-2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0709.1948"&gt;Information theoretic approach to interactive learning (S. Still, 2007-2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0905.3587"&gt;Prediction, Retrodiction, and The Amount of Information Stored in the Present (2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/physics/0303011"&gt;How many clusters? An information theoretic perspective (S. Still, 2003)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0902.1209"&gt;Time's Barbed Arrow: Irreversibility, Crypticity, and Stored Information (2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0905.4787"&gt;Information Accessibility and Cryptic Processes (2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0906.5099"&gt;Information Accessibility and Cryptic Processes: Linear Combinations of Causal States (2009)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0806.4789"&gt;The Organization of Intrinsic Computation: Complexity-Entropy Diagrams and the Diversity of Natural Information Processing (2008)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1007.5354"&gt;Synchronization and Control in Intrinsic and Designed Computation: An Information-Theoretic Analysis of Competing Models of Stochastic Computation (2010)&lt;/a&gt;&lt;a href="http://arxiv.org/abs/cond-mat/9907176"&gt;Computational Mechanics: Pattern and Prediction, Structure and Simplicity (2000)&lt;/a&gt;&lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin.AO/0409024"&gt;Quantifying Self-Organization with Optimal Predictors (2004)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin/0507067"&gt;Quantifying Self-Organization in Cyclic Cellular Automata (2005)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cs/0210025"&gt;An Algorithm for Pattern Discovery in Time Series (2002)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/pdf/cs/0406011"&gt;Blind Construction of Optimal Nonlinear Recursive Predictors for Discrete Sequences (2004)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;sqi=2&amp;ved=0CBgQFjAA&amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.92.7770%26rep%3Drep1%26type%3Dpdf&amp;rct=j&amp;q=Causal%20architecture%2C%20complexity%20and%20self-organization%20in%20time%20series%20and%20cellular%20automata&amp;ei=oE9pTc3dOpObtweA_MnmAg&amp;usg=AFQjCNGuV7SwI_zsltpwsxni5iGaTalFlg"&gt;Causal architecture, complexity and self-organization in time series and cellular automata (thesis of C.R.Shalizi, 2001)&lt;/a&gt;&lt;a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.48.8487&amp;rep=rep1&amp;type=pdf"&gt; &lt;/br&gt;Computational mechanics of cellular automata: An example (1997)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://hornacek.coa.edu/dave/Thesis/thesis.html"&gt;Computational Mechanics of Classical Spin Systems (Feldman thesis, 1998)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.santafe.edu/media/workingpapers/98-04-026.pdf"&gt;Discovering Noncritical Organization: Statistical Mechanical, Information Theoretical, and Computational Views of Patterns in One-Dimensional Spin Systems (1998)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://prl.aps.org/abstract/PRL/v63/i2/p105_1"&gt;Inferring statistical complexity (1989)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.disca.upv.es/pabmitor/FILES/Complexity/971111_GEN_4.pdf"&gt;Measures of statistical complexity: Why? (1995)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1012.1890"&gt;A measure of statistical complexity based on predictive information (Abdallah, Plumbey ,2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/math/0305160"&gt;Optimal Nonlinear Prediction of Random Fields on Networks (2003)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/math/0405425"&gt;Reductions of Hidden Information Sources (2004)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cond-mat/0102181"&gt;Regularities unseen, randomness observed: Levels of entropy convergence (2001)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=2&amp;ved=0CCMQFjAB&amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.90.9741%26rep%3Drep1%26type%3Dpdf&amp;ei=PFVpTfC0MIz3gAf4_vXLCg&amp;usg=AFQjCNGCadj-PFVHNmnYFV1wBubHjjptdA"&gt;The calculi of emergence: computation, dynamics and induction (1994)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBMQFjAA&amp;url=http%3A%2F%2Fwww.cscs.umich.edu%2F~crshalizi%2Fresearch%2FTDCS.pdf&amp;ei=llVpTYmCJoXcgQeQ3o3LCg&amp;usg=AFQjCNG8wrqHTZ03kzU203j_bY37ktyQcA"&gt;Thermodynamic depth of causal states: Objective complexity via minimal representations (1994)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cond-mat/0303625"&gt;What Is a Macrostate? Subjective Observations and Objective Dynamics (2003)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cond-mat/9702191"&gt;Statistical Complexity of Simple 1D Spin Systems (1997)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1012.0356"&gt;The Past and the Future in the Present (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1007.5354?context=cs.IT"&gt;Synchronization and Control in Intrinsic and Designed Computation: An Information-Theoretic Analysis of Competing Models of Stochastic Computation (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1005.2714"&gt;Structural Drift: The Population Dynamics of Sequential Learning (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin/0406058"&gt;Objects That Make Objects: The Population Dynamics of Structural Complexity (2004)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/arXiv:1010.5545"&gt;Many Roads to Synchrony: Natural Time Scales and Their Algorithms (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1010.5019"&gt;How the Dimension of Space Affects the Products of Pre-Biotic Evolution: The Spatial Population Dynamics of Structural Complexity and The Emergence of Membranes (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1008.4182"&gt;Exact Synchronization for Finite-State Sources (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1011.0036"&gt;Enumerating Finitary Processes (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1011.1581"&gt;Asymptotic Synchronization for Finite-State Sources (2010-2011)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin/0603001"&gt;Hierarchical Self-Organization in the Finitary Process Soup (2006)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/0704.3771"&gt;Primordial Evolution in the Finitary Process Soup (2007)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1010.5545"&gt;Many Roads to Synchrony: Natural Time Scales and Their Algorithms (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://users.cse.ucdavis.edu/~cmg/papers/ODOS.pdf"&gt;Order and Disorder on Open Systems (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/1007.5354"&gt;Synchronization and Control in Intrinsic and Designed Computation: An Information-Theoretic Analysis of Competing Models of Stochastic Computation (2010)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://cse.ucdavis.edu/~cmg/compmech/pubs/oimnc.htm"&gt;Optimal Instruments and Models for Noisy Chaos (2007) &lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/math/0703715"&gt;Inferring Markov Chains: Bayesian Estimation, Model Comparison, Entropy Rate, and Out-of-class Modeling (2007)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cs.LG/0611054"&gt;How Random is a Coin Toss? Bayesian Inference and the Symbolic Dynamics of Deterministic Chaos (2006)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin.CD/0504040"&gt;Persistent Chaos in High Dimensions (2005)&lt;/a&gt; &lt;/br&gt; &lt;a href="http://arxiv.org/abs/cs/0410017"&gt;Automated Pattern Detection--An Algorithm for Constructing Optimally Synchronizing Multi-Regular Language Filters (2004)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin.AO/0208040"&gt;Synchronizing to Periodicity: The Transient Information and Synchronization Time of Periodic Sequences (2002)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin.AO/0103038"&gt;Synchronizing to the Environment: Information Theoretic Constraints on Agent Learning (2001)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/nlin.AO/0006025"&gt;Information Bottlenecks, Causal States, and Statistical Relevance Bases: How to Represent Relevant Information in Memoryless Transduction (2000)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://arxiv.org/abs/cs.LG/0001027"&gt;Pattern Discovery and Computational Mechanics (2000)&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Useful links: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://cse.ucdavis.edu/~chaos/"&gt;Jim Crutchfield Complexity Science Center at UCDavids&lt;/a&gt; (here it is all its bibliography) &lt;/br&gt;&lt;a href="http://www.santafe.edu/search/results/?query=crutchfield"&gt;Santa Fe institute, query=Crutchfield&lt;/a&gt; &lt;/br&gt;&lt;a href="http://tuvalu.santafe.edu/~jpc/JPCPapers.html"&gt;Jim Crutchfield's Research Communications&lt;/a&gt; &lt;/br&gt;&lt;a href="http://hornacek.coa.edu/dave/publications.html"&gt;List of Publications: David P. Feldman&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.citeulike.org/user/dpf/author/Crutchfield:JP"&gt;http://www.citeulike.org/user/dpf/author/Crutchfield:JP&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7556331483641517764?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7556331483641517764/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7556331483641517764' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7556331483641517764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7556331483641517764'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/complexity-bibliography.html' title='Complexity - Bibliography'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7535172552683072156</id><published>2011-02-25T18:03:00.003-03:00</published><updated>2011-02-26T19:59:09.917-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='setting-up'/><category scheme='http://www.blogger.com/atom/ns#' term='computational resources'/><category scheme='http://www.blogger.com/atom/ns#' term='bandurria'/><title type='text'>Computational Resources - BGL on the GTMC</title><content type='html'>In a previous post I fond that BGL is not installed on bandurria (a computer cluster at GTMC). So now I have to see for a solution. One (plausible) solution involves to ask the cluster maintainer to install BGL on the cluster. Other (plausible) solution is to install BGL in my home dir.&lt;/br&gt;&lt;/br&gt;So, how I do that? This is the reason of this post. &lt;/br&gt;&lt;/br&gt;Now, it seems that the installation of BGL is system dependent. That is, BGL is installed in different ways in different systems. For example, check &lt;a href="http://beans.seartipy.com/category/c_boost/"&gt;this post&lt;/a&gt; (there, it seems that the owner of the blog install the Boost C++ library, not only BGL). &lt;/br&gt;&lt;/br&gt;So, the first question is. Which kind of system is bandurria? It is a cluster, so I don't know exactly how the files are shared there. As far I know, one has access to every node, but in practice one only need access to the "main" node of the cluster. In fact, when one login into bandurria, the filesystem that one can see is the filesystem of the "main" node-computer of the group (that is, pulga). &lt;/br&gt;&lt;/br&gt;So, in my first try, I will appeal to the fact that BGL is (except some exceptions) basically a header only library, so it is (in principle) not system dependent. So, I go &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;here&lt;/a&gt; and from there I go &lt;a href="http://sourceforge.net/projects/boost/files/boost/1.46.0/"&gt;here&lt;/a&gt; and downloaded &lt;i&gt;boost_1_46_0.zip&lt;/i&gt; (notice that I have downloaded all the boost library, not only BGL). Then I copy that file to a temporary directory on bandurria where I plan to try the example programs that uses BGL. I unzip the library inside that temporary directory and a new directory named &lt;b&gt;boost_1_46_0&lt;/b&gt; was created. inside it there is a directory named &lt;b&gt;boost/&lt;/b&gt; which contains the library.&lt;/br&gt;&lt;/br&gt;So, I simply do the following whit the same example used in the &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/computational-resources-checking-if-i.html"&gt;previous post&lt;/a&gt; &lt;/br&gt;, I compile via: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;g++ -I/home/myusername/tmp/boost_1_46_0/ main.cpp &lt;br /&gt;In file included from main.cpp:8:&lt;br /&gt;main.h:70:3: warning: no newline at end of file&lt;br /&gt;[myusername@bandurria tmp]$ ls&lt;br /&gt;a.out  boost_1_46_0  boost_1_46_0.zip  main.cpp  main.h&lt;br /&gt;[perotti@bandurria tmp]$ ./a.out &lt;br /&gt;hello world BGL&lt;br /&gt;vertices(g) = 0 1 2 3 4 &lt;br /&gt;edges(g) = (0,1) (0,3) (2,0) (3,2) (2,4) (1,3) (3,4) &lt;br /&gt;adjacent structure of vertex: 0&lt;br /&gt;out-edges: (0,1) (0,3) &lt;br /&gt;in-edges: (2,0) &lt;br /&gt;adjacent vertices: 1 3 &lt;br /&gt;adjacent structure of vertex: 1&lt;br /&gt;out-edges: (1,3) &lt;br /&gt;in-edges: (0,1) &lt;br /&gt;adjacent vertices: 3 &lt;br /&gt;adjacent structure of vertex: 2&lt;br /&gt;out-edges: (2,0) (2,4) &lt;br /&gt;in-edges: (3,2) &lt;br /&gt;adjacent vertices: 0 4 &lt;br /&gt;adjacent structure of vertex: 3&lt;br /&gt;out-edges: (3,2) (3,4) &lt;br /&gt;in-edges: (0,3) (1,3) &lt;br /&gt;adjacent vertices: 2 4 &lt;br /&gt;adjacent structure of vertex: 4&lt;br /&gt;out-edges: &lt;br /&gt;in-edges: (2,4) (3,4) &lt;br /&gt;adjacent vertices: &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, it works. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7535172552683072156?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7535172552683072156/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7535172552683072156' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7535172552683072156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7535172552683072156'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/computational-resources-bgl-on-gtmc.html' title='Computational Resources - BGL on the GTMC'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8248046846430394187</id><published>2011-02-25T12:03:00.006-03:00</published><updated>2011-02-25T16:58:51.920-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codelite'/><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='setting-up'/><category scheme='http://www.blogger.com/atom/ns#' term='computational resources'/><title type='text'>Computational Resources - Checking if I can run programs developed in my machine in the GTMC computers/clusters</title><content type='html'>In order to try to answer some questions of &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/computational-resources-cluster-at-gtmc.html"&gt;this post&lt;/a&gt; I will try to run some programs developed in Codelite, in the computers/clusters at my disposition in &lt;a href="http://www.famaf.unc.edu.ar/gtmc/"&gt;GTMC&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;So, my first trying step is to write a simple(basic) program in Codelite, make an executable from it, and then run it in (for example) jote. So, I made a simple hello world program in codelite: &lt;/br&gt; &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * Simple hello world program&lt;br /&gt; * &lt;br /&gt; * Note that it includes the header stdio.h&lt;br /&gt; */&lt;br /&gt; &lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt;    printf(&amp;quot;hello world\n&amp;quot;);&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then build it. Inside the project directory (named &lt;b&gt;basicprogram&lt;/b&gt;) there is a directory named &lt;b&gt;Debug/&lt;/b&gt;, inside it there is an executable file named &lt;i&gt;basicprogram&lt;/i&gt; (so it seems that the executable acquires the project name). The I copied it inside jote (into a &lt;b&gt;tmp&lt;/b&gt; directory), and try tu run it: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ./basicprogram  &lt;br /&gt;-bash: ./basicprogram: cannot execute binary file&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, this simple hello world program does not work. Is this because the inclusion of the &lt;i&gt;stdio.h&lt;/i&gt; header? Lets look what happens if I do not include it. So I modify the program: &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.cpp&lt;br /&gt; *&lt;br /&gt; * Simple hello world program&lt;br /&gt; * &lt;br /&gt; * Note that now the inclusion of stdio.h is commented&lt;br /&gt; */&lt;br /&gt; &lt;br /&gt;//#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt;//    printf(&amp;quot;hello world\n&amp;quot;);&lt;br /&gt;    int j=0;&lt;br /&gt;    return j;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it also does not work. So, it seems that the code need to be compiled on the target machine. &lt;/br&gt;&lt;/br&gt;What happens if I compile that code using simply my g++ ubuntu compiler? It also doesn't work.&lt;/br&gt;&lt;/br&gt;TODO: Ask to the computers maintainers if there is (and which one, g++, gcc, etc) a C++ compiler installed on the computers. &lt;/br&gt;&lt;/br&gt;Nice... g++ is installed in bandurria, and a simple Hello World program can be compiled and run there. What about a program that uses STL o BGL?&lt;/br&gt;&lt;/br&gt;TODO: Answer this question. &lt;/br&gt;&lt;/br&gt;The following program uses STL: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.cpp&lt;br /&gt; *&lt;br /&gt; * This program objective is to see if code that uses STL&lt;br /&gt; * can be compiled in the clusters of GTMC, in particular&lt;br /&gt; * in bandurria.&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * This kind of including does not work on my system.&lt;br /&gt; */&lt;br /&gt;//#include &amp;lt;string.h&amp;gt;&lt;br /&gt;//#include &amp;lt;algo.h&amp;gt;&lt;br /&gt;//#include &amp;lt;vector.h&amp;gt;&lt;br /&gt;//#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;//#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * This kind of including does work on my system.&lt;br /&gt; */&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;main ()&lt;br /&gt;{&lt;br /&gt;  using namespace std;&lt;br /&gt;    &lt;br /&gt;  vector&amp;lt;int&amp;gt; v;  // create an empty vector of integers&lt;br /&gt;  int input;&lt;br /&gt;  while (cin &amp;gt;&amp;gt; input)    // while not end of file (press ctrl-D on my system to EOF)&lt;br /&gt;    v.push_back (input);  // append to vector&lt;br /&gt; &lt;br /&gt;  // sort takes two random iterators, and sorts the elements between &lt;br /&gt;  // them.  As is always the case in STL, this includes the value&lt;br /&gt;  // referred to by first but not the one referred to by last; indeed,&lt;br /&gt;  // this is often the past-the-end value, and is therefore not&lt;br /&gt;  // dereferenceable.&lt;br /&gt;  sort(v.begin(), v.end());&lt;br /&gt; &lt;br /&gt;  int n = v.size();&lt;br /&gt;  for (int i = 0; i &amp;lt; n; i++)&lt;br /&gt;    cout &amp;lt;&amp;lt; v[i] &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;it compiled and run on my system, and also if I copied main.cpp into bandurria I also can compile and run it. So, STL exists in bandurria, and is included in the same way (as far as I can see from this example) that I do that on my system. Now (again), what about BGL?, lets try with it. So I try a simple project in Codelite that involves two files:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.cpp&lt;br /&gt; * &lt;br /&gt; * This file is intended to write a small program that&lt;br /&gt; * uses BGL.&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;#include &amp;quot;main.h&amp;quot;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;{&lt;br /&gt;    using namespace std;&lt;br /&gt;    &lt;br /&gt;    cout &amp;lt;&amp;lt; &amp;quot;hello world BGL&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    &lt;br /&gt;    // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, bidirectionalS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] = &lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);&lt;br /&gt;&lt;br /&gt;    // get the property map for vertex indices&lt;br /&gt;    typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;    IndexMap index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;    // accessing the vertex set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;vertices(g) = &amp;quot;;&lt;br /&gt;    typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;    std::pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;    for (vp = vertices(g); vp.first != vp.second; ++vp.first)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // accessing the edge set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;edges(g) = &amp;quot;;&lt;br /&gt;    graph_traits&amp;lt;Graph&amp;gt;::edge_iterator ei, ei_end;&lt;br /&gt;    for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[source(*ei, g)] &lt;br /&gt;                  &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[target(*ei, g)] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // the adjacency structure&lt;br /&gt;    std::for_each(vertices(g).first, vertices(g).second,&lt;br /&gt;                  exercise_vertex&amp;lt;Graph&amp;gt;(g));&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;and: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * filename: main.h&lt;br /&gt; * &lt;br /&gt; * This file is intended to write a small program that&lt;br /&gt; * uses BGL.&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/dijkstra_shortest_paths.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;  using namespace boost;&lt;br /&gt;&lt;br /&gt;  template &amp;lt;class Graph&amp;gt; struct exercise_vertex {&lt;br /&gt;    // the functor&lt;br /&gt;    exercise_vertex(Graph&amp;amp; g_) : g(g_) {}&lt;br /&gt;&lt;br /&gt;    typedef typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor Vertex;&lt;br /&gt;&lt;br /&gt;    // vertex descriptor&lt;br /&gt;    void operator()(const Vertex&amp;amp; v) const&lt;br /&gt;    {&lt;br /&gt;      typedef graph_traits&amp;lt;Graph&amp;gt; GraphTraits;&lt;br /&gt;      typename property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;      // which vertex&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent structure of vertex: &amp;quot; &amp;lt;&amp;lt; index[v] &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // out edges&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;out-edges: &amp;quot;;&lt;br /&gt;      typename GraphTraits::out_edge_iterator out_i, out_end;&lt;br /&gt;      typename GraphTraits::edge_descriptor e;&lt;br /&gt;      for (tie(out_i, out_end) = out_edges(v, g); &lt;br /&gt;           out_i != out_end; ++out_i) {&lt;br /&gt;        e = *out_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &lt;br /&gt;                  &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;      }&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // in edges&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;in-edges: &amp;quot;;&lt;br /&gt;      typename GraphTraits::in_edge_iterator in_i, in_end;&lt;br /&gt;      for (tie(in_i, in_end) = in_edges(v,g); &lt;br /&gt;           in_i != in_end; ++in_i) {&lt;br /&gt;        e = *in_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;      }&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // adjacent vertices (notice that it only returns the vertex that are targets of out edges of vertex v)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent vertices: &amp;quot;;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai_end;&lt;br /&gt;      for (tie(ai, ai_end) = adjacent_vertices(v, g); ai != ai_end; ++ai)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; index[*ai] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // ...&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    Graph&amp;amp; g;&lt;br /&gt;  };&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it works on my system, but it does not compile in bandurria. Seems that BGL is not there. So, now I have two (plaussible) directions. One is to install BGL on my home in bandurria, the other is to ask Banchio to install it in the system.&lt;/br&gt;&lt;/br&gt;TODO: Solve this problem. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8248046846430394187?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8248046846430394187/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8248046846430394187' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8248046846430394187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8248046846430394187'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/computational-resources-checking-if-i.html' title='Computational Resources - Checking if I can run programs developed in my machine in the GTMC computers/clusters'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-5606845198497297233</id><published>2011-02-25T11:51:00.004-03:00</published><updated>2011-02-25T11:53:54.358-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computational resources'/><title type='text'>Computational resources - Clusters and computers at my disposition</title><content type='html'>This post is dedicated to "my relationship" with the clusters at the &lt;a href="http://www.famaf.unc.edu.ar/gtmc/"&gt;GTMC&lt;/a&gt; group in &lt;a href="http://www.famaf.unc.edu.ar/"&gt;FaMAF&lt;/a&gt;. Some time ago I had used some computer with 8 nodes of the &lt;a href="http://www.famaf.unc.edu.ar/grupos/grg/"&gt;Grupo de Relatividad&lt;/a&gt; at FaMAF. The name of the computer is Manguruyu.I know that there are other clusters in the &lt;a href="http://www.unc.edu.ar/"&gt;UNC&lt;/a&gt;, but I don't have much more information (plausible contact: Christian Sanchez at the Facultad de Quimica).&lt;/br&gt;&lt;/br&gt;So, at GTMC (my main option) there are two clusters of computers: &lt;/br&gt;&lt;/br&gt;Deep Bluee II &lt;/br&gt;Bandurria &lt;/br&gt;&lt;/br&gt;Also there are some isolated machines that I can access to to run programs. They are: &lt;/br&gt;&lt;/br&gt;tero (a core i7 with 6 or 8 nodes) &lt;/br&gt;jote &lt;/br&gt;lince (maybe soon with GPGPU)&lt;/br&gt;lechuza (maybe) &lt;/br&gt;&lt;/br&gt;Now, I know that most of them has an Intel Fortran compiler. I don't know if they have some C++ compiler. I believe that some of them has some version of R installed (but, I'm not sure, and I don't know which one is/are).&lt;/br&gt;&lt;/br&gt;So, a list of TODO things: &lt;/br&gt;&lt;/br&gt;TODO: Check which computers/clusters have some C++ compiler and which one (g++, or gcc, etc). &lt;/br&gt;TODO: Check which computer (maybe cluster) has R (and which version).&lt;/br&gt;TODO: Determine in which computers is best to install R. &lt;/br&gt;&lt;/br&gt;Also some questions came to my mind. If I develop C++ progrmas in codelite (in my machine), then: &lt;/br&gt;&lt;/br&gt;How then I run them in the clusters? &lt;/br&gt;I compile in my machine and copy the executables to the clusters? &lt;/br&gt;Or is best to compiler the programs directly on the clusters? &lt;/br&gt;The programs that where originally developed in codelite, are easy to compile in the clusters (or in other machine that does not have Codelite installed)? &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-5606845198497297233?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/5606845198497297233/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=5606845198497297233' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5606845198497297233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5606845198497297233'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/computational-resources-cluster-at-gtmc.html' title='Computational resources - Clusters and computers at my disposition'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7616159107619779063</id><published>2011-02-24T21:43:00.004-03:00</published><updated>2011-02-26T12:57:31.882-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='programming languages'/><category scheme='http://www.blogger.com/atom/ns#' term='generic programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><title type='text'>News - Programming Languages</title><content type='html'>The new C++ standard is comming:&lt;a href="http://en.wikipedia.org/wiki/C%2B%2B0x"&gt;C++0x at Wiki&lt;/a&gt;One of it virtues is to improve/facilitate the "usage" of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Generic_programming"&gt;generic programming&lt;/a&gt;&lt;/i&gt; (that one that uses &lt;a href="http://en.wikipedia.org/wiki/Concept_(generic_programming)"&gt;&lt;i&gt;concepts&lt;/i&gt;&lt;/a&gt; as in for example &lt;a href="http://en.wikipedia.org/wiki/Standard_Template_Library"&gt;&lt;i&gt;STL&lt;/i&gt;&lt;/a&gt;)Una de las virtudes, es mejorar/facilitar el uso de "generic programming". &lt;/br&gt;&lt;/br&gt;Here a video: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://video.google.com/videoplay?docid=-1790714981047186825#"&gt;Concepts Extending C++ Templates For Generic Programming&lt;/a&gt; (google video) &lt;/br&gt;&lt;/br&gt;Here is the (some) official page about ConecptGCC (Generic programming trough concepts) that is provided in the talk of the video: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.generic-programming.org/software/ConceptGCC/"&gt;http://www.generic-programming.org/software/ConceptGCC/&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www2.research.att.com/~bs/C++0xFAQ.html"&gt;Here&lt;/a&gt; a good source of information about C++0x. &lt;/br&gt;&lt;/br&gt;Wow, as mentionated &lt;a href="http://www2.research.att.com/~bs/C++0xFAQ.html#what-concepts"&gt;here&lt;/a&gt;, it seems that after all, concepts will not be part of C++0x, it seems that the committee decided to postpone the inclusion of concepts to a later version (eg. C++1x). &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7616159107619779063?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7616159107619779063/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7616159107619779063' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7616159107619779063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7616159107619779063'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/news-programming-languages.html' title='News - Programming Languages'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-408959772353633411</id><published>2011-02-24T19:33:00.001-03:00</published><updated>2011-02-24T19:40:26.158-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='system manteinance'/><title type='text'>System manteinance</title><content type='html'>This days when ubuntu start up a window appears. It says: &lt;/br&gt;&lt;/br&gt;&lt;blockquote&gt;Apt Authentication issueProblem during package list update. The package list update failed with a authentication failure. This usually happens behind a network proxy server. Please try to click on the "Run this action now" button to correct the problem or update the list manually by running Update Manager and clicking on "Check".&lt;/blockquote&gt;&lt;/br&gt;So, I click on a button that says "Run this action now", and then another windows appears inwhich the following message can be read: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://cran-r.c3sl.ufpr.br karmic/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9&lt;br /&gt;&lt;br /&gt;W: Failed to fetch http://cran-r.c3sl.ufpr.br/bin/linux/ubuntu/karmic/Release  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it has to do with CRAN. What this problem mean? And, how I can solve it? &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-408959772353633411?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/408959772353633411/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=408959772353633411' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/408959772353633411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/408959772353633411'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/system-manteinance.html' title='System manteinance'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3538817690343204458</id><published>2011-02-24T14:52:00.011-03:00</published><updated>2011-02-25T17:13:12.637-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='codelite'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>IDEs - Codelite n.2 - C++, R, Rcpp, BGL</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/ides-codelite-n1.html"&gt;previous post&lt;/a&gt; I managed to build a project in &lt;a href="http://codelite.org/"&gt;Codelite&lt;/a&gt; that buid as a C++ project and also from it I can build a R package that uses Rcpp. Now, I will go further and try to add some difficulty to it. I will incorporate &lt;a href="http://www.boost.org/doc/libs/1_46_0/libs/graph/doc/index.html"&gt;BGL&lt;/a&gt; code into it. &lt;/br&gt;&lt;/br&gt;So as in the &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/ides-codelite-n1.html"&gt;previous post&lt;/a&gt; I start by opening a R console from Codelite and write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(Rcpp)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp.package.skeleton(&amp;quot;codeliteRcppBgl&amp;quot;)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './codeliteRcppBgl/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, inside the same workspace directory as in the previous post (Codelite starts in the same workspace that I was working in the previous post) I have created a Rcpp source package named&lt;b&gt;codeliteRcppBgl&lt;/b&gt;. &lt;/br&gt;&lt;/br&gt;Now, I tried to create a new project with the same name (inside the actual workspace) of the type "Simple executable g++" and I get the following message: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;The File 'main.cpp' already exists at the target directory '/home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace'&lt;br /&gt;Please select a different project path&lt;br /&gt;The file 'main.cpp' is part of the template project [Simple executable (g++)]&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I choose not to overwrite. So, it seems that this is not the right way of using workspaces and projects. So I deleted the source package (from a linux terminal), close the actual working space and create a new one. Inside the new workspace directory I created again the Rcpp source package. The I created inside the workspace a project (of the type "Simple executable g++") with the same name as the Rcpp source package. &lt;/br&gt;&lt;/br&gt;Now I incorporate the files of the Rcpp source package into the project. That is, I incorporate&lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt;, &lt;i&gt;rcpp_hello_world.h&lt;/i&gt;, and &lt;i&gt;rcpp_hello_world.R&lt;/i&gt; (the last one codelite recognizes it as a simple plain text file). Inside &lt;i&gt;rcpp_hello_world.h&lt;/i&gt; there is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#ifndef _codeliteRcppBgl_RCPP_HELLO_WORLD_H&lt;br /&gt;#define _codeliteRcppBgl_RCPP_HELLO_WORLD_H&lt;br /&gt;&lt;br /&gt;#include &amp;lt;Rcpp.h&amp;gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * note : RcppExport is an alias to `extern &amp;quot;C&amp;quot;` defined by Rcpp.&lt;br /&gt; *&lt;br /&gt; * It gives C calling convention to the rcpp_hello_world function so that &lt;br /&gt; * it can be called from .Call in R. Otherwise, the C++ compiler mangles the &lt;br /&gt; * name of the function and .Call can't find it.&lt;br /&gt; *&lt;br /&gt; * It is only useful to use RcppExport when the function is intended to be called&lt;br /&gt; * by .Call. See the thread http://thread.gmane.org/gmane.comp.lang.r.rcpp/649/focus=672&lt;br /&gt; * on Rcpp-devel for a misuse of RcppExport&lt;br /&gt; */&lt;br /&gt;RcppExport SEXP rcpp_hello_world() ;&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So I modify it into (by following ideas that I had previously done &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/c-stl-bgl-learning-some-examples-n2.html"&gt;here&lt;/a&gt;): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#ifndef _codeliteRcppBgl_RCPP_HELLO_WORLD_H&lt;br /&gt;#define _codeliteRcppBgl_RCPP_HELLO_WORLD_H&lt;br /&gt;&lt;br /&gt;#include &amp;lt;Rcpp.h&amp;gt;&lt;br /&gt;&lt;br /&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/dijkstra_shortest_paths.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * note : RcppExport is an alias to `extern &amp;quot;C&amp;quot;` defined by Rcpp.&lt;br /&gt; *&lt;br /&gt; * It gives C calling convention to the rcpp_hello_world function so that &lt;br /&gt; * it can be called from .Call in R. Otherwise, the C++ compiler mangles the &lt;br /&gt; * name of the function and .Call can't find it.&lt;br /&gt; *&lt;br /&gt; * It is only useful to use RcppExport when the function is intended to be called&lt;br /&gt; * by .Call. See the thread http://thread.gmane.org/gmane.comp.lang.r.rcpp/649/focus=672&lt;br /&gt; * on Rcpp-devel for a misuse of RcppExport&lt;br /&gt; */&lt;br /&gt;RcppExport SEXP rcpp_hello_world() ;&lt;br /&gt;&lt;br /&gt;using namespace boost;&lt;br /&gt;&lt;br /&gt;  template &amp;lt;class Graph&amp;gt; struct exercise_vertex {&lt;br /&gt;    // the functor&lt;br /&gt;    exercise_vertex(Graph&amp;amp; g_) : g(g_) {}&lt;br /&gt;&lt;br /&gt;    typedef typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor Vertex;&lt;br /&gt;&lt;br /&gt;    // vertex descriptor&lt;br /&gt;    void operator()(const Vertex&amp;amp; v) const&lt;br /&gt;    {&lt;br /&gt;      typedef graph_traits&amp;lt;Graph&amp;gt; GraphTraits;&lt;br /&gt;      typename property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;      // which vertex&lt;br /&gt;//      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent structure of vertex: &amp;quot; &amp;lt;&amp;lt; index[v] &amp;lt;&amp;lt; std::endl;&lt;br /&gt;        Rprintf(&amp;quot;adjacent structure of vertex: %d \n&amp;quot;);&lt;br /&gt;&lt;br /&gt;      // out edges&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;out-edges: &amp;quot;;&lt;br /&gt;      typename GraphTraits::out_edge_iterator out_i, out_end;&lt;br /&gt;      typename GraphTraits::edge_descriptor e;&lt;br /&gt;      for (tie(out_i, out_end) = out_edges(v, g); &lt;br /&gt;           out_i != out_end; ++out_i) {&lt;br /&gt;        e = *out_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;//        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &lt;br /&gt;//                  &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;        Rprintf(&amp;quot;(%d,%d)&amp;quot;,index[src],index[targ]);&lt;br /&gt;      }&lt;br /&gt;//      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;        Rprintf(&amp;quot;\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;      // in edges&lt;br /&gt;//      std::cout &amp;lt;&amp;lt; &amp;quot;in-edges: &amp;quot;;&lt;br /&gt;        Rprintf(&amp;quot;in-edged: &amp;quot;);&lt;br /&gt;      typename GraphTraits::in_edge_iterator in_i, in_end;&lt;br /&gt;      for (tie(in_i, in_end) = in_edges(v,g); &lt;br /&gt;           in_i != in_end; ++in_i) {&lt;br /&gt;        e = *in_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;//        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;        Rprintf(&amp;quot;(%d,%d)&amp;quot;,index[src],index[targ]);&lt;br /&gt;      }&lt;br /&gt;//      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;        Rprintf(&amp;quot;\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;      // adjacent vertices (notice that it only returns the vertex that are targets of out edges of vertex v)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent vertices: &amp;quot;;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai_end;&lt;br /&gt;      for (tie(ai, ai_end) = adjacent_vertices(v, g); ai != ai_end; ++ai){&lt;br /&gt;//        std::cout &amp;lt;&amp;lt; index[*ai] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;  &lt;br /&gt;        Rprintf(&amp;quot;%d&amp;quot;,index[*ai]);&lt;br /&gt;      }&lt;br /&gt;//      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;    Rprintf(&amp;quot;\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;      // ...&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    Graph&amp;amp; g;&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;And modifiy &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; from: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;    &lt;br /&gt;    CharacterVector x = CharacterVector::create( &amp;quot;foo&amp;quot;, &amp;quot;bar&amp;quot; )  ;&lt;br /&gt;    NumericVector y   = NumericVector::create( 0.0, 1.0 ) ;&lt;br /&gt;    List z            = List::create( x, y ) ;&lt;br /&gt;&lt;br /&gt;    return z ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;into: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;    &lt;br /&gt;    CharacterVector x = CharacterVector::create( &amp;quot;foo&amp;quot;, &amp;quot;bar&amp;quot; )  ;&lt;br /&gt;    NumericVector y   = NumericVector::create( 0.0, 1.0 ) ;&lt;br /&gt;    List z            = List::create( x, y ) ;&lt;br /&gt;&lt;br /&gt; // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, bidirectionalS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] = &lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);&lt;br /&gt;&lt;br /&gt;    // get the property map for vertex indices&lt;br /&gt;    typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;    IndexMap index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;    // accessing the vertex set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;vertices(g) = &amp;quot;;&lt;br /&gt;    typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;    std::pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;    for (vp = vertices(g); vp.first != vp.second; ++vp.first)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // accessing the edge set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;edges(g) = &amp;quot;;&lt;br /&gt;    graph_traits&amp;lt;Graph&amp;gt;::edge_iterator ei, ei_end;&lt;br /&gt;    for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[source(*ei, g)] &lt;br /&gt;                  &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[target(*ei, g)] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // the adjacency structure&lt;br /&gt;    std::for_each(vertices(g).first, vertices(g).second,exercise_vertex&amp;lt;Graph&amp;gt;(g));&lt;br /&gt;&lt;br /&gt;    return wrap(&amp;quot;fin&amp;quot;) ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then I installed the source package via clicking the Codelite Extension tool button that I previously incorporate into Codelite (see &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/ides-codelite-n1.html"&gt;here&lt;/a&gt;). And then (also from Codelite via another Extension tool button) I open a R console and run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;codeliteRcppBgl&amp;quot;)&lt;br /&gt;Loading required package: codeliteRcppBgl&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; rcpp_hello_world()&lt;br /&gt;vertices(g) = 0 1 2 3 4 &lt;br /&gt;edges(g) = (0,1) (0,3) (2,0) (3,2) (2,4) (1,3) (3,4) &lt;br /&gt;adjacent structure of vertex: 0 &lt;br /&gt;out-edges: (0,1) (0,3) &lt;br /&gt;in-edged: (2,0) &lt;br /&gt;adjacent vertices: 1 3 &lt;br /&gt;adjacent structure of vertex: 1 &lt;br /&gt;out-edges: (1,3) &lt;br /&gt;in-edged: (0,1) &lt;br /&gt;adjacent vertices: 3 &lt;br /&gt;adjacent structure of vertex: 2 &lt;br /&gt;out-edges: (2,0) (2,4) &lt;br /&gt;in-edged: (3,2) &lt;br /&gt;adjacent vertices: 0 4 &lt;br /&gt;adjacent structure of vertex: 3 &lt;br /&gt;out-edges: (3,2) (3,4) &lt;br /&gt;in-edged: (0,3) (1,3) &lt;br /&gt;adjacent vertices: 2 4 &lt;br /&gt;adjacent structure of vertex: 4 &lt;br /&gt;out-edges: &lt;br /&gt;in-edged: (2,4) (3,4) &lt;br /&gt;adjacent vertices: &lt;br /&gt;[1] &amp;quot;fin&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it works nice !!!. Notice that it will not compilate as a C++ project inside Codelite. In fact, as I call "Rprintf()" in the template definition of the struct &lt;i&gt;exercise_vertex&lt;/i&gt; inside &lt;i&gt;rcpp_hello_world.h&lt;/i&gt; I think it will not work, even if I made all the header and library inclusions in the codelite call to the g++ compiler, because I imagine that &lt;i&gt;Rprintf()&lt;/i&gt; only works in a R console. &lt;/br&gt;&lt;/br&gt;Notice, that in the (template) code that I write in &lt;i&gt;rcpp_hello_world.h&lt;/i&gt; I call &lt;i&gt;Rprintf()&lt;/i&gt; to print in screen. But (by mistake) in the code inside &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; I use &lt;i&gt;cout&lt;/i&gt; to print on screen and it works !!! But, this is not recommended (I read some time). &lt;/br&gt; &lt;/br&gt;TODO: Try to compile this as a C++ Codelite project.&lt;/br&gt; &lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3538817690343204458?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3538817690343204458/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3538817690343204458' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3538817690343204458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3538817690343204458'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/ides-codelite-n2-c-r-rcpp-blg.html' title='IDEs - Codelite n.2 - C++, R, Rcpp, BGL'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6373528061259369276</id><published>2011-02-22T10:02:00.014-03:00</published><updated>2011-02-24T14:36:55.403-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='codelite'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>IDEs - Codelite n.1</title><content type='html'>I'm just installed &lt;a href="http://codelite.org/"&gt;Codelite&lt;/a&gt; to give it a try. It is mainly developed to work with C/C++. But as can be seen &lt;a href="http://codelite.org/docs/VideoTutorials/ExternalTools.html"&gt;here&lt;/a&gt; (video example) you can extend Codelite with external tools. Maybe this is a way to integrate some R functionality into Codelite. &lt;/br&gt;&lt;/br&gt;Now I have a problem. In the video example above the user incorporate external tools via menu:&lt;i&gt;Pluggins&lt;/i&gt; -&gt; &lt;i&gt;External tools&lt;/i&gt; -&gt; &lt;i&gt;Configure external tools&lt;/i&gt;. But in my installed version of Codelite there exist &lt;i&gt;Pluggins&lt;/i&gt; but it does not have &lt;i&gt;External tools&lt;/i&gt;. So I go to &lt;i&gt;synaptic&lt;/i&gt; (I'm on ubuntu) and search for &lt;i&gt;codelite-pluggins-externaltools&lt;/i&gt; and installed it. &lt;/br&gt;&lt;/br&gt;Now I try to follow the video in order to try to "install" a R console. So I do the following: &lt;/br&gt;&lt;/br&gt;1) I create a new &lt;i&gt;External tool&lt;/i&gt; that opens a ubuntu gnome-terminal. The only thing that worth to mention is that in the field &lt;i&gt;Path&lt;/i&gt; I write &lt;i&gt;gnome-terminal&lt;/i&gt; (so this is the command that it will execute and will open a ubuntu console). Also in the field &lt;i&gt;Working directory&lt;/i&gt; I go to help and copy &lt;i&gt;$(ProjectPath)&lt;/i&gt; (at least for the moment). Finally I "pick" the icons from &lt;b&gt;/usr/share/icons/gnome/...&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;Then I create another &lt;i&gt;External tool&lt;/i&gt; to open a R console. The things that worth to mention are. In the field &lt;i&gt;Path&lt;/i&gt; I write &lt;i&gt;gnome-terminal&lt;/i&gt;, and in the field &lt;i&gt;Arguments&lt;/i&gt; I write &lt;i&gt;-e R&lt;/i&gt; (so it opens a ubuntu terminal and run from it R). In the field &lt;i&gt;Working directory&lt;/i&gt; I write &lt;i&gt;$(ProjectPath)&lt;/i&gt; (you can choose predeterimated options from the help button in the pop up window). Finally I create adecuate R icons in format .png and save it under &lt;b&gt;/usr/share/icons/R/&lt;/b&gt; then I pick them. &lt;/br&gt;&lt;/br&gt;Now the idea is to create a Project from one can deal with a R source package. So in this first attempt I do the following. So, first one must to create a (codelite)workspace and inside it the (codelite)projects. So I create a workspace that requires a working directory. Then I open a R console (from codelite) and do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp.package.skeleton(&amp;quot;codelitepkg&amp;quot;)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './codelitepkg/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt;&amp;gt; dir()&lt;br /&gt;[1] &amp;quot;codelitepkg&amp;quot;                         &lt;br /&gt;[2] &amp;quot;codelite-workspace.tags&amp;quot;             &lt;br /&gt;[3] &amp;quot;codelite-workspace.workspace&amp;quot;        &lt;br /&gt;[4] &amp;quot;codelite-workspace.workspace.session&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so as one can see, I create a R (Rcpp) source package inside the workspace directory. Then I create a project named codelitepkg (the same name as the R source package). Inside it there appears a virtual directory named &lt;b&gt;src&lt;/b&gt;. I create two other virtual directories inside the project, one named &lt;b&gt;R&lt;/b&gt; and the other &lt;b&gt;Rsrc&lt;/b&gt;. Inside &lt;b&gt;R&lt;/b&gt; I incorporate the &lt;i&gt;rcpp_hello_world.R&lt;/i&gt; file inside the &lt;b&gt;codelitepkg/R/&lt;/b&gt; R source package directory (that it becomes created when I create the source package via the R console trough the command &lt;i&gt;Rcpp.package.skeleton("codelitepkg")&lt;/i&gt;). Analogously, inside &lt;b&gt;Rsrc&lt;/b&gt; I incorporate the &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; file inside &lt;b&gt;codelitepkg/src/&lt;/b&gt;.&lt;/br&gt;&lt;/br&gt;Now there remains to "complete the environment" with the addecuate External tools. So I create a new External tool that Install a R source package. In the field &lt;i&gt;Path&lt;/i&gt; I write &lt;i&gt;gnome-terminal&lt;/i&gt;. In the field &lt;i&gt;Arguments&lt;/i&gt; I write &lt;i&gt;-e 'R CMD INSTALL $(ProjectName)'&lt;/i&gt; (So it executes the R package installation command with the appropriate package name. For it to work the project name and the R source package must have the same name). Then I create (with &lt;a href="http://www.gimp.org/"&gt;Gimp&lt;/a&gt;) appropriate icons. Finally I check to Yes the &lt;i&gt;Save all files&lt;/i&gt; and &lt;i&gt;Capture output&lt;/i&gt; options. Now reamins to test it. &lt;/br&gt; &lt;/br&gt;So I click in the newly created icon (the one that install the source package inside the working space directory with the same name as the project), and in the output window I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Current working directory: /home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace&lt;br /&gt;Running program: &amp;quot;gnome-terminal&amp;quot; -e 'R CMD INSTALL codelitepkg'&lt;br /&gt;Program exited with return code: 0&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, there is not a log of the installation process. In fact, it opens temporarily an ubuntu console and one can see the log of installation process (in progress), but it gets closed when the process ends. So if there is some error maybe may be difficult to have the time to see it. &lt;/br&gt;TODO: How to solve this?&lt;/br&gt;In this case the process goes right as I can see when I open a R console (from Codelite) and write:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;codelitepkg&amp;quot;)&lt;br /&gt;Loading required package: codelitepkg&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; rcpp_hello_world()&lt;br /&gt;[[1]]&lt;br /&gt;[1] &amp;quot;foo&amp;quot; &amp;quot;bar&amp;quot;&lt;br /&gt;&lt;br /&gt;[[2]]&lt;br /&gt;[1] 0 1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Notice that one may eventually try to compile only the C++ from the standard way in Codelite. It will not work because the Rcpp.h is required. In fact, in the &lt;i&gt;Build&lt;/i&gt; I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;----------Build Started--------&lt;br /&gt;&amp;quot;make&amp;quot;  -j 2 -f &amp;quot;codelite-workspace_wsp.mk&amp;quot;&lt;br /&gt;----------Building project:[ codelitepkg - Debug ]----------&lt;br /&gt;In file included from /home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.cpp:1:&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.h:4:18: error: Rcpp.h: No such file or directory&lt;br /&gt;g++ -c  &amp;quot;/home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.cpp&amp;quot; -g  -o ./Debug/rcpp_hello_world.o &amp;quot;-I.&amp;quot; &amp;quot;-I.&amp;quot; &lt;br /&gt;In file included from /home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.cpp:1:&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.h:17: error: &amp;#8216;RcppExport&amp;#8217; does not name a type&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/codelite-workspace/codelitepkg/src/rcpp_hello_world.cpp:3: error: &amp;#8216;SEXP&amp;#8217; does not name a type&lt;br /&gt;make[1]: *** [Debug/rcpp_hello_world.o] Error 1&lt;br /&gt;make: *** [All] Error 2&lt;br /&gt;----------Build Ended----------&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I think that the following famous &lt;i&gt;Rcpp&lt;/i&gt; arguments passed to &lt;i&gt;g++&lt;/i&gt; are required: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;PKG_LIBS = `$(R_HOME)/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;`&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;that one can find inside the Makevars file inside the &lt;b&gt;src/&lt;/b&gt; in the R source package directory. Eventually it may be interesting to build a R source package that can be  R installed (as a package) and which C++ code can be called from a main.cpp file in the codelite project in order to (for example) test the C++ code inside the R source package without calling to R. In other words, some kind of programming in parallel R and C++ in such a way that it can be build into an R package, but also, its C++ part can be run separately from a main.cpp&lt;/br&gt;&lt;/br&gt;TODO: How to solve this problem? &lt;/br&gt;&lt;/br&gt;Maybe I must enter into &lt;a href="http://linux.die.net/man/1/g++"&gt;this&lt;/a&gt;. So, it seems that the process consists (in a first approximation) on four steps: &lt;/br&gt;&lt;/br&gt;1) preprocessing &lt;/br&gt;2) compilation &lt;/br&gt;3) assembly &lt;/br&gt;4) linking &lt;/br&gt;&lt;/br&gt;If in a linux console I write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(R RHOME)/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I obtain: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, where I must put this inside the Codelite IDE? &lt;/br&gt;&lt;/br&gt;So I do the following. First, one must notice that there are two things to do. One is to specify where the R and Rcpp headers are. Second specify appropriate linking parameters to Rcpp precompiled lib. &lt;/br&gt;&lt;/br&gt;For the first task I search trough my system where R.h and Rcpp.h are, and then include those paths in Codelite. Where? Well you click right button on the project (named codelitepkg in this case) in the window that contains the "workspace tree". Then I choose Settings -&gt; Compiler -&gt; Additional Search Path, and it this field I write (the previously mentioned paths): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/usr/local/lib/R/site-library/Rcpp/include;/usr/share/R/include&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, the paths are separated by a semicolon. The first path is the path to R.h (and related headers), the second path is the path to Rcpp.h (and related headers).&lt;/br&gt;Now, in respect to linking the code to the Rcpp precompiled library I do: (same as before) -&gt; Settings -&gt; Linker -&gt; Options, and in that field I write: &lt;/br&gt;&lt;/br&gt; &lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;`/usr/lib64/R/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;`&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;And it works, it compiles and run. Also as a test, inside the files &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; and &lt;i&gt;rcpp_hello_world.h&lt;/i&gt; I define and declare a function that I cal from &lt;i&gt;main.cpp&lt;/i&gt; and it works. &lt;/br&gt;&lt;/br&gt;Now there remains some things to solve. The "parameters" that I pass to codelite are very system specific. More precisely, the paths that I set in the compiler settings are specified at hand. Is there some way to obtain this paths automatically? For example, if in a ubuntu console one can get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R RHOME&lt;br /&gt;/usr/lib64/R&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, if R is installed it can give some paths. Can it give the paths to include its headers?Can it give the paths to include the Rcpp headers? In answering that question it may be useful too: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(R RHOME)/bin/Rscript -e &amp;quot;Rcpp:::CxxFlags()&amp;quot;&lt;br /&gt;-I/usr/local/lib/R/site-library/Rcpp/include&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;TODO: Solve those questions. &lt;/br&gt;&lt;/br&gt;In respect to this question, I submit a question to the &lt;a href="http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik4VSXhhx38-PmrkArGxET81TXvEZcgjSCO7%2BKf%40mail.gmail.com&amp;forum_name=codelite-users"&gt;codelite-user mailing list&lt;/a&gt;, and also make the same question on the &lt;a href="http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik4VSXhhx38-PmrkArGxET81TXvEZcgjSCO7%2BKf%40mail.gmail.com&amp;forum_name=codelite-users"&gt;codelite forum&lt;/a&gt;. Lets see what happen. &lt;/br&gt;&lt;/br&gt;Also note &lt;a href="http://codelite.org/LiteEditor/ProjectSettingsSummary"&gt;here&lt;/a&gt; that it seems that the CodeLite uses a makefile based system to process the settings that can be specified. &lt;/br&gt;So, Eran reply on the forum (thanks Eran ;)). He suggest this: Write the followingin the Linker options:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(shell $(shell R RHOME)/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it works. Now remains to do the analogous thing in the the include options. &lt;/br&gt;&lt;/br&gt;So, in order to do that I do the following. First I delete what I had written before in (right click project name) -&gt; Compiler -&gt; Additional Search Path. Now the idea is to specify the samein ... Compiler -&gt; Compiler Options via "-I". So there, in ... Compiler -&gt; Compiler Options there is already "-g", so I live it there and append to the end the "new" compiler options. More precisely, in the ... -&gt; Compiler Options I write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;-g $(shell $(shell R RHOME)/bin/Rscript -e &amp;quot;Rcpp:::CxxFlags()&amp;quot;) -I$(shell $(shell R RHOME)/bin/Rscript -e &amp;quot;cat(R.home('include'))&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, as it has 3 parts, the "-g" that is there before, and one to include the Rcpp headers: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(shell $(shell R RHOME)/bin/Rscript -e &amp;quot;Rcpp:::CxxFlags()&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and one to include the R headers: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(shell R RHOME)/bin/Rscript -e &amp;quot;cat(R.home('include'))&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Note that I made use of the following R commands: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; R.home('include')&lt;br /&gt;[1] &amp;quot;/usr/share/R/include&amp;quot;&lt;br /&gt;&amp;gt; require(Rcpp)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp:::LdFlags()&lt;br /&gt;-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;The "cat()" is to "clean" the output of "R.home('include')". And that is, with this thing, itworks (the code compiles and run). &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6373528061259369276?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6373528061259369276/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6373528061259369276' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6373528061259369276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6373528061259369276'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/ides-codelite-n1.html' title='IDEs - Codelite n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6498181170540024284</id><published>2011-02-20T20:24:00.004-03:00</published><updated>2011-02-21T14:33:24.497-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='Doxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Roxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Learning Roxygen, Doxygen - n.1</title><content type='html'>&lt;b&gt;Fist, Doxygen:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;Check &lt;a href="http://shaiperednik.com/2009/07/quick-guide-to-using-doxygen-in-ubuntu/"&gt;this&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Dosygen + Emacs: &lt;a href="http://code.google.com/p/epydoc-el/"&gt;this&lt;/a&gt;, &lt;a href="http://doxymacs.sourceforge.net/"&gt;this&lt;/a&gt; (doxymacs). &lt;/br&gt;&lt;/br&gt;Doxygen + Eclipse: &lt;a href="http://gna.org/projects/eclox"&gt;this&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Doxygen extensions: &lt;a href="http://www.stack.nl/~dimitri/doxygen/helpers.html"&gt;this&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Doxygen tutorials, intros: &lt;a href="http://www.cypax.net/tutorials/doxygen/index?language=en"&gt;here&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Doxygen, getting started: &lt;a href="http://www.stack.nl/~dimitri/doxygen/starting.html"&gt;here&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;TODO &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Second, Roxygen:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;TODO &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6498181170540024284?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6498181170540024284/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6498181170540024284' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6498181170540024284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6498181170540024284'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/learning-roxygen-and-doxygen-n1.html' title='Learning Roxygen, Doxygen - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-2253273176588518348</id><published>2011-02-20T17:24:00.000-03:00</published><updated>2011-02-20T17:24:35.035-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><category scheme='http://www.blogger.com/atom/ns#' term='Emacs'/><title type='text'>Learning - Debugging in R or/and C++ - n.1</title><content type='html'>So, I'm looking to improve my resources as a code writer. So I look for IDEs (&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-statistics-ides.html"&gt;previous post&lt;/a&gt;), also I have in mind &lt;a href="http://roxygen.org/"&gt;Roxygen&lt;/a&gt; (see &lt;a href="http://deliriosderayohauno.blogspot.com/search/label/Roxygen"&gt;previous post&lt;/a&gt;, and maybe using &lt;a href="http://www.stack.nl/~dimitri/doxygen/"&gt;Doxygen&lt;/a&gt; for the non R code) in order to practice an appropriate code documentation style. &lt;/br&gt;&lt;/br&gt;But, what about debugging? This may enhance the code development a lot !!! In fact was &lt;a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs"&gt;this&lt;/a&gt; the thing that makes me think about debugging tools. &lt;/br&gt;&lt;/br&gt;From the C++ side there exist &lt;i&gt;gdb&lt;/i&gt; (look &lt;a href="http://www.delorie.com/gnu/docs/gdb/gdb_toc.html"&gt;here&lt;/a&gt;, and &lt;a href="http://www.tutorialspoint.com/gnu_debugger/index.htm"&gt;here&lt;/a&gt;). And it seems that it can be integrated to Emacs (see &lt;a href="http://tedlab.mit.edu/~dr/gdbintro.html"&gt;here&lt;/a&gt;). Thoug it seems that debugging simultaneously R and C++ code (the last one integrated to R) is not an "easy" task in the sense that there is no direct way (see &lt;a href="http://stackoverflow.com/questions/4980595/how-to-debug-an-r-package-with-c-code-in-emacs-using-gdb"&gt;here&lt;/a&gt;, and &lt;a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs"&gt;here&lt;/a&gt;). &lt;/br&gt;&lt;/br&gt;Keywords: debugging, gdb (related to g++)&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-2253273176588518348?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/2253273176588518348/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=2253273176588518348' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2253273176588518348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2253273176588518348'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/learning-debugging-in-r-orand-c-n1.html' title='Learning - Debugging in R or/and C++ - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6644089911145307800</id><published>2011-02-19T17:08:00.000-03:00</published><updated>2011-02-19T17:08:39.567-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pseudorandom'/><category scheme='http://www.blogger.com/atom/ns#' term='random'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><title type='text'>Pseudo-Random number generators in Boost C++ Library</title><content type='html'>Here I pick some info about random number generation in &lt;a href="http://www.boost.org/"&gt;Boost C++ Library&lt;/a&gt;. It is about using the &lt;a href="http://www.boost.org/doc/libs/1_45_0/doc/html/boost_random.html#boost_random.introduction"&gt;Boost.Random C++ Library&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Here some examples of its usage: &lt;a href="http://stackoverflow.com/questions/2254909/boost-random-number-generator"&gt;ex1&lt;/a&gt;, &lt;a href="http://stackoverflow.com/questions/4329284/c-boost-random-numeric-generation-problem"&gt;ex2&lt;/a&gt; (there is also examples in the Boost.Random C++ Library). &lt;/br&gt;&lt;/br&gt;And &lt;a href="http://arxiv.org/PS_cache/arxiv/pdf/1005/1005.4117v1.pdf"&gt;here&lt;/a&gt; a nice &lt;a href="http://arxiv.org/"&gt;arXiv&lt;/a&gt; paper on random number in scientific research. &lt;/br&gt;&lt;/br&gt;I think that Mersenne Twister (&lt;i&gt;mt29937()&lt;/i&gt; in the boost) is a good candidate, becauseit is random enough and also fast. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6644089911145307800?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6644089911145307800/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6644089911145307800' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6644089911145307800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6644089911145307800'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/pseudo-random-number-generators-in.html' title='Pseudo-Random number generators in Boost C++ Library'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-2959458690189641587</id><published>2011-02-19T11:33:00.009-03:00</published><updated>2011-02-19T19:05:52.373-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='examples'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++, STL, BGL Learning - Some examples - n.2</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/c-stl-bgl-learning-some-examples-n1.html"&gt;previous post&lt;/a&gt; I try a simple example of a C++ program that uses STL. Now in this post I will try a simple program that uses BGL. &lt;/br&gt;&lt;/br&gt;So, I try an example from &lt;a href="http://beta.boost.org/doc/libs/1_46_0_beta1/libs/graph/doc/quick_tour.html"&gt;here&lt;/a&gt;: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/dijkstra_shortest_paths.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;  using namespace boost;&lt;br /&gt;&lt;br /&gt;  int main(int,char*[])&lt;br /&gt;  {&lt;br /&gt;    // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, bidirectionalS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] =&lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);&lt;br /&gt;    ...&lt;br /&gt;    return 0;&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, in a ubuntu console, I do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example-basic-bgl.cpp &lt;br /&gt;example-basic-bgl.cpp:4:42: error: boost/graph/graph_traits.hpp: No such file or directory&lt;br /&gt;example-basic-bgl.cpp:5:44: error: boost/graph/adjacency_list.hpp: No such file or directory&lt;br /&gt;example-basic-bgl.cpp:6:53: error: boost/graph/dijkstra_shortest_paths.hpp: No such file or directory&lt;br /&gt;example-basic-bgl.cpp:8: error: &amp;#8216;boost&amp;#8217; is not a namespace-name&lt;br /&gt;example-basic-bgl.cpp:8: error: expected namespace-name before &amp;#8216;;&amp;#8217; token&lt;br /&gt;example-basic-bgl.cpp: In function &amp;#8216;int main(int, char**)&amp;#8217;:&lt;br /&gt;example-basic-bgl.cpp:13: error: expected initializer before &amp;#8216;&amp;lt;&amp;#8217; token&lt;br /&gt;example-basic-bgl.cpp:28: error: &amp;#8216;Graph&amp;#8217; was not declared in this scope&lt;br /&gt;example-basic-bgl.cpp:28: error: expected &amp;#8216;;&amp;#8217; before &amp;#8216;g&amp;#8217;&lt;br /&gt;example-basic-bgl.cpp:32: error: &amp;#8216;g&amp;#8217; was not declared in this scope&lt;br /&gt;example-basic-bgl.cpp:32: error: &amp;#8216;add_edge&amp;#8217; was not declared in this scope&lt;br /&gt;example-basic-bgl.cpp:33: error: expected primary-expression before &amp;#8216;...&amp;#8217; token&lt;br /&gt;example-basic-bgl.cpp:33: error: expected &amp;#8216;;&amp;#8217; before &amp;#8216;...&amp;#8217; token&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, the BGL is not installed on my system. What about BGL on ubuntu? Maybe &lt;a href="http://joysofprogramming.com/install-libboost-graph-dev-ubuntu/"&gt;this post&lt;/a&gt; may help. So I do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ sudo apt-get install libboost-graph-dev&lt;br /&gt;[sudo] password for juan: &lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree       &lt;br /&gt;Reading state information... Done&lt;br /&gt;The following packages were automatically installed and are no longer required:&lt;br /&gt;  libaccess-bridge-java libboost-python1.38.0 icedtea-6-jre-cacao openjdk-6-jre-lib openjdk-6-jre-headless libaccess-bridge-java-jni dkms tzdata-java gccxml rhino&lt;br /&gt;  ca-certificates-java libjline-java&lt;br /&gt;Use 'apt-get autoremove' to remove them.&lt;br /&gt;The following extra packages will be installed:&lt;br /&gt;  gccxml libboost-date-time1.38-dev libboost-date-time1.38.0 libboost-filesystem1.38-dev libboost-filesystem1.38.0 libboost-graph1.38-dev libboost-graph1.38.0&lt;br /&gt;  libboost-iostreams1.38-dev libboost-iostreams1.38.0 libboost-math1.38-dev libboost-math1.38.0 libboost-program-options1.38-dev libboost-program-options1.38.0&lt;br /&gt;  libboost-python1.38.0 libboost-regex1.38-dev libboost-regex1.38.0 libboost-serialization1.38-dev libboost-serialization1.38.0 libboost-signals1.38-dev&lt;br /&gt;  libboost-signals1.38.0 libboost-system1.38-dev libboost-system1.38.0 libboost-test1.38-dev libboost-test1.38.0 libboost-thread1.38-dev libboost-thread1.38.0&lt;br /&gt;  libboost-wave1.38-dev libboost-wave1.38.0 libboost1.38-dev libboost1.38-doc libicu-dev&lt;br /&gt;Suggested packages:&lt;br /&gt;  graphviz icu-doc&lt;br /&gt;Recommended packages:&lt;br /&gt;  libboost-python1.38-dev&lt;br /&gt;The following NEW packages will be installed:&lt;br /&gt;  gccxml libboost-date-time1.38-dev libboost-date-time1.38.0 libboost-filesystem1.38-dev libboost-filesystem1.38.0 libboost-graph-dev libboost-graph1.38-dev&lt;br /&gt;  libboost-graph1.38.0 libboost-iostreams1.38-dev libboost-iostreams1.38.0 libboost-math1.38-dev libboost-math1.38.0 libboost-program-options1.38-dev&lt;br /&gt;  libboost-program-options1.38.0 libboost-python1.38.0 libboost-regex1.38-dev libboost-regex1.38.0 libboost-serialization1.38-dev libboost-serialization1.38.0&lt;br /&gt;  libboost-signals1.38-dev libboost-signals1.38.0 libboost-system1.38-dev libboost-system1.38.0 libboost-test1.38-dev libboost-test1.38.0 libboost-thread1.38-dev&lt;br /&gt;  libboost-thread1.38.0 libboost-wave1.38-dev libboost-wave1.38.0 libboost1.38-dev libboost1.38-doc libicu-dev&lt;br /&gt;0 upgraded, 32 newly installed, 0 to remove and 15 not upgraded.&lt;br /&gt;Need to get 59.0MB of archives.&lt;br /&gt;After this operation, 314MB of additional disk space will be used.&lt;br /&gt;Do you want to continue [Y/n]? Y&lt;br /&gt;Get:1 http://ar.archive.ubuntu.com karmic/main gccxml 0.9.0+cvs20080525-1ubuntu1 [4,013kB]&lt;br /&gt;Get:2 http://ar.archive.ubuntu.com karmic/main libboost1.38-dev 1.38.0-6ubuntu6 [3,786kB]                                                                              &lt;br /&gt;Get:3 http://ar.archive.ubuntu.com karmic/main libboost-date-time1.38.0 1.38.0-6ubuntu6 [40.1kB]                                                                       &lt;br /&gt;Get:4 http://ar.archive.ubuntu.com karmic/main libboost-serialization1.38.0 1.38.0-6ubuntu6 [232kB]                                                                    &lt;br /&gt;Get:5 http://ar.archive.ubuntu.com karmic/main libboost-serialization1.38-dev 1.38.0-6ubuntu6 [375kB]                                                                  &lt;br /&gt;Get:6 http://ar.archive.ubuntu.com karmic/main libboost-date-time1.38-dev 1.38.0-6ubuntu6 [166kB]                                                                      &lt;br /&gt;Get:7 http://ar.archive.ubuntu.com karmic/main libboost-system1.38.0 1.38.0-6ubuntu6 [24.9kB]                                                                          &lt;br /&gt;Get:8 http://ar.archive.ubuntu.com karmic/main libboost-filesystem1.38.0 1.38.0-6ubuntu6 [46.2kB]                                                                      &lt;br /&gt;Get:9 http://ar.archive.ubuntu.com karmic/main libboost-system1.38-dev 1.38.0-6ubuntu6 [32.6kB]                                                                        &lt;br /&gt;Get:10 http://ar.archive.ubuntu.com karmic/main libboost-filesystem1.38-dev 1.38.0-6ubuntu6 [76.5kB]                                                                   &lt;br /&gt;Get:11 http://ar.archive.ubuntu.com karmic/main libboost-test1.38.0 1.38.0-6ubuntu6 [183kB]                                                                            &lt;br /&gt;Get:12 http://ar.archive.ubuntu.com karmic/main libboost-test1.38-dev 1.38.0-6ubuntu6 [383kB]                                                                          &lt;br /&gt;Get:13 http://ar.archive.ubuntu.com karmic/main libboost-graph1.38-dev 1.38.0-6ubuntu6 [415kB]                                                                         &lt;br /&gt;Get:14 http://ar.archive.ubuntu.com karmic/universe libboost-graph-dev 1.38.1 [1,702B]                                                                                 &lt;br /&gt;Get:15 http://ar.archive.ubuntu.com karmic/main libboost-graph1.38.0 1.38.0-6ubuntu6 [124kB]                                                                           &lt;br /&gt;Get:16 http://ar.archive.ubuntu.com karmic/main libboost-regex1.38.0 1.38.0-6ubuntu6 [341kB]                                                                           &lt;br /&gt;Get:17 http://ar.archive.ubuntu.com karmic/main libicu-dev 4.0.1-2ubuntu2 [8,225kB]                                                                                    &lt;br /&gt;Get:18 http://ar.archive.ubuntu.com karmic/main libboost-regex1.38-dev 1.38.0-6ubuntu6 [592kB]                                                                         &lt;br /&gt;Get:19 http://ar.archive.ubuntu.com karmic/main libboost-iostreams1.38.0 1.38.0-6ubuntu6 [34.8kB]                                                                      &lt;br /&gt;Get:20 http://ar.archive.ubuntu.com karmic/main libboost-iostreams1.38-dev 1.38.0-6ubuntu6 [132kB]                                                                     &lt;br /&gt;Get:21 http://ar.archive.ubuntu.com karmic/main libboost-math1.38.0 1.38.0-6ubuntu6 [449kB]                                                                            &lt;br /&gt;Get:22 http://ar.archive.ubuntu.com karmic/main libboost-math1.38-dev 1.38.0-6ubuntu6 [2,052kB]                                                                        &lt;br /&gt;Get:23 http://ar.archive.ubuntu.com karmic/main libboost-program-options1.38.0 1.38.0-6ubuntu6 [119kB]                                                                 &lt;br /&gt;Get:24 http://ar.archive.ubuntu.com karmic/main libboost-program-options1.38-dev 1.38.0-6ubuntu6 [194kB]                                                               &lt;br /&gt;Get:25 http://ar.archive.ubuntu.com karmic/main libboost-python1.38.0 1.38.0-6ubuntu6 [245kB]                                                                          &lt;br /&gt;Get:26 http://ar.archive.ubuntu.com karmic/main libboost-signals1.38.0 1.38.0-6ubuntu6 [47.7kB]                                                                        &lt;br /&gt;Get:27 http://ar.archive.ubuntu.com karmic/main libboost-signals1.38-dev 1.38.0-6ubuntu6 [68.0kB]                                                                      &lt;br /&gt;Get:28 http://ar.archive.ubuntu.com karmic/main libboost-thread1.38.0 1.38.0-6ubuntu6 [47.6kB]                                                                         &lt;br /&gt;Get:29 http://ar.archive.ubuntu.com karmic/main libboost-thread1.38-dev 1.38.0-6ubuntu6 [80.7kB]                                                                       &lt;br /&gt;Get:30 http://ar.archive.ubuntu.com karmic/main libboost-wave1.38.0 1.38.0-6ubuntu6 [249kB]                                                                            &lt;br /&gt;Get:31 http://ar.archive.ubuntu.com karmic/main libboost-wave1.38-dev 1.38.0-6ubuntu6 [551kB]                                                                          &lt;br /&gt;Get:32 http://ar.archive.ubuntu.com karmic/main libboost1.38-doc 1.38.0-6ubuntu6 [35.7MB]                                                                              &lt;br /&gt;Fetched 59.0MB in 2min 32s (388kB/s)                                                                                                                                   &lt;br /&gt;Extracting templates from packages: 100%&lt;br /&gt;Selecting previously deselected package gccxml.&lt;br /&gt;(Reading database ... 226092 files and directories currently installed.)&lt;br /&gt;Unpacking gccxml (from .../gccxml_0.9.0+cvs20080525-1ubuntu1_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost1.38-dev.&lt;br /&gt;Unpacking libboost1.38-dev (from .../libboost1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-date-time1.38.0.&lt;br /&gt;Unpacking libboost-date-time1.38.0 (from .../libboost-date-time1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-serialization1.38.0.&lt;br /&gt;Unpacking libboost-serialization1.38.0 (from .../libboost-serialization1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-serialization1.38-dev.&lt;br /&gt;Unpacking libboost-serialization1.38-dev (from .../libboost-serialization1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-date-time1.38-dev.&lt;br /&gt;Unpacking libboost-date-time1.38-dev (from .../libboost-date-time1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-system1.38.0.&lt;br /&gt;Unpacking libboost-system1.38.0 (from .../libboost-system1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-filesystem1.38.0.&lt;br /&gt;Unpacking libboost-filesystem1.38.0 (from .../libboost-filesystem1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-system1.38-dev.&lt;br /&gt;Unpacking libboost-system1.38-dev (from .../libboost-system1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-filesystem1.38-dev.&lt;br /&gt;Unpacking libboost-filesystem1.38-dev (from .../libboost-filesystem1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-test1.38.0.&lt;br /&gt;Unpacking libboost-test1.38.0 (from .../libboost-test1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-test1.38-dev.&lt;br /&gt;Unpacking libboost-test1.38-dev (from .../libboost-test1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-graph1.38-dev.&lt;br /&gt;Unpacking libboost-graph1.38-dev (from .../libboost-graph1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-graph-dev.&lt;br /&gt;Unpacking libboost-graph-dev (from .../libboost-graph-dev_1.38.1_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-graph1.38.0.&lt;br /&gt;Unpacking libboost-graph1.38.0 (from .../libboost-graph1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-regex1.38.0.&lt;br /&gt;Unpacking libboost-regex1.38.0 (from .../libboost-regex1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libicu-dev.&lt;br /&gt;Unpacking libicu-dev (from .../libicu-dev_4.0.1-2ubuntu2_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-regex1.38-dev.&lt;br /&gt;Unpacking libboost-regex1.38-dev (from .../libboost-regex1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-iostreams1.38.0.&lt;br /&gt;Unpacking libboost-iostreams1.38.0 (from .../libboost-iostreams1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-iostreams1.38-dev.&lt;br /&gt;Unpacking libboost-iostreams1.38-dev (from .../libboost-iostreams1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-math1.38.0.&lt;br /&gt;Unpacking libboost-math1.38.0 (from .../libboost-math1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-math1.38-dev.&lt;br /&gt;Unpacking libboost-math1.38-dev (from .../libboost-math1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-program-options1.38.0.&lt;br /&gt;Unpacking libboost-program-options1.38.0 (from .../libboost-program-options1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-program-options1.38-dev.&lt;br /&gt;Unpacking libboost-program-options1.38-dev (from .../libboost-program-options1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-python1.38.0.&lt;br /&gt;Unpacking libboost-python1.38.0 (from .../libboost-python1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-signals1.38.0.&lt;br /&gt;Unpacking libboost-signals1.38.0 (from .../libboost-signals1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-signals1.38-dev.&lt;br /&gt;Unpacking libboost-signals1.38-dev (from .../libboost-signals1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-thread1.38.0.&lt;br /&gt;Unpacking libboost-thread1.38.0 (from .../libboost-thread1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-thread1.38-dev.&lt;br /&gt;Unpacking libboost-thread1.38-dev (from .../libboost-thread1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-wave1.38.0.&lt;br /&gt;Unpacking libboost-wave1.38.0 (from .../libboost-wave1.38.0_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost-wave1.38-dev.&lt;br /&gt;Unpacking libboost-wave1.38-dev (from .../libboost-wave1.38-dev_1.38.0-6ubuntu6_amd64.deb) ...&lt;br /&gt;Selecting previously deselected package libboost1.38-doc.&lt;br /&gt;Unpacking libboost1.38-doc (from .../libboost1.38-doc_1.38.0-6ubuntu6_all.deb) ...&lt;br /&gt;Processing triggers for man-db ...&lt;br /&gt;Processing triggers for doc-base ...&lt;br /&gt;Processing 1 added doc-base file(s)...&lt;br /&gt;Registering documents with scrollkeeper...&lt;br /&gt;Setting up gccxml (0.9.0+cvs20080525-1ubuntu1) ...&lt;br /&gt;Setting up libboost1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-date-time1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-serialization1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-serialization1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-date-time1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-system1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-filesystem1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-system1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-filesystem1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-test1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-test1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-graph1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-graph-dev (1.38.1) ...&lt;br /&gt;Setting up libboost-graph1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-regex1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libicu-dev (4.0.1-2ubuntu2) ...&lt;br /&gt;Setting up libboost-regex1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-iostreams1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-iostreams1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-math1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-math1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-program-options1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-program-options1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-python1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-signals1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-signals1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-thread1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-thread1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost-wave1.38.0 (1.38.0-6ubuntu6) ...&lt;br /&gt;&lt;br /&gt;Setting up libboost-wave1.38-dev (1.38.0-6ubuntu6) ...&lt;br /&gt;Setting up libboost1.38-doc (1.38.0-6ubuntu6) ...&lt;br /&gt;Processing triggers for libc-bin ...&lt;br /&gt;ldconfig deferred processing now taking place&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems that the BGL for ubuntu is installed in my system now. It took 341MB !!!. Now I get:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls /usr/include/boost/graph/&lt;br /&gt;adjacency_iterator.hpp           depth_first_search.hpp       graphviz.hpp                    minimum_degree_ordering.hpp     simple_point.hpp&lt;br /&gt;adjacency_list.hpp               detail                       gursoy_atun_layout.hpp          named_function_params.hpp       sloan_ordering.hpp&lt;br /&gt;adjacency_list_io.hpp            dijkstra_shortest_paths.hpp  howard_cycle_ratio.hpp          named_graph.hpp                 smallest_last_ordering.hpp&lt;br /&gt;adjacency_matrix.hpp             dominator_tree.hpp           incremental_components.hpp      neighbor_bfs.hpp                small_world_generator.hpp&lt;br /&gt;adj_list_serialize.hpp           edge_connectivity.hpp        is_kuratowski_subgraph.hpp      page_rank.hpp                   stanford_graph.hpp&lt;br /&gt;astar_search.hpp                 edge_list.hpp                isomorphism.hpp                 planar_canonical_ordering.hpp   strong_components.hpp&lt;br /&gt;bandwidth.hpp                    edmonds_karp_max_flow.hpp    is_straight_line_drawing.hpp    planar_detail                   subgraph.hpp&lt;br /&gt;bc_clustering.hpp                edmunds_karp_max_flow.hpp    iteration_macros.hpp            planar_face_traversal.hpp       topological_sort.hpp&lt;br /&gt;bellman_ford_shortest_paths.hpp  erdos_renyi_generator.hpp    iteration_macros_undef.hpp      plod_generator.hpp              transitive_closure.hpp&lt;br /&gt;betweenness_centrality.hpp       exception.hpp                johnson_all_pairs_shortest.hpp  prim_minimum_spanning_tree.hpp  transpose_graph.hpp&lt;br /&gt;biconnected_components.hpp       filtered_graph.hpp           kamada_kawai_spring_layout.hpp  profile.hpp                     tree_traits.hpp&lt;br /&gt;boyer_myrvold_planar_test.hpp    floyd_warshall_shortest.hpp  king_ordering.hpp               properties.hpp                  two_bit_color_map.hpp&lt;br /&gt;breadth_first_search.hpp         fruchterman_reingold.hpp     kolmogorov_max_flow.hpp         property_iter_range.hpp         undirected_dfs.hpp&lt;br /&gt;chrobak_payne_drawing.hpp        graph_archetypes.hpp         kruskal_min_spanning_tree.hpp   push_relabel_max_flow.hpp       vector_as_graph.hpp&lt;br /&gt;circle_layout.hpp                graph_as_tree.hpp            leda_graph.hpp                  random.hpp                      visitors.hpp&lt;br /&gt;compressed_sparse_row_graph.hpp  graph_concepts.hpp           make_biconnected_planar.hpp     random_layout.hpp               wavefront.hpp&lt;br /&gt;connected_components.hpp         graphml.hpp                  make_connected.hpp              r_c_shortest_paths.hpp          write_dimacs.hpp&lt;br /&gt;copy.hpp                         graph_selectors.hpp          make_maximal_planar.hpp         read_dimacs.hpp&lt;br /&gt;create_condensation_graph.hpp    graph_test.hpp               matrix_as_graph.hpp             relax.hpp&lt;br /&gt;cuthill_mckee_ordering.hpp       graph_traits.hpp             max_cardinality_matching.hpp    reverse_graph.hpp&lt;br /&gt;dag_shortest_paths.hpp           graph_utility.hpp            metric_tsp_approx.hpp           sequential_vertex_coloring.hpp&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so BGL seems to be there. Lets look if the program compiles. So I do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example-basic-bgl.cpp &lt;br /&gt;In file included from /usr/include/c++/4.4/backward/hash_set:59,&lt;br /&gt;                 from /usr/include/boost/graph/adjacency_list.hpp:25,&lt;br /&gt;                 from example-basic-bgl.cpp:5:&lt;br /&gt;/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.&lt;br /&gt;example-basic-bgl.cpp: In function &amp;#8216;int main(int, char**)&amp;#8217;:&lt;br /&gt;example-basic-bgl.cpp:33: error: expected primary-expression before &amp;#8216;...&amp;#8217; token&lt;br /&gt;example-basic-bgl.cpp:33: error: expected &amp;#8216;;&amp;#8217; before &amp;#8216;...&amp;#8217; token&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, there is a warning saying that &lt;i&gt;backward_warning.h&lt;/i&gt; include at least one antiquated or  deprecated (in spanish: obsoleto). Also there are compilation errors.&lt;/br&gt;I forgot to remove ... in the example. So I remove it and try again: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example-basic-bgl.cpp &lt;br /&gt;In file included from /usr/include/c++/4.4/backward/hash_set:59,&lt;br /&gt;                 from /usr/include/boost/graph/adjacency_list.hpp:25,&lt;br /&gt;                 from example-basic-bgl.cpp:5:&lt;br /&gt;/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.&lt;br /&gt;$ ./a.out &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it compile and run. But it shows nothing on the screen because the program example is not intended for this. Lets enhance the program a little and see what happens. So I make a new version of the program (I still pick the idea from &lt;a href="http://beta.boost.org/doc/libs/1_46_0_beta1/libs/graph/doc/quick_tour.html"&gt;here&lt;/a&gt;):&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/dijkstra_shortest_paths.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;  using namespace boost;&lt;br /&gt;  &lt;br /&gt;  int main(int,char*[])&lt;br /&gt;  {&lt;br /&gt;    // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, bidirectionalS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] = &lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);&lt;br /&gt;&lt;br /&gt;    // get the property map for vertex indices&lt;br /&gt;    typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;    IndexMap index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;    // accessing the vertex set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;vertices(g) = &amp;quot;;&lt;br /&gt;    typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;    std::pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;    for (vp = vertices(g); vp.first != vp.second; ++vp.first)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // accessing the edge set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;edges(g) = &amp;quot;;&lt;br /&gt;    graph_traits&amp;lt;Graph&amp;gt;::edge_iterator ei, ei_end;&lt;br /&gt;    for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[source(*ei, g)] &lt;br /&gt;                  &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[target(*ei, g)] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;compile and run it: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example-basic-bgl-v1.cpp &lt;br /&gt;In file included from /usr/include/c++/4.4/backward/hash_set:59,&lt;br /&gt;                 from /usr/include/boost/graph/adjacency_list.hpp:25,&lt;br /&gt;                 from example-basic-bgl-v1.cpp:5:&lt;br /&gt;/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.&lt;br /&gt;$ ./a.out &lt;br /&gt;vertices(g) = 0 1 2 3 4 &lt;br /&gt;edges(g) = (0,1) (0,3) (2,0) (3,2) (2,4) (1,3) (3,4)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it works !!!. Now there is another bit of example code that can be added to this program that is explained in &lt;a href="http://beta.boost.org/doc/libs/1_46_0_beta1/libs/graph/doc/quick_tour.html"&gt;here&lt;/a&gt; (the same source of the above code). It uses something called &lt;i&gt;functor&lt;/i&gt; (name inherited from type theory; &lt;a href="http://stackoverflow.com/questions/356950/c-functors-and-their-uses"&gt;here&lt;/a&gt; an idea of what a functor is). Lets try it. So I make a new program version: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  #include &amp;lt;iostream&amp;gt;                  // for std::cout&lt;br /&gt;  #include &amp;lt;utility&amp;gt;                   // for std::pair&lt;br /&gt;  #include &amp;lt;algorithm&amp;gt;                 // for std::for_each&lt;br /&gt;  #include &amp;lt;boost/graph/graph_traits.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;  #include &amp;lt;boost/graph/dijkstra_shortest_paths.hpp&amp;gt;&lt;br /&gt;&lt;br /&gt;  using namespace boost;&lt;br /&gt;&lt;br /&gt;  template &amp;lt;class Graph&amp;gt; struct exercise_vertex {&lt;br /&gt;    // the functor&lt;br /&gt;    exercise_vertex(Graph&amp;amp; g_) : g(g_) {}&lt;br /&gt;&lt;br /&gt;    typedef typename graph_traits&amp;lt;Graph&amp;gt;::vertex_descriptor Vertex;&lt;br /&gt;&lt;br /&gt;    // vertex descriptor&lt;br /&gt;    void operator()(const Vertex&amp;amp; v) const&lt;br /&gt;    {&lt;br /&gt;      typedef graph_traits&amp;lt;Graph&amp;gt; GraphTraits;&lt;br /&gt;      typename property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;      // which vertex&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent structure of vertex: &amp;quot; &amp;lt;&amp;lt; index[v] &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // out edges&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;out-edges: &amp;quot;;&lt;br /&gt;      typename GraphTraits::out_edge_iterator out_i, out_end;&lt;br /&gt;      typename GraphTraits::edge_descriptor e;&lt;br /&gt;      for (tie(out_i, out_end) = out_edges(v, g); &lt;br /&gt;           out_i != out_end; ++out_i) {&lt;br /&gt;        e = *out_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &lt;br /&gt;                  &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;      }&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // in edges&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;in-edges: &amp;quot;;&lt;br /&gt;      typename GraphTraits::in_edge_iterator in_i, in_end;&lt;br /&gt;      for (tie(in_i, in_end) = in_edges(v,g); &lt;br /&gt;           in_i != in_end; ++in_i) {&lt;br /&gt;        e = *in_i;&lt;br /&gt;        Vertex src = source(e, g), targ = target(e, g);&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[src] &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[targ] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;      }&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // adjacent vertices (notice that it only returns the vertex that are targets of out edges of vertex v)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; &amp;quot;adjacent vertices: &amp;quot;;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai;&lt;br /&gt;      typename GraphTraits::adjacency_iterator ai_end;&lt;br /&gt;      for (tie(ai, ai_end) = adjacent_vertices(v, g); ai != ai_end; ++ai)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; index[*ai] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;      std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;      // ...&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    Graph&amp;amp; g;&lt;br /&gt;  };&lt;br /&gt;  &lt;br /&gt;  int main(int,char*[])&lt;br /&gt;  {&lt;br /&gt;    // create a typedef for the Graph type&lt;br /&gt;    typedef adjacency_list&amp;lt;vecS, vecS, bidirectionalS&amp;gt; Graph;&lt;br /&gt;&lt;br /&gt;    // Make convenient labels for the vertices&lt;br /&gt;    enum { A, B, C, D, E, N };&lt;br /&gt;    const int num_vertices = N;&lt;br /&gt;    const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;&lt;br /&gt;    // writing out the edges in the graph&lt;br /&gt;    typedef std::pair&amp;lt;int, int&amp;gt; Edge;&lt;br /&gt;    Edge edge_array[] = &lt;br /&gt;    { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),&lt;br /&gt;      Edge(C,E), Edge(B,D), Edge(D,E) };&lt;br /&gt;    const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]);&lt;br /&gt;&lt;br /&gt;    // declare a graph object&lt;br /&gt;    Graph g(num_vertices);&lt;br /&gt;&lt;br /&gt;    // add the edges to the graph object&lt;br /&gt;    for (int i = 0; i &amp;lt; num_edges; ++i)&lt;br /&gt;      add_edge(edge_array[i].first, edge_array[i].second, g);&lt;br /&gt;&lt;br /&gt;    // get the property map for vertex indices&lt;br /&gt;    typedef property_map&amp;lt;Graph, vertex_index_t&amp;gt;::type IndexMap;&lt;br /&gt;    IndexMap index = get(vertex_index, g);&lt;br /&gt;&lt;br /&gt;    // accessing the vertex set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;vertices(g) = &amp;quot;;&lt;br /&gt;    typedef graph_traits&amp;lt;Graph&amp;gt;::vertex_iterator vertex_iter;&lt;br /&gt;    std::pair&amp;lt;vertex_iter, vertex_iter&amp;gt; vp;&lt;br /&gt;    for (vp = vertices(g); vp.first != vp.second; ++vp.first)&lt;br /&gt;      std::cout &amp;lt;&amp;lt; index[*vp.first] &amp;lt;&amp;lt;  &amp;quot; &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // accessing the edge set&lt;br /&gt;    std::cout &amp;lt;&amp;lt; &amp;quot;edges(g) = &amp;quot;;&lt;br /&gt;    graph_traits&amp;lt;Graph&amp;gt;::edge_iterator ei, ei_end;&lt;br /&gt;    for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)&lt;br /&gt;        std::cout &amp;lt;&amp;lt; &amp;quot;(&amp;quot; &amp;lt;&amp;lt; index[source(*ei, g)] &lt;br /&gt;                  &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; index[target(*ei, g)] &amp;lt;&amp;lt; &amp;quot;) &amp;quot;;&lt;br /&gt;    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;&lt;br /&gt;    // the adjacency structure&lt;br /&gt;    std::for_each(vertices(g).first, vertices(g).second,&lt;br /&gt;                  exercise_vertex&amp;lt;Graph&amp;gt;(g));&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;  } &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;compile and run it: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example-basic-bgl-v2.cpp &lt;br /&gt;In file included from /usr/include/c++/4.4/backward/hash_set:59,&lt;br /&gt;                 from /usr/include/boost/graph/adjacency_list.hpp:25,&lt;br /&gt;                 from example-basic-bgl-v2.cpp:5:&lt;br /&gt;/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.&lt;br /&gt;$ ./a.out &lt;br /&gt;vertices(g) = 0 1 2 3 4 &lt;br /&gt;edges(g) = (0,1) (0,3) (2,0) (3,2) (2,4) (1,3) (3,4) &lt;br /&gt;adjacent structure of vertex: 0&lt;br /&gt;out-edges: (0,1) (0,3) &lt;br /&gt;in-edges: (2,0) &lt;br /&gt;adjacent vertices: 1 3 &lt;br /&gt;adjacent structure of vertex: 1&lt;br /&gt;out-edges: (1,3) &lt;br /&gt;in-edges: (0,1) &lt;br /&gt;adjacent vertices: 3 &lt;br /&gt;adjacent structure of vertex: 2&lt;br /&gt;out-edges: (2,0) (2,4) &lt;br /&gt;in-edges: (3,2) &lt;br /&gt;adjacent vertices: 0 4 &lt;br /&gt;adjacent structure of vertex: 3&lt;br /&gt;out-edges: (3,2) (3,4) &lt;br /&gt;in-edges: (0,3) (1,3) &lt;br /&gt;adjacent vertices: 2 4 &lt;br /&gt;adjacent structure of vertex: 4&lt;br /&gt;out-edges: &lt;br /&gt;in-edges: (2,4) (3,4) &lt;br /&gt;adjacent vertices: &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it works !!! Notice that the adjacent vertex returned by &lt;i&gt;adjacent_vertices(v, g)&lt;/i&gt; are target vertex of the outgoing edges adjacent to &lt;i&gt;v&lt;/i&gt; (the target vertex of the ingoing edges does not appears in this list). &lt;/br&gt;&lt;/br&gt;So, now remains to understand more clearly what the code does. For example: &lt;/br&gt;TODO: What is &lt;i&gt;adjacence_list&amp;lt; &amp;gt;&lt;/i&gt; here? &lt;/br&gt;TODO: What is &lt;i&gt;property_map&amp;lt; &amp;gt&lt;/i&gt;; here? &lt;/br&gt;The other thing more or less I imagine what they do. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-2959458690189641587?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/2959458690189641587/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=2959458690189641587' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2959458690189641587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2959458690189641587'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/c-stl-bgl-learning-some-examples-n2.html' title='C++, STL, BGL Learning - Some examples - n.2'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-2268895049539313461</id><published>2011-02-19T08:22:00.009-03:00</published><updated>2011-02-20T17:25:13.724-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++, STL, BGL Learning - Some examples - n.1</title><content type='html'>The idea in this series of postings is to try some code in order to learn C++, STL and BGL. &lt;/br&gt;&lt;/br&gt;So, in this first post I will start with an example of STL. So, from &lt;a href="http://www.decompile.com/cpp/stl_tutorial/index.htm#3"&gt;here&lt;/a&gt; I pick this example: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;#include &amp;lt;algo.h&amp;gt;&lt;br /&gt;#include &amp;lt;vector.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt; &lt;br /&gt;main ()&lt;br /&gt;{&lt;br /&gt;  vector&amp;lt;int&amp;gt; v;  // create an empty vector of integers&lt;br /&gt;  int input;&lt;br /&gt;  while (cin &amp;gt;&amp;gt; input)    // while not end of file&lt;br /&gt;    v.push_back (input);  // append to vector&lt;br /&gt; &lt;br /&gt;  // sort takes two random iterators, and sorts the elements between &lt;br /&gt;  // them.  As is always the case in STL, this includes the value&lt;br /&gt;  // referred to by first but not the one referred to by last; indeed,&lt;br /&gt;  // this is often the past-the-end value, and is therefore not&lt;br /&gt;  // dereferenceable.&lt;br /&gt;  sort(v.begin(), v.end());&lt;br /&gt; &lt;br /&gt;  int n = v.size();&lt;br /&gt;  for (int i = 0; i &amp;lt; n; i++)&lt;br /&gt;    cout &amp;lt;&amp;lt; v[i] &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I try to compile it and get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example_sort_vector.cpp &lt;br /&gt;example_sort_vector.cpp:2:18: error: algo.h: No such file or directory&lt;br /&gt;example_sort_vector.cpp:3:20: error: vector.h: No such file or directory&lt;br /&gt;example_sort_vector.cpp:5:22: error: iostream.h: No such file or directory&lt;br /&gt;example_sort_vector.cpp: In function &amp;#8216;int main()&amp;#8217;:&lt;br /&gt;example_sort_vector.cpp:9: error: &amp;#8216;vector&amp;#8217; was not declared in this scope&lt;br /&gt;example_sort_vector.cpp:9: error: expected primary-expression before &amp;#8216;int&amp;#8217;&lt;br /&gt;example_sort_vector.cpp:9: error: expected &amp;#8216;;&amp;#8217; before &amp;#8216;int&amp;#8217;&lt;br /&gt;example_sort_vector.cpp:11: error: &amp;#8216;cin&amp;#8217; was not declared in this scope&lt;br /&gt;example_sort_vector.cpp:12: error: &amp;#8216;v&amp;#8217; was not declared in this scope&lt;br /&gt;example_sort_vector.cpp:19: error: &amp;#8216;v&amp;#8217; was not declared in this scope&lt;br /&gt;example_sort_vector.cpp:19: error: &amp;#8216;sort&amp;#8217; was not declared in this scope&lt;br /&gt;example_sort_vector.cpp:23: error: &amp;#8216;cout&amp;#8217; was not declared in this scope&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, is STL installed by default on ubuntu? &lt;a href="http://ubuntuforums.org/showthread.php?t=1261897"&gt;This ubuntu post&lt;/a&gt; may help. So, I try this:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;$ sudo apt-get install build-essential&lt;br /&gt;[sudo] password for juan: &lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree       &lt;br /&gt;Reading state information... Done&lt;br /&gt;build-essential is already the newest version.&lt;br /&gt;build-essential set to manually installed.&lt;br /&gt;The following packages were automatically installed and are no longer required:&lt;br /&gt;  libaccess-bridge-java icedtea-6-jre-cacao openjdk-6-jre-lib openjdk-6-jre-headless libaccess-bridge-java-jni dkms tzdata-java rhino ca-certificates-java&lt;br /&gt;  libjline-java&lt;br /&gt;Use 'apt-get autoremove' to remove them.&lt;br /&gt;0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, if essentials includes STL then it is already installed. But, I looked inside: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls /usr/include/&lt;br /&gt;aio.h        compiz       envz.h         gconv.h         langinfo.h  monetary.h     nfs                 pthread.h    semaphore.h  syslog.h      utmp.h&lt;br /&gt;aliases.h    complex.h    err.h          getopt.h        lastlog.h   mqueue.h       nl_types.h          pty.h        setjmp.h     tar.h         utmpx.h&lt;br /&gt;alloca.h     cpio.h       errno.h        GL              libgen.h    mtd            nss.h               pwd.h        sgtty.h      termcap.h     uuid&lt;br /&gt;a.out.h      crypt.h      error.h        glob.h          libintl.h   nc_tparm.h     numpy               python2.5    shadow.h     term_entry.h  values.h&lt;br /&gt;argp.h       ctype.h      eti.h          gnu             libio.h     ncurses_dll.h  obstack.h           python2.5_d  signal.h     term.h        video&lt;br /&gt;argz.h       cursesapp.h  etip.h         gnu-versions.h  libpng      ncurses.h      panel.h             python2.6    sound        termio.h      wait.h&lt;br /&gt;ar.h         cursesf.h    execinfo.h     grace_np.h      libpng12    net            paths.h             python2.6_d  spawn.h      termios.h     wchar.h&lt;br /&gt;arpa         curses.h     fcntl.h        grp.h           libxml2     netash         pcrecpparg.h        rdma         stab.h       tgmath.h      wctype.h&lt;br /&gt;asm          cursesm.h    features.h     gshadow.h       limits.h    netatalk       pcrecpp.h           readline     stdint.h     thread_db.h   wordexp.h&lt;br /&gt;asm-generic  cursesp.h    fenv.h         iconv.h         link.h      netax25        pcre.h              re_comp.h    stdio_ext.h  tic.h         X11&lt;br /&gt;assert.h     cursesw.h    fmtmsg.h       ieee754.h       linux       netdb.h        pcreposix.h         regex.h      stdio.h      time.h        xcb&lt;br /&gt;bits         cursslk.h    fnmatch.h      ifaddrs.h       locale.h    neteconet      pcre_scanner.h      regexp.h     stdlib.h     ttyent.h      xen&lt;br /&gt;blkid        dbus-1.0     form.h         inttypes.h      malloc.h    netinet        pcre_stringpiece.h  resolv.h     string.h     ucontext.h    xlocale.h&lt;br /&gt;byteswap.h   dirent.h     fpu_control.h  jconfig.h       math.h      netipx         pngconf.h           rpc          strings.h    ulimit.h      zconf.h&lt;br /&gt;bzlib.h      dlfcn.h      fstab.h        jerror.h        mcheck.h    netiucv        png.h               rpcsvc       stropts.h    unctrl.h      zlibdefs.h&lt;br /&gt;c++          drm          fts.h          jmorecfg.h      memory.h    netpacket      poll.h              sched.h      sys          unistd.h      zlib.h&lt;br /&gt;cblas_f77.h  elf.h        ftw.h          jpegint.h       menu.h      netrom         printf.h            scsi         syscall.h    ustat.h&lt;br /&gt;cblas.h      endian.h     _G_config.h    jpeglib.h       mntent.h    netrose        protocols           search.h     sysexits.h   utime.h&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, there is no &lt;b&gt;stl/&lt;/b&gt; directory there. But, inside: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls /usr/include/c++/4.4/&lt;br /&gt;algorithm        cerrno     complex             cstdint          cxxabi.h             fstream           limits   parallel     stdexcept     typeinfo&lt;br /&gt;array            cfenv      complex.h           cstdio           debug                functional        list     queue        streambuf     type_traits&lt;br /&gt;backward         cfloat     condition_variable  cstdlib          deque                initializer_list  locale   random       string        unordered_map&lt;br /&gt;bits             chrono     csetjmp             cstring          exception            iomanip           map      ratio        system_error  unordered_set&lt;br /&gt;bitset           cinttypes  csignal             ctgmath          exception_defines.h  ios               memory   regex        tgmath.h      utility&lt;br /&gt;c++0x_warning.h  ciso646    cstdarg             ctime            exception_ptr.h      iosfwd            mutex    set          thread        valarray&lt;br /&gt;cassert          climits    cstdatomic          cwchar           ext                  iostream          new      sstream      tr1           vector&lt;br /&gt;ccomplex         clocale    cstdbool            cwctype          fenv.h               istream           numeric  stack        tr1_impl      x86_64-linux-gnu&lt;br /&gt;cctype           cmath      cstddef             cxxabi-forced.h  forward_list         iterator          ostream  stdatomic.h  tuple&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so there appears names as &lt;i&gt;iterator&lt;/i&gt;, &lt;i&gt;vector&lt;/i&gt;, etc. So it seems that some (ubuntu) version of STL is there. So, I run the following example from the ubuntu post above:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;iterator&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;   std::vector&amp;lt;int&amp;gt; vec;   // declare a vector of int&lt;br /&gt;&lt;br /&gt;   vec.push_back(10);      // add some values&lt;br /&gt;   vec.push_back(20);&lt;br /&gt;   vec.push_back(30);&lt;br /&gt;&lt;br /&gt;   std::copy(vec.begin(), vec.end(), std::ostream_iterator&amp;lt;int&amp;gt;(std::cout, &amp;quot; &amp;quot;));&lt;br /&gt;   std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it works: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ simple.cpp &lt;br /&gt;$ ./a.out &lt;br /&gt;10 20 30&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So I modify the first example into the form: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;main ()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  using namespace std ;&lt;br /&gt;&lt;br /&gt;  vector&amp;lt;int&amp;gt; v;  // create an empty vector of integers&lt;br /&gt;  int input;&lt;br /&gt;  while (cin &amp;gt;&amp;gt; input)    // while not end of file&lt;br /&gt;    v.push_back (input);  // append to vector&lt;br /&gt;&lt;br /&gt;  // sort takes two random iterators, and sorts the elements between &lt;br /&gt;  // them.  As is always the case in STL, this includes the value&lt;br /&gt;  // referred to by first but not the one referred to by last; indeed,&lt;br /&gt;  // this is often the past-the-end value, and is therefore not&lt;br /&gt;  // dereferenceable.&lt;br /&gt;  sort(v.begin(), v.end());&lt;br /&gt;&lt;br /&gt;  int n = v.size();&lt;br /&gt;  for (int i = 0; i &amp;lt; n; i++)&lt;br /&gt;    cout &amp;lt;&amp;lt; v[i] &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it works: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ g++ example_sort_vector.cpp &lt;br /&gt;$ ./a.out &lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;^X&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Notice that &lt;i&gt;algo.h&lt;/i&gt; is replaced by &lt;i&gt;algorithm&lt;/i&gt;, &lt;i&gt;vector.h&lt;/i&gt; by &lt;i&gt;vector&lt;/i&gt; and &lt;i&gt;iostream.h&lt;/i&gt; by &lt;i&gt;iostream&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;So, this first post of the series has to do with simply the compilation of a simple C++ program that uses STL. &lt;/br&gt;&lt;/br&gt;So, this is a "crap", ubuntu has his own version of STL, that will bring me problems for sure. Is there a really standard STL?. The &lt;a href="http://www.sgi.com/tech/stl/index.html"&gt;SGI STL&lt;/a&gt; is a particular STL version of STL? Here a list of ubuntu post related to this: &lt;a href="http://ubuntuforums.org/showthread.php?t=722432"&gt;post-1&lt;/a&gt;, &lt;a href="http://packages.ubuntu.com/search?keywords=stl-manual"&gt;post-2&lt;/a&gt;, &lt;a href="https://launchpad.net/ubuntu/+source/stl-manual"&gt;post-3&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;TODO: So, what is the best choice? I try to use the SGI or the ubuntu version? &lt;/br&gt;TODO: BGL integrates with the ubuntu STL? And with the CGI? &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-2268895049539313461?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/2268895049539313461/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=2268895049539313461' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2268895049539313461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2268895049539313461'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/c-stl-bgl-learning-some-examples-n1.html' title='C++, STL, BGL Learning - Some examples - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-4669886524959219844</id><published>2011-02-17T10:09:00.002-03:00</published><updated>2011-03-19T12:23:37.564-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S3'/><category scheme='http://www.blogger.com/atom/ns#' term='S4'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - S3 and S4 classes</title><content type='html'>In this post I want to list material useful to deal with S3 and S4 classes. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.r-bloggers.com/resources-for-s4-classes-and-methods/"&gt;Resources for S4 classes and methods&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-4669886524959219844?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/4669886524959219844/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=4669886524959219844' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4669886524959219844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4669886524959219844'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-resources-s3-and-s4-classes.html' title='R Learning - S3 and S4 classes'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-2018844132390346901</id><published>2011-02-16T23:01:00.018-03:00</published><updated>2011-02-19T08:20:05.899-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='RBGL'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Rcpp, BGL - n.1</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-self-sufficient.html"&gt;previous post&lt;/a&gt; I see some difficulties in trying to build a self-sufficient package that integrates &lt;i&gt;LGL&lt;/i&gt; via &lt;b&gt;Rcpp&lt;/b&gt;. Maybe the alternative of using BGL is better in some way. After all, it is a "standard" library in C++, although it may be harder to learn (I think that it requires to learn pattern programming via templates). So, as I state before &lt;i&gt;BGL&lt;/i&gt; yet has a corresponding R package named &lt;b&gt;RBGL&lt;/b&gt; so this may be useful in some way. Even, maybe there yet exists ways to transform graph between the &lt;b&gt;igraph&lt;/b&gt; and &lt;b&gt;RBGL&lt;/b&gt; R packages. &lt;/br&gt;&lt;/br&gt;TODO: Look if there are ways to transform graph between the &lt;b&gt;igraph&lt;/b&gt; and &lt;b&gt;RBGL&lt;/b&gt; R packages. Answ: There is, look downside in this post.&lt;/br&gt;&lt;/br&gt;So, lets take a look at &lt;i&gt;BGL&lt;/i&gt;. &lt;a href="http://ecee.colorado.edu/~siek/boostcon2010bgl.pdf"&gt;Here&lt;/a&gt; there is a presentation that shows some important aspects of &lt;i&gt;BGL&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;Clearly I will also need to learn (more) C++, so &lt;a href="http://www.cplusplus.com/doc/tutorial/"&gt;here&lt;/a&gt; there is a C++ tutorial. &lt;/br&gt;&lt;/br&gt;Also I (probably) will need to learn &lt;i&gt;STL&lt;/i&gt; (C++ standard template library), so i) &lt;a href="http://www.decompile.com/cpp/stl_tutorial/index.htm"&gt;here&lt;/a&gt; a basic &lt;i&gt;STL&lt;/i&gt; tutorial; and ii) &lt;a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialC++STL.html"&gt;here&lt;/a&gt; are other one; iii) &lt;a href="http://www.cs.brown.edu/~jak/proglang/cpp/stltut/"&gt;here&lt;/a&gt; another; iv) &lt;a href="http://www.mochima.com/tutorials/STL.html"&gt;here&lt;/a&gt; an introduction. v) The &lt;i&gt;STL&lt;/i&gt; main page &lt;a href="http://www.sgi.com/tech/stl/index.html"&gt;here&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;Also, &lt;a href="http://pages.cs.wisc.edu/~driscoll/typename.html"&gt;here&lt;/a&gt; is some important discussion about templates and typedef.&lt;/br&gt; &lt;/br&gt;TODO: I have started from iii), complete the reading of it. I also have started to read v), also complete the reading of it.&lt;/br&gt;&lt;/br&gt;Here a list of source information about BGL: i) &lt;a href="http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/BGL/Chapter_main.html"&gt;here&lt;/a&gt; a shot introduction. &lt;/br&gt;&lt;/br&gt;Today (17-02-2011) I fond this in Lemon mailing list: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;On Monday 14 February 2011 12:32:09 Alp?r J?ttner wrote:&lt;br /&gt;&lt;br /&gt;&amp;gt; &amp;gt; I want to create a graph with weighted edges and iterate through&lt;br /&gt;&amp;gt; &amp;gt; outgoing edges of a given node with ascending weights.&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;gt; Unfortunately you must somehow sort the edges by hand in this case.&lt;br /&gt;&lt;br /&gt;Dear all,&lt;br /&gt;&lt;br /&gt;It occurred to me earlier that using STL algorithms with LEMON would be pretty&lt;br /&gt;nice indeed. This would solve the above issues as well. Some of the most used&lt;br /&gt;STL algorithms (like &amp;quot;find&amp;quot;, &amp;quot;copy&amp;quot;, etc.) are reimplemented in LEMON over&lt;br /&gt;LEMON maps (&amp;quot;mapCopy&amp;quot;, &amp;quot;mapFind&amp;quot;, etc.), but the lack of a good &amp;quot;sort&amp;quot;,&lt;br /&gt;&amp;quot;count&amp;quot;, &amp;quot;replace&amp;quot;, etc. is a real pain. You constantly need to copy out maps&lt;br /&gt;into a std::vectors or similar, call the STL algorithm and then plug the&lt;br /&gt;result back to LEMON somehow.&lt;br /&gt;&lt;br /&gt;I once started to write an iterator adaptor class that would make a LEMON&lt;br /&gt;nodemap or arcmap look to STL like a standard STL iterator. This would make it&lt;br /&gt;possible to seamlessly call STL algorithms, like &amp;quot;sort&amp;quot;, directly to LEMON&lt;br /&gt;maps without the need to copy the maps out into STL containers. I achieved&lt;br /&gt;some sort of advance, but my lack of time and C++ skills inhibited me to&lt;br /&gt;decide whether the fact that it does not work is due to that I coded the idea&lt;br /&gt;badly, or it is straight out impossible to do what I want.&lt;br /&gt;&lt;br /&gt;I attach the code I could come up with to this mail in the hope that someone&lt;br /&gt;more knowledgeable than me would find it useful, or finish it up, or at least&lt;br /&gt;explain me why the idea I tried to implement does not work. In fact, I only&lt;br /&gt;did the ForwardIterator, so &amp;quot;sort&amp;quot; is not expected to work but &amp;quot;find&amp;quot; and&lt;br /&gt;&amp;quot;copy&amp;quot; are. Doing the RandomAccessIterator is another matter, of course.&lt;br /&gt;&lt;br /&gt;The idea is to have an iterator adaptor class that, given a graph 'g', a&lt;br /&gt;nodemap 'm(g)' and a node iterator 'n(g)', would make it possible to declare&lt;br /&gt;&lt;br /&gt;node_map_it it(m, n);&lt;br /&gt;&lt;br /&gt;and then 'it' would return the node the cursor is at, and '*it' would give the&lt;br /&gt;map's value associated with this node. The same for arcs.&lt;br /&gt;&lt;br /&gt;What I have so far is:&lt;br /&gt;&lt;br /&gt;1. STL copy into output iterator works&lt;br /&gt;&lt;br /&gt; copy (arc_map_it&amp;lt;int&amp;gt;(w, ArcIt(g)),&lt;br /&gt;       arc_map_it&amp;lt;int&amp;gt;(w, INVALID),&lt;br /&gt;       ostream_iterator&amp;lt;int&amp;gt;(cout, &amp;quot;\n&amp;quot;));&lt;br /&gt;&lt;br /&gt;2. STL copy into std::list does not seem to work (compiles but does not print&lt;br /&gt;anything at all)&lt;br /&gt;&lt;br /&gt; list&amp;lt;int&amp;gt; l;&lt;br /&gt; copy(arc_map_it&amp;lt;int&amp;gt;(w, ArcIt(g)),&lt;br /&gt;      arc_map_it&amp;lt;int&amp;gt;(w, INVALID),&lt;br /&gt;      l.begin());&lt;br /&gt;&lt;br /&gt; copy (l.begin(), l.end(), ostream_iterator&amp;lt;int&amp;gt;(cout, &amp;quot;\n&amp;quot;));&lt;br /&gt;&lt;br /&gt;3. STL find halfway works: finds the value but does not return the&lt;br /&gt;corresponding node&lt;br /&gt;&lt;br /&gt; arc_map_it&amp;lt;int&amp;gt; it = find(arc_map_it&amp;lt;int&amp;gt;(w, ArcIt(g)),&lt;br /&gt;                           arc_map_it&amp;lt;int&amp;gt;(w, INVALID),&lt;br /&gt;                           42);&lt;br /&gt; // this writes 42 as expected&lt;br /&gt; cout &amp;lt;&amp;lt; &amp;quot;Map value found: &amp;quot; &amp;lt;&amp;lt; *it &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt; // cannot get this to compile&lt;br /&gt; //  cout &amp;lt;&amp;lt; &amp;quot;Node id with weight 42: &amp;quot; &amp;lt;&amp;lt; g.id(it) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I am open to comments, should you have any idea how to improve it further. I&lt;br /&gt;really would like to see something similar in LEMON.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Gabor&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems that &lt;i&gt;BGL&lt;/i&gt; is better after all, it is more standard so seems that it also has more standard functionalities. In this case, it seems that using &lt;i&gt;BGL&lt;/i&gt; is "easy" to sort a weighted adjacent list, but if you want to do that thing using LGL you has two ways, one implement yout own sort algorithm, second "copy" some things to &lt;i&gt;STL&lt;/i&gt; format sort and "copy back" to &lt;i&gt;LGL&lt;/i&gt;.&lt;/br&gt;&lt;/br&gt;&lt;a href="http://svitsrv25.epfl.ch/R-doc/library/RBGL/html/RBGL.overview.html"&gt;Here&lt;/a&gt; there are a RBGL overview (on CRAN) that may be useful. &lt;/br&gt;&lt;/br&gt;It seems that &lt;b&gt;RBGL&lt;/b&gt; is not a package that entirely provides tools to deal with graphs. It seems that RBGL complements the &lt;a href="http://cran.r-project.org/web/packages/graph/index.html"&gt;&lt;b&gt;graph&lt;/b&gt;&lt;/a&gt; package which (seems that its) main graph object is named &lt;a href="http://svitsrv25.epfl.ch/R-doc/library/graph/html/graphNEL-class.html"&gt;&lt;i&gt;graphNEL&lt;/i&gt;&lt;/a&gt;. So, it seems that the idea is that some "standar" functions (as for example the Dijkstra algorithm) is provided from &lt;b&gt;RBGL&lt;/b&gt; to the &lt;b&gt;graph&lt;/b&gt; packages.It seems that the &lt;b&gt;graph&lt;/b&gt; package is slower thant the &lt;b&gt;igraph&lt;/b&gt; package, so maybe it is useful to transform a &lt;i&gt;graphNEL&lt;/i&gt; object to a &lt;i&gt;igraph&lt;/i&gt; object (and visceversa), &lt;a href="http://igraph.sourceforge.net/doc-0.5.1/R/graphNEL.html"&gt;here&lt;/a&gt; are something about that. In general, a good introduction to the &lt;b&gt;graph&lt;/b&gt; package is in &lt;a href="http://cran.r-project.org/web/packages/graph/vignettes/GraphClass.pdf"&gt;its vignette&lt;/a&gt; (Notice that there are other &lt;i&gt;graph&lt;/i&gt; class objects in addition of &lt;i&gt;graphNEL&lt;/i&gt;). &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-2018844132390346901?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/2018844132390346901/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=2018844132390346901' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2018844132390346901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/2018844132390346901'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-rcpp-bgl-n1.html' title='R Learning - Rcpp, BGL - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7925764705551898703</id><published>2011-02-15T17:04:00.014-03:00</published><updated>2011-02-15T19:25:05.431-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building a self-sufficient package that integrates the C++ LGL via Rcpp - n.2 : Trying something</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-package-that.html"&gt;previous post&lt;/a&gt; I was looking for a way of building a R package that integrates LGL (&lt;a href="http://lemon.cs.elte.hu/trac/lemon"&gt;Lemon Graph Library&lt;/a&gt;) in a self-sufficient way. In other words, build a R package that contains C++ code that uses the LGL but does not need that LGL was previously installed. &lt;/br&gt;&lt;/br&gt;So, I will try the following. I pick a working directory, open a R console and write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp.package.skeleton(&amp;quot;sslgl&amp;quot;)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './sslgl/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, a package source named &lt;b&gt;sslgl&lt;/b&gt; was created in the working directory. Now as suggested (I suggest) in the previously mentioned post I do the following. First from the LGL home page I download the file &lt;i&gt;lemon-1.2.1.tar.gz&lt;/i&gt; and decompress it. So a directory named &lt;b&gt;lemon-1.2.1&lt;/b&gt; was created. Inside it there is a file named &lt;i&gt;configure&lt;/i&gt;, I copy it inside &lt;b&gt;sslgl/src/&lt;/b&gt;. Also there is a directory named &lt;b&gt;lemon&lt;/b&gt; which I also copy inside &lt;b&gt;sslgl/src/&lt;/b&gt;. Then I modify the file inside &lt;b&gt;sslgl/src/&lt;/b&gt; named &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; putting inside it: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;#include &amp;quot;lemon/list_graph.h&amp;quot;&lt;br /&gt;using namespace lemon ;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;&lt;br /&gt;    int res = 1;&lt;br /&gt;&lt;br /&gt;    ListDigraph g;&lt;br /&gt;&lt;br /&gt;    ListDigraph::Node u = g.addNode();&lt;br /&gt;    ListDigraph::Node v = g.addNode();&lt;br /&gt;    ListDigraph::Arc  a = g.addArc(u, v);&lt;br /&gt;&lt;br /&gt;    int i = countNodes(g);&lt;br /&gt;    int j = countArcs(g);&lt;br /&gt;&lt;br /&gt;    Rprintf(&amp;quot;num nodes is %d , and num edges is %d \n&amp;quot;,i,j);&lt;br /&gt;&lt;br /&gt;    return wrap(res) ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now I try to install the package. So from the linux console inside the working directory I do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL sslgl&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;sslgl&amp;#8217; ...&lt;br /&gt;** libs&lt;br /&gt;g++ -shared -o sslgl.so rcpp_hello_world.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib64/R/lib -lR&lt;br /&gt;installing to /home/juan/R/x86_64-pc-linux-gnu-library/2.12/sslgl/libs&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;sslgl&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;    sslgl-package                           html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (sslgl)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, lets see if it works. I open a R console and do: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;sslgl&amp;quot;)&lt;br /&gt;Loading required package: sslgl&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; rcpp_hello_world()&lt;br /&gt;num nodes is 2 , and num edges is 1 &lt;br /&gt;[1] 1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems to work. But, it work because LGL was previously installed in my system? It work because it does not require another LGL .cc file compiled (i.e. maybe LGL worked as a template)? &lt;/br&gt;&lt;/br&gt;In fact, none .cc file inside &lt;b&gt;sslgl/src/lemon/&lt;/b&gt; was compiled to an .o or .so file. &lt;/br&gt;&lt;/br&gt;TODO: Answer those questions. &lt;/br&gt;&lt;/br&gt;I will try. It seems that a &lt;i&gt;configure&lt;/i&gt; file is run by R CMD INSTALL only if it is inside &lt;b&gt;sslgl/&lt;/b&gt; and not inside &lt;b&gt;sslgl/src/&lt;/b&gt;. So I make the following trick. I put a &lt;i&gt;configure&lt;/i&gt; file inside &lt;b&gt;sslgl/&lt;/b&gt; with the following content: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;cd src&lt;br /&gt;./configure&lt;br /&gt;cd ..&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Also, I copied all the content of the untared &lt;i&gt;lemon-1.2.1.tar.gz&lt;/i&gt; inside &lt;b&gt;sslgl/src/&lt;/b&gt; (if not, I get some error). Then I install via $R CMD INSTALL sslgl and I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL sslgl&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;sslgl&amp;#8217; ...&lt;br /&gt;checking for a BSD-compatible install... /usr/bin/install -c&lt;br /&gt;checking whether build environment is sane... yes&lt;br /&gt;checking for a thread-safe mkdir -p... /bin/mkdir -p&lt;br /&gt;checking for gawk... /usr/bin/awk&lt;br /&gt;checking whether make sets $(MAKE)... yes&lt;br /&gt;checking for style of include used by make... GNU&lt;br /&gt;checking for g++... g++&lt;br /&gt;checking whether the C++ compiler works... yes&lt;br /&gt;checking for C++ compiler default output file name... a.out&lt;br /&gt;checking for suffix of executables... &lt;br /&gt;checking whether we are cross compiling... no&lt;br /&gt;checking for suffix of object files... o&lt;br /&gt;checking whether we are using the GNU C++ compiler... yes&lt;br /&gt;checking whether g++ accepts -g... yes&lt;br /&gt;checking dependency style of g++... gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for grep that handles long lines and -e... /bin/grep&lt;br /&gt;checking for egrep... /bin/grep -E&lt;br /&gt;checking for ANSI C header files... yes&lt;br /&gt;checking for sys/types.h... yes&lt;br /&gt;checking for sys/stat.h... yes&lt;br /&gt;checking for stdlib.h... yes&lt;br /&gt;checking for string.h... yes&lt;br /&gt;checking for memory.h... yes&lt;br /&gt;checking for strings.h... yes&lt;br /&gt;checking for inttypes.h... yes&lt;br /&gt;checking for stdint.h... yes&lt;br /&gt;checking for unistd.h... yes&lt;br /&gt;checking for long long... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking build system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking host system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking for gcc... gcc&lt;br /&gt;checking whether we are using the GNU C compiler... yes&lt;br /&gt;checking whether gcc accepts -g... yes&lt;br /&gt;checking for gcc option to accept ISO C89... none needed&lt;br /&gt;checking dependency style of gcc... gcc3&lt;br /&gt;checking for a sed that does not truncate output... /bin/sed&lt;br /&gt;checking for fgrep... /bin/grep -F&lt;br /&gt;checking for ld used by gcc... /usr/bin/ld&lt;br /&gt;checking if the linker (/usr/bin/ld) is GNU ld... yes&lt;br /&gt;checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B&lt;br /&gt;checking the name lister (/usr/bin/nm -B) interface... BSD nm&lt;br /&gt;checking whether ln -s works... yes&lt;br /&gt;checking the maximum length of command line arguments... 1572864&lt;br /&gt;checking whether the shell understands some XSI constructs... yes&lt;br /&gt;checking whether the shell understands &amp;quot;+=&amp;quot;... yes&lt;br /&gt;checking for /usr/bin/ld option to reload object files... -r&lt;br /&gt;checking for objdump... objdump&lt;br /&gt;checking how to recognize dependent libraries... pass_all&lt;br /&gt;checking for ar... ar&lt;br /&gt;checking for strip... strip&lt;br /&gt;checking for ranlib... ranlib&lt;br /&gt;checking command to parse /usr/bin/nm -B output from gcc object... ok&lt;br /&gt;checking for dlfcn.h... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for objdir... .libs&lt;br /&gt;checking if gcc supports -fno-rtti -fno-exceptions... no&lt;br /&gt;checking for gcc option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if gcc PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if gcc static flag -static works... yes&lt;br /&gt;checking if gcc supports -c -o file.o... yes&lt;br /&gt;checking if gcc supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking whether stripping libraries is possible... yes&lt;br /&gt;checking if libtool supports shared libraries... yes&lt;br /&gt;checking whether to build shared libraries... no&lt;br /&gt;checking whether to build static libraries... yes&lt;br /&gt;checking for ld used by g++... /usr/bin/ld -m elf_x86_64&lt;br /&gt;checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking for g++ option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if g++ PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if g++ static flag -static works... yes&lt;br /&gt;checking if g++ supports -c -o file.o... yes&lt;br /&gt;checking if g++ supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking for doxygen... no&lt;br /&gt;checking for python... yes&lt;br /&gt;checking for gs... yes&lt;br /&gt;checking whether we are using the Intel C++ compiler... no&lt;br /&gt;checking for GLPK... no&lt;br /&gt;checking for CPLEX... no&lt;br /&gt;checking for SOPLEX... no&lt;br /&gt;checking for CLP... no&lt;br /&gt;checking whether to build the additional tools... yes&lt;br /&gt;checking limits.h usability... yes&lt;br /&gt;checking limits.h presence... yes&lt;br /&gt;checking for limits.h... yes&lt;br /&gt;checking sys/time.h usability... yes&lt;br /&gt;checking sys/time.h presence... yes&lt;br /&gt;checking for sys/time.h... yes&lt;br /&gt;checking sys/times.h usability... yes&lt;br /&gt;checking sys/times.h presence... yes&lt;br /&gt;checking for sys/times.h... yes&lt;br /&gt;checking for unistd.h... (cached) yes&lt;br /&gt;checking for an ANSI C-conforming const... yes&lt;br /&gt;checking for inline... inline&lt;br /&gt;checking for size_t... yes&lt;br /&gt;checking whether time.h and sys/time.h may both be included... yes&lt;br /&gt;checking whether struct tm is in sys/time.h or time.h... time.h&lt;br /&gt;checking for ANSI C header files... (cached) yes&lt;br /&gt;checking for gettimeofday... yes&lt;br /&gt;checking for times... yes&lt;br /&gt;checking for ctime_r... yes&lt;br /&gt;configure: creating ./config.status&lt;br /&gt;config.status: creating Makefile&lt;br /&gt;config.status: creating demo/Makefile&lt;br /&gt;config.status: creating cmake/version.cmake&lt;br /&gt;config.status: creating doc/Doxyfile&lt;br /&gt;config.status: creating lemon/lemon.pc&lt;br /&gt;config.status: creating config.h&lt;br /&gt;config.status: creating lemon/config.h&lt;br /&gt;config.status: executing depfiles commands&lt;br /&gt;config.status: executing libtool commands&lt;br /&gt;&lt;br /&gt;****************************** SUMMARY ******************************&lt;br /&gt;&lt;br /&gt;Package version............... : lemon-1.2.1&lt;br /&gt;&lt;br /&gt;C++ compiler.................. : g++&lt;br /&gt;C++ compiles flags............ : -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2&lt;br /&gt;&lt;br /&gt;Compiler supports long long... : yes&lt;br /&gt;&lt;br /&gt;GLPK support.................. : no&lt;br /&gt;CPLEX support................. : no&lt;br /&gt;SOPLEX support................ : no&lt;br /&gt;CLP support................... : no&lt;br /&gt;CBC support................... : no&lt;br /&gt;&lt;br /&gt;Build additional tools........ : yes&lt;br /&gt;Use valgrind for tests........ : no&lt;br /&gt;&lt;br /&gt;The packace will be installed in&lt;br /&gt;  /usr/local.&lt;br /&gt;&lt;br /&gt;*********************************************************************&lt;br /&gt;&lt;br /&gt;Configure complete, now type 'make' and then 'make install'.&lt;br /&gt;&lt;br /&gt;** libs&lt;br /&gt;** arch - &lt;br /&gt;Makefile:1343: warning: overriding commands for target `.cc.o'&lt;br /&gt;/usr/lib64/R/etc/Makeconf:116: warning: ignoring old commands for target `.cc.o'&lt;br /&gt;CDPATH=&amp;quot;${ZSH_VERSION+.}:&amp;quot; &amp;amp;&amp;amp; cd . &amp;amp;&amp;amp; /bin/bash /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing --run aclocal-1.11 -I m4&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing: line 52: aclocal-1.11: command not found&lt;br /&gt;WARNING: `aclocal-1.11' is missing on your system.  You should only need it if&lt;br /&gt;         you modified `acinclude.m4' or `configure.ac'.  You might want&lt;br /&gt;         to install the `Automake' and `Perl' packages.  Grab them from&lt;br /&gt;         any GNU archive site.&lt;br /&gt; cd . &amp;amp;&amp;amp; /bin/bash /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing --run automake-1.11 --foreign&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing: line 52: automake-1.11: command not found&lt;br /&gt;WARNING: `automake-1.11' is missing on your system.  You should only need it if&lt;br /&gt;         you modified `Makefile.am', `acinclude.m4' or `configure.ac'.&lt;br /&gt;         You might want to install the `Automake' and `Perl' packages.&lt;br /&gt;         Grab them from any GNU archive site.&lt;br /&gt;CDPATH=&amp;quot;${ZSH_VERSION+.}:&amp;quot; &amp;amp;&amp;amp; cd . &amp;amp;&amp;amp; /bin/bash /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing --run autoconf&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing: line 52: autoconf: command not found&lt;br /&gt;WARNING: `autoconf' is missing on your system.  You should only need it if&lt;br /&gt;         you modified `configure.ac'.  You might want to install the&lt;br /&gt;         `Autoconf' and `GNU m4' packages.  Grab them from any GNU&lt;br /&gt;         archive site.&lt;br /&gt;/bin/bash ./config.status --recheck&lt;br /&gt;running CONFIG_SHELL=/bin/bash /bin/bash ./configure --no-create --no-recursion&lt;br /&gt;checking for a BSD-compatible install... /usr/bin/install -c&lt;br /&gt;checking whether build environment is sane... yes&lt;br /&gt;checking for a thread-safe mkdir -p... /bin/mkdir -p&lt;br /&gt;checking for gawk... /usr/bin/awk&lt;br /&gt;checking whether make sets $(MAKE)... yes&lt;br /&gt;checking for style of include used by make... GNU&lt;br /&gt;checking for g++... g++&lt;br /&gt;checking whether the C++ compiler works... yes&lt;br /&gt;checking for C++ compiler default output file name... a.out&lt;br /&gt;checking for suffix of executables... &lt;br /&gt;checking whether we are cross compiling... no&lt;br /&gt;checking for suffix of object files... o&lt;br /&gt;checking whether we are using the GNU C++ compiler... yes&lt;br /&gt;checking whether g++ accepts -g... yes&lt;br /&gt;checking dependency style of g++... gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for grep that handles long lines and -e... /bin/grep&lt;br /&gt;checking for egrep... /bin/grep -E&lt;br /&gt;checking for ANSI C header files... yes&lt;br /&gt;checking for sys/types.h... yes&lt;br /&gt;checking for sys/stat.h... yes&lt;br /&gt;checking for stdlib.h... yes&lt;br /&gt;checking for string.h... yes&lt;br /&gt;checking for memory.h... yes&lt;br /&gt;checking for strings.h... yes&lt;br /&gt;checking for inttypes.h... yes&lt;br /&gt;checking for stdint.h... yes&lt;br /&gt;checking for unistd.h... yes&lt;br /&gt;checking for long long... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking build system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking host system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking for gcc... gcc&lt;br /&gt;checking whether we are using the GNU C compiler... yes&lt;br /&gt;checking whether gcc accepts -g... yes&lt;br /&gt;checking for gcc option to accept ISO C89... none needed&lt;br /&gt;checking dependency style of gcc... gcc3&lt;br /&gt;checking for a sed that does not truncate output... /bin/sed&lt;br /&gt;checking for fgrep... /bin/grep -F&lt;br /&gt;checking for ld used by gcc... /usr/bin/ld&lt;br /&gt;checking if the linker (/usr/bin/ld) is GNU ld... yes&lt;br /&gt;checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B&lt;br /&gt;checking the name lister (/usr/bin/nm -B) interface... BSD nm&lt;br /&gt;checking whether ln -s works... yes&lt;br /&gt;checking the maximum length of command line arguments... 3458764513820540925&lt;br /&gt;checking whether the shell understands some XSI constructs... yes&lt;br /&gt;checking whether the shell understands &amp;quot;+=&amp;quot;... yes&lt;br /&gt;checking for /usr/bin/ld option to reload object files... -r&lt;br /&gt;checking for objdump... objdump&lt;br /&gt;checking how to recognize dependent libraries... pass_all&lt;br /&gt;checking for ar... ar&lt;br /&gt;checking for strip... strip&lt;br /&gt;checking for ranlib... ranlib&lt;br /&gt;checking command to parse /usr/bin/nm -B output from gcc object... ok&lt;br /&gt;checking for dlfcn.h... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for objdir... .libs&lt;br /&gt;checking if gcc supports -fno-rtti -fno-exceptions... no&lt;br /&gt;checking for gcc option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if gcc PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if gcc static flag -static works... yes&lt;br /&gt;checking if gcc supports -c -o file.o... yes&lt;br /&gt;checking if gcc supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking whether stripping libraries is possible... yes&lt;br /&gt;checking if libtool supports shared libraries... yes&lt;br /&gt;checking whether to build shared libraries... no&lt;br /&gt;checking whether to build static libraries... yes&lt;br /&gt;checking for ld used by g++... /usr/bin/ld -m elf_x86_64&lt;br /&gt;checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking for g++ option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if g++ PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if g++ static flag -static works... yes&lt;br /&gt;checking if g++ supports -c -o file.o... yes&lt;br /&gt;checking if g++ supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking for doxygen... no&lt;br /&gt;checking for python... yes&lt;br /&gt;checking for gs... yes&lt;br /&gt;checking whether we are using the Intel C++ compiler... no&lt;br /&gt;checking for GLPK... no&lt;br /&gt;checking for CPLEX... no&lt;br /&gt;checking for SOPLEX... no&lt;br /&gt;checking for CLP... no&lt;br /&gt;checking whether to build the additional tools... yes&lt;br /&gt;checking limits.h usability... yes&lt;br /&gt;checking limits.h presence... yes&lt;br /&gt;checking for limits.h... yes&lt;br /&gt;checking sys/time.h usability... yes&lt;br /&gt;checking sys/time.h presence... yes&lt;br /&gt;checking for sys/time.h... yes&lt;br /&gt;checking sys/times.h usability... yes&lt;br /&gt;checking sys/times.h presence... yes&lt;br /&gt;checking for sys/times.h... yes&lt;br /&gt;checking for unistd.h... (cached) yes&lt;br /&gt;checking for an ANSI C-conforming const... yes&lt;br /&gt;checking for inline... inline&lt;br /&gt;checking for size_t... yes&lt;br /&gt;checking whether time.h and sys/time.h may both be included... yes&lt;br /&gt;checking whether struct tm is in sys/time.h or time.h... time.h&lt;br /&gt;checking for ANSI C header files... (cached) yes&lt;br /&gt;checking for gettimeofday... yes&lt;br /&gt;checking for times... yes&lt;br /&gt;checking for ctime_r... yes&lt;br /&gt;configure: creating ./config.status&lt;br /&gt;&lt;br /&gt;****************************** SUMMARY ******************************&lt;br /&gt;&lt;br /&gt;Package version............... : lemon-1.2.1&lt;br /&gt;&lt;br /&gt;C++ compiler.................. : g++&lt;br /&gt;C++ compiles flags............ : -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2&lt;br /&gt;&lt;br /&gt;Compiler supports long long... : yes&lt;br /&gt;&lt;br /&gt;GLPK support.................. : no&lt;br /&gt;CPLEX support................. : no&lt;br /&gt;SOPLEX support................ : no&lt;br /&gt;CLP support................... : no&lt;br /&gt;CBC support................... : no&lt;br /&gt;&lt;br /&gt;Build additional tools........ : yes&lt;br /&gt;Use valgrind for tests........ : no&lt;br /&gt;&lt;br /&gt;The packace will be installed in&lt;br /&gt;  /usr/local.&lt;br /&gt;&lt;br /&gt;*********************************************************************&lt;br /&gt;&lt;br /&gt;Configure complete, now type 'make' and then 'make install'.&lt;br /&gt;&lt;br /&gt; /bin/bash ./config.status&lt;br /&gt;config.status: creating Makefile&lt;br /&gt;config.status: creating demo/Makefile&lt;br /&gt;config.status: creating cmake/version.cmake&lt;br /&gt;config.status: creating doc/Doxyfile&lt;br /&gt;config.status: creating lemon/lemon.pc&lt;br /&gt;config.status: creating config.h&lt;br /&gt;config.status: config.h is unchanged&lt;br /&gt;config.status: creating lemon/config.h&lt;br /&gt;config.status: lemon/config.h is unchanged&lt;br /&gt;config.status: executing depfiles commands&lt;br /&gt;config.status: executing libtool commands&lt;br /&gt;Makefile:1343: warning: overriding commands for target `.cc.o'&lt;br /&gt;/usr/lib64/R/etc/Makeconf:116: warning: ignoring old commands for target `.cc.o'&lt;br /&gt;(CDPATH=&amp;quot;${ZSH_VERSION+.}:&amp;quot; &amp;amp;&amp;amp; cd . &amp;amp;&amp;amp; /bin/bash /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing --run autoheader)&lt;br /&gt;/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src/build-aux/missing: line 52: autoheader: command not found&lt;br /&gt;WARNING: `autoheader' is missing on your system.  You should only need it if&lt;br /&gt;         you modified `acconfig.h' or `configure.ac'.  You might want&lt;br /&gt;         to install the `Autoconf' and `GNU m4' packages.  Grab them&lt;br /&gt;         from any GNU archive site.&lt;br /&gt;rm -f stamp-h1&lt;br /&gt;touch config.h.in&lt;br /&gt;cd . &amp;amp;&amp;amp; /bin/bash ./config.status config.h&lt;br /&gt;config.status: creating config.h&lt;br /&gt;config.status: config.h is unchanged&lt;br /&gt;make  all-recursive&lt;br /&gt;make[1]: Entering directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;make[2]: Entering directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-arg_parser.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-arg_parser.Tpo -c -o lemon/lemon_libemon_la-arg_parser.lo `test -f 'lemon/arg_parser.cc' &amp;#124;&amp;#124; echo './'`lemon/arg_parser.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-arg_parser.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-arg_parser.Tpo -c lemon/arg_parser.cc -o lemon/lemon_libemon_la-arg_parser.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-arg_parser.Tpo lemon/.deps/lemon_libemon_la-arg_parser.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-base.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-base.Tpo -c -o lemon/lemon_libemon_la-base.lo `test -f 'lemon/base.cc' &amp;#124;&amp;#124; echo './'`lemon/base.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-base.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-base.Tpo -c lemon/base.cc -o lemon/lemon_libemon_la-base.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-base.Tpo lemon/.deps/lemon_libemon_la-base.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-color.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-color.Tpo -c -o lemon/lemon_libemon_la-color.lo `test -f 'lemon/color.cc' &amp;#124;&amp;#124; echo './'`lemon/color.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-color.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-color.Tpo -c lemon/color.cc -o lemon/lemon_libemon_la-color.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-color.Tpo lemon/.deps/lemon_libemon_la-color.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-lp_base.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-lp_base.Tpo -c -o lemon/lemon_libemon_la-lp_base.lo `test -f 'lemon/lp_base.cc' &amp;#124;&amp;#124; echo './'`lemon/lp_base.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-lp_base.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-lp_base.Tpo -c lemon/lp_base.cc -o lemon/lemon_libemon_la-lp_base.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-lp_base.Tpo lemon/.deps/lemon_libemon_la-lp_base.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-lp_skeleton.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-lp_skeleton.Tpo -c -o lemon/lemon_libemon_la-lp_skeleton.lo `test -f 'lemon/lp_skeleton.cc' &amp;#124;&amp;#124; echo './'`lemon/lp_skeleton.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-lp_skeleton.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-lp_skeleton.Tpo -c lemon/lp_skeleton.cc -o lemon/lemon_libemon_la-lp_skeleton.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-lp_skeleton.Tpo lemon/.deps/lemon_libemon_la-lp_skeleton.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/lemon_libemon_la-random.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-random.Tpo -c -o lemon/lemon_libemon_la-random.lo `test -f 'lemon/random.cc' &amp;#124;&amp;#124; echo './'`lemon/random.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/lemon_libemon_la-random.lo -MD -MP -MF lemon/.deps/lemon_libemon_la-random.Tpo -c lemon/random.cc -o lemon/lemon_libemon_la-random.o&lt;br /&gt;mv -f lemon/.deps/lemon_libemon_la-random.Tpo lemon/.deps/lemon_libemon_la-random.Plo&lt;br /&gt;/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2 -MT lemon/bits/lemon_libemon_la-windows.lo -MD -MP -MF lemon/bits/.deps/lemon_libemon_la-windows.Tpo -c -o lemon/bits/lemon_libemon_la-windows.lo `test -f 'lemon/bits/windows.cc' &amp;#124;&amp;#124; echo './'`lemon/bits/windows.cc&lt;br /&gt;libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT lemon/bits/lemon_libemon_la-windows.lo -MD -MP -MF lemon/bits/.deps/lemon_libemon_la-windows.Tpo -c lemon/bits/windows.cc -o lemon/bits/lemon_libemon_la-windows.o&lt;br /&gt;mv -f lemon/bits/.deps/lemon_libemon_la-windows.Tpo lemon/bits/.deps/lemon_libemon_la-windows.Plo&lt;br /&gt;/bin/bash ./libtool --tag=CXX   --mode=link g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas      -g -O2       -o lemon/libemon.la -rpath /usr/local/lib lemon/lemon_libemon_la-arg_parser.lo lemon/lemon_libemon_la-base.lo lemon/lemon_libemon_la-color.lo lemon/lemon_libemon_la-lp_base.lo lemon/lemon_libemon_la-lp_skeleton.lo lemon/lemon_libemon_la-random.lo lemon/bits/lemon_libemon_la-windows.lo       &lt;br /&gt;libtool: link: ar cru lemon/.libs/libemon.a  lemon/lemon_libemon_la-arg_parser.o lemon/lemon_libemon_la-base.o lemon/lemon_libemon_la-color.o lemon/lemon_libemon_la-lp_base.o lemon/lemon_libemon_la-lp_skeleton.o lemon/lemon_libemon_la-random.o lemon/bits/lemon_libemon_la-windows.o&lt;br /&gt;libtool: link: ranlib lemon/.libs/libemon.a&lt;br /&gt;libtool: link: ( cd &amp;quot;lemon/.libs&amp;quot; &amp;amp;&amp;amp; rm -f &amp;quot;libemon.la&amp;quot; &amp;amp;&amp;amp; ln -s &amp;quot;../libemon.la&amp;quot; &amp;quot;libemon.la&amp;quot; )&lt;br /&gt;depbase=`echo tools/dimacs-solver.o &amp;#124; sed 's&amp;#124;[^/]*$&amp;#124;.deps/&amp;amp;&amp;#124;;s&amp;#124;\.o$&amp;#124;&amp;#124;'`;\&lt;br /&gt;    g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT tools/dimacs-solver.o -MD -MP -MF $depbase.Tpo -c -o tools/dimacs-solver.o tools/dimacs-solver.cc &amp;amp;&amp;amp;\&lt;br /&gt;    mv -f $depbase.Tpo $depbase.Po&lt;br /&gt;/bin/bash ./libtool --tag=CXX   --mode=link g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2   -o tools/dimacs-solver tools/dimacs-solver.o ./lemon/libemon.la &lt;br /&gt;libtool: link: g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -o tools/dimacs-solver tools/dimacs-solver.o  ./lemon/.libs/libemon.a&lt;br /&gt;depbase=`echo tools/dimacs-to-lgf.o &amp;#124; sed 's&amp;#124;[^/]*$&amp;#124;.deps/&amp;amp;&amp;#124;;s&amp;#124;\.o$&amp;#124;&amp;#124;'`;\&lt;br /&gt;    g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT tools/dimacs-to-lgf.o -MD -MP -MF $depbase.Tpo -c -o tools/dimacs-to-lgf.o tools/dimacs-to-lgf.cc &amp;amp;&amp;amp;\&lt;br /&gt;    mv -f $depbase.Tpo $depbase.Po&lt;br /&gt;/bin/bash ./libtool --tag=CXX   --mode=link g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2   -o tools/dimacs-to-lgf tools/dimacs-to-lgf.o ./lemon/libemon.la &lt;br /&gt;libtool: link: g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -o tools/dimacs-to-lgf tools/dimacs-to-lgf.o  ./lemon/.libs/libemon.a&lt;br /&gt;depbase=`echo tools/lgf-gen.o &amp;#124; sed 's&amp;#124;[^/]*$&amp;#124;.deps/&amp;amp;&amp;#124;;s&amp;#124;\.o$&amp;#124;&amp;#124;'`;\&lt;br /&gt;    g++ -DHAVE_CONFIG_H   -I. -I.  -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -MT tools/lgf-gen.o -MD -MP -MF $depbase.Tpo -c -o tools/lgf-gen.o tools/lgf-gen.cc &amp;amp;&amp;amp;\&lt;br /&gt;    mv -f $depbase.Tpo $depbase.Po&lt;br /&gt;/bin/bash ./libtool --tag=CXX   --mode=link g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2   -o tools/lgf-gen tools/lgf-gen.o ./lemon/libemon.la &lt;br /&gt;libtool: link: g++ -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2 -o tools/lgf-gen tools/lgf-gen.o  ./lemon/.libs/libemon.a&lt;br /&gt;make[2]: Leaving directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;make[1]: Leaving directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;installing to /home/juan/R/x86_64-pc-linux-gnu-library/2.12/sslgl/libs&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;sslgl&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;    sslgl-package                           html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (sslgl)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, I get some Warnings. Inside &lt;b&gt;sslgl/src/lemon/&lt;/b&gt; there are .o files, so it works in some way, but I don't know if is fine. &lt;/br&gt;&lt;/br&gt;Then I uninstall the lemon library doing the following. I open a linux terminal on the directory where I run the make install when I installed the lemon library and run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ make uninstall&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then I try starting from a "clean" &lt;b&gt;sslgl&lt;/b&gt; source (removed the installed R sslgl package (see &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/utils/html/remove.packages.html"&gt;here&lt;/a&gt; if you want to know how to do that) , then I removed th &lt;b&gt;sslgl&lt;/b&gt; source, then I create it again following the steps above): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL sslgl/&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;sslgl&amp;#8217; ...&lt;br /&gt;checking for a BSD-compatible install... /usr/bin/install -c&lt;br /&gt;checking whether build environment is sane... yes&lt;br /&gt;checking for a thread-safe mkdir -p... /bin/mkdir -p&lt;br /&gt;checking for gawk... /usr/bin/awk&lt;br /&gt;checking whether make sets $(MAKE)... yes&lt;br /&gt;checking for style of include used by make... GNU&lt;br /&gt;checking for g++... g++&lt;br /&gt;checking whether the C++ compiler works... yes&lt;br /&gt;checking for C++ compiler default output file name... a.out&lt;br /&gt;checking for suffix of executables... &lt;br /&gt;checking whether we are cross compiling... no&lt;br /&gt;checking for suffix of object files... o&lt;br /&gt;checking whether we are using the GNU C++ compiler... yes&lt;br /&gt;checking whether g++ accepts -g... yes&lt;br /&gt;checking dependency style of g++... gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for grep that handles long lines and -e... /bin/grep&lt;br /&gt;checking for egrep... /bin/grep -E&lt;br /&gt;checking for ANSI C header files... yes&lt;br /&gt;checking for sys/types.h... yes&lt;br /&gt;checking for sys/stat.h... yes&lt;br /&gt;checking for stdlib.h... yes&lt;br /&gt;checking for string.h... yes&lt;br /&gt;checking for memory.h... yes&lt;br /&gt;checking for strings.h... yes&lt;br /&gt;checking for inttypes.h... yes&lt;br /&gt;checking for stdint.h... yes&lt;br /&gt;checking for unistd.h... yes&lt;br /&gt;checking for long long... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking build system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking host system type... x86_64-unknown-linux-gnu&lt;br /&gt;checking for gcc... gcc&lt;br /&gt;checking whether we are using the GNU C compiler... yes&lt;br /&gt;checking whether gcc accepts -g... yes&lt;br /&gt;checking for gcc option to accept ISO C89... none needed&lt;br /&gt;checking dependency style of gcc... gcc3&lt;br /&gt;checking for a sed that does not truncate output... /bin/sed&lt;br /&gt;checking for fgrep... /bin/grep -F&lt;br /&gt;checking for ld used by gcc... /usr/bin/ld&lt;br /&gt;checking if the linker (/usr/bin/ld) is GNU ld... yes&lt;br /&gt;checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B&lt;br /&gt;checking the name lister (/usr/bin/nm -B) interface... BSD nm&lt;br /&gt;checking whether ln -s works... yes&lt;br /&gt;checking the maximum length of command line arguments... 1572864&lt;br /&gt;checking whether the shell understands some XSI constructs... yes&lt;br /&gt;checking whether the shell understands &amp;quot;+=&amp;quot;... yes&lt;br /&gt;checking for /usr/bin/ld option to reload object files... -r&lt;br /&gt;checking for objdump... objdump&lt;br /&gt;checking how to recognize dependent libraries... pass_all&lt;br /&gt;checking for ar... ar&lt;br /&gt;checking for strip... strip&lt;br /&gt;checking for ranlib... ranlib&lt;br /&gt;checking command to parse /usr/bin/nm -B output from gcc object... ok&lt;br /&gt;checking for dlfcn.h... yes&lt;br /&gt;checking whether we are using the GNU C++ compiler... (cached) yes&lt;br /&gt;checking whether g++ accepts -g... (cached) yes&lt;br /&gt;checking dependency style of g++... (cached) gcc3&lt;br /&gt;checking how to run the C++ preprocessor... g++ -E&lt;br /&gt;checking for objdir... .libs&lt;br /&gt;checking if gcc supports -fno-rtti -fno-exceptions... no&lt;br /&gt;checking for gcc option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if gcc PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if gcc static flag -static works... yes&lt;br /&gt;checking if gcc supports -c -o file.o... yes&lt;br /&gt;checking if gcc supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking whether stripping libraries is possible... yes&lt;br /&gt;checking if libtool supports shared libraries... yes&lt;br /&gt;checking whether to build shared libraries... no&lt;br /&gt;checking whether to build static libraries... yes&lt;br /&gt;checking for ld used by g++... /usr/bin/ld -m elf_x86_64&lt;br /&gt;checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking for g++ option to produce PIC... -fPIC -DPIC&lt;br /&gt;checking if g++ PIC flag -fPIC -DPIC works... yes&lt;br /&gt;checking if g++ static flag -static works... yes&lt;br /&gt;checking if g++ supports -c -o file.o... yes&lt;br /&gt;checking if g++ supports -c -o file.o... (cached) yes&lt;br /&gt;checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes&lt;br /&gt;checking dynamic linker characteristics... GNU/Linux ld.so&lt;br /&gt;checking how to hardcode library paths into programs... immediate&lt;br /&gt;checking for doxygen... no&lt;br /&gt;checking for python... yes&lt;br /&gt;checking for gs... yes&lt;br /&gt;checking whether we are using the Intel C++ compiler... no&lt;br /&gt;checking for GLPK... no&lt;br /&gt;checking for CPLEX... no&lt;br /&gt;checking for SOPLEX... no&lt;br /&gt;checking for CLP... no&lt;br /&gt;checking whether to build the additional tools... yes&lt;br /&gt;checking limits.h usability... yes&lt;br /&gt;checking limits.h presence... yes&lt;br /&gt;checking for limits.h... yes&lt;br /&gt;checking sys/time.h usability... yes&lt;br /&gt;checking sys/time.h presence... yes&lt;br /&gt;checking for sys/time.h... yes&lt;br /&gt;checking sys/times.h usability... yes&lt;br /&gt;checking sys/times.h presence... yes&lt;br /&gt;checking for sys/times.h... yes&lt;br /&gt;checking for unistd.h... (cached) yes&lt;br /&gt;checking for an ANSI C-conforming const... yes&lt;br /&gt;checking for inline... inline&lt;br /&gt;checking for size_t... yes&lt;br /&gt;checking whether time.h and sys/time.h may both be included... yes&lt;br /&gt;checking whether struct tm is in sys/time.h or time.h... time.h&lt;br /&gt;checking for ANSI C header files... (cached) yes&lt;br /&gt;checking for gettimeofday... yes&lt;br /&gt;checking for times... yes&lt;br /&gt;checking for ctime_r... yes&lt;br /&gt;configure: creating ./config.status&lt;br /&gt;config.status: creating Makefile&lt;br /&gt;config.status: creating demo/Makefile&lt;br /&gt;config.status: creating cmake/version.cmake&lt;br /&gt;config.status: creating doc/Doxyfile&lt;br /&gt;config.status: creating lemon/lemon.pc&lt;br /&gt;config.status: creating config.h&lt;br /&gt;config.status: config.h is unchanged&lt;br /&gt;config.status: creating lemon/config.h&lt;br /&gt;config.status: lemon/config.h is unchanged&lt;br /&gt;config.status: executing depfiles commands&lt;br /&gt;config.status: executing libtool commands&lt;br /&gt;&lt;br /&gt;****************************** SUMMARY ******************************&lt;br /&gt;&lt;br /&gt;Package version............... : lemon-1.2.1&lt;br /&gt;&lt;br /&gt;C++ compiler.................. : g++&lt;br /&gt;C++ compiles flags............ : -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas -g -O2&lt;br /&gt;&lt;br /&gt;Compiler supports long long... : yes&lt;br /&gt;&lt;br /&gt;GLPK support.................. : no&lt;br /&gt;CPLEX support................. : no&lt;br /&gt;SOPLEX support................ : no&lt;br /&gt;CLP support................... : no&lt;br /&gt;CBC support................... : no&lt;br /&gt;&lt;br /&gt;Build additional tools........ : yes&lt;br /&gt;Use valgrind for tests........ : no&lt;br /&gt;&lt;br /&gt;The packace will be installed in&lt;br /&gt;  /usr/local.&lt;br /&gt;&lt;br /&gt;*********************************************************************&lt;br /&gt;&lt;br /&gt;Configure complete, now type 'make' and then 'make install'.&lt;br /&gt;&lt;br /&gt;** libs&lt;br /&gt;** arch - &lt;br /&gt;Makefile:1343: warning: overriding commands for target `.cc.o'&lt;br /&gt;/usr/lib64/R/etc/Makeconf:116: warning: ignoring old commands for target `.cc.o'&lt;br /&gt;make  all-recursive&lt;br /&gt;make[1]: Entering directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;make[2]: Entering directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;make[2]: Leaving directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;make[1]: Leaving directory `/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/src'&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/plain/sslgl/man/sslgl-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;sslgl&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;    sslgl-package                           html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;Error in library.dynam(lib, package, package.lib) : &lt;br /&gt;  shared object 'sslgl' not found&lt;br /&gt;ERROR: loading failed&lt;br /&gt;* removing &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12/sslgl&amp;#8217;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, it doesn't work. It seems that I must get involved into the configure and make more deeply. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7925764705551898703?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7925764705551898703/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7925764705551898703' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7925764705551898703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7925764705551898703'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-self-sufficient.html' title='R Learning - Building a self-sufficient package that integrates the C++ LGL via Rcpp - n.2 : Trying something'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-9048625038831845364</id><published>2011-02-14T13:04:00.012-03:00</published><updated>2011-02-15T16:48:32.789-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building a self-sufficient package that integrates the C++ LGL via Rcpp - n.1 : Exploring</title><content type='html'>First of all, thanks to the mailing list of LGL users, and specially to Alpár Jüttner. &lt;/br&gt;&lt;/br&gt;I had previously integrated LGL in R via Rcpp, but using the installation of LGL (&lt;a href="http://lemon.cs.elte.hu/trac/lemon"&gt;Lemon C++ Graph Library&lt;/a&gt;) in the system (see &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html"&gt;here&lt;/a&gt;). But now, the idea is to build a R package that uses LGL but do not need the installation of LGL. In other words to build a self-sufficient R package that integrates LGL. &lt;/br&gt;So I start by replicating an interchange in the lemon user mailing list: &lt;/br&gt;&lt;/br&gt;First, I send: &lt;/br&gt;&lt;/br&gt;&lt;blockquote&gt;Hi, everybody. &lt;/br&gt;&lt;/br&gt;I'm just new on this. Few months before I had started to learn R (http://www.r-project.org/). R is nice, but it may be slow. I'm a physicist and normally I do high performance computations. Eventually I get to know that one can integrate C++ codeinto R. As I normally work in complex networks, I was looking for C++ libraries developed for that purpose. In fact, igraph isa package available to R users. So eventually I think to look at the C implementation of it. But I found the C igraph librarya bit "dirty" to deal with. Eventually I also found the Boost Graph Library, but I read about it that it has a step learning curve.Then I found LGL (Lemon Graph Library). It looks pretty nice to work with, and it seems "transparent" so one can understandit easily. Also it seems that can deal with hard computations. So, I decide to try the integration of R with LGL using a Rpackage called Rcpp (which is also awesome!!!). So after a while I had success on it. More precisely, I just got workinga very small and simple program that integrates LGL via Rcpp into R. &lt;/br&gt;&lt;/br&gt;I wrote the details of this in my blog. So I want to share it with the LGL community. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html&lt;/a&gt; &lt;/br&gt;&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html "&gt;http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html &lt;/a&gt;&lt;/br&gt;&lt;/br&gt;Maybe, some others are walking on the same road. Let my know about that. &lt;/br&gt;&lt;/br&gt;Best Regards&lt;/blockquote&gt;Then, Alpár reply: &lt;/br&gt;&lt;/br&gt;&lt;blockquote&gt;Hi Juan, &lt;/br&gt;&lt;/br&gt;Thanks for sharing your experience. I am not familiar with R, but wenttrough your blogpost and I found it really exciting. &lt;/br&gt;&lt;/br&gt;At the end of your post (and at http://stackoverflow.com/) you have aquestion about using LEMON without installing it. Is it a general issueusing Rcpp, or something LEMON specific? &lt;/br&gt;&lt;/br&gt;In general, LEMON headers must be included like#include&lt;lemon/dijkstra.h&gt;, indeed, but this shouldn't cause any problemfor you - simply create a lemon subdirectory within your include dir andput the lemon headers there. &lt;/br&gt;&lt;/br&gt;Regards,Alpár&lt;/br&gt;P.S. It was nice to find other happy users following the links in yourpost. &lt;/br&gt;&lt;/blockquote&gt;Then, I reply: &lt;/br&gt;&lt;blockquote&gt;Hi Alpár, &lt;/br&gt;&lt;/br&gt;Thanks for your kind response and interest.  If I'll try to answer yourquestion maybe I can formulate more precisely my own. When youwrite a R package there are 2 main subdirectories, one named R/and other src/. Inside R/ you put all your .R files (the files with the Rcode) and inside src/ you put all your .cpp and .h files. Eventuallyyou build the package with the R builder which will compile and link the.cpp and .h files in src/, in libraries files .so that you can "load"from the R code. &lt;/br&gt;&lt;/br&gt;Now, that seems to be the way when you use your own .cpp and .hfiles. In the case of using Lemon I think in two possibilities: &lt;/br&gt;&lt;/br&gt;1) Installing it, so all the .h and (may be .so, I don't know if there are someof them) files will be some where in the systems accessible via the system PATHs. So one can use the tools provided by the library by meansof a simple line like: &lt;/br&gt;&lt;/br&gt;#include &amp;lt;lemon/dijkstra.h&amp;gt; &lt;/br&gt;&lt;/br&gt;in your/s .cpp file/s. And this is what I had done. I first try this options becauseI don't know what the installation of the Lemon library does. So maybe theprocess of installation is necessary in order that the Lemon library works. &lt;/br&gt;&lt;/br&gt;2) Now, I'm thinking in this other option (which I do not test yet). Just copyingthe /lemon/ directory inside the src/ directory and access the .h files trougha line like (for example): &lt;/br&gt;&lt;/br&gt;#include "lemon/dijkstra.h" &lt;/br&gt;&lt;/br&gt;that is, now the .h files (I don't know what happens if there are or must be .so files in the Lemon library) are not accessed via the system PATHs, butdirectly inside the src/ directory. This option is in some way better for me(and maybe for others) if it works. Why? Simply, in this way one can builda self-sufficient R package that can be easily installed in other systemsthat uses R via a simple R command from a R console like this (suppose that the package is named LemonPkg): &lt;/br&gt;&lt;/br&gt;&amp;gt; install.packages("LemonPkg") &lt;/br&gt;&lt;/br&gt;and that is !!! You can use all the power of R (the main power ofR is that it integrates conveniently a lot of libraries, also it seems a nice language to work with) and Lemon in a very easy way. But only if this second option works. I will try this at some point. &lt;/br&gt;&lt;/br&gt;Best Regards &lt;/br&gt;&lt;/br&gt;P.S.: Sorry if my mail is so extent. &lt;/blockquote&gt;Then, Alpár reply: &lt;/br&gt;&lt;blockquote&gt;Hi, &lt;/br&gt;&lt;/br&gt;... in response to 2) &lt;/br&gt;&lt;/br&gt;This should basically work, but with the following reservations: &lt;/br&gt;&amp;nbsp;&amp;nbsp;     * Each lemon header includes &lt;lemon/config.h&gt;, which in not in the &lt;/br&gt;&amp;nbsp;&amp;nbsp;       tarball, but instead it is generated from lemon/config.h.in or &lt;/br&gt;&amp;nbsp;&amp;nbsp;       from lemon/config.h.cmake (depending on the build system you &lt;/br&gt;&amp;nbsp;&amp;nbsp;       use) during the configuration phase. &lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             * The easiest solution is to have cmake or ./configure &lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               generate this file and use that, or &lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             * a simple empty file will also serve quite well. (At the &lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               price that some of the tools won't be able to handle the &lt;/br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;               'long long' type and the LP interface will be disables) &lt;/br&gt;&amp;nbsp;&amp;nbsp;     * There are some .cc files you should also compile. The only &lt;/br&gt;&amp;nbsp;&amp;nbsp;       crucial is base.cc, but color.cc (for the graphToEps() tool) &lt;/br&gt;&amp;nbsp;&amp;nbsp;       might also be good. All the remaining .cc files are of little &lt;/br&gt;&amp;nbsp;&amp;nbsp;       use for you (they are used by the LP interface and by &lt;/br&gt;&amp;nbsp;&amp;nbsp;       ArgParser). &lt;/br&gt;&lt;/br&gt;Regards, &lt;/br&gt;Alpar&lt;/blockquote&gt;&lt;/br&gt;Now, what is LP? I found &lt;a href="http://en.wikipedia.org/wiki/COIN-OR"&gt;this&lt;/a&gt; (read section CLP which also link to &lt;a href="http://en.wikipedia.org/wiki/Linear_programming"&gt;this&lt;/a&gt;).So, as I see, there are two main directions to follow: &lt;/br&gt;&lt;/br&gt;i) The simplest: avoid using lemon/config.h (empty file) with the cost of loosing 'long long' type and LP tool. &lt;/br&gt;2) A harder one: intervene the C++ compilation that R does when building the package (I know that this can be done in some way) and try to use the lemon/config.h.cmake or lemon/config.h.in&lt;/br&gt;TODO: Explore this possibilities &lt;/br&gt;&lt;/br&gt;So taking in consideration the 2) possibility. Inspecting a little the &lt;a href="http://cran.r-project.org/doc/manuals/R-exts.pdf"&gt;Writing R Extensions&lt;/a&gt; there "speaks" about a &lt;i&gt;Makefile&lt;/i&gt; and &lt;i&gt;Makevars&lt;/i&gt; files. &lt;/br&gt;&lt;/br&gt;So, in the R side we have: &lt;/br&gt;&lt;/br&gt;Makevars &lt;/br&gt;Makefile &lt;/br&gt;&lt;/br&gt;In the LGL side we have: &lt;/br&gt;&lt;/br&gt;config.h.in &lt;/br&gt;config.h.cmake &lt;/br&gt;cmake &lt;/br&gt;./configure &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Keywords&lt;/b&gt;: POSIX, make, configure, Makevars, Autoconf,... &lt;/br&gt;&lt;/br&gt;Now I found in &lt;a href="http://cran.r-project.org/doc/manuals/R-exts.pdf"&gt;Writing R Extensions&lt;/a&gt; (Section 1.2 Configure and cleanup) the following: &lt;/br&gt;&lt;blockquote&gt;If your package needs some system-dependent configuration before installation you can include an executable (Bourne shell) script ‘configure’ in your package which (if present) isexecuted by R CMD INSTALL before any other action is performed. This can be a script createdby the Autoconf mechanism, but may also be a script written by yourself. Use this to detectif any nonstandard libraries are present such that corresponding code in the package can bedisabled at install time rather than giving error messages when the package is compiled or used.To summarize, the full power of Autoconf is available for your extension package (includingvariable substitution, searching for libraries, etc.).&lt;/blockquote&gt;&lt;/br&gt;so, it seems that maybe the &lt;i&gt;configure&lt;/i&gt; file inside the LGL source could be automatically ran and do the proper configuration required by the &lt;b&gt;lemon/&lt;/b&gt;&lt;i&gt;config.h&lt;/i&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-9048625038831845364?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/9048625038831845364/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=9048625038831845364' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/9048625038831845364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/9048625038831845364'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-package-that.html' title='R Learning - Building a self-sufficient package that integrates the C++ LGL via Rcpp - n.1 : Exploring'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7710842181196422041</id><published>2011-02-13T19:30:00.005-03:00</published><updated>2011-02-13T20:23:59.863-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Roxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Experimenting with Roxygen: R,Rcpp,LGL via Roxygen - n.3</title><content type='html'>In two previous posts (&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-utitilites-roxygen.html"&gt;this&lt;/a&gt; and &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-experimenting-with-roxygen.html"&gt;this&lt;/a&gt;) I was experimenting with the construction of packages using &lt;b&gt;Literate Programming&lt;/b&gt; via &lt;a href="http://roxygen.org/"&gt;&lt;b&gt;Roxygen&lt;/b&gt;&lt;/a&gt;. &lt;/br&gt;&lt;/br&gt;In the other side, I also was experimenting with building R packages that integrates Lemon Graph Library (LGL) C++ code via Rcpp (&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html"&gt;this post&lt;/a&gt;). &lt;/br&gt;&lt;/br&gt;Now the challenge is to build a R package that integrates LGL C++ code via Rcpp using &lt;i&gt;Roxygen&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;How will I do it? Well, I think that the shortest way is to use as a starting point the source package named &lt;b&gt;pkgwithlgl&lt;/b&gt; which development I discuss &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html"&gt;in the post mentionated above&lt;/a&gt;  related to the integration of LGL via Rcpp. Also to use as guide the .R files used in the &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-experimenting-with-roxygen.html"&gt;other mentioned post&lt;/a&gt; above about the use of roxygen. &lt;/br&gt;&lt;/br&gt;TODO ... (the package is running, it remains to determine which things roxygen predetermines in the DESCRIPTION and NAMESPACE files). &lt;a href="http://stackoverflow.com/questions/3086081/how-do-you-write-your-package-documentation"&gt;This&lt;/a&gt; may be useful for this goal. Notice that Depends is not the same as Import, for example a R package may depend on the Rcpp package because it includes Rcpp.h, but if does not use R code inside Rcpp so there is no need to import Rcpp.&lt;/br&gt; &lt;/br&gt;TODO: There remains: i) Try to learn some IDE as &lt;a href="http://ess.r-project.org/"&gt;ESS&lt;/a&gt; or &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;-&lt;a href="http://www.walware.de/goto/statet"&gt;StatET&lt;/a&gt;. ii) See if there is something similar to roxygen for the &lt;b&gt;src/&lt;/b&gt; code in a R package. &lt;/br&gt;&lt;/br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7710842181196422041?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7710842181196422041/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7710842181196422041' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7710842181196422041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7710842181196422041'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-experimenting-with-roxygen_13.html' title='R Learning - Experimenting with Roxygen: R,Rcpp,LGL via Roxygen - n.3'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-7776118193799874794</id><published>2011-02-13T12:58:00.012-03:00</published><updated>2011-02-13T16:42:29.504-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='logbook'/><category scheme='http://www.blogger.com/atom/ns#' term='Roxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Experimenting with Roxygen - n.2</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-utitilites-roxygen.html"&gt;previous post&lt;/a&gt; I take a little experiment with a simple Roxygen example (the first one that appears in &lt;a href="http://cran.r-project.org/web/packages/roxygen/vignettes/roxygen.pdf"&gt;its vignette&lt;/a&gt; on CRAN). Now I will try with the second example. So I pick a working directory and create the following files: &lt;/br&gt;&lt;/br&gt;First one named &lt;i&gt;pseudoprime-package.R&lt;/i&gt; containing: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#' Tests pseudoprimality by Fermat's little theorem.&lt;br /&gt;#'&lt;br /&gt;#' \tabular{ll}{&lt;br /&gt;#' Package: \tab pseudoprime\cr&lt;br /&gt;#' Type: \tab Package\cr&lt;br /&gt;#' Version: \tab 0.1\cr&lt;br /&gt;#' Date: \tab 2008-08-24\cr&lt;br /&gt;#' License: \tab GPL (&amp;gt;= 2)\cr&lt;br /&gt;#' LazyLoad: \tab yes\cr&lt;br /&gt;#' }&lt;br /&gt;#'&lt;br /&gt;#' Using the Fermat primality test, pseudoprime checks for primes&lt;br /&gt;#' probabilistically; the test is fooled every time by Carmichael&lt;br /&gt;#' numbers.&lt;br /&gt;#'&lt;br /&gt;#' \code{\link{is.pseudoprime}} checks a number \code{n} for&lt;br /&gt;#' pseudoprimality, applying Fermat's test \code{times} times.&lt;br /&gt;#'&lt;br /&gt;#' @name pseudoprime-package&lt;br /&gt;#' @aliases pseudoprime&lt;br /&gt;#' @docType package&lt;br /&gt;#' @title Tests pseudoprimality by Fermat's little theorem&lt;br /&gt;#' @author Peter Danenberg \email{pcd@@roxygen.org}&lt;br /&gt;#' @references&lt;br /&gt;#' \url{http://en.wikipedia.org/wiki/Fermat's_little_theorem}&lt;br /&gt;#' @keywords package&lt;br /&gt;#' @seealso \code{\link{is.pseudoprime}}&lt;br /&gt;#' @examples&lt;br /&gt;#' is.pseudoprime(13, 4)&lt;br /&gt;roxygen()&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;another named &lt;i&gt;fermat.R&lt;/i&gt; containing: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#' Test an integer for primality with Fermat's little theorem.&lt;br /&gt;#'&lt;br /&gt;#' Fermat's little theorem states that if \eqn{n} is a prime&lt;br /&gt;#' number and \eqn{a} is any positive integer less than \eqn{n},&lt;br /&gt;#' then \eqn{a} raised to the \eqn{n}th power is congruent to&lt;br /&gt;#' \eqn{a\ modulo\ n}{a modulo n}.&lt;br /&gt;#'&lt;br /&gt;#' @param n the integer to test for primality&lt;br /&gt;#' @return Whether the integer passes the Fermat test&lt;br /&gt;#' for a randomized \eqn{0 &amp;lt; a &amp;lt; n}&lt;br /&gt;#' @callGraphPrimitives&lt;br /&gt;#' @note \code{fermat.test} doesn't work for integers above&lt;br /&gt;#' approximately fifteen because modulus loses precision.&lt;br /&gt;#' @references&lt;br /&gt;#' \url{http://en.wikipedia.org/wiki/Fermat's_little_theorem}&lt;br /&gt;#' @author Peter Danenberg \email{pcd@@roxygen.org}&lt;br /&gt;fermat.test &amp;lt;- function(n) {&lt;br /&gt;    a &amp;lt;- floor(runif(1, min=1, max=n))&lt;br /&gt;    a ^ n %% n == a&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and finally another named &lt;i&gt;pseudoprime.R&lt;/i&gt; containing: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#' @include fermat.R&lt;br /&gt;roxygen()&lt;br /&gt;&lt;br /&gt;#' Check an integer for pseudo-primality to an arbitrary&lt;br /&gt;#' precision.&lt;br /&gt;#'&lt;br /&gt;#' A number is pseudo-prime if it is probably prime, the basis&lt;br /&gt;#' of which is the probabilistic Fermat test; if it passes two&lt;br /&gt;#' such tests, the chances are better than 3 out of 4 that&lt;br /&gt;#' \eqn{n} is prime.&lt;br /&gt;#'&lt;br /&gt;#' @param n the integer to test for pseudoprimality.&lt;br /&gt;#' @param times the number of Fermat tests to perform&lt;br /&gt;#' @return Whether the number is pseudoprime&lt;br /&gt;#' @export&lt;br /&gt;#' @seealso \code{\link{fermat.test}}&lt;br /&gt;#' @references Abelson, Hal; Jerry Sussman, and Julie Sussman.&lt;br /&gt;#' Structure and Interpretation of Computer Programs.&lt;br /&gt;#' Cambridge: MIT Press, 1984.&lt;br /&gt;#' @author Peter Danenberg \email{pcd@@roxygen.org}&lt;br /&gt;#' @examples&lt;br /&gt;#' is.pseudoprime(13, 4) # TRUE most of the time&lt;br /&gt;is.pseudoprime &amp;lt;- function(n, times) {&lt;br /&gt;    if (times == 0) TRUE&lt;br /&gt;    else if (fermat.test(n)) is.pseudoprime(n, times - 1)&lt;br /&gt;    else FALSE&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Notice that the first file (&lt;i&gt;pseudoprime-package.R&lt;/i&gt;) contains no R code, It is just something that Roxygen eats in order to create the &lt;i&gt;pseudoprime-package.Rd&lt;/i&gt; file (and something more?). The third file (&lt;i&gt;pseudoprime.R&lt;/i&gt;) contains the "main" code that will be exposed to the package user, this file "includes" (import) code stored in the second file (&lt;i&gt;fermat.R&lt;/i&gt;). &lt;/br&gt;&lt;/br&gt;Now lets proceed to build a roxygenized package from this files. I open a R console in the working directory and run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; files &amp;lt;- c(&amp;quot;pseudoprime-package.R&amp;quot;,&amp;quot;pseudoprime.R&amp;quot;,&amp;quot;fermat.R&amp;quot;)&lt;br /&gt;&amp;gt; package.skeleton(&amp;quot;pseudoprimePackage&amp;quot;,code_files=files,force=TRUE)&lt;br /&gt;Error in eval(expr, envir, enclos) : could not find function &amp;quot;roxygen&amp;quot;&lt;br /&gt;&amp;gt; require(&amp;quot;roxygen&amp;quot;)&lt;br /&gt;Loading required package: roxygen&lt;br /&gt;Loading required package: digest&lt;br /&gt;&amp;gt; package.skeleton(&amp;quot;pseudoprimePackage&amp;quot;,code_files=files,force=TRUE)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Copying code files ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './pseudoprimePackage/Read-and-delete-me'.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;It creates a package with the corresponding .R files in the &lt;b&gt;R&lt;/b&gt;. Inside the &lt;b&gt;man&lt;/b&gt; directory there are 3 files: &lt;i&gt;fermat.test.Rd&lt;/i&gt;, &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt; and  &lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt;. The first one contains: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{fermat.test}&lt;br /&gt;\alias{fermat.test}&lt;br /&gt;%- Also NEED an '\alias' for EACH other topic documented here.&lt;br /&gt;\title{&lt;br /&gt;%%  ~~function to do ... ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;%%  ~~ A concise (1-5 lines) description of what the function does. ~~&lt;br /&gt;}&lt;br /&gt;\usage{&lt;br /&gt;fermat.test(n)&lt;br /&gt;}&lt;br /&gt;%- maybe also 'usage' for other objects documented here.&lt;br /&gt;\arguments{&lt;br /&gt;  \item{n}{&lt;br /&gt;%%     ~~Describe \code{n} here~~&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;%%  ~~ If necessary, more details than the description above ~~&lt;br /&gt;}&lt;br /&gt;\value{&lt;br /&gt;%%  ~Describe the value returned&lt;br /&gt;%%  If it is a LIST, use&lt;br /&gt;%%  \item{comp1 }{Description of 'comp1'}&lt;br /&gt;%%  \item{comp2 }{Description of 'comp2'}&lt;br /&gt;%% ...&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;%% ~put references to the literature/web site here ~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;%%  ~~who you are~~&lt;br /&gt;}&lt;br /&gt;\note{&lt;br /&gt;%%  ~~further notes~~&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;%% ~Make other sections like Warning with \section{Warning }{....} ~&lt;br /&gt;&lt;br /&gt;\seealso{&lt;br /&gt;%% ~~objects to See Also as \code{\link{help}}, ~~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;##---- Should be DIRECTLY executable !! ----&lt;br /&gt;##-- ==&amp;gt;  Define data, use random,&lt;br /&gt;##--    or do  help(data=index)  for the standard data sets.&lt;br /&gt;&lt;br /&gt;## The function is currently defined as&lt;br /&gt;function (n) &lt;br /&gt;{&lt;br /&gt;    a &amp;lt;- floor(runif(1, min = 1, max = n))&lt;br /&gt;    a^n\%\%n == a&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;% Add one or more standard keywords, see file 'KEYWORDS' in the&lt;br /&gt;% R documentation directory.&lt;br /&gt;\keyword{ ~kwd1 }&lt;br /&gt;\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;the second one contains: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{is.pseudoprime}&lt;br /&gt;\alias{is.pseudoprime}&lt;br /&gt;%- Also NEED an '\alias' for EACH other topic documented here.&lt;br /&gt;\title{&lt;br /&gt;%%  ~~function to do ... ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;%%  ~~ A concise (1-5 lines) description of what the function does. ~~&lt;br /&gt;}&lt;br /&gt;\usage{&lt;br /&gt;is.pseudoprime(n, times)&lt;br /&gt;}&lt;br /&gt;%- maybe also 'usage' for other objects documented here.&lt;br /&gt;\arguments{&lt;br /&gt;  \item{n}{&lt;br /&gt;%%     ~~Describe \code{n} here~~&lt;br /&gt;}&lt;br /&gt;  \item{times}{&lt;br /&gt;%%     ~~Describe \code{times} here~~&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;%%  ~~ If necessary, more details than the description above ~~&lt;br /&gt;}&lt;br /&gt;\value{&lt;br /&gt;%%  ~Describe the value returned&lt;br /&gt;%%  If it is a LIST, use&lt;br /&gt;%%  \item{comp1 }{Description of 'comp1'}&lt;br /&gt;%%  \item{comp2 }{Description of 'comp2'}&lt;br /&gt;%% ...&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;%% ~put references to the literature/web site here ~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;%%  ~~who you are~~&lt;br /&gt;}&lt;br /&gt;\note{&lt;br /&gt;%%  ~~further notes~~&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;%% ~Make other sections like Warning with \section{Warning }{....} ~&lt;br /&gt;&lt;br /&gt;\seealso{&lt;br /&gt;%% ~~objects to See Also as \code{\link{help}}, ~~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;##---- Should be DIRECTLY executable !! ----&lt;br /&gt;##-- ==&amp;gt;  Define data, use random,&lt;br /&gt;##--    or do  help(data=index)  for the standard data sets.&lt;br /&gt;&lt;br /&gt;## The function is currently defined as&lt;br /&gt;function (n, times) &lt;br /&gt;{&lt;br /&gt;    if (times == 0) &lt;br /&gt;        TRUE&lt;br /&gt;    else if (fermat.test(n)) &lt;br /&gt;        is.pseudoprime(n, times - 1)&lt;br /&gt;    else FALSE&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;% Add one or more standard keywords, see file 'KEYWORDS' in the&lt;br /&gt;% R documentation directory.&lt;br /&gt;\keyword{ ~kwd1 }&lt;br /&gt;\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and finally the third one contains: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{pseudoprimePackage-package}&lt;br /&gt;\alias{pseudoprimePackage-package}&lt;br /&gt;\alias{pseudoprimePackage}&lt;br /&gt;\docType{package}&lt;br /&gt;\title{&lt;br /&gt;What the package does (short line)&lt;br /&gt;~~ package title ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;More about what it does (maybe more than one line)&lt;br /&gt;~~ A concise (1-5 lines) description of the package ~~&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;\tabular{ll}{&lt;br /&gt;Package: \tab pseudoprimePackage\cr&lt;br /&gt;Type: \tab Package\cr&lt;br /&gt;Version: \tab 1.0\cr&lt;br /&gt;Date: \tab 2011-02-13\cr&lt;br /&gt;License: \tab What license is it under?\cr&lt;br /&gt;LazyLoad: \tab yes\cr&lt;br /&gt;}&lt;br /&gt;~~ An overview of how to use the package, including the most important ~~&lt;br /&gt;~~ functions ~~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;Who wrote it&lt;br /&gt;&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;~~ The author and/or maintainer of the package ~~&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;~~ Literature or other references for background information ~~&lt;br /&gt;}&lt;br /&gt;~~ Optionally other standard keywords, one per line, from file KEYWORDS in ~~&lt;br /&gt;~~ the R documentation directory ~~&lt;br /&gt;\keyword{ package }&lt;br /&gt;\seealso{&lt;br /&gt;~~ Optional links to other man pages, e.g. ~~&lt;br /&gt;~~ \code{\link[&amp;lt;pkg&amp;gt;:&amp;lt;pkg&amp;gt;-package]{&amp;lt;pkg&amp;gt;}} ~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;~~ simple examples of the most important functions ~~&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now, lets roxygenize the package. In a linux console inside the container directory (the one that contains the recently created package) I run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD roxygen -d pseudoprimePackage&lt;br /&gt;Loading required package: digest&lt;br /&gt;Writing fermat.test to pseudoprimePackage/man/fermat.test.Rd&lt;br /&gt;Writing pseudoprime-package to pseudoprimePackage/man/pseudoprime-package.Rd&lt;br /&gt;Writing is.pseudoprime to pseudoprimePackage/man/is.pseudoprime.Rd&lt;br /&gt;Writing namespace directives to pseudoprimePackage/NAMESPACE &lt;br /&gt;Merging collate directive with pseudoprimePackage/DESCRIPTION to pseudoprimePackage/DESCRIPTION &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now (I forgot to put the version before roxygenize it) in the DESCRIPTION file one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: pseudoprimePackage&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-13&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What license is it under?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;Collate: 'fermat.R' 'pseudoprime-package.R' 'pseudoprime.R'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Notice the extra line "Collate" which seems to determine the appropriate order of collation. Then inside &lt;i&gt;fermat.test.Rd&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;\name{fermat.test}&lt;br /&gt;\alias{fermat.test}&lt;br /&gt;\title{Test an integer for primality with Fermat's little theorem.}&lt;br /&gt;\usage{fermat.test(n)}&lt;br /&gt;\description{Test an integer for primality with Fermat's little theorem.}&lt;br /&gt;\details{Fermat's little theorem states that if \eqn{n} is a prime&lt;br /&gt;number and \eqn{a} is any positive integer less than \eqn{n},&lt;br /&gt;then \eqn{a} raised to the \eqn{n}th power is congruent to&lt;br /&gt;\eqn{a\ modulo\ n}{a modulo n}.}&lt;br /&gt;\value{Whether the integer passes the Fermat test&lt;br /&gt;for a randomized \eqn{0 &amp;lt; a &amp;lt; n}}&lt;br /&gt;\note{\code{fermat.test} doesn't work for integers above&lt;br /&gt;approximately fifteen because modulus loses precision.}&lt;br /&gt;\references{\url{http://en.wikipedia.org/wiki/Fermat's_little_theorem}}&lt;br /&gt;\author{Peter Danenberg \email{pcd@roxygen.org}}&lt;br /&gt;\arguments{\item{n}{the integer to test for primality}}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;inside &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{is.pseudoprime}&lt;br /&gt;\alias{is.pseudoprime}&lt;br /&gt;\title{Check an integer for pseudo-primality to an arbitrary...}&lt;br /&gt;\usage{is.pseudoprime(n, times)}&lt;br /&gt;\description{Check an integer for pseudo-primality to an arbitrary&lt;br /&gt;precision.}&lt;br /&gt;\details{A number is pseudo-prime if it is probably prime, the basis&lt;br /&gt;of which is the probabilistic Fermat test; if it passes two&lt;br /&gt;such tests, the chances are better than 3 out of 4 that&lt;br /&gt;\eqn{n} is prime.}&lt;br /&gt;\value{Whether the number is pseudoprime}&lt;br /&gt;\seealso{\code{\link{fermat.test}}}&lt;br /&gt;\references{Abelson, Hal; Jerry Sussman, and Julie Sussman.&lt;br /&gt;Structure and Interpretation of Computer Programs.&lt;br /&gt;Cambridge: MIT Press, 1984.}&lt;br /&gt;\author{Peter Danenberg \email{pcd@roxygen.org}}&lt;br /&gt;\arguments{\item{n}{the integer to test for pseudoprimality.}&lt;br /&gt;\item{times}{the number of Fermat tests to perform}}&lt;br /&gt;\examples{is.pseudoprime(13, 4) # TRUE most of the time}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;&lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt; remains the same, and there appears other file named &lt;i&gt;pseudoprime-package.Rd&lt;/i&gt; which contains: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{pseudoprime-package}&lt;br /&gt;\title{Tests pseudoprimality by Fermat's little theorem}&lt;br /&gt;\description{Tests pseudoprimality by Fermat's little theorem.}&lt;br /&gt;\details{\tabular{ll}{&lt;br /&gt;Package: \tab pseudoprime\cr&lt;br /&gt;Type: \tab Package\cr&lt;br /&gt;Version: \tab 0.1\cr&lt;br /&gt;Date: \tab 2008-08-24\cr&lt;br /&gt;License: \tab GPL (&amp;gt;= 2)\cr&lt;br /&gt;LazyLoad: \tab yes\cr&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Using the Fermat primality test, pseudoprime checks for primes&lt;br /&gt;probabilistically; the test is fooled every time by Carmichael&lt;br /&gt;numbers.&lt;br /&gt;&lt;br /&gt;\code{\link{is.pseudoprime}} checks a number \code{n} for&lt;br /&gt;pseudoprimality, applying Fermat's test \code{times} times.}&lt;br /&gt;\alias{pseudoprime}&lt;br /&gt;\docType{package}&lt;br /&gt;\author{Peter Danenberg \email{pcd@roxygen.org}}&lt;br /&gt;\references{\url{http://en.wikipedia.org/wiki/Fermat's_little_theorem}}&lt;br /&gt;\keyword{package}&lt;br /&gt;\seealso{\code{\link{is.pseudoprime}}}&lt;br /&gt;\examples{is.pseudoprime(13, 4)}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, there is something to remark. Initially the &lt;i&gt;package.skeleton(...)&lt;/i&gt; function creates 3 &lt;b&gt;man&lt;/b&gt; files (&lt;i&gt;fermat.test.Rd&lt;/i&gt;, &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt; and &lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt;)two of them related to R functions (the files &lt;i&gt;fermat.test.Rd&lt;/i&gt; and &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt;), the other one (&lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt;) dedicated to the description of the package. Then, &lt;i&gt;roxygenize&lt;/i&gt; replace two of them (the corresponding to the R functions: &lt;i&gt;fermat.test.Rd&lt;/i&gt; and &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt;), left untouched &lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt; and create a fourth one &lt;i&gt;pseudoprime-package.Rd&lt;/i&gt; which transcript the roxygen code inside &lt;i&gt;pseudoprime-package.R&lt;/i&gt;, so the idea is that this fourth file replaces in its function of describing the package to the file &lt;i&gt;pseudoprimePackage-package.Rd&lt;/i&gt;. So, one file become useless. How to avoid this? The way is to name the .R file that trough the roxygenation eventually lead to the .Rd file that becomes the package description. In other words using the right names in the call of &lt;i&gt;package.skeleton(...)&lt;/i&gt; and in the &lt;i&gt;roxygenation&lt;/i&gt;.Iin this case the right thing would be to construct a source package via (in a R console): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; package.skeleton(&amp;quot;pseudoprime&amp;quot;,code_files=files,force=TRUE)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Copying code files ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './pseudoprime/Read-and-delete-me'.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and then (in a linux console): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD roxygen -d pseudoprime&lt;br /&gt;Loading required package: digest&lt;br /&gt;Writing fermat.test to pseudoprime/man/fermat.test.Rd&lt;br /&gt;Writing pseudoprime-package to pseudoprime/man/pseudoprime-package.Rd&lt;br /&gt;Writing is.pseudoprime to pseudoprime/man/is.pseudoprime.Rd&lt;br /&gt;Writing namespace directives to pseudoprime/NAMESPACE &lt;br /&gt;Merging collate directive with pseudoprime/DESCRIPTION to pseudoprime/DESCRIPTION &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, now the source package directory name is &lt;b&gt;pseudoprime&lt;/b&gt;, and inside &lt;b&gt;man&lt;/b&gt; one finds only 3 files: &lt;i&gt;fermat.test.Rd&lt;/i&gt;, &lt;i&gt;is.pseudoprime.Rd&lt;/i&gt;, and &lt;i&gt;pseudoprime-package.Rd&lt;/i&gt;. All of them with content determined via the comment directives that interpret roxygen in the source .R files. In other words, the .Rd file containing the package description originally created by &lt;i&gt;package.skeleton(...)&lt;/i&gt; was replaced by a file of the same name created by the &lt;i&gt;roxygenization&lt;/i&gt;.&lt;/br&gt;&lt;/br&gt;Now lets install the package in order to see if it works. So I proceed in a linux console in the working directory that contains the source package: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL pseudoprime&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;pseudoprime&amp;#8217; ...&lt;br /&gt;** R&lt;br /&gt;** inst&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;Error in eval(expr, envir, enclos) : could not find function &amp;quot;roxygen&amp;quot;&lt;br /&gt;Error : unable to load R code in package 'pseudoprime'&lt;br /&gt;ERROR: lazy loading failed for package &amp;#8216;pseudoprime&amp;#8217;&lt;br /&gt;* removing &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12/pseudoprime&amp;#8217;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, it doesn't work. It seems that the first Error has to do with a call to the function &lt;i&gt;roxygen()&lt;/i&gt; which is not imported. It seems that for some reason after R comments that serves as roxygen commands there need to be a NULL (a R "command" that does nothing). A way to implement this is to call the function &lt;i&gt;roxygen()&lt;/i&gt; which returns NULL. Lets see what happens if I replace the &lt;i&gt;roxygen()&lt;/i&gt; calls with NULL. &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;R CMD INSTALL pseudoprime/&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;pseudoprime&amp;#8217; ...&lt;br /&gt;** R&lt;br /&gt;** inst&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;pseudoprime&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    fermat.test                             html  &lt;br /&gt;    is.pseudoprime                          html  &lt;br /&gt;    pseudoprime-package                     html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (pseudoprime)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;it seems to work. Lets se now if it works from a R console: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;pseudoprime&amp;quot;)&lt;br /&gt;Loading required package: pseudoprime&lt;br /&gt;&amp;gt; is.pseudoprime(13,4)&lt;br /&gt;[1] TRUE&lt;br /&gt;&amp;gt; fermat.test(13)&lt;br /&gt;Error: could not find function &amp;quot;fermat.test&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, as one can see, it works and only the exported function is available. &lt;/br&gt;&lt;/br&gt;TODO: Now the next challenge is to use &lt;i&gt;roxygen&lt;/i&gt; and &lt;i&gt;Rcpp.package.skeleton()&lt;/i&gt; to build a package that integrates C++ code, and eventually LGL C++ code. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-7776118193799874794?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/7776118193799874794/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=7776118193799874794' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7776118193799874794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/7776118193799874794'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-experimenting-with-roxygen.html' title='R Learning - Experimenting with Roxygen - n.2'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-950894965481839956</id><published>2011-02-13T12:03:00.006-03:00</published><updated>2011-02-13T12:58:38.009-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='logbook'/><category scheme='http://www.blogger.com/atom/ns#' term='Roxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Experimenting with Roxygen - n.1</title><content type='html'>In this post, I will write a logbook about trying some examples that uses Roxygen. I will base my experiment on the &lt;a href="http://cran.r-project.org/web/packages/roxygen/vignettes/roxygen.pdf"&gt;roxygen vignette&lt;/a&gt; where there are 2 examples. Lets start with the simplest one. I pick a working directory, and inside it I create a file named &lt;i&gt;hello-roxygen.R&lt;/i&gt; with the following content: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#' A package to check Roxygen's sanity&lt;br /&gt;#' @name helloRoxygen-package&lt;br /&gt;#' @docType package&lt;br /&gt;NA&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then I open a R console on the working directory and run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;roxygen&amp;quot;)&lt;br /&gt;Loading required package: roxygen&lt;br /&gt;Loading required package: digest&lt;br /&gt;&amp;gt; package.skeleton(&amp;quot;hello-roxygen&amp;quot;,code_files=&amp;quot;hello-roxygen.R&amp;quot;,force=TRUE)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Copying code files ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './hello-roxygen/Read-and-delete-me'.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, inside the working directory appears a directory named &lt;b&gt;hello-roxygen&lt;/b&gt; which correspond to a source package. Inside it there are 2 files (&lt;i&gt;DESCRIPTION&lt;/i&gt; and &lt;i&gt;Read-and-delete-me&lt;/i&gt;) and 2 directories (&lt;b&gt;man&lt;/b&gt; and &lt;b&gt;R&lt;/b&gt;). I will focus in the content of &lt;i&gt;DESCRIPTION&lt;/i&gt; and &lt;b&gt;man/&lt;/b&gt;&lt;i&gt;hello-roxygen.Rd&lt;/i&gt;. So, the content of DESCRIPTION is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: hello-roxygen&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-13&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What license is it under?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and the content of &lt;i&gt;hello-roxygen.Rd&lt;/i&gt; is: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{hello-roxygen-package}&lt;br /&gt;\alias{hello-roxygen-package}&lt;br /&gt;\alias{hello-roxygen}&lt;br /&gt;\docType{package}&lt;br /&gt;\title{&lt;br /&gt;What the package does (short line)&lt;br /&gt;~~ package title ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;More about what it does (maybe more than one line)&lt;br /&gt;~~ A concise (1-5 lines) description of the package ~~&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;\tabular{ll}{&lt;br /&gt;Package: \tab hello-roxygen\cr&lt;br /&gt;Type: \tab Package\cr&lt;br /&gt;Version: \tab 1.0\cr&lt;br /&gt;Date: \tab 2011-02-13\cr&lt;br /&gt;License: \tab What license is it under?\cr&lt;br /&gt;LazyLoad: \tab yes\cr&lt;br /&gt;}&lt;br /&gt;~~ An overview of how to use the package, including the most important ~~&lt;br /&gt;~~ functions ~~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;Who wrote it&lt;br /&gt;&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;~~ The author and/or maintainer of the package ~~&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;~~ Literature or other references for background information ~~&lt;br /&gt;}&lt;br /&gt;~~ Optionally other standard keywords, one per line, from file KEYWORDS in ~~&lt;br /&gt;~~ the R documentation directory ~~&lt;br /&gt;\keyword{ package }&lt;br /&gt;\seealso{&lt;br /&gt;~~ Optional links to other man pages, e.g. ~~&lt;br /&gt;~~ \code{\link[&amp;lt;pkg&amp;gt;:&amp;lt;pkg&amp;gt;-package]{&amp;lt;pkg&amp;gt;}} ~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;~~ simple examples of the most important functions ~~&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now, I run in the R console the appropriate roxygen commands: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; roxygenize(&amp;quot;hello-roxygen&amp;quot;,roxygen.dir=&amp;quot;hello-roxygen&amp;quot;,copy.package=FALSE,unlink.target=FALSE)&lt;br /&gt;Writing helloRoxygen-package to hello-roxygen/man/helloRoxygen-package.Rd&lt;br /&gt;Writing namespace directives to hello-roxygen/NAMESPACE &lt;br /&gt;Merging collate directive with hello-roxygen/DESCRIPTION to hello-roxygen/DESCRIPTION&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now lets look if some changes occurs in the previous mentioned files. Inside DESCRIPTION one can find: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: hello-roxygen&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-13&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What license is it under?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;Collate: 'hello-roxygen.R'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, it is the same file as before but with an extra line:  &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Collate: 'hello-roxygen.R'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I don't know what this line minds, but in &lt;a href="http://cran.r-project.org/doc/manuals/R-exts.html"&gt;Writin R extensions&lt;/a&gt; there is written about this the following: &lt;/br&gt;&lt;blockquote&gt;An ‘Collate’ field can be used for controlling the collation order for the R code files in a package when these are processed for package installation. The default is to collate according to the ‘C’ locale. If present, the collate specification must list all R code files in the package (taking possible OS-specific subdirectories into account, see Package subdirectories) as a whitespace separated list of file paths relative to the R subdirectory. Paths containing white space or quotes need to be quoted. An OS-specific collation field (‘Collate.unix’ or ‘Collate.windows’) will be used instead of ‘Collate’.&lt;/blockquote&gt;Now, inside the &lt;b&gt;man&lt;/b&gt; directory there are two files: &lt;i&gt;hello-roxygen-package.Rd&lt;/i&gt; and &lt;i&gt;helloRoxygen-package.Rd&lt;/i&gt;. Inside &lt;i&gt;hello-roxygen-package.Rd&lt;/i&gt; one finds:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{hello-roxygen-package}&lt;br /&gt;\alias{hello-roxygen-package}&lt;br /&gt;\alias{hello-roxygen}&lt;br /&gt;\docType{package}&lt;br /&gt;\title{&lt;br /&gt;What the package does (short line)&lt;br /&gt;~~ package title ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;More about what it does (maybe more than one line)&lt;br /&gt;~~ A concise (1-5 lines) description of the package ~~&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;\tabular{ll}{&lt;br /&gt;Package: \tab hello-roxygen\cr&lt;br /&gt;Type: \tab Package\cr&lt;br /&gt;Version: \tab 1.0\cr&lt;br /&gt;Date: \tab 2011-02-13\cr&lt;br /&gt;License: \tab What license is it under?\cr&lt;br /&gt;LazyLoad: \tab yes\cr&lt;br /&gt;}&lt;br /&gt;~~ An overview of how to use the package, including the most important ~~&lt;br /&gt;~~ functions ~~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;Who wrote it&lt;br /&gt;&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;~~ The author and/or maintainer of the package ~~&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;~~ Literature or other references for background information ~~&lt;br /&gt;}&lt;br /&gt;~~ Optionally other standard keywords, one per line, from file KEYWORDS in ~~&lt;br /&gt;~~ the R documentation directory ~~&lt;br /&gt;\keyword{ package }&lt;br /&gt;\seealso{&lt;br /&gt;~~ Optional links to other man pages, e.g. ~~&lt;br /&gt;~~ \code{\link[&amp;lt;pkg&amp;gt;:&amp;lt;pkg&amp;gt;-package]{&amp;lt;pkg&amp;gt;}} ~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;~~ simple examples of the most important functions ~~&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, this is the same file that there exist before applying the &lt;i&gt;roxygenize(...)&lt;/i&gt; command, it was untouched . Inside &lt;i&gt;helloRoxygen-package.Rd&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{helloRoxygen-package}&lt;br /&gt;\alias{helloRoxygen-package}&lt;br /&gt;\title{A package to check Roxygen's sanity...}&lt;br /&gt;\description{A package to check Roxygen's sanity}&lt;br /&gt;\docType{package}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, this is a new file created by &lt;i&gt;roxygenize(...)&lt;/i&gt;, and it contains the expression of the directives written in the &lt;i&gt;hello-roxygen.R&lt;/i&gt; file.&lt;/br&gt;This example package does not have code of any kind (not R code, not C++, etc), so there is no reason for to install it in order to test it. &lt;/br&gt;&lt;/br&gt;TODO: Try with the next example in the roxygen vignette. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-950894965481839956?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/950894965481839956/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=950894965481839956' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/950894965481839956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/950894965481839956'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-utitilites-roxygen.html' title='R Learning - Experimenting with Roxygen - n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-561090381738808508</id><published>2011-02-12T21:53:00.002-03:00</published><updated>2011-02-12T21:53:57.382-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='high performance computing'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Utilities - the cxxPack package</title><content type='html'>I don't know exactly what this package does. But it seems that facilitates building packages that uses C++ code via Rcpp. &lt;/br&gt;&lt;/br&gt;Here a &lt;a href="http://cran.r-project.org/web/packages/cxxPack/index.html"&gt;link&lt;/a&gt; to the package on CRAN. &lt;/br&gt;&lt;/br&gt;TODO: Check if it is useful. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-561090381738808508?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/561090381738808508/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=561090381738808508' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/561090381738808508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/561090381738808508'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-utilities-cxxpack-package.html' title='R Utilities - the cxxPack package'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-4460754715851963573</id><published>2011-02-12T12:28:00.017-03:00</published><updated>2011-02-21T15:38:59.406-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='StatET'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='ESS'/><category scheme='http://www.blogger.com/atom/ns#' term='Roxygen'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><category scheme='http://www.blogger.com/atom/ns#' term='Emacs'/><title type='text'>R statistics and C++ - IDEs, GUIs, etc...</title><content type='html'>Now, it is time to think around IDEs. Some months before I have worked with .NET framework for C#. I found this experience grateful. Normally I work using vi, that is because I normally looks for simplicity. But it happens that simplicity maybe provided by a nice IDE (integrated development environment). It requires to learn something more, and also (frequently) to pick from several options, but I begin to think that it may worth the effort. &lt;/br&gt;&lt;/br&gt;So, for the moment I just have some names (these are not all IDEs, there are also tools that may become part of some IDE). I list them here: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://ess.r-project.org/"&gt;ESS&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.eclipse.org/"&gt;ECLIPSE&lt;/a&gt; with &lt;a href="http://www.walware.de/goto/statet"&gt;StatET&lt;/a&gt; &lt;/br&gt;&lt;a href="http://roxygen.org/"&gt;Roxygen&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.stat.uni-muenchen.de/~leisch/Sweave/"&gt;Sweave&lt;/a&gt; &lt;/br&gt;Gedit + &lt;a href="http://sourceforge.net/projects/rgedit/"&gt;RGedit plugin&lt;/a&gt; + Snippets plugin &lt;/br&gt;&lt;/br&gt;I need to learn to distinguish terms. IDE, framework and GUI are not the same. Now I'm trying to install &lt;a href="http://www.eclipse.org/"&gt;ECLIPSE&lt;/a&gt; and its plugin &lt;a href="http://www.walware.de/goto/statet"&gt;StatET&lt;/a&gt;. Lets see what happens... Well it is working (maybe the configuration is not in its best). But I notice something that I don't like. It requires a lot of resources of my laptop. Maybe &lt;a href="http://stackoverflow.com/questions/3086081/how-do-you-write-your-package-documentation"&gt;this post&lt;/a&gt; can be useful.&lt;/br&gt;&lt;/br&gt;TODO: Now the goal is to understand the function and interplay between R, Roxygen, Eclipse, and StatET. &lt;/br&gt;&lt;/br&gt;Useful links: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://roxygen.org/useR/roxygen-part-1.pdf"&gt;Roxygen Tutorial (presentation)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://user2010.org/tutorials/Danenberg.html"&gt;Tutorial: Literate programming with Roxygen at userR! 2010&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.r-bloggers.com/rd2roxygen-convert-rd-to-roxygen-documentation/"&gt;Rd2roxygen: Convert Rd to roxygen documentation (video, ESS)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://www.stat.rice.edu/~helpdesk/tutorial/ess.html"&gt;S-Plus/R with ESS (tutorial)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://lists.r-forge.r-project.org/pipermail/statet-user/2008-June/000018.html"&gt;[StatET-user] tip for StatET users new to Eclipse (at the StatET mailing list)&lt;/a&gt; &lt;/br&gt;&lt;a href="http://eclipsetutorial.sourceforge.net/workbenchlessons.html"&gt;Eclipse And Java: Free Video Tutorials&lt;/a&gt; &lt;/br&gt;&lt;a href="https://github.com/hadley/devtools/wiki/Namespaces"&gt;Namespaces ...&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Now taking in account that I also want to code in C++ (and eventually integrate it on R) I must to think about IDE's that are functional to C++ also, and evenly to R and C++ at the same time. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.stats.uwaterloo.ca/stats_navigation/StatSoftware/Essential-Software/pdf/EclipseAndEmacs.pdf"&gt;This&lt;/a&gt; presentation gives an overview of the topic. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/4980595/how-to-debug-an-r-package-with-c-code-in-emacs-using-gdb"&gt;This&lt;/a&gt; post in stack overflow "talks" about debugging R and C++ code at the same time. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs"&gt;Here&lt;/a&gt; some info about using ESS (Emacs Speaks Statistics) with R. Also speaks about debugging R code within R. &lt;/br&gt;TODO: Is this mechanism also usable to debug C++ code integrated with R? &lt;/br&gt;&lt;/br&gt;There are also C++ specific IDEs. &lt;a href="http://codelite.org/"&gt;Codelite&lt;/a&gt; sounds in my head. But I think that after all maybe Emacs is the best choice if I will code R and C++ because it can deal with both (and I think that it can do that at the same time).&lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-4460754715851963573?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/4460754715851963573/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=4460754715851963573' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4460754715851963573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4460754715851963573'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-statistics-ides.html' title='R statistics and C++ - IDEs, GUIs, etc...'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3091401157871318508</id><published>2011-02-11T15:21:00.004-03:00</published><updated>2011-02-11T16:07:34.583-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building R packages that integrates C++ via Rcpp - n.4 (linking with LGL)</title><content type='html'>So, as I stated before, it is time to see if I can integrate C++ code that uses the Lemon Graph Library into R via Rcpp (see these sequel of previous posts: &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;here&lt;/a&gt;, &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages.html"&gt;here&lt;/a&gt;, &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that.html"&gt;here&lt;/a&gt; and &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_11.html"&gt;here&lt;/a&gt;). &lt;/br&gt;&lt;/br&gt;In my first approach I will not use &lt;b&gt;modules&lt;/b&gt; (a tool provided by &lt;b&gt;Rcpp&lt;/b&gt;). So I start a new pakage skeleton from a R console: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp.package.skeleton(&amp;quot;pkgwithlgl&amp;quot;)&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './pkgwithlgl/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now inside the directory where I run the R console I found a directory named &lt;b&gt;pkgwithlgl&lt;/b&gt; which is the source of this "experimental" package (the directory's name correspond to package with LGL (Lemon Graph Library)).&lt;/br&gt;&lt;/br&gt;Now, the main idea is to edit &lt;b&gt;rcpp_hello_world.cpp&lt;/b&gt; (stored in the &lt;b&gt;src&lt;/b&gt;) so to implement what I do &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;here&lt;/a&gt;. More precisely, I change that file from this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;&lt;br /&gt;    CharacterVector x = CharacterVector::create( &amp;quot;foo&amp;quot;, &amp;quot;bar&amp;quot; )  ;&lt;br /&gt;    NumericVector y   = NumericVector::create( 0.0, 1.0 ) ;&lt;br /&gt;    List z            = List::create( x, y ) ;&lt;br /&gt;&lt;br /&gt;    return z ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;into this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;#include &amp;lt;lemon/list_graph.h&amp;gt;&lt;br /&gt;using namespace lemon ;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;&lt;br /&gt;    int res = 1;&lt;br /&gt;&lt;br /&gt;    ListDigraph g;&lt;br /&gt;&lt;br /&gt;    ListDigraph::Node u = g.addNode();&lt;br /&gt;    ListDigraph::Node v = g.addNode();&lt;br /&gt;    ListDigraph::Arc  a = g.addArc(u, v);&lt;br /&gt;&lt;br /&gt;    int i = countNodes(g);&lt;br /&gt;    int j = countArcs(g);&lt;br /&gt;&lt;br /&gt;    Rprintf(&amp;quot;num nodes is %d , and num edges is %d \n&amp;quot;,i,j);&lt;br /&gt;&lt;br /&gt;    return wrap(res) ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Lets see what happens when I try to install the package. So in a linux console in the container directory of &lt;b&gt;pkgwithlgl&lt;/b&gt; I run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL pkgwithlgl&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;pkgwithlgl&amp;#8217; ...&lt;br /&gt;** libs&lt;br /&gt;g++ -I/usr/share/R/include   -I&amp;quot;/usr/local/lib/R/site-library/Rcpp/include&amp;quot;   -fpic  -O3 -pipe  -g -c rcpp_hello_world.cpp -o rcpp_hello_world.o&lt;br /&gt;g++ -shared -o pkgwithlgl.so rcpp_hello_world.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib64/R/lib -lR&lt;br /&gt;installing to /home/juan/R/x86_64-pc-linux-gnu-library/2.12/pkgwithlgl/libs&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/pkgwithlgl/man/pkgwithlgl-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/pkgwithlgl/man/pkgwithlgl-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;pkgwithlgl&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    pkgwithlgl-package                      html  &lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (pkgwithlgl)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so It seems that the package was installed. Lets se if it works: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;pkgwithlgl&amp;quot;)&lt;br /&gt;Loading required package: pkgwithlgl&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; rcpp_hello_world()&lt;br /&gt;num nodes is 2 , and num edges is 1&lt;br /&gt;[1] 1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;It works !!! &lt;/br&gt;&lt;/br&gt;Now I'm answering myself. What happens if I upload this package to (forexample) the &lt;a href="http://cran.r-project.org/"&gt;CRAN&lt;/a&gt; repository and other one install it (without the installation of the LGL package). Will it work this package to him? &lt;/br&gt;&lt;/br&gt;TODO: Answer that question. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3091401157871318508?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3091401157871318508/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3091401157871318508' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3091401157871318508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3091401157871318508'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_468.html' title='R Learning - Building R packages that integrates C++ via Rcpp - n.4 (linking with LGL)'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-5282729822861244961</id><published>2011-02-11T11:13:00.009-03:00</published><updated>2011-02-11T12:23:32.024-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp modules'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building R packages that integrates C++ via Rcpp - n.3</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that.html"&gt;previous post&lt;/a&gt; I stated that remains to explore the example about how to develop a package, that one obtains calling the &lt;i&gt;Rcpp.package.skeleton()&lt;/i&gt; function of the &lt;i&gt;Rcpp&lt;/i&gt; package in the case that &lt;i&gt;modules&lt;/i&gt; are used. &lt;/br&gt;&lt;/br&gt;So, I start from an R console typing: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; ?Rcpp.package.skeleton&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, the &lt;b&gt;man&lt;/b&gt; of the &lt;i&gt;Rcpp.package.skeleton()&lt;/i&gt; function appears, and in the end it suggest the following example (which I type in the R console): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; Rcpp.package.skeleton( &amp;quot;testmod&amp;quot;, module = TRUE )&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './testmod/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt; &amp;gt;&amp;gt; copied the example module&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems that the source example package was created. Lets take a look at the directory from where I run the R console. There appears a directory called &lt;b&gt;testmod&lt;/b&gt; which corresponds to the source of the example package. Inside it one founds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls&lt;br /&gt;DESCRIPTION  man  NAMESPACE  R  Read-and-delete-me  src&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;that is, 3 files and 3 directories. Lets look first the files. Inside DESCRIPTION one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: testmod&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-11&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What Licence is it under ?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;Depends: methods, Rcpp (&amp;gt;= 0.9.0)&lt;br /&gt;LinkingTo: Rcpp&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;which is a little different from the example that does not uses &lt;b&gt;modules&lt;/b&gt; (in this case it depends also on &lt;i&gt;methods&lt;/i&gt;). Then, inside &lt;i&gt;NAMESPACE&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;useDynLib(testmod)&lt;br /&gt;exportPattern(&amp;quot;^[[:alpha:]]+&amp;quot;)&lt;br /&gt;import( Rcpp )&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;which is also different from the example that does not uses &lt;b&gt;modules&lt;/b&gt;. In this case appears an extra line: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import( Rcpp )&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;which (as stated &lt;a href="http://cran.r-project.org/doc/manuals/R-exts.html#Specifying-imports-and-exports"&gt;here&lt;/a&gt;) its function is to import all the exported variables of the specified package (&lt;b&gt;Rcpp&lt;/b&gt; in this case). So it seems that a packages that uses modules requires some functionality provided by the package &lt;b&gt;Rcpp&lt;/b&gt; (and not simply the inclusion of the &lt;i&gt;Rcpp.h&lt;/i&gt; header). So in the first case, it seems that the Rcpp package needs to be there in order to provide access to &lt;i&gt;Rcpp.h&lt;/i&gt;, but in the second case, it is also required to require the &lt;b&gt;Rcpp&lt;/b&gt; package. The &lt;i&gt;Read-and-delete-me&lt;/i&gt; file is the same as in the other examples. Now lets look inside the directories. First we look inside &lt;b&gt;R&lt;/b&gt; and found: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls&lt;br /&gt;rcpp_hello_world.R  zzz.R&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;that is 2 files. Inside &lt;i&gt;rcpp_hello_world.R&lt;/i&gt; one found: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;rcpp_hello_world &amp;lt;- function(){&lt;br /&gt;        .Call( &amp;quot;rcpp_hello_world&amp;quot;, PACKAGE = &amp;quot;testmod&amp;quot; )&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;the same that there is in the example that does not uses &lt;i&gt;modules&lt;/i&gt;. Inside &lt;b&gt;zzz.R&lt;/b&gt; one founds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;# grab the namespace&lt;br /&gt;.NAMESPACE &amp;lt;- environment()&lt;br /&gt;&lt;br /&gt;# dummy module, will be replace later&lt;br /&gt;yada &amp;lt;- new( &amp;quot;Module&amp;quot; )&lt;br /&gt;&lt;br /&gt;.onLoad &amp;lt;- function(pkgname, libname){&lt;br /&gt;        # load the module and store it in our namespace&lt;br /&gt;        unlockBinding( &amp;quot;yada&amp;quot; , .NAMESPACE )&lt;br /&gt;        assign( &amp;quot;yada&amp;quot;,  Module( &amp;quot;yada&amp;quot; ), .NAMESPACE )&lt;br /&gt;        lockBinding( &amp;quot;yada&amp;quot;, .NAMESPACE )&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I'm not sure what it is, maybe some can be understood from &lt;a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf"&gt;here&lt;/a&gt; (the Rcpp modules vignettes). I will pospone a better understanding of this until I'll install the package and play with it. &lt;/br&gt;&lt;/br&gt;Inside the &lt;b&gt;src&lt;/b&gt; directory one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls&lt;br /&gt;Makevars  Makevars.win  rcpp_hello_world.cpp  rcpp_hello_world.h  rcpp_module.cpp&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;&lt;i&gt;I will focus on only &lt;/i&gt;Makevars and &lt;i&gt;rcpp_module.cpp&lt;/i&gt; (the other does not changes from the example that does not uses modules). So, inside &lt;i&gt;rcpp_module.cpp&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;Rcpp.h&amp;gt;&lt;br /&gt;&lt;br /&gt;std::string hello() {&lt;br /&gt;        throw std::range_error( &amp;quot;boom&amp;quot; ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int bar( int x){&lt;br /&gt;        return x*2 ;&lt;br /&gt;}&lt;br /&gt;        &lt;br /&gt;double foo( int x, double y){&lt;br /&gt;        return x * y ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void bla( ){&lt;br /&gt;        Rprintf( &amp;quot;hello\\n&amp;quot; ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void bla1( int x){&lt;br /&gt;        Rprintf( &amp;quot;hello (x = %d)\\n&amp;quot;, x ) ;&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;void bla2( int x, double y){&lt;br /&gt;        Rprintf( &amp;quot;hello (x = %d, y = %5.2f)\\n&amp;quot;, x, y ) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class World {&lt;br /&gt;public:&lt;br /&gt;    World() : msg(&amp;quot;hello&amp;quot;){}&lt;br /&gt;    void set(std::string msg) { this-&amp;gt;msg = msg; }&lt;br /&gt;    std::string greet() { return msg; }&lt;br /&gt;&lt;br /&gt;private:&lt;br /&gt;    std::string msg;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;RCPP_MODULE(yada){&lt;br /&gt;        using namespace Rcpp ;&lt;br /&gt;                          &lt;br /&gt;        function( &amp;quot;hello&amp;quot; , &amp;amp;hello  , &amp;quot;documentation for hello &amp;quot; ) ;&lt;br /&gt;        function( &amp;quot;bla&amp;quot;   , &amp;amp;bla    , &amp;quot;documentation for bla &amp;quot; ) ;&lt;br /&gt;        function( &amp;quot;bla1&amp;quot;  , &amp;amp;bla1   , &amp;quot;documentation for bla1 &amp;quot; ) ;&lt;br /&gt;        function( &amp;quot;bla2&amp;quot;  , &amp;amp;bla2   , &amp;quot;documentation for bla2 &amp;quot; ) ;&lt;br /&gt;        &lt;br /&gt;        // with formal arguments specification&lt;br /&gt;        function( &amp;quot;bar&amp;quot;   , &amp;amp;bar    , &lt;br /&gt;            List::create( _[&amp;quot;x&amp;quot;] = 0.0 ), &lt;br /&gt;            &amp;quot;documentation for bar &amp;quot; ) ;&lt;br /&gt;        function( &amp;quot;foo&amp;quot;   , &amp;amp;foo    , &lt;br /&gt;            List::create( _[&amp;quot;x&amp;quot;] = 1, _[&amp;quot;y&amp;quot;] = 1.0 ),&lt;br /&gt;            &amp;quot;documentation for foo &amp;quot; ) ;        &lt;br /&gt;        &lt;br /&gt;        class_&amp;lt;World&amp;gt;( &amp;quot;World&amp;quot; )&lt;br /&gt;        &lt;br /&gt;            // expose the default constructor&lt;br /&gt;            .constructor()    &lt;br /&gt;            &lt;br /&gt;                .method( &amp;quot;greet&amp;quot;, &amp;amp;World::greet , &amp;quot;get the message&amp;quot; )&lt;br /&gt;                .method( &amp;quot;set&amp;quot;, &amp;amp;World::set     , &amp;quot;set the message&amp;quot; )&lt;br /&gt;        ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, the idea is that one defines "normal" C++ functions and classes (I'm not sure if they satisfy some restriction) and then via RCPP_MODULE(yada){...} a new module called yada is created that "export" all the C++ functions and classes to R (so they can be accessed from R).&lt;/br&gt;There remains the &lt;b&gt;man&lt;/b&gt; directory, but I will not enter in details now. So, lets try to install the package. So I run in a linux console in the directory that contains the source package (that is, that contains the directory &lt;b&gt;testmod&lt;/b&gt;) the following: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL testmod&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;testmod&amp;#8217; ...&lt;br /&gt;** libs&lt;br /&gt;g++ -I/usr/share/R/include   -I&amp;quot;/usr/local/lib/R/site-library/Rcpp/include&amp;quot;   -fpic  -O3 -pipe  -g -c rcpp_hello_world.cpp -o rcpp_hello_world.o&lt;br /&gt;g++ -I/usr/share/R/include   -I&amp;quot;/usr/local/lib/R/site-library/Rcpp/include&amp;quot;   -fpic  -O3 -pipe  -g -c rcpp_module.cpp -o rcpp_module.o&lt;br /&gt;g++ -shared -o testmod.so rcpp_hello_world.o rcpp_module.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib64/R/lib -lR&lt;br /&gt;installing to /home/juan/R/x86_64-pc-linux-gnu-library/2.12/testmod/libs&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/testmod/man/testmod-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/testmod/man/testmod-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;testmod&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;    testmod-package                         html  &lt;br /&gt;    yada                                    html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (testmod)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it seems to work. Now lets run a R console and look if the package is accessible:&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;testmod&amp;quot;)&lt;br /&gt;Loading required package: testmod&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it seems that the package was loaded. Now lets try something with it (I pick what to do looking inside &lt;b&gt;src/&lt;/b&gt;&lt;i&gt;rcpp_module.cpp&lt;/i&gt; and in the &lt;a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf"&gt;Rccp module vignettes&lt;/a&gt;). I first try: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;testmod&amp;quot;)&lt;br /&gt;Loading required package: testmod&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; yada$hello()&lt;br /&gt;terminate called after throwing an instance of 'std::range_error'&lt;br /&gt;  what():  boom&lt;br /&gt;Aborted&lt;br /&gt;$&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so it displays "boom" and then aborted returning to the linux console as expected, that is, it works. Now lets try: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;testmod&amp;quot;)&lt;br /&gt;Loading required package: testmod&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; yada$bar(2)&lt;br /&gt;[1] 4&lt;br /&gt;&amp;gt; yada$foo(1L,0.8)&lt;br /&gt;[1] 0.8&lt;br /&gt;&amp;gt; yada$bla()&lt;br /&gt;hello&lt;br /&gt;&amp;gt; yada$bla1(10)&lt;br /&gt;hello (x = 10)&lt;br /&gt;&amp;gt; yada$bla2(10L,0.5)&lt;br /&gt;hello (x = 10, y =  0.50)&lt;br /&gt;&amp;gt; a &amp;lt;- new( yada$World )&lt;br /&gt;&amp;gt; a&lt;br /&gt;C++ object &amp;lt;0x136f5e0&amp;gt; of class 'World' &amp;lt;0x181ae50&amp;gt;&lt;br /&gt;&amp;gt; a$greet()&lt;br /&gt;[1] &amp;quot;hello&amp;quot;&lt;br /&gt;&amp;gt; a$set(&amp;quot;mama&amp;quot;)&lt;br /&gt;&amp;gt; a$greet()&lt;br /&gt;[1] &amp;quot;mama&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it works (even the class) !!!. Now, what about &lt;i&gt;zzz.R&lt;/i&gt; ? I assumes that when the package is required the code inside zzz.R is "loaded" and "executed" as was done with all the &lt;i&gt;.R&lt;/i&gt; files in the &lt;b&gt;R&lt;/b&gt; directory as is determined in the &lt;i&gt;NAMESPACE&lt;/i&gt; file. &lt;/br&gt;&lt;/br&gt;TODO: Now it is time to experiment with code of my own (starting by modifications of these packages) and to explore the possibility of the inclusion of the Lemon Graph Library.&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-5282729822861244961?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/5282729822861244961/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=5282729822861244961' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5282729822861244961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5282729822861244961'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that_11.html' title='R Learning - Building R packages that integrates C++ via Rcpp - n.3'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8681804886191175892</id><published>2011-02-09T20:46:00.009-03:00</published><updated>2011-02-11T11:24:57.130-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building R packages that integrates C++ via Rcpp - n.2</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages.html"&gt;previous post&lt;/a&gt; I wrote a kind of logbook about my first package building. It was so naive, but it was very useful also because it gives to me very important basic notions. &lt;/br&gt;&lt;/br&gt;Exploring with my first package was good, but it does not integrate C++ code. So in this post my intention will be to build my first packages that integrates C++ code via Rcpp. In fact I'm planning a series of post (that start with the previous one mentioned above). In this post I will explore the option provided by the function &lt;i&gt;Rccp.package.skeleton()&lt;/i&gt; provided in the &lt;i&gt;&lt;b&gt;Rcpp&lt;/b&gt;&lt;/i&gt; package. More precisely, this function provides two basic options to explore. The first one just build a "plain" &lt;i&gt;Rcpp&lt;/i&gt; based package, and the second one a &lt;i&gt;Rcpp&lt;/i&gt; package based on the usage of &lt;i&gt;Rcpp modules&lt;/i&gt;. So here I will explore the first of these two options. Next the second option, and finally an important option. One that integrates the &lt;i&gt;Lemon Graph Library&lt;/i&gt; (see &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;here&lt;/a&gt;). &lt;/br&gt;&lt;/br&gt;I will follow (as a first guide) this: &lt;a href="http://dirk.eddelbuettel.com/code/rcpp/Rcpp-package.pdf"&gt;Writing a package that uses Rcpp - Dirk Eddelbuettel&lt;/a&gt; &lt;/br&gt;, mixed with the basic help provided by: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; ?Rcpp.package.skeleton&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, the first thing is typing in a R console: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; Rcpp.package.skeleton( &amp;quot;foobar&amp;quot; )&lt;br /&gt;Creating directories ...&lt;br /&gt;Creating DESCRIPTION ...&lt;br /&gt;Creating NAMESPACE ...&lt;br /&gt;Creating Read-and-delete-me ...&lt;br /&gt;Saving functions and data ...&lt;br /&gt;Making help files ...&lt;br /&gt;Done.&lt;br /&gt;Further steps are described in './foobar/Read-and-delete-me'.&lt;br /&gt;&lt;br /&gt;Adding Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Depends: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added LinkingTo: Rcpp&lt;br /&gt; &amp;gt;&amp;gt; added useDynLib directive to NAMESPACE&lt;br /&gt; &amp;gt;&amp;gt; added Makevars file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added Makevars.win file with Rcpp settings&lt;br /&gt; &amp;gt;&amp;gt; added example header file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example src file using Rcpp classes&lt;br /&gt; &amp;gt;&amp;gt; added example R file calling the C++ example&lt;br /&gt; &amp;gt;&amp;gt; added Rd file for rcpp_hello_world&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now in the directory from where I run the R console a new directory called &lt;b&gt;foobar&lt;/b&gt; appears. Inside it is the following (3 subdirectories and 3 files): &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls&lt;br /&gt;DESCRIPTION  man  NAMESPACE  R  Read-and-delete-me  src&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Inside &lt;i&gt;DESCRIPTION&lt;/i&gt; the following appears: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: foobar&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-09&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What Licence is it under ?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;Depends: Rcpp (&amp;gt;= 0.9.0)&lt;br /&gt;LinkingTo: Rcpp&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I think that R uses in some way the information inside &lt;i&gt;DESCRIPTION&lt;/i&gt; but for the moment I will not discuss in detail what it means because I believe that the package can be installed without pay to much attention to this. Inside &lt;i&gt;NAMESPACE&lt;/i&gt; the following appears: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;useDynLib(foobar)&lt;br /&gt;exportPattern(&amp;quot;^[[:alpha:]]+&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;This require some explanation. What this mean? Something is explained here: &lt;a href="http://cran.r-project.org/doc/manuals/R-exts.html#Package-name-spaces"&gt;Writing R extensions - packages and namespaces&lt;/a&gt;. I will not (at least for the moment) enter in details, but it allows the package writer to specify which variables in the package should be exported to make them available to package users, and which variables should be imported from other packages. As stated &lt;a href="http://dirk.eddelbuettel.com/code/rcpp/Rcpp-package.pdf"&gt;here&lt;/a&gt; the first line ensure that the dynamic library contained in the package that have been cre-ated via Rcpp.package.skeleton will be loaded and thereby made available to the newly created R package. The second line declares which functions should be globally visible from the namespace of this package, in this case (as reasonable default) it export all functions. &lt;/br&gt;&lt;/br&gt;Then, Inside &lt;i&gt;Read-and-delete-me&lt;/i&gt; says: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;* Edit the help file skeletons in 'man', possibly combining help files&lt;br /&gt;  for multiple functions.&lt;br /&gt;* Edit the exports in 'NAMESPACE', and add necessary imports.&lt;br /&gt;* Put any C/C++/Fortran code in 'src'.&lt;br /&gt;* If you have compiled code, add a useDynLib() directive to&lt;br /&gt;  'NAMESPACE'.&lt;br /&gt;* Run R CMD build to build the package tarball.&lt;br /&gt;* Run R CMD check to check the package tarball.&lt;br /&gt;&lt;br /&gt;Read &amp;quot;Writing R Extensions&amp;quot; for more information.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;which essentially does not differ from the one obtained when building a common package (look &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages.html"&gt;here&lt;/a&gt;). Now is time to look inside the directories. Inside the &lt;b&gt;R&lt;/b&gt; directory there is a fille called &lt;i&gt;rcpp_hello_world.R&lt;/i&gt;. Inside it one can find:&lt;/br&gt; &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;rcpp_hello_world &amp;lt;- function(){&lt;br /&gt;        .Call( &amp;quot;rcpp_hello_world&amp;quot;, PACKAGE = &amp;quot;foobar&amp;quot; )&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it is just a R function definition in whose body it calls an external C++ function via the &lt;i&gt;.Call()&lt;/i&gt; R function. For the moment, there is no to much to say about this. Then I look inside the &lt;b&gt;src&lt;/b&gt; directory and found 4 files:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ ls&lt;br /&gt;Makevars  Makevars.win  rcpp_hello_world.cpp  rcpp_hello_world.h&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Inside &lt;i&gt;rcpp_hello_world.h&lt;/i&gt; one finds: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#ifndef _foobar_RCPP_HELLO_WORLD_H&lt;br /&gt;#define _foobar_RCPP_HELLO_WORLD_H&lt;br /&gt;&lt;br /&gt;#include &amp;lt;Rcpp.h&amp;gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * note : RcppExport is an alias to `extern &amp;quot;C&amp;quot;` defined by Rcpp.&lt;br /&gt; *&lt;br /&gt; * It gives C calling convention to the rcpp_hello_world function so that &lt;br /&gt; * it can be called from .Call in R. Otherwise, the C++ compiler mangles the &lt;br /&gt; * name of the function and .Call can't find it.&lt;br /&gt; *&lt;br /&gt; * It is only useful to use RcppExport when the function is intended to be called&lt;br /&gt; * by .Call. See the thread http://thread.gmane.org/gmane.comp.lang.r.rcpp/649/focus=672&lt;br /&gt; * on Rcpp-devel for a misuse of RcppExport&lt;br /&gt; */&lt;br /&gt;RcppExport SEXP rcpp_hello_world() ;&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, it is a "standard" .h file which includes the &lt;i&gt;Rcpp.h&lt;/i&gt; file and declared the C++ function &lt;i&gt;rcpp_hello_world()&lt;/i&gt;. Inside the &lt;i&gt;rcpp_hello_world.cpp&lt;/i&gt; file one finds:&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;quot;rcpp_hello_world.h&amp;quot;&lt;br /&gt;&lt;br /&gt;SEXP rcpp_hello_world(){&lt;br /&gt;    using namespace Rcpp ;&lt;br /&gt;    &lt;br /&gt;    CharacterVector x = CharacterVector::create( &amp;quot;foo&amp;quot;, &amp;quot;bar&amp;quot; )  ;&lt;br /&gt;    NumericVector y   = NumericVector::create( 0.0, 1.0 ) ;&lt;br /&gt;    List z            = List::create( x, y ) ;&lt;br /&gt;    &lt;br /&gt;    return z ;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it includes the previous .h header, and defines the &lt;i&gt;rcpp_hello_world()&lt;/i&gt; function. Note here that in the declaration the function name is preceded by &lt;i&gt;RcppExport&lt;/i&gt; and in the definition it is preceded by SEXP. It seems (as commented in the header) that &lt;i&gt;RcppExport&lt;/i&gt; also "extern" to C code the C++ code (plus setting the returning type to SEXP). &lt;/br&gt;&lt;/br&gt;Now, here comes the most involved part here (what to put inside the .cpp and .h files is more related to programming, but not to packaging). Inside &lt;i&gt;Makevars&lt;/i&gt; there one can see: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;## Use the R_HOME indirection to support installations of multiple R version&lt;br /&gt;PKG_LIBS = `$(R_HOME)/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;`&lt;br /&gt;&lt;br /&gt;## As an alternative, one can also add this code in a file 'configure'&lt;br /&gt;##&lt;br /&gt;##    PKG_LIBS=`${R_HOME}/bin/Rscript -e &amp;quot;Rcpp:::LdFlags()&amp;quot;`&lt;br /&gt;## &lt;br /&gt;##    sed -e &amp;quot;s&amp;#124;@PKG_LIBS@&amp;#124;${PKG_LIBS}&amp;#124;&amp;quot; \&lt;br /&gt;##        src/Makevars.in &amp;gt; src/Makevars&lt;br /&gt;## &lt;br /&gt;## which together with the following file 'src/Makevars.in'&lt;br /&gt;##&lt;br /&gt;##    PKG_LIBS = @PKG_LIBS@&lt;br /&gt;##&lt;br /&gt;## can be used to create src/Makevars dynamically. This scheme is more&lt;br /&gt;## powerful and can be expanded to also check for and link with other&lt;br /&gt;## libraries.  It should be complemented by a file 'cleanup'&lt;br /&gt;##&lt;br /&gt;##    rm src/Makevars&lt;br /&gt;##&lt;br /&gt;## which removes the autogenerated file src/Makevars. &lt;br /&gt;##&lt;br /&gt;## Of course, autoconf can also be used to write configure files. This is&lt;br /&gt;## done by a number of packages, but recommended only for more advanced users&lt;br /&gt;## comfortable with autoconf and its related tools.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So it seems that this has to do with linking during C++ compilation time. As stated in &lt;a href="http://dirk.eddelbuettel.com/code/rcpp/Rcpp-package.pdf"&gt;Writing a package that uses Rcpp - Dirk Eddelbuettel&lt;/a&gt; it seems that R does not provide an self-enough (C++) library linking mechanism this must be done "manually". Obviously this (probably) will be a main matter in the case of including the Lemong Graph Library (se &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;here&lt;/a&gt;) to the Rcpp code here.&lt;/br&gt;&lt;/br&gt;The remaining file &lt;i&gt;Makevars.win&lt;/i&gt; is the windows version of this one (so, for the moment I'm not interested in it). &lt;/br&gt;&lt;/br&gt;Finally, inside the &lt;b&gt;man&lt;/b&gt; directory there are 2 files: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;ls&lt;br /&gt;foobar-package.Rd  rcpp_hello_world.Rd&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I will not enter in detail about the &lt;b&gt;man&lt;/b&gt; directory (unless I need to do it in order to install the package). &lt;/br&gt;&lt;/br&gt;So, the next thing to do, is to install the package to see if it works. So in a linux console  inside the directory that contains &lt;b&gt;foobar&lt;/b&gt; I run: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL foobar&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;foobar&amp;#8217; ...&lt;br /&gt;** libs&lt;br /&gt;g++ -I/usr/share/R/include   -I&amp;quot;/usr/local/lib/R/site-library/Rcpp/include&amp;quot;   -fpic  -O3 -pipe  -g -c rcpp_hello_world.cpp -o rcpp_hello_world.o&lt;br /&gt;g++ -shared -o foobar.so rcpp_hello_world.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib64/R/lib -lR&lt;br /&gt;installing to /home/juan/R/x86_64-pc-linux-gnu-library/2.12/foobar/libs&lt;br /&gt;** R&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/foobar/man/foobar-package.Rd:32: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/foobar/man/foobar-package.Rd:33: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;foobar&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    foobar-package                          html  &lt;br /&gt;    rcpp_hello_world                        html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (foobar)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems to work. Now lets see if its work, that is, if it can be loaded from R. So I open a R console and write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;foobar&amp;quot;)&lt;br /&gt;Loading required package: foobar&lt;br /&gt;Loading required package: Rcpp&lt;br /&gt;&amp;gt; rcpp_hello_world()&lt;br /&gt;[[1]]&lt;br /&gt;[1] &amp;quot;foo&amp;quot; &amp;quot;bar&amp;quot;&lt;br /&gt;&lt;br /&gt;[[2]]&lt;br /&gt;[1] 0 1&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it works !!!.&lt;/br&gt;TODO: Now there remains two things. Explore the option/example that uses modules, andthen try to include the Lemon Graph Library. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8681804886191175892?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8681804886191175892/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8681804886191175892' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8681804886191175892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8681804886191175892'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages-that.html' title='R Learning - Building R packages that integrates C++ via Rcpp - n.2'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-8961879467354653880</id><published>2011-02-08T09:28:00.008-03:00</published><updated>2011-02-19T08:22:15.332-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='concepts'/><title type='text'>C++ Learning - General concepts, resources, tips, ...</title><content type='html'>I know some about C++, but I need learn more. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Specifically about C++ (basic C++, standard libraries, etc): &lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.4p8.com/eric.brasseur/cppcen.html#l1"&gt;This (C++ for C users)&lt;/a&gt; may be an adequate starting point. &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Related to C++ (compilation, environment, etc):&lt;/b&gt; &lt;/br&gt; &lt;/br&gt;Clearly there aare some issues about the &lt;i&gt;configure&lt;/i&gt;, &lt;i&gt;make&lt;/i&gt;, &lt;i&gt;install&lt;/i&gt;, &lt;i&gt;Makevars&lt;/i&gt;, etc., files commonly used when compiling and installing C++ code (into a linux system?) about which I know almost nothing. So this seems to be an inescapable topic that eventually I must to deal with. This list contain things that may help:&lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.openismus.com/documents/linux/automake/automake"&gt;Using Automake and Autoconf with C++&lt;/a&gt; &lt;/br&gt;&lt;a href="http://linux.byexamples.com/archives/156/installing-from-tarballs/"&gt;Installing from tarballs&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;List of important concepts, tips to take in account:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;1) &lt;a href="http://pages.cs.wisc.edu/~driscoll/typename.html"&gt;Here&lt;/a&gt; is some important discussion about templates and typedef.&lt;/br&gt; &lt;/br&gt;&lt;b&gt;List of answered doubts:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;1) I eventually found some C++ code like this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;int Loan::calcInterest() const&lt;br /&gt;{&lt;br /&gt;        return loan_value * interest_rate; &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;What does the "const" means? Well, it means that function &lt;i&gt;Loan::calcInterest()&lt;/i&gt; is (defined by the programmer) a safe function member to call from objects instantiated as &lt;i&gt;const&lt;/i&gt;. In other words, if that &lt;i&gt;const&lt;/i&gt; where not there, then the followingcode will return compilation error: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;const Loan a(100);&lt;br /&gt;&lt;br /&gt;a.calcInterest(); //Here error compilation&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;But the &lt;i&gt;const&lt;/i&gt; token defines that this function can be safely called as a member function of a const object. &lt;a href="http://www.cprogramming.com/tutorial/const_correctness.html"&gt;Here&lt;/a&gt; more detailed explanation.&lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-8961879467354653880?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/8961879467354653880/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=8961879467354653880' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8961879467354653880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/8961879467354653880'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/c-learning.html' title='C++ Learning - General concepts, resources, tips, ...'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-484819982270548233</id><published>2011-02-07T22:09:00.024-03:00</published><updated>2011-02-10T11:21:44.400-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='Learning'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R Learning - Building R packages n.1</title><content type='html'>In previous posts (for example &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;this&lt;/a&gt; and &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-rcpp-and-lemon-graph-library.html"&gt;this&lt;/a&gt;) I state about my necessity to integrate C++ code (that makes use of C++ libraries) into R. &lt;/br&gt;&lt;/br&gt;I'm not sure if using the &lt;i&gt;inline&lt;/i&gt; package is enough. In fact, I begin to believe that using &lt;i&gt;inline&lt;/i&gt; brings out the problem of sharing functions between different .cpp modules. I don't know if it is possbile.&lt;/br&gt;&lt;/br&gt;So, it seems that the solution is to build an R package. This (series of) post is dedicated to learn to build R packages that integrates &lt;i&gt;Rcpp&lt;/i&gt; code.&lt;/br&gt;Obviously, the main resource is: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://cran.r-project.org/doc/manuals/R-exts.html"&gt;Writing R Extensions&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;But this .pdf &lt;a href="http://www.4shared.com/document/OYVPK2NH/Leisch-CreatingPackages.html" target=_blank&gt;Creating R Packages: A Tutorial - Friedrich Leisch&lt;/a&gt; is a convenient starting point. &lt;/br&gt;&lt;/br&gt;Specifically in relation to Rcpp there exist &lt;a href="http://finzi.psych.upenn.edu/R/library/Rcpp/html/Rcpp.package.skeleton.html"&gt;Rcpp.package.skeleton&lt;/a&gt; which is the Rcpp version of &lt;a href="http://finzi.psych.upenn.edu/R/library/utils/html/package.skeleton.html"&gt;package.skeleton&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;So, lets start from something easy. I open an R console and write: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; ?package.skeleton&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and I obtaing a realtively long description about this R function. In there it gives this example: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(stats)&lt;br /&gt;&amp;gt; ## two functions and two &amp;quot;data sets&amp;quot; :&lt;br /&gt;&amp;gt; f &amp;lt;- function(x,y) x+y&lt;br /&gt;&amp;gt; g &amp;lt;- function(x,y) x-y&lt;br /&gt;&amp;gt; d &amp;lt;- data.frame(a=1, b=2)&lt;br /&gt;&amp;gt; e &amp;lt;- rnorm(1000)&lt;br /&gt;&amp;gt; package.skeleton(list=c(&amp;quot;f&amp;quot;,&amp;quot;g&amp;quot;,&amp;quot;d&amp;quot;,&amp;quot;e&amp;quot;), name=&amp;quot;mypkg&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Lets see what it does. I executed this code in the R console and then look inside the directory from where I run the R console. I found inside there a directory called &lt;b&gt;mypkg&lt;/b&gt;. Inside &lt;b&gt;mypkg&lt;/b&gt; there are 3 more directories: &lt;b&gt;data&lt;/b&gt;, &lt;b&gt;man&lt;/b&gt;, &lt;b&gt;R&lt;/b&gt; and 2 files: &lt;i&gt;DESCRIPTION&lt;/i&gt; and &lt;i&gt;Read-and-delete-me&lt;/i&gt;. Inside &lt;i&gt;DESCRIPTION&lt;/i&gt; it says: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Package: mypkg&lt;br /&gt;Type: Package&lt;br /&gt;Title: What the package does (short line)&lt;br /&gt;Version: 1.0&lt;br /&gt;Date: 2011-02-09&lt;br /&gt;Author: Who wrote it&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;Description: More about what it does (maybe more than one line)&lt;br /&gt;License: What license is it under?&lt;br /&gt;LazyLoad: yes&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so this is information about the package. Inside &lt;i&gt;Read-and-delete-me&lt;/i&gt; it says: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;* Edit the help file skeletons in 'man', possibly combining help files&lt;br /&gt;  for multiple functions.&lt;br /&gt;* Put any C/C++/Fortran code in 'src'.&lt;br /&gt;* If you have compiled code, add a .First.lib() function in 'R' to load&lt;br /&gt;  the shared object.&lt;br /&gt;* Run R CMD build to build the package tarball.&lt;br /&gt;* Run R CMD check to check the package tarball.&lt;br /&gt;&lt;br /&gt;Read &amp;quot;Writing R Extensions&amp;quot; for more information.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So it gives information very basic instructions of the following steps to do. The I look inside the directories. First I look inside &lt;b&gt;R&lt;/b&gt; and found two files: &lt;i&gt;f.R&lt;/i&gt; and &lt;i&gt;g.R&lt;/i&gt; (the two functions passed to &lt;i&gt;package.skeleton()&lt;/i&gt;). So I look inside them and found: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#the f.R file...&lt;br /&gt;f &amp;lt;-&lt;br /&gt;function(x,y) x+y&lt;br /&gt;#the g.R file...&lt;br /&gt;g &amp;lt;-&lt;br /&gt;function(x,y) x-y&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;so, there are just the function declarations. Then I look inside the &lt;b&gt;DATA&lt;/b&gt; directory and found 2 files: &lt;i&gt;d.rda&lt;/i&gt; and &lt;i&gt;e.rda&lt;/i&gt;. When I try to look inside them (using the less linix command) it accuse me that they are binary files. So I assume that those files contains the data objects passed to the &lt;i&gt;package.skeleton()&lt;/i&gt; function. Finally I look inside the &lt;b&gt;man&lt;/b&gt; directory&lt;/br&gt; and found 5 files: &lt;i&gt;d.Rd&lt;/i&gt;, &lt;i&gt;e.Rd&lt;/i&gt;, &lt;i&gt;f.Rd&lt;/i&gt;, &lt;i&gt;g.Rd&lt;/i&gt; and &lt;i&gt;mypkg-package.Rd&lt;/i&gt;. I look inside 3 of them and found. For &lt;i&gt;d.Rd&lt;/i&gt;:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{d}&lt;br /&gt;\alias{d}&lt;br /&gt;\docType{data}&lt;br /&gt;\title{&lt;br /&gt;%%   ~~ data name/kind ... ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;%%  ~~ A concise (1-5 lines) description of the dataset. ~~&lt;br /&gt;}&lt;br /&gt;\usage{data(d)}&lt;br /&gt;\format{&lt;br /&gt;  A data frame with 1 observations on the following 2 variables.&lt;br /&gt;  \describe{&lt;br /&gt;    \item{\code{a}}{a numeric vector}&lt;br /&gt;    \item{\code{b}}{a numeric vector}&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;%%  ~~ If necessary, more details than the __description__ above ~~&lt;br /&gt;}&lt;br /&gt;\source{&lt;br /&gt;%%  ~~ reference to a publication or URL from which the data were obtained ~~&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;%%  ~~ possibly secondary sources and usages ~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;data(d)&lt;br /&gt;## maybe str(d) ; plot(d) ...&lt;br /&gt;}&lt;br /&gt;\keyword{datasets}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;for &lt;i&gt;f.Rd&lt;/i&gt;: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{f}&lt;br /&gt;\alias{f}&lt;br /&gt;%- Also NEED an '\alias' for EACH other topic documented here.&lt;br /&gt;\title{&lt;br /&gt;%%  ~~function to do ... ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;%%  ~~ A concise (1-5 lines) description of what the function does. ~~&lt;br /&gt;}&lt;br /&gt;\usage{&lt;br /&gt;f(x, y)&lt;br /&gt;}&lt;br /&gt;%- maybe also 'usage' for other objects documented here.&lt;br /&gt;\arguments{&lt;br /&gt;  \item{x}{&lt;br /&gt;%%     ~~Describe \code{x} here~~&lt;br /&gt;}&lt;br /&gt;  \item{y}{&lt;br /&gt;%%     ~~Describe \code{y} here~~&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;%%  ~~ If necessary, more details than the description above ~~&lt;br /&gt;}&lt;br /&gt;\value{&lt;br /&gt;%%  ~Describe the value returned&lt;br /&gt;%%  If it is a LIST, use&lt;br /&gt;%%  \item{comp1 }{Description of 'comp1'}&lt;br /&gt;%%  \item{comp2 }{Description of 'comp2'}&lt;br /&gt;%% ...&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;%% ~put references to the literature/web site here ~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;%%  ~~who you are~~&lt;br /&gt;}&lt;br /&gt;\note{&lt;br /&gt;%%  ~~further notes~~&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;%% ~Make other sections like Warning with \section{Warning }{....} ~&lt;br /&gt;&lt;br /&gt;\seealso{&lt;br /&gt;%% ~~objects to See Also as \code{\link{help}}, ~~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;##---- Should be DIRECTLY executable !! ----&lt;br /&gt;##-- ==&amp;gt;  Define data, use random,&lt;br /&gt;##--    or do  help(data=index)  for the standard data sets.&lt;br /&gt;&lt;br /&gt;## The function is currently defined as&lt;br /&gt;function(x,y) x+y&lt;br /&gt;}&lt;br /&gt;% Add one or more standard keywords, see file 'KEYWORDS' in the&lt;br /&gt;% R documentation directory.&lt;br /&gt;\keyword{ ~kwd1 }&lt;br /&gt;\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and for &lt;i&gt;mypkg-package.Rd&lt;/i&gt;: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;\name{mypkg-package}&lt;br /&gt;\alias{mypkg-package}&lt;br /&gt;\alias{mypkg}&lt;br /&gt;\docType{package}&lt;br /&gt;\title{&lt;br /&gt;What the package does (short line)&lt;br /&gt;~~ package title ~~&lt;br /&gt;}&lt;br /&gt;\description{&lt;br /&gt;More about what it does (maybe more than one line)&lt;br /&gt;~~ A concise (1-5 lines) description of the package ~~&lt;br /&gt;}&lt;br /&gt;\details{&lt;br /&gt;\tabular{ll}{&lt;br /&gt;Package: \tab mypkg\cr&lt;br /&gt;Type: \tab Package\cr&lt;br /&gt;Version: \tab 1.0\cr&lt;br /&gt;Date: \tab 2011-02-09\cr&lt;br /&gt;License: \tab What license is it under?\cr&lt;br /&gt;LazyLoad: \tab yes\cr&lt;br /&gt;}&lt;br /&gt;~~ An overview of how to use the package, including the most important ~~&lt;br /&gt;~~ functions ~~&lt;br /&gt;}&lt;br /&gt;\author{&lt;br /&gt;Who wrote it&lt;br /&gt;&lt;br /&gt;Maintainer: Who to complain to &amp;lt;yourfault@somewhere.net&amp;gt;&lt;br /&gt;~~ The author and/or maintainer of the package ~~&lt;br /&gt;}&lt;br /&gt;\references{&lt;br /&gt;~~ Literature or other references for background information ~~&lt;br /&gt;}&lt;br /&gt;~~ Optionally other standard keywords, one per line, from file KEYWORDS in ~~&lt;br /&gt;~~ the R documentation directory ~~&lt;br /&gt;\keyword{ package }&lt;br /&gt;\seealso{&lt;br /&gt;~~ Optional links to other man pages, e.g. ~~&lt;br /&gt;~~ \code{\link[&amp;lt;pkg&amp;gt;:&amp;lt;pkg&amp;gt;-package]{&amp;lt;pkg&amp;gt;}} ~~&lt;br /&gt;}&lt;br /&gt;\examples{&lt;br /&gt;~~ simple examples of the most important functions ~~&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, this correspond to the "descrpition"/"help"/"man" files of the R objects stored in the package and also a "description"/"help"/"man" file of the R package itself. &lt;/br&gt;&lt;/br&gt;Now I'm not sure how what is the right next thing to do. Reading the .pdf above (&lt;a href="http://www.4shared.com/document/OYVPK2NH/Leisch-CreatingPackages.html" target=_blank&gt;Creating R Packages: A Tutorial - Friedrich Leisch&lt;/a&gt;) it "talks" about 3 commands (executed in a linux terminal on the directory that contains the packages directory, i.e., in this case the directory that contains the directory &lt;i&gt;pkgname&lt;/i&gt;) that can be done over a package. These are the following ones: &lt;/br&gt;&lt;/br&gt;First (maybe with another command options not stated on this examples):&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL pkgname&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;this installs the package into a library and makes it available for usage in R. Second: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD check pkgname&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;runs a battery of tests on the package. Third: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD build pkgname&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;removes temporary files from the source tree of the package and packs everything into anarchive file.&lt;/br&gt;Now before keep going it is convenient to incorporate some &lt;b&gt;specific terms&lt;/b&gt; (I stole them from the previously mentionated .pdf) : &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Package&lt;/b&gt;: An extension of the R base system with code, data and documentation in standardized format. &lt;/br&gt;&lt;b&gt;Library&lt;/b&gt;: A directory containing installed packages.&lt;/br&gt;&lt;b&gt;Repository&lt;/b&gt;: A website providing packages for installation. &lt;/br&gt;&lt;b&gt;Source&lt;/b&gt;: The original version of a package with human-readable text and code. &lt;/br&gt;&lt;b&gt;Binary&lt;/b&gt;: A compiled version of a package with computer-readable text and code, may work only on a specific platform. &lt;/br&gt;&lt;b&gt;Base packages&lt;/b&gt;: Part of the R source tree, maintained by R Core. &lt;/br&gt;&lt;b&gt;Recommended packages&lt;/b&gt;: Part of every R installation, but not necessarily maintained by R Core. &lt;/br&gt;&lt;b&gt;Contributed packages&lt;/b&gt;: All the rest. This does not mean that these packages are necessarily of lesser quality than the above, e.g., many contributed packages on CRAN are written and maintained by R Core members. We simply try to keep the base distribution as lean as possible. &lt;/br&gt;&lt;/br&gt;Now I guess that the following step to do is to run R CMD INSTALL. I believe that this is the standard way of "test" (or maybe "debug") a package (installing it, and then requiring it from a R console, and playing with the package content). Anyway, it happens that in principle one must specify the path to the library where the package will be installed. &lt;/br&gt;&lt;/br&gt;In a R console I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; .libPaths()&lt;br /&gt;[1] &amp;quot;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;quot;&lt;br /&gt;[2] &amp;quot;/usr/local/lib/R/site-library&amp;quot;                &lt;br /&gt;[3] &amp;quot;/usr/lib/R/site-library&amp;quot;                      &lt;br /&gt;[4] &amp;quot;/usr/lib/R/library&amp;quot;                           &lt;br /&gt;[5] &amp;quot;/usr/lib64/R/library&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, those are the R libraries that my system has. The first of them has: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;juan@juanlaptop:~/R/x86_64-pc-linux-gnu-library/2.12$ ls&lt;br /&gt;RcppArmadillo  RcppClassic  RcppExamples  R.css&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So it seems that here are contributed packages (all of them related to Rcpp). The second of them has: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;juan@juanlaptop:/usr/local/lib/R/site-library$ ls&lt;br /&gt;doMC  foreach  igraph  inline  multicore  network  Rcpp  R.css&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;that also are contributed packages. The third of them has: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;juan@juanlaptop:/usr/lib/R/site-library$ ls&lt;br /&gt;doMC  doSNOW  foreach  iterators  jit  multicore  Rcpp  R.css  Revobase&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Note that some packages in the second and the third are repeated. I think that this has to do with the fact that I reinstalled R in order to update my R version (look this previous&lt;a href="http://deliriosderayohauno.blogspot.com/2011/01/r-installation.html"&gt;post&lt;/a&gt;). In fact, Rcpp in the second library is version (as I can deduce looking inside the &lt;i&gt;DESCRIPTION&lt;/i&gt; file in the &lt;b&gt;Rcpp&lt;/b&gt; directory) 0.9.0, meanwhile Rcpp in the third library is version 0.6.5, so the R packages of the old installation is in the third library.&lt;/br&gt;The fourth library looks: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;juan@juanlaptop:/usr/lib/R/library$ ls&lt;br /&gt;abind      class      cubature   Ecdat    Formula    grid        lattice  mgcv        nlme      quadprog  scatterplot3d  SparseM  stats     timeDate  utils&lt;br /&gt;base       cluster    datasets   ellipse  gclus      gtools      MASS     miscTools   nnet      R.css     slam           spatial  stats4    tools     xtable&lt;br /&gt;bdsmatrix  coda       degreenet  ergm     graphics   ineq        Matrix   modeltools  numDeriv  rlecuyer  sna            splines  survival  trust&lt;br /&gt;boot       codetools  e1071      foreign  grDevices  KernSmooth  methods  mvtnorm     nws       rpart     snow           statmod  tcltk     urca&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and the fifth looks: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;juan@juanlaptop:/usr/lib64/R/library$ ls&lt;br /&gt;abind      class      cubature   Ecdat    Formula    grid        lattice  mgcv        nlme      quadprog  scatterplot3d  SparseM  stats     timeDate  utils&lt;br /&gt;base       cluster    datasets   ellipse  gclus      gtools      MASS     miscTools   nnet      R.css     slam           spatial  stats4    tools     xtable&lt;br /&gt;bdsmatrix  coda       degreenet  ergm     graphics   ineq        Matrix   modeltools  numDeriv  rlecuyer  sna            splines  survival  trust&lt;br /&gt;boot       codetools  e1071      foreign  grDevices  KernSmooth  methods  mvtnorm     nws       rpart     snow           statmod  tcltk     urca&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, both are base R libraries, the difference being the 32 or 64 bit platform. Looking inside the DESCRIPTION file in the &lt;b&gt;base&lt;/b&gt; directory (in both libraries), versions are the same with value 2.12.1 (so they are the last I install). &lt;/br&gt;&lt;/br&gt;Now, where is the right place to install my packages? I think that the first one is the best choice. It is inside my home so it cannot destroy the R core system, also it does not require linux root access (I think the other libraries does). Also is the first on the list, so is the default one (in principle).&lt;/br&gt;&lt;/br&gt;Lets try to see what happens.&lt;/br&gt;So in a linux console, inside the container directory of &lt;b&gt;mypkg&lt;/b&gt; source package directory (mypkg is the source that I construct as mentioned above using &lt;i&gt;package.skeleton()&lt;/i&gt;) I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL mypkg/&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;mypkg&amp;#8217; ...&lt;br /&gt;** R&lt;br /&gt;** data&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:34: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:35: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;Error in Rd_info(db[[i]]) : &lt;br /&gt;  Rd files must have a non-empty \title.&lt;br /&gt;See chapter 'Writing R documentation' in manual 'Writing R Extensions'.&lt;br /&gt;* removing &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12/mypkg&amp;#8217;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it fails because "Rd files must have a non-empty \title.". Note also that as I speculated above it try to install the package in the first library as it can be deduced from the last line. Lets try to "solve" the error in order the installation goes right.&lt;/br&gt;&lt;/br&gt;So, I add some titles (and things like that) to the .Rd files inside &lt;b&gt;../mypkg/man/&lt;/b&gt; and then I try again to install the package and I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;$ R CMD INSTALL mypkg/&lt;br /&gt;* installing to library &amp;#8216;/home/juan/R/x86_64-pc-linux-gnu-library/2.12&amp;#8217;&lt;br /&gt;* installing *source* package &amp;#8216;mypkg&amp;#8217; ...&lt;br /&gt;** R&lt;br /&gt;** data&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;** help&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:34: All text must be in a section&lt;br /&gt;Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:35: All text must be in a section&lt;br /&gt;*** installing help indices&lt;br /&gt;  converting help for package &amp;#8216;mypkg&amp;#8217;&lt;br /&gt;    finding HTML links ... done&lt;br /&gt;    d                                       html  &lt;br /&gt;    e                                       html  &lt;br /&gt;    f                                       html  &lt;br /&gt;    g                                       html  &lt;br /&gt;    mypkg-package                           html  &lt;br /&gt;** building package indices ...&lt;br /&gt;** testing if installed package can be loaded&lt;br /&gt;&lt;br /&gt;* DONE (mypkg)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it seems to work. Lets see if I call require it from a R console: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; require(&amp;quot;mypkg&amp;quot;)&lt;br /&gt;Loading required package: mypkg&lt;br /&gt;&amp;gt; data(d)&lt;br /&gt;&amp;gt; data(e)&lt;br /&gt;&amp;gt; f(1,2)&lt;br /&gt;[1] 3&lt;br /&gt;&amp;gt; g(1,2)&lt;br /&gt;[1] -1&lt;br /&gt;&amp;gt; d&lt;br /&gt;  a b&lt;br /&gt;1 1 1&lt;br /&gt;&amp;gt; e&lt;br /&gt;   [1] -0.733391210  1.035536205 -0.297609744 -0.340793522  1.529938790&lt;br /&gt;   [6]  0.860719209  1.528990851 -0.593957432 -0.876811563  0.083046158&lt;br /&gt; ... BLA BLA BLA ...&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it works nice !!! Also if I type: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; ?g&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;g                    package:mypkg                     R Documentation&lt;br /&gt;&lt;br /&gt;Function that returns the substraction of two numeric arguments.&lt;br /&gt;&lt;br /&gt;Description:&lt;br /&gt;&lt;br /&gt;     A second very simple function.&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;br /&gt;     g(x, y)&lt;br /&gt;     &lt;br /&gt;Arguments:&lt;br /&gt;&lt;br /&gt;       x:&lt;br /&gt;&lt;br /&gt;       y:&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;     ##---- Should be DIRECTLY executable !! ----&lt;br /&gt;     ##-- ==&amp;gt;  Define data, use random,&lt;br /&gt;     ##--    or do  help(data=index)  for the standard data sets.&lt;br /&gt;     &lt;br /&gt;     ## The function is currently defined as&lt;br /&gt;     function(x,y) x-y&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;That is, I also get the R help inside "man" of the mypkg package. Now lets try check. In the container directory of &lt;b&gt;mypkg&lt;/b&gt; I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$ R CMD INSTALL mypkg/&lt;br /&gt; ... BLA BLA BLA ...&lt;br /&gt;Error: parse error in file 'mypkg-Ex.R':&lt;br /&gt;11: unexpected symbol&lt;br /&gt;99: &lt;br /&gt;100: ~~ simple examples&lt;br /&gt;               ^&lt;br /&gt;Execution halted&lt;br /&gt;* checking data for non-ASCII characters ... OK&lt;br /&gt;* checking examples ... ERROR&lt;br /&gt;Running examples in &amp;#8216;mypkg-Ex.R&amp;#8217; failed&lt;br /&gt;The error most likely occurred in:&lt;br /&gt;&lt;br /&gt;&amp;gt; ### Name: mypkg-package&lt;br /&gt;&amp;gt; ### Title: What the package does (short line) ~~ package title ~~&lt;br /&gt;&amp;gt; ### Aliases: mypkg-package mypkg&lt;br /&gt;&amp;gt; ### Keywords: package&lt;br /&gt;&amp;gt; &lt;br /&gt;&amp;gt; ### ** Examples&lt;br /&gt;&amp;gt; &lt;br /&gt;&amp;gt; ~~ simple examples of the most important functions ~~&lt;br /&gt;Error: unexpected symbol in &amp;quot;~~ simple examples&amp;quot;&lt;br /&gt;Execution halted&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So the checking fails for a problem with the examples. Then I corrected those errors and finally checked with 4 Warnings (that can be found inside ): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;* checking whether package &amp;#8216;mypkg&amp;#8217; can be installed ... WARNING&lt;br /&gt;Found the following significant warnings:&lt;br /&gt;  Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:34: All text must be in a section&lt;br /&gt;  Warning: /home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg/man/mypkg-package.Rd:35: All text must be in a section&lt;br /&gt;See &amp;#8216;/home/juan/Desktop/facu/investigacion_ensayos/Cosas_crudas/programming_coding/R-work-space/integrating_R_with_cpp_via_Rcpp/using_packages/mypkg.Rcheck/00install.out&amp;#8217; for details.&lt;br /&gt;... BLA BLA BLA ...&lt;br /&gt;* checking DESCRIPTION meta-information ... WARNING&lt;br /&gt;Non-standard license specification:&lt;br /&gt;  What license is it under?&lt;br /&gt;Standardizable: FALSE&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, it remains TODO a build... but it is not interesting to build this package. The most interesting thing to do is to explore with a package that involves the usage of Rcpp. &lt;/br&gt;&lt;/br&gt;TODO : Make an experiment with a package that involves the usage of Rcpp.&lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-484819982270548233?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/484819982270548233/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=484819982270548233' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/484819982270548233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/484819982270548233'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-learning-building-r-packages.html' title='R Learning - Building R packages n.1'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-4960646166374718284</id><published>2011-02-07T11:13:00.011-03:00</published><updated>2011-02-27T23:44:02.892-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forums'/><category scheme='http://www.blogger.com/atom/ns#' term='programming languages'/><category scheme='http://www.blogger.com/atom/ns#' term='Resources'/><category scheme='http://www.blogger.com/atom/ns#' term='mailing-lists'/><title type='text'>Resources - Mailing Lists, Forums, and so like</title><content type='html'>I have started to deal with mailing list (as a consequence of R, Rcpp, BGL, LGL and igraph). It is an important resource in order to get out of trouble. &lt;/br&gt;&lt;/br&gt;So I list here the list of mailing list, forums, and so on: &lt;/br&gt;&lt;/br&gt;&lt;b&gt;1) Miscelaneous&lt;/b&gt; (I put here things that I don't know how to classify yet): &lt;/br&gt;&lt;/br&gt;&lt;a href="http://stackoverflow.com/"&gt;http://stackoverflow.com/&lt;/a&gt; &lt;/br&gt;&lt;a href="http://meta.stackoverflow.com/"&gt;http://meta.stackoverflow.com/&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;2) Mailing lists:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://www.r-project.org/mail.html"&gt;List of R mailing lists&lt;/a&gt; &lt;/br&gt;&lt;a href="https://stat.ethz.ch/mailman/listinfo/r-help"&gt;rcpp-develop mailing list&lt;/a&gt; &lt;/br&gt;&lt;!-- &lt;a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"&gt;rcpp-develop mailing list&lt;/a&gt; &lt;/br&gt; --&gt;&lt;a href="https://stat.ethz.ch/mailman/listinfo/r-sig-networks"&gt;R-sig-networks&lt;/a&gt; (graph-network R mailing list) &lt;/br&gt;&lt;a href="https://stat.ethz.ch/mailman/listinfo/r-sig-hpc"&gt;R-sig-hpc -- High-Performance Computing with R&lt;/a&gt; &lt;/br&gt;&lt;a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/roxygen-devel"&gt;roxygen mailing list&lt;/a&gt; &lt;/br&gt;Non R... &lt;/br&gt;&lt;a href="http://lists.nongnu.org/mailman/listinfo/igraph-help"&gt;igraph mailing list&lt;/a&gt; &lt;/br&gt;&lt;a href="http://lemon.cs.elte.hu/mailman/listinfo/lemon-user"&gt;Lemon Graph Library (user level) mailing list&lt;/a&gt; &lt;/br&gt;&lt;a href="https://lists.sourceforge.net/lists/listinfo/codelite-users"&gt;codelite user mailing list&lt;/a&gt; &lt;/br&gt;&lt;a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users"&gt;Boost C++ User mailing list&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;&lt;b&gt;3) Forums:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;&lt;a href="http://codelite.org/forum/"&gt;Codelite forum&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-4960646166374718284?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/4960646166374718284/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=4960646166374718284' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4960646166374718284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/4960646166374718284'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/resources-mailing-lists-forums-and-so.html' title='Resources - Mailing Lists, Forums, and so like'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-6621458587976860381</id><published>2011-02-05T10:57:00.019-03:00</published><updated>2011-02-06T23:38:18.206-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='high performance computing'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='logbook'/><category scheme='http://www.blogger.com/atom/ns#' term='graph'/><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='inline'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Lemon Graph Library (LGL) instalation - logbook</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-rcpp-and-lemon-graph-library.html"&gt;previous post&lt;/a&gt; I wrote about a library dedicated to work with graph. It is called &lt;a href="http://lemon.cs.elte.hu/trac/lemon/"&gt;Lemon Graph Library&lt;/a&gt; (LGL). The idea is eventually integrate LGL with R via Rcpp. So it seems that I first need to install the LGL. &lt;/br&gt;&lt;/br&gt;Why to install LGL instead of simply use its .cc and .h files? Well, I look inside the .cc and .h files and the inclusion of other .h headers goes like this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include&amp;lt;lemon/tolerance.h&amp;gt;&lt;br /&gt;#include&amp;lt;lemon/core.h&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;(I pick this lines from ../lemon/base.cc). So it seems that in order that the inclusion of the headers can be donde, then the library needs to be installed. &lt;/br&gt;&lt;/br&gt;So, in this post I will write the logbook about the installation of LGL. &lt;/br&gt; I will follow &lt;a href="http://lemon.cs.elte.hu/trac/lemon/wiki/InstallAutotool"&gt;this&lt;/a&gt; instructions. &lt;/br&gt;&lt;/br&gt;I had downloaded lemon-1.2.1.tar.gz and untared it. Now I'm in a ubuntu console inside the &lt;i&gt;lemon-1.2.1&lt;/i&gt; directory. I then proceed: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;../lemon-1.2.1$ ./configure&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and seems to work. Now I proceed: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;../lemon-1.2.1$ make&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and also seems to work. Now I proceed: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;../lemon-1.2.1$ make check&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and I get this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;test/test_tools_fail.cc:23: error: Don't panic. Failing is the right behaviour here.&lt;br /&gt;/bin/bash: line 5:  7977 Aborted                 ${dir}$tst&lt;br /&gt;XFAIL: test/test_tools_fail&lt;br /&gt;PASS: test/test_tools_pass&lt;br /&gt;u: 0.07s, s: 0.03s, cu: 0s, cs: 0s, real: 0.100001s (77313 time queries)&lt;br /&gt;u: 3.27826e-09s, s: 0s, cu: 0s, cs: 0s, real: 3.12811e-09s (33554432 tests)&lt;br /&gt;Total: u: 0.11s, s: 0s, cu: 0s, cs: 0s, real: 0.104962s&lt;br /&gt;u: 0.000859375s, s: 0.0003125s, cu: 0s, cs: 0s, real: 0.00124676s (128 tests)&lt;br /&gt;Total: u: 0.11s, s: 0.04s, cu: 0s, cs: 0s, real: 0.159585s&lt;br /&gt;PASS: test/time_measure_test&lt;br /&gt;PASS: test/unionfind_test&lt;br /&gt;=====================================================&lt;br /&gt;All 36 tests behaved as expected (1 expected failure)&lt;br /&gt;=====================================================&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;It seems that there is a failure, but this failure is intentional. So, it also seems to work. Now I proceed: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;../lemon-1.2.1$ sudo make install&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and it seems to work (note that I used sudo (root permissions), so I installed the library in the standard directory) and I get this (Note that in the blog the vertical pipe character may not appear. I put all this here because I want to have a register about what happens):&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;test -z &amp;quot;/usr/local/lib&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/lib&amp;quot;&lt;br /&gt; /bin/bash ./libtool   --mode=install /usr/bin/install -c   lemon/libemon.la '/usr/local/lib'&lt;br /&gt;libtool: install: /usr/bin/install -c lemon/.libs/libemon.lai /usr/local/lib/libemon.la&lt;br /&gt;libtool: install: /usr/bin/install -c lemon/.libs/libemon.a /usr/local/lib/libemon.a&lt;br /&gt;libtool: install: chmod 644 /usr/local/lib/libemon.a&lt;br /&gt;libtool: install: ranlib /usr/local/lib/libemon.a&lt;br /&gt;libtool: finish: PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/sbin&amp;quot; ldconfig -n /usr/local/lib&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;Libraries have been installed in:&lt;br /&gt;   /usr/local/lib&lt;br /&gt;&lt;br /&gt;If you ever happen to want to link against installed libraries&lt;br /&gt;in a given directory, LIBDIR, you must either use libtool, and&lt;br /&gt;specify the full pathname of the library, or use the `-LLIBDIR'&lt;br /&gt;flag during linking and do at least one of the following:&lt;br /&gt;   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable&lt;br /&gt;     during execution&lt;br /&gt;   - add LIBDIR to the `LD_RUN_PATH' environment variable&lt;br /&gt;     during linking&lt;br /&gt;   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag&lt;br /&gt;   - have your system administrator add LIBDIR to `/etc/ld.so.conf'&lt;br /&gt;&lt;br /&gt;See any operating system documentation about shared libraries for&lt;br /&gt;more information, such as the ld(1) and ld.so(8) manual pages.&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;test -z &amp;quot;/usr/local/bin&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/bin&amp;quot;&lt;br /&gt;  /bin/bash ./libtool   --mode=install /usr/bin/install -c tools/dimacs-solver tools/dimacs-to-lgf tools/lgf-gen '/usr/local/bin'&lt;br /&gt;libtool: install: /usr/bin/install -c tools/dimacs-solver /usr/local/bin/dimacs-solver&lt;br /&gt;libtool: install: /usr/bin/install -c tools/dimacs-to-lgf /usr/local/bin/dimacs-to-lgf&lt;br /&gt;libtool: install: /usr/bin/install -c tools/lgf-gen /usr/local/bin/lgf-gen&lt;br /&gt;test -z &amp;quot;/usr/local/bin&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/bin&amp;quot;&lt;br /&gt; /usr/bin/install -c tools/lemon-0.x-to-1.x.sh '/usr/local/bin'&lt;br /&gt;test -z &amp;quot;/usr/local/include/lemon/bits&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/include/lemon/bits&amp;quot;&lt;br /&gt; /usr/bin/install -c -m 644 lemon/bits/alteration_notifier.h lemon/bits/array_map.h lemon/bits/bezier.h lemon/bits/default_map.h lemon/bits/edge_set_extender.h lemon/bits/enable_if.h lemon/bits/graph_adaptor_extender.h lemon/bits/graph_extender.h lemon/bits/map_extender.h lemon/bits/path_dump.h lemon/bits/solver_bits.h lemon/bits/traits.h lemon/bits/variant.h lemon/bits/vector_map.h '/usr/local/include/lemon/bits'&lt;br /&gt;test -z &amp;quot;/usr/local/include/lemon/concepts&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/include/lemon/concepts&amp;quot;&lt;br /&gt; /usr/bin/install -c -m 644 lemon/concepts/digraph.h lemon/concepts/graph.h lemon/concepts/graph_components.h lemon/concepts/heap.h lemon/concepts/maps.h lemon/concepts/path.h '/usr/local/include/lemon/concepts'&lt;br /&gt;test -z &amp;quot;/usr/local/include/lemon&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/include/lemon&amp;quot;&lt;br /&gt; /usr/bin/install -c -m 644 lemon/adaptors.h lemon/arg_parser.h lemon/assert.h lemon/bellman_ford.h lemon/bfs.h lemon/bin_heap.h lemon/binomial_heap.h lemon/bucket_heap.h lemon/capacity_scaling.h lemon/cbc.h lemon/circulation.h lemon/clp.h lemon/color.h lemon/concept_check.h lemon/connectivity.h lemon/core.h lemon/cost_scaling.h lemon/counter.h lemon/cplex.h lemon/cycle_canceling.h lemon/dfs.h lemon/dheap.h lemon/dijkstra.h lemon/dim2.h lemon/dimacs.h lemon/edge_set.h lemon/elevator.h lemon/error.h lemon/euler.h lemon/fib_heap.h lemon/fractional_matching.h lemon/full_graph.h lemon/glpk.h lemon/gomory_hu.h lemon/graph_to_eps.h lemon/grid_graph.h lemon/hartmann_orlin_mmc.h lemon/howard_mmc.h lemon/hypercube_graph.h lemon/karp_mmc.h '/usr/local/include/lemon'&lt;br /&gt; /usr/bin/install -c -m 644 lemon/kruskal.h lemon/hao_orlin.h lemon/lgf_reader.h lemon/lgf_writer.h lemon/list_graph.h lemon/lp.h lemon/lp_base.h lemon/lp_skeleton.h lemon/maps.h lemon/matching.h lemon/math.h lemon/min_cost_arborescence.h lemon/nauty_reader.h lemon/network_simplex.h lemon/pairing_heap.h lemon/path.h lemon/planarity.h lemon/preflow.h lemon/quad_heap.h lemon/radix_heap.h lemon/radix_sort.h lemon/random.h lemon/smart_graph.h lemon/soplex.h lemon/static_graph.h lemon/suurballe.h lemon/time_measure.h lemon/tolerance.h lemon/unionfind.h lemon/bits/windows.h '/usr/local/include/lemon'&lt;br /&gt;test -z &amp;quot;/usr/local/include/lemon&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/include/lemon&amp;quot;&lt;br /&gt; /usr/bin/install -c -m 644 lemon/config.h '/usr/local/include/lemon'&lt;br /&gt;test -z &amp;quot;/usr/local/lib/pkgconfig&amp;quot; &amp;#124;&amp;#124; /bin/mkdir -p &amp;quot;/usr/local/lib/pkgconfig&amp;quot;&lt;br /&gt; /usr/bin/install -c -m 644 lemon/lemon.pc '/usr/local/lib/pkgconfig'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now is time to make a simple test to see if I can use the library (for the moment in the standard way, not including it in R). I will try what is written &lt;a href="http://lemon.cs.elte.hu/trac/lemon/wiki/HowToCompile"&gt;here&lt;/a&gt; which says: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$g++ -O2 mycode.cc -lemon&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt; But for that, I need a mycode.cc example, so I will try this one (obtained from &lt;a href="http://lemon.cs.elte.hu/pub/tutorial/a00011.html"&gt;here&lt;/a&gt;): &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;lemon/list_graph.h&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace lemon;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  ListDigraph g;&lt;br /&gt;&lt;br /&gt;  ListDigraph::Node u = g.addNode();&lt;br /&gt;  ListDigraph::Node v = g.addNode();&lt;br /&gt;  ListDigraph::Arc  a = g.addArc(u, v);&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;Hello World! This is LEMON library here.&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;We have a directed graph with &amp;quot; &amp;lt;&amp;lt; countNodes(g) &amp;lt;&amp;lt; &amp;quot; nodes &amp;quot;&lt;br /&gt;       &amp;lt;&amp;lt; &amp;quot;and &amp;quot; &amp;lt;&amp;lt; countArcs(g) &amp;lt;&amp;lt; &amp;quot; arc.&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;It works as can be seen from what I had obtained: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$./a.out&lt;br /&gt;Hello World! This is LEMON library here.&lt;br /&gt;We have a directed graph with 2 nodes and 1 arc.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now I have to try to integrate Lemon to R via Rcpp. So I write a file called &lt;i&gt;myexample_inline.R&lt;/i&gt; with this content: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt; inc &amp;lt;- '&lt;br /&gt;        #include &amp;lt;lemon/list_graph.h&amp;gt;&lt;br /&gt;        using namespace lemon ;&lt;br /&gt;        '&lt;br /&gt; &lt;br /&gt; src &amp;lt;- '&lt;br /&gt;        int xx = Rcpp::as&amp;lt;int&amp;gt;(x);&lt;br /&gt;&lt;br /&gt;        int res = xx + 1;&lt;br /&gt;&lt;br /&gt;        ListDigraph g;&lt;br /&gt;&lt;br /&gt;        ListDigraph::Node u = g.addNode();&lt;br /&gt;        ListDigraph::Node v = g.addNode();&lt;br /&gt;        ListDigraph::Arc  a = g.addArc(u, v);&lt;br /&gt;&lt;br /&gt;        int i = countNodes(g);&lt;br /&gt;        int j = countArcs(g);&lt;br /&gt;&lt;br /&gt;        Rprintf(&amp;quot;num nodes is %d , and num edges is %d \\n&amp;quot;,i,j);&lt;br /&gt;&lt;br /&gt;        return Rcpp::wrap(res);&lt;br /&gt;        '&lt;br /&gt;&lt;br /&gt; fun &amp;lt;- cxxfunction( signature(x=&amp;quot;numeric&amp;quot;), body=src,include=inc, plugin=&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then I run R from a ubuntu terminal and in the R console I obtain: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;&amp;gt; library(&amp;quot;inline&amp;quot;)&lt;br /&gt;&amp;gt; library(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;&amp;gt; source(&amp;quot;myexample_inline.R&amp;quot;)&lt;br /&gt;&amp;gt; fun(1)&lt;br /&gt;num nodes is 2 , and num edges is 1 &lt;br /&gt;[1] 2&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So it works !!! &lt;/br&gt;&lt;/br&gt;TODO: What if I want to construct a package that uses LGL. How I do that? The right thing is that the installation of a R package can not depend on the installation of another non R package as LGL. So this is something that I need to explore.&lt;/br&gt;&lt;/br&gt;TODO: Now I have a question. In the example the C++ function is "inlined" in R. So, if I want to call that function from other C++ function: How I do it? And if it is possible: It is (in terms of speed) convenient? &lt;/br&gt; Maybe "inlining" is not the best choice. What other options do I have? Maybe &lt;a href="http://dirk.eddelbuettel.com/code/rcpp/html/main.html"&gt;this&lt;/a&gt; (and &lt;a href="http://dirk.eddelbuettel.com/blog/2009/12/20/"&gt;this&lt;/a&gt;) may be helpful. &lt;/br&gt;Also I open &lt;a href="http://stackoverflow.com/questions/4917401/lemon-graph-library-on-r-using-rcpp"&gt;this question&lt;/a&gt; in &lt;a href="http://stackoverflow.com/"&gt;http://stackoverflow.com/&lt;/a&gt;, so maybe I get some answer from there. &lt;/br&gt;This is the &lt;a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel"&gt;rcpp-development list&lt;/a&gt; which I have subscribed to. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-6621458587976860381?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/6621458587976860381/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=6621458587976860381' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6621458587976860381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/6621458587976860381'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html' title='Lemon Graph Library (LGL) instalation - logbook'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-5142811595660888929</id><published>2011-02-04T10:34:00.009-03:00</published><updated>2011-02-07T11:48:41.914-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LGL'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R, Rcpp, and the Lemon Graph Library (LGL) and others options</title><content type='html'>In a &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-rcpp-and-std.html"&gt;previous post&lt;/a&gt; it wrote about the possibility to combine &lt;a href="http://www.boost.org/doc/libs/1_45_0/libs/graph/doc/index.html"&gt;&lt;i&gt;BGL&lt;/i&gt;&lt;/a&gt; with &lt;i&gt;Rcpp&lt;/i&gt; (I also discuss other options). I do not read to much about &lt;i&gt;BGL&lt;/i&gt;, so I do not know if it is a nice option. &lt;/br&gt;&lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/2751826/which-c-graph-library-should-i-use"&gt;Here&lt;/a&gt; I found that along with &lt;i&gt;BGL&lt;/i&gt; there are other options. In this post I want to write about the &lt;a href="http://lemon.cs.elte.hu/trac/lemon"&gt;&lt;i&gt;Lemon Graph Library&lt;/i&gt;&lt;/a&gt; (LGL). This seems a very nice option to work with graph (as I can see reading a little inside the its home page). The only thing that I don't know if it is easily integrable with &lt;i&gt;Rcpp&lt;/i&gt;. &lt;/br&gt; It seems that it uses &lt;a href="http://en.wikipedia.org/wiki/Standard_Template_Library"&gt;&lt;i&gt;STL&lt;/i&gt;&lt;/a&gt;, but it is not entirely developed trough the use of it. That is the reason that make me suspicious about its integrability with &lt;i&gt;Rcpp&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;&lt;i&gt;LGL&lt;/i&gt; is integrable to &lt;i&gt;R&lt;/i&gt; with &lt;i&gt;Rcpp&lt;/i&gt;. At least using the &lt;i&gt;inline&lt;/i&gt; package. Check &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/lemon-graph-library-lgl-instalation.html"&gt;this&lt;/a&gt; posts.&lt;/br&gt;&lt;/br&gt;TODO: Is convenient to integrate &lt;i&gt;LGL&lt;/i&gt; to &lt;i&gt;R&lt;/i&gt; using the &lt;i&gt;inline&lt;/i&gt; package?&lt;/br&gt;TODO: Is &lt;i&gt;LGL&lt;/i&gt; integrable as an &lt;i&gt;R&lt;/i&gt; package? &lt;/br&gt;&lt;/br&gt;&lt;b&gt;Divergent discussion:&lt;/b&gt; &lt;/br&gt;&lt;/br&gt;Here it is a &lt;a href="http://stackoverflow.com/questions/3010805/scalable-parallel-large-graph-analysis-library"&gt;post&lt;/a&gt; which discuss several options and talks good about &lt;i&gt;LGL&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;Here a list of other options aside of LGL: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://goblin2.sourceforge.net/"&gt;GOBLIN&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-5142811595660888929?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/5142811595660888929/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=5142811595660888929' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5142811595660888929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/5142811595660888929'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-rcpp-and-lemon-graph-library.html' title='R, Rcpp, and the Lemon Graph Library (LGL) and others options'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3032623234773862767</id><published>2011-02-03T20:44:00.009-03:00</published><updated>2011-02-04T11:12:20.114-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='BGL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='igraph'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost C++ Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R, Rcpp, STL, Boost C++ Library and the Boost Graph Library inside it.</title><content type='html'>In previous posts (&lt;a href="http://deliriosderayohauno.blogspot.com/2011/01/r-statistics-utilities-high-performance_29.html"&gt;this&lt;/a&gt; and &lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/r-statistics-utilities-high-performance.html"&gt;this&lt;/a&gt;) I wrote about some of the benefits of Rcpp as an alternative to high performance computing in R. &lt;/br&gt;&lt;/br&gt;Rcpp facilitates integrating C++ code and R code in severals ways. One of them are provided by &lt;i&gt;Rcpp::as&lt;/i&gt; and &lt;i&gt;Rcpp::wrap&lt;/i&gt;. But what are they? &lt;/br&gt;&lt;/br&gt;a) Esencially &lt;i&gt;Rcpp::wrap&lt;/i&gt; allows conversion of some C++ objects to R objects. &lt;/br&gt;b) Vice-versa &lt;i&gt;Rcpp::as&lt;/i&gt; allows conversion of R objects to C++ objects. &lt;/br&gt;&lt;/br&gt;Obviously not every C++ object can be converted into an R object by means of &lt;i&gt;Rcpp::wrap&lt;/i&gt; (so it seems that it can be programmed if necessary (and possible) by means of &lt;a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf"&gt;Rcpp-extending&lt;/a&gt;). Esentially one can convert: &lt;/br&gt;&lt;/br&gt;i) primitive types: &lt;i&gt;int&lt;/i&gt;, &lt;i&gt;double&lt;/i&gt;, ... &lt;/br&gt;ii) &lt;i&gt;std::string&lt;/i&gt; objects &lt;/br&gt;iii) STL containers such as &lt;i&gt;std::vector&amp;lt;T&amp;gt;&lt;/i&gt;, std::list&amp;lt;T&amp;gt;,... as long as type &lt;i&gt;T&lt;/i&gt; is also wrappeable. &lt;/br&gt;iv) STL maps which use sdt::string for keys (e.g. std::map&amp;lt;std::string,T&amp;gt; as long as &lt;i&gt;T&lt;/i&gt; is also wrappeable.v) any type that can be readily converted by means of &lt;i&gt;SEXP()&lt;/i&gt; &lt;/br&gt;vi) any type for which the wrap is fully specialized. &lt;/br&gt;&lt;/br&gt;Something similar occurs with &lt;i&gt;Rcpp::as&lt;/i&gt; (look &lt;a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-introduction.pdf"&gt;here&lt;/a&gt; for more details). But what is STL? STL is the short of &lt;a href="http://en.wikipedia.org/wiki/Standard_Template_Library"&gt;Standard Template Library&lt;/a&gt; which is related to the &lt;a href="http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library"&gt;C++ Standard Library&lt;/a&gt;. STL provides important facilities as &lt;a href="http://en.wikipedia.org/wiki/Vector_(STL)"&gt;&lt;i&gt;std::vectors&lt;/i&gt;&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/List_(C%2B%2B)"&gt;&lt;i&gt;std::lists&lt;/i&gt;&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Deque_(C%2B%2B)"&gt;&lt;i&gt;std::deque&lt;/i&gt;&lt;/a&gt; and so on. &lt;/br&gt;&lt;/br&gt;One of the interesting things related to it is the &lt;a href="http://en.wikipedia.org/wiki/Boost_C%2B%2B_Libraries"&gt;&lt;i&gt;Boost C++ Libraries&lt;/i&gt;&lt;/a&gt; which is some kind of extension of the &lt;i&gt;STL&lt;/i&gt; and &lt;i&gt;C++ Standard Libraries&lt;/i&gt;. They are free, and in particular there is one that seems interesting to me. It is called &lt;i&gt;Boost Graph Library&lt;/i&gt; (or &lt;i&gt;BGL&lt;/i&gt;, developed by Jeremy Siek and a University of Notre Dame team). The home page of the &lt;i&gt;Boost C++ Libraries&lt;/i&gt; seems to be &lt;a href="http://www.pdc.kth.se/training/Talks/C++/boost/libs/libraries.htm"&gt;this&lt;/a&gt;. In particular there is a section dedicated to the &lt;i&gt;BGL&lt;/i&gt; one (is &lt;a href="http://www.pdc.kth.se/training/Talks/C++/boost/libs/graph/doc/table_of_contents.html"&gt;this&lt;/a&gt;). It seems that the &lt;i&gt;Boost C++ Libraries&lt;/i&gt; can be downloaded from &lt;a href="http://www.boost.org/users/index.html"&gt;here&lt;/a&gt;. Interestingly there is also a &lt;a href="http://osl.iu.edu/research/pbgl/"&gt;&lt;i&gt;Parallel BGL&lt;/i&gt;&lt;/a&gt; (which is based in &lt;i&gt;BGL&lt;/i&gt; but redeveloped for parallel computation).&lt;/br&gt;&lt;/br&gt;So, in another previous post (&lt;a href="http://deliriosderayohauno.blogspot.com/2011/02/idea-rcpp-on-igraph.html"&gt;this&lt;/a&gt;) I analyzed the idea to integrate the &lt;a href="http://igraph.sourceforge.net/"&gt;&lt;i&gt;igraph&lt;/i&gt;&lt;/a&gt; library with &lt;i&gt;Rcpp.&lt;/i&gt; But maybe it will be easier trough the &lt;i&gt;BGL&lt;/i&gt; library inside the &lt;i&gt;Boost C++ Libraries&lt;/i&gt; because this last one is developed using STL. It is something that need to be explored with more care. &lt;/br&gt;&lt;/br&gt;Note that &lt;i&gt;BGL&lt;/i&gt; is already implemented in &lt;b&gt;R&lt;/b&gt; (&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/RBGL/index.html"&gt;this&lt;/a&gt; is the link to the package) &lt;/br&gt;&lt;/br&gt;TODO : look the &lt;b&gt;BGL&lt;/b&gt; library inside the &lt;i&gt;Boost C++ Libraries&lt;/i&gt;.Then try to determine if it is easily integrable with &lt;i&gt;Rcpp&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;In fact I made a list before about the different packages to handle graphs in R (&lt;a href="http://www.blogger.com/post-edit.g?blogID=3136325786002442223&amp;postID=2747684516820593461"&gt;this post&lt;/a&gt;). From that list now, I will remark the following ones: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/igraph/index.html"&gt;&lt;i&gt;igraph&lt;/i&gt;&lt;/a&gt; &lt;/br&gt;&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/RBGL/index.html"&gt;&lt;i&gt;RBGL&lt;/i&gt;&lt;/a&gt; &lt;/br&gt;as the main options, but there are also: &lt;/br&gt;&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/graph/index.html"&gt;graph&lt;/a&gt; &lt;/br&gt;&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/gRbase/index.html"&gt;gRbase&lt;/a&gt; &lt;/br&gt;&lt;a href="http://cran-r.c3sl.ufpr.br/web/packages/giRaph/index.html"&gt;giRaph&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;TODO: Check which of those alternatives are integrable with &lt;i&gt;Rcpp&lt;/i&gt;. &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3032623234773862767?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3032623234773862767/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3032623234773862767' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3032623234773862767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3032623234773862767'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-rcpp-and-std.html' title='R, Rcpp, STL, Boost C++ Library and the Boost Graph Library inside it.'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-415100853658508734</id><published>2011-02-02T14:21:00.003-03:00</published><updated>2011-02-02T14:25:56.846-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ideas'/><category scheme='http://www.blogger.com/atom/ns#' term='igraph'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Idea: igraph on R intermediated by Rcpp</title><content type='html'>The other day I found &lt;a href="http://romainfrancois.blog.free.fr/index.php?post/2010/10/07/LondonR-Rcpp-slides"&gt;this&lt;/a&gt; (a slides from Roman Francois, one of the developers of Rcpp). There he shows that the speed difference between R and Rcpp can be very significant. Also, Rcpp provides facilities like &lt;i&gt;Rcpp syntactic sugar&lt;/i&gt; and &lt;i&gt;Rcpp modules&lt;/i&gt; which makes easier the integration with R and also facilitates the C++ code development (for example providing access to R functions and convenient Rcpp classes). &lt;/br&gt;&lt;/br&gt;In the other hand, I'm probably focusing on Complex Networks research, so packages like &lt;i&gt;igraph&lt;/i&gt; are very convenient. But, it is fast? I think that it may be reasonably fast. But, it is also fast in R? I'm not so sure about that. But, do not despair so fast, igraph is mainly coded in C, so one (as a last resource) can use those C routines to work with graph. But, hey !!! What happens with R? Well, looking inside the igraph R package one can see that there is used those C functions called by the R API. More specifically, the igraph R packages is constituted by: &lt;/br&gt; &lt;/br&gt;(i)the standard igraph C code &lt;/br&gt;(ii) a bit of R code (the wrapper R functions) &lt;/br&gt;(iii) and another bit of C code that serves as interface between the R code and the standard C code. &lt;/br&gt;&lt;/br&gt;So, it is nice not so much. It left Rcpp out of the matter. So, Is there a "short" way to develop a Rcpp interface that replaces (iii)? &lt;/br&gt;&lt;/br&gt;By the moment I will try to ask about in the &lt;a href="http://lists.nongnu.org/mailman/listinfo/igraph-help"&gt;igraph help mailing list&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-415100853658508734?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/415100853658508734/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=415100853658508734' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/415100853658508734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/415100853658508734'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/idea-rcpp-on-igraph.html' title='Idea: igraph on R intermediated by Rcpp'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-3952373856558688913</id><published>2011-02-01T14:14:00.004-03:00</published><updated>2011-02-06T18:55:33.775-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp modules'/><category scheme='http://www.blogger.com/atom/ns#' term='high performance computing'/><category scheme='http://www.blogger.com/atom/ns#' term='classes'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R statistics - Utilities: High Performance Computing, Rcpp Modules</title><content type='html'>One of the possibilities within the &lt;i&gt;Rcpp&lt;/i&gt; package is &lt;i&gt;Rcpp modules&lt;/i&gt;. Lookat: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf"&gt;Exposing C++ functions and classes with Rcpp modules&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Basically, the idea is that trough Rcpp modules, exposing C++ functions and classes to R (so they can be called and used from R) is to much easier than with the &lt;i&gt;R API&lt;/i&gt; way, even it is easier than in the standard way provided trough Rcpp. &lt;/br&gt;&lt;/br&gt;By the moment I will not discuss the technicalities involved here. It is something to just keep in mind. &lt;/br&gt;&lt;/br&gt;A list of links that may be useful: &lt;/br&gt;&lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/3327697/how-to-make-rcpp-find-a-new-module"&gt;How to make Rcpp find a new module?&lt;/a&gt; &lt;/br&gt;&lt;a href="http://stackoverflow.com/questions/1724024/using-c-libraries-in-an-r-package"&gt;Using C++ libraries in an R package&lt;/a&gt; &lt;/br&gt;&lt;a href="http://r.789695.n4.nabble.com/Error-using-Rcpp-td1690524.html"&gt;Error using Rcpp&lt;/a&gt; &lt;/br&gt;&lt;/br&gt;Salut !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3136325786002442223-3952373856558688913?l=deliriosderayohauno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deliriosderayohauno.blogspot.com/feeds/3952373856558688913/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3136325786002442223&amp;postID=3952373856558688913' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3952373856558688913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3136325786002442223/posts/default/3952373856558688913'/><link rel='alternate' type='text/html' href='http://deliriosderayohauno.blogspot.com/2011/02/r-statistics-utilities-high-performance.html' title='R statistics - Utilities: High Performance Computing, Rcpp Modules'/><author><name>rayo</name><uri>http://www.blogger.com/profile/13251936771676443733</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3136325786002442223.post-1006290216338448572</id><published>2011-01-30T19:23:00.043-03:00</published><updated>2011-01-31T15:03:00.979-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latest versio'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='logbook'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Rcpp'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>R installation - Latest version on ubuntu in order to allow syntactic sugar in Rcpp</title><content type='html'>Today (the day that I begin the post) is 30-01-2010. &lt;/br&gt;&lt;/br&gt;I don't remember exactly how I install R in my Ubuntu 9.10 Karmic Koala (I have a Pentium Dual Core T4200 which corresponds to x86_64). But when I startup R (typing R in a ubuntu terminal) then it says: &lt;i&gt;R version 2.9.2 (2009-08-24)&lt;/i&gt;.In the &lt;a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html"&gt;R FAQ&lt;/a&gt; page (today) it says that the &lt;a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-the-current-version-of-R_003f"&gt;actual version&lt;/a&gt; is 2.12.1 so I have an outdated R version. &lt;/br&gt;&lt;/br&gt;Normally I will not have problem about having outdated versions of a given soft meanwhile it is useful to me. But, today I tried to install the &lt;i&gt;Rcpp&lt;/i&gt; package and fails (as I will state later it seems that the reason is that the R version is too old). At least, I couldn't from the R prompt via: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; install.packages(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Warning in install.packages(&amp;quot;Rcpp&amp;quot;) :&lt;br /&gt;  argument 'lib' is missing: using '/home/juan/R/x86_64-pc-linux-gnu-library/2.9'&lt;br /&gt;--- Please select a CRAN mirror for use in this session ---&lt;br /&gt;Loading Tcl/Tk interface ... done&lt;br /&gt;Warning message:&lt;br /&gt;In getDependencies(pkgs, dependencies, available, lib) :&lt;br /&gt;  package &amp;#8216;Rcpp&amp;#8217; is not available&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So, I ask my self: what happens? Then (obviously) I google and found &lt;a href="http://stackoverflow.com/questions/3391631/installing-rcpp-in-r-2-10-on-ubuntu"&gt;this post&lt;/a&gt; but it seems that it doesn't solve the problem (or at least I couldn't figure out how from it). Then I found &lt;a href="http://permalink.gmane.org/gmane.comp.lang.r.rcpp/1467"&gt;this other&lt;/a&gt; which says that it could be that the R version is too old. This is the reason for that I want the latest version of R in my computer. I want to install the &lt;i&gt;Rcpp&lt;/i&gt; package with &lt;i&gt;syntactic sugar&lt;/i&gt;.&lt;/br&gt;&lt;/br&gt;But now, there is another problem. I can install R from the synaptic manager of ubuntu but I don't get the latest one (I get the 2.9.2 as I state above), in fact I can install the Rcpp package from there. But the package version also is too old as I can see via: &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; z&amp;lt;-installed.packages()&lt;br /&gt;&amp;gt; z[&amp;quot;Rcpp&amp;quot;,&amp;quot;Version&amp;quot;]&lt;br /&gt;[1] &amp;quot;0.6.5&amp;quot;.&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;In fact, as is told &lt;a href="http://dirk.eddelbuettel.com/code/rcpp.html"&gt;here&lt;/a&gt;, syntactic sugar is included in the Rcpp package from the version 0.8.3&lt;/br&gt;&lt;/br&gt;So, the solution seems to install the latest version of R. But: &lt;/br&gt;&lt;/br&gt;1) From where? &lt;/br&gt;2) How?. &lt;/br&gt;3) I'll need to uninstall my actual version of R? &lt;/br&gt;&lt;/br&gt;I'm a bit (ok, more than a bit) scared to experiment with it (now) because I'm ending my PhD. Thesis. I don't want my system down now !!!&lt;/br&gt;Anyway, lets try...&lt;/br&gt;So, I try what it says about ubuntu in CRAN, that is I look in &lt;a href="http://cran.r-project.org/bin/linux/ubuntu/"&gt;http://cran.r-project.org/bin/linux/ubuntu/&lt;/a&gt; and via (the ubuntu menu) System -&gt; Administration -&gt; Software Sources -&gt; Other Software tab add in the /etc/apt/sources.list file, a line like this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;deb http://&amp;lt;my.favorite.cran.mirror&amp;gt;/bin/linux/ubuntu karmic&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;In fact, this line is a kind of prototype, in the "real" one must replace &amp;lt;my.favorite.cran.mirror&amp;gt;  by your prefered CRAN mirror (you can get a list of them here &lt;a href="http://cran.r-project.org/mirrors.html"&gt;http://cran.r-project.org/mirrors.html&lt;/a&gt;). In my case this line becames: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;http://cran-r.c3sl.ufpr.br/bin/linux/ubuntu karmic&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;(note that this line depends on the ubuntu version, look in &lt;a href="http://cran.r-project.org/bin/linux/ubuntu/"&gt;http://cran.r-project.org/bin/linux/ubuntu/&lt;/a&gt; for how to be done in the other versions). Then ubuntu ask me to update, so I do that but I get this error:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;W: GPG error: http://cran-r.c3sl.ufpr.br karmic/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D67FC6EAE2A11821&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So I simply do what is said &lt;a href="http://ubuntuforums.org/archive/index.php/t-1160912.html"&gt;here&lt;/a&gt;, that is, in a ubuntu terminal I run the commands:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;gpg --keyserver keyserver.ubuntu.com --recv D67FC6EAE2A11821&lt;br /&gt;gpg --export --armor D67FC6EAE2A11821 &amp;#124; sudo apt-key add -&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Then ubuntu ask me to update again and it works. So I continue with what is said in&lt;a href="http://cran.r-project.org/bin/linux/ubuntu/"&gt;http://cran.r-project.org/bin/linux/ubuntu/&lt;/a&gt;, that is I run in a ubuntu terminal the commands:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;sudo apt-get update&lt;br /&gt;sudo apt-get install r-base&lt;br /&gt;sudo apt-get install r-base-dev&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now I have the 2.12.1 R Version as I can view executing R in a ubuntu terminal.&lt;/br&gt;Now it is time to see if I can install the latest version of Rcpp. So the first thing is to see if it is already installed. So I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; library(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;Error: package 'Rcpp' was built before R 2.10.0: please re-install it&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Now, it happens that when I tried (before upgrade R) to update all packages via: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; update.packages()&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;it get stuck in some "place" trying to update the &lt;i&gt;network&lt;/i&gt; package. Lets see what happens now... Ok, after a while I get:&lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;Warning messages:&lt;br /&gt;1: In install.packages(update[instlib == l, &amp;quot;Package&amp;quot;], l, contriburl = contriburl,  :&lt;br /&gt;  installation of package 'Rcpp' had non-zero exit status&lt;br /&gt;2: In install.packages(update[instlib == l, &amp;quot;Package&amp;quot;], l, contriburl = contriburl,  :&lt;br /&gt;  installation of package 'foreach' had non-zero exit status&lt;br /&gt;3: In install.packages(update[instlib == l, &amp;quot;Package&amp;quot;], l, contriburl = contriburl,  :&lt;br /&gt;  installation of package 'doMC' had non-zero exit status&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;So it seems to work partially, and in fact it fails with "Rcpp", the one that I mainly want to install !!! So, now I will try: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; install.package(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;It seems that it work because I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; library(&amp;quot;Rcpp&amp;quot;)&lt;br /&gt;&amp;gt; z &amp;lt;- installed.packages()&lt;br /&gt;&amp;gt; z[&amp;quot;Rcpp&amp;quot;,&amp;quot;Version&amp;quot;]&lt;br /&gt;[1] &amp;quot;0.9.0&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;Lets see if I can install the other 2 packages that give me an error before. So I first try: &lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; install.packages(&amp;quot;foreach&amp;quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;and I get: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;gt; library(&amp;quot;foreach&amp;quot;)&lt;br /&gt;Loading required package: iterators&lt;br /&gt;Loading required package: codetools&lt;br /&gt;foreach: simple, scalable parallel programming from REvolution Computing&lt;br /&gt;Use REvolution R for scalability, fault tolerance and more.&lt;br /&gt;http://www.revolution-computing.com&lt;br /&gt;&amp;gt; z &amp;lt;- installed.packages()&lt;br /&gt;&amp;gt; z[&amp;quot;foreach&amp;quot;,&amp;quot;Version&amp;quot;]&lt;br /&gt;[1] &amp;quot;1.3.0&amp;quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/br&gt;With the other package I get this: &lt;/br&gt;&lt;/br&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;&amp;gt; install.packages(&amp;quot;doMC&amp;quot;)&lt;br /&gt;Installing package(s) into &amp;#8216;/usr/local/lib/R/site-library&amp;#8217;&lt;br /&gt;(as &amp;#8216;lib&amp;#8217; is unspecified)&lt;br /&gt;trying URL 'http://cran-r.c3sl.ufpr.br/src/contrib/doMC_1.2.1.tar.gz'&lt;br /&gt;Content type 'application/x-gzip' length 93727 bytes (91 Kb)&lt;br /&gt;opened URL&lt;br /&gt;==================================================&lt;br /&gt;downloaded 91 Kb&lt;br /&gt;&lt;br /&gt;* installing *source* package &amp;#8216;doMC&amp;#8217; ...&lt;br /&gt;** R&lt;br /&gt;** demo&lt;br /&gt;** inst&lt;br /&gt;** preparing package for lazy loading&lt;br /&gt;Loading required package: iterators&lt;br /&gt;Loading required package: codetools&lt;br /&gt;Error : package 'multicore' was built before R 2.10.0: please re-install it&lt;br /&gt;ERROR: lazy loading failed for package &amp;#8216;doMC&amp;#8217;&lt;br /&gt;* removing &amp;#8216;/usr/local/lib/R/site-library/doMC&amp;#8217;&lt;br /&gt;&lt;br /&gt;The downloaded packages are in&lt;br /&gt;    &amp;#8216;/tmp/RtmpXRkkYx/downloaded_packages&amp;#8217;&lt;br /&gt;Warning message:&lt;br /&gt;In install.packages(
