<div dir="ltr"><div><div><div>Hi,<br><br></div><div>thanks for your mail.<br></div><div><br>I don't have to use cmake for my project. It's totally fine to use plain Makefiles for me. <br><br>Sure,
 I can release this. But first, I want to optimize the code a bit. For 
instance, I am working with Eigen matrices and vectors in my<br></div>c++
 program but I don't know how to convert a Rcpp::NumericVector to say 
Eigen::VectorXd. Right now, I first convert to std::vector with 
Rcpp::as<><br></div>and then to Eigen::VectorXd with Eigen::Map. There is certainly a better way but I didn't figure it out yet.<br><br></div><div>Ulf<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 4:15 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Ulf,<br>
<span class=""><br>
On 23 July 2015 at 15:53, Ulf Mertens wrote:<br>
| I am working on a project in C++ where I have to use Bayesian Statistics quite<br>
| extensively. I coded my own Metropolis Hasting Sampler but since it is not<br>
| working that well, I wanted to call rstan from within C++ via RInside. I<br>
| already wrote the appropriate RInside/Rcpp code but I don't know how to rewrite<br>
| my CMakeLists.txt file to make it work.<br>
<br>
</span>Sounds nice. Will you release this?<br>
<span class=""><br>
| I looked at the CMakelists.txt file in the standard/examples folder but I don't<br>
| know enough about cmake to rewrite it for my own project.<br>
|<br>
| My project consists of 3 source files and 2 header files and I am working with<br>
| Eclipse Mars. Here is my current file:<br>
|<br>
| cmake_minimum_required(VERSION 2.6)<br>
|<br>
| project(XX)<br>
|<br>
| # use C++11<br>
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")<br>
|<br>
| add_executable(${PROJECT_NAME}<br>
|   global.h<br>
|   model.h<br>
|   model.cpp<br>
|   run.cpp<br>
|   mcmc.h<br>
|   mcmc.cpp<br>
|   )<br>
|<br>
| What do I have to change (in the file or in Eclipse itself) to make it work?<br>
<br>
</span>I wrote and support the 'plain old Makefile(s)' and can help with this.<br>
<br>
CMake support was added by Peter (CC'ed) who may be able to help you with this.<br>
My usual approach for 'non-Make' builds is to make it work with make, and<br>
then carry the changes over.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</font></span></blockquote></div><br></div>