1

I am packing a bunch of my functions into an R package. My problem is that I have both .f90 code and c++ (through Rcpp) which I want to be compiled separately in two different shared libraries, also because they need different includes/link options.

I found only the package "grDevices" which has 2 shared libraries, and there the problem is solved using subdirectories with adapted Makefiles, whose syntax is however voodoo for me. Are there other examples out there?

Can I achieve what I want without expliciting everything in a Makefile, for example using just the Makevars file? Any hint appreciated. Cheers, domanov

1 Answer 1

3

I would start with a src/Makevars setting the respective variables for Fortran and C++:

PKG_CXXFLAGS
PKG_FLAGS
PKG_FCFLAGS

as well as

FLIBS
FCLIBS

See Section 1.2.1 "Using 'Makevars'" in Writing R Extensions for more.

Sign up to request clarification or add additional context in comments.

1 Comment

If this is helpful, please consider "accepting" (click on the tickmark only you as question-owner see) and/or "upvoting" (click on up-triangle) as that is how StackOverflow rolls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.