Thank you for your help Simon. I resolved my issue.
As you told me, I put my C++ program in a separate directory of my package.  I 
create a library with my C++ program. On my package, there are only functions 
called by R and that uses my program.

From: Simon Urbanek [via R] 
[mailto:ml-node+3570897-797271001-242...@n4.nabble.com]
Sent: 03 June 2011 15:04
To: Pauline Ferrouillat
Subject: Re: Problem to execute a function loading by my package that I created

Pauline,

since you mentioned Rcpp, you're on the wrong list. I have put some comments 
below but they assume you're using regular R packaging and not Rcpp.

On Jun 3, 2011, at 4:41 AM, Po wrote:

> I still look for my problem.
> I think that maybe my Makefile is not good.
>
> In my folder src of my package, I put an existing program. In this program,
> I had already a makefile.
> So I kept this makefile and I changed.
>

Thats generally not a safe idea, because R has its own ways of compiling and 
linking so you would have to replicate that. If what you have is a stand-alone 
library, you can put it in a separate directory in your package and have it 
build itself so src will consist of the interface between R and you library 
only.

If what you have is essentially the package code in C++ then you don't need a 
Makefile at all - R will simply compile all sources you put in src and create a 
shared object for the package from it. You don't need to do anything, just 
remove your Makefile.


> I saw that it's better to have a file Makevars to compile. But I don't know 
> what is a file Makevars and I don't know how I can gather the files Makefile 
> and Makevars together.
>

Makevars is simply a makefile without compilation and linking rules as those 
are provided by R automatically. See recent posts about it on this list.

Cheers,
Simon

> Thank you in advance,
>
> Pauline
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Problem-to-execute-a-function-loading-by-my-package-that-I-created-tp3568081p3570314.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email]</user/SendEmail.jtp?type=node&node=3570897&i=0> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

______________________________________________
[hidden email]</user/SendEmail.jtp?type=node&node=3570897&i=1> mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

________________________________
If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/Makevars-and-Makefile-tp3568081p3570897.html
To unsubscribe from Makevars and Makefile, click 
here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3568081&code=UGF1bGluZS5GZXJyb3VpbGxhdEBodXR0b24uYWMudWt8MzU2ODA4MXw0NzUwODMyOTM=>.
________________________________________________________
This email is from The James Hutton Institute (JHI), however the views
expressed by the sender are not necessarily the views of JHI and its
subsidiaries. This email and any attachments are confidential and are intended
solely for the use of the recipient(s) to whom they are addressed.  If you
are not the intended recipient, you should not read, copy, disclose or rely on
any information contained in this email, and we would ask you to contact the
sender immediately and delete the email from your system.  Although JHI has
taken reasonable precautions to ensure no viruses are present in this email,
neither the Institute nor the sender accepts any responsibility for any
viruses, and it is your responsibility to scan the email and any attachments.

The James Hutton Institute is a Scottish charitable company limited by
guarantee.
Registered in Edinburgh No. SC374831
Registered Office: The James Hutton Institute, Invergowrie Dundee DD2 5DA.
Charity No. SC041796

--
View this message in context: 
http://r.789695.n4.nabble.com/Makevars-and-Makefile-tp3568081p3571267.html
Sent from the R devel mailing list archive at Nabble.com.
        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to