Re: [Rd] Problem to execute a function loading by my package that I created

From: Po <>
Date: Fri, 03 Jun 2011 08:55:03 -0700 (PDT)

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] [] Sent: 03 June 2011 15:04
To: Pauline Ferrouillat
Subject: Re: Problem to execute a function loading by my package that I created


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.


> Thank you in advance,
> Pauline
> --
> View this message in context:
> Sent from the R devel mailing list archive at
> ______________________________________________
> [hidden email]</user/SendEmail.jtp?type=node&node=3570897&i=0> mailing list

[hidden email]</user/SendEmail.jtp?type=node&node=3570897&i=1> mailing list

If you reply to this email, your message will be added to the discussion below: To unsubscribe from Makevars and Makefile, click here<>.

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:
Sent from the R devel mailing list archive at
	[[alternative HTML version deleted]]

______________________________________________ mailing list
Received on Fri 03 Jun 2011 - 16:05:43 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 03 Jun 2011 - 17:30:16 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive