Open Bijaelo opened 3 years ago
@Bijaelo sorry for the late response on this.
You are correct. The example only searched pre-specified directories. The suggested change addresses this limitation nicely by yielding all files instead of just the subdirectories. So, thanks for taking the time to write this up!
As it was a long time ago that I worked on this example, I think I might have held off on using find
as I was worried about more GNU restrictions/compatibilities. Have you experienced any issues with packages on CRAN using this approach?
Hi @coatless, I have not yet published my package to CRAN yet (It turned out to be somewhat of a more time-taking task). That being said, I have since read the R-extension manual potentially a few too many times, and the SOURCES directory is described in section 1.2.1.3 Compiling in sub-directories and specifically suggests using SOURCES and OBJECTS of makevars in this fashion. This should give reason that the change is within the bounds of CRAN requirements. :-)
Hey, thank you for your example. In all honesty Makevars and configure are massive roadblocks and the documentation is nowhere near user friendly. One thing I noticed however, was that you only search certain (specified) directories in your example
And this is not really mentioned in your post. But if one changed this to
This should:
*.cpp
files./
(output from find).\n
with a whitespaceThis might be dangerous if someone were building a package linking to an external library (boost, tensorflow whatever). But for these users I am expecting them to have enough knowledge, to actually make their own scripts. Meanwhile I'll shamelessly copy-paste your scripts, and continue bashing my phase against the extension manual to hopefully understand these parts in the future.
Edit:
If this was to be used one should change
to
(as the main directory is already included)