Somewhere (and I can't remember where) I mentioned that the uncompressed size of this file set could be more that halved if we got rid of files that aren't actually used by BioCro. This isn't so urgent now that we've reduced the size of the BioCro R package by other means, but it is something to consider going forward.
In any case, I thought it worthwhile making a record of the method I used to find and dispense with unused Boost files. I was working on a Mac using the Z shell, but I'm sure this would work without modification in the Bash shell and on any Linux machine, and probably also on any Windows machine that has Cygwin or MinGW installed.
The first step was to add the -H flag to line at the top of the Makevars (or Makevars.win) file that appends to the PKG_CPPFLAGS variable so that the line became
PKG_CPPFLAGS+=-I../src/inc -DR_NO_REMAP -H
Then, starting in the src directory, I executed the following sequence of commands. There are probably a few extraneous things left in here, which I'm not bothering to weed out at this point:
# This line could be omitted if you start with a clean working directory or if you use the `--preclean` option in the `R CMD INSTALL` command immediately following.
for file in `grep --exclude-dir boost --exclude-dir .deps "<boost/" --include "*.h" --include "*.cpp" -rl .`; do touch $file; done
cd ..
R CMD INSTALL . 2>&1 | tee install_log
grep -E "^\.+ \.\./src/inc" install_log > boost_includes
sed 's|^.*\.\./src/inc/||' boost_includes | sort -u > boost_unique_includes
cd src/inc
mv ../../boost_unique_includes .
find boost -type f | sort > all_boost_files
for file in `find boost -type f`; do
if ! grep $file -q boost_unique_includes; then rm $file; fi
done
cd -
R CMD INSTALL --preclean . 2>&1 | tee install_log_2
cd tests
Rscript testthat.R
Somewhere (and I can't remember where) I mentioned that the uncompressed size of this file set could be more that halved if we got rid of files that aren't actually used by BioCro. This isn't so urgent now that we've reduced the size of the BioCro R package by other means, but it is something to consider going forward.
In any case, I thought it worthwhile making a record of the method I used to find and dispense with unused Boost files. I was working on a Mac using the Z shell, but I'm sure this would work without modification in the Bash shell and on any Linux machine, and probably also on any Windows machine that has Cygwin or MinGW installed.
The first step was to add the
-Hflag to line at the top of theMakevars(orMakevars.win) file that appends to thePKG_CPPFLAGSvariable so that the line becameThen, starting in the src directory, I executed the following sequence of commands. There are probably a few extraneous things left in here, which I'm not bothering to weed out at this point: