<div dir="ltr"><div>Hi,<br><br>I just looked into the GNUMakefile. I think I just have to only change those two lines, right?<br><br><span class="gI"><span class="go">sources :=         $(wildcard *.cpp)<br>programs :=       $(sources:.cpp=)<br><br></span></span><br>If I understand it correctly, it only works for .cpp files. So it has be changed to something like this?<br><br>sources :=        $(wildcard *.cpp)<br>header :=          $(wildcard *.h)<br>programs :=      $(sources:.cpp= header:.h=)<br><br></div><div>Thanks<br><br></div><div>Ulf<br></div><div><br><br></div><span class="gI"><span class="go"><span></span></span></span><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 5:14 PM, Ulf Mertens <span dir="ltr"><<a href="mailto:mertens.ulf@gmail.com" target="_blank">mertens.ulf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><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></span><div class="gmail_extra"><br><div class="gmail_quote"><span class="">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></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
Hi Ulf,<br>
<span><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><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>
</div></div><span><font color="#888888"><br>
Dirk<span class="HOEnZb"><font color="#888888"><br>
<br>
--</font></span><span class=""><br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</span></font></span></blockquote></div><br></div>
</blockquote></div><br></div>