* checking installed package size ... NOTE installed size is 230.0Mb sub-directories of 1Mb or more: include 109.4Mb libs 74.1Mb libstan 46.2Mb-rw-r--r-- 1 jq jq 3.1M Jul 6 21:37 libstan.a-rw-r--r-- 1 jq jq 6.7M Jul 6 21:41 libstanc.a-rwxr-xr-x 1 jq jq 2.3M Jul 6 21:41 stancAs we are trying to make the source of RStan small, do we need to worry about the binary version size?
Now, if I run a R CMD check on the source, one note is* checking installed package size ... NOTEinstalled size is 230.0Mbsub-directories of 1Mb or more:include 109.4Mblibs 74.1Mblibstan 46.2Mb
goodrich@CYBERPOWERPC:/usr/lib/R/site-library$ du -h -d 1 | sort -h | tail
3.3M ./rgl
3.7M ./fPortfolio
4.1M ./Rcmdr
5.0M ./VGAM
5.6M ./qtl
9.5M ./GenABEL
11M ./Rcpp
18M ./RGtk2
33M ./mapdata
195M .
You can cut RStan down a little bit more by excluding src/test/ and logos/. Also, it seems that make clean-all does not eliminate the .o files in the subdirectories of src/ so that adds to the size. Even still, CRAN is probably not going to be too happy.
* checking installed package size ... NOTE
installed size is 117.5Mb
sub-directories of 1Mb or more:
include 113.6Mb
libs 2.7Mb
libstan 1.0Mb
The size will probably be even bigger on Windows
On Saturday, July 7, 2012 1:31:36 PM UTC-4, Ben Goodrich wrote:The size will probably be even bigger on Windows. The only things that I know to do to reduce the size of compiled objects are
-- Use -Os instead of -O2 or -O3
-- Eliminate the -g flag
-- Include the -s flag
And with those options I get* checking installed package size ...NOTE
installed size is 117.5Mb
sub-directories of 1Mb or more:
include 113.6Mb
libs 2.7Mb
libstan 1.0Mb
and yet the examples still work.
Ben
P.S. Unrelated thing, but it would be better to write the *.csv files to tempdir() rather than getwd() because the working directory might not be writable by the user. But the *.csv files will get deleted when the user closes R, so we would need to direct the user to copy them elsewhere if desired.
On 7/7/12 1:51 PM, Ben Goodrich wrote:
> On Saturday, July 7, 2012 1:31:36 PM UTC-4, Ben Goodrich wrote:
>
> The size will probably be even bigger on Windows. The only things that I know to do to reduce the size of compiled
> objects are
>
> -- Use -Os instead of -O2 or -O3
We want to step back from -O3 only as a last
resort. It's about 10 times faster than -O0;
how the -O1 or -O2 behave differs between clang++
and g++. The upside is that it's faster to compile
with less optimization.
> -- Include the -s flag
What does this do?
> P.S. Unrelated thing, but it would be better to write the *.csv files to tempdir() rather than getwd() because the
> working directory might not be writable by the user. But the *.csv files will get deleted when the user closes R, so we
> would need to direct the user to copy them elsewhere if desired.
Could we do this
1. if user supplies file name, use that if it's writable, if
not bomb and say it's not writable.
2. if user does not supply a file name, use getwd() if it's
writable.
3. as a last resort, use tempdir() and issue a warning
I don't know how easy it is to test file properties in R.
make -f 'Makevars' -f '/usr/lib/R/etc/Makeconf' -f '/usr/share/R/share/make/shlib.mk' -f '/home/jq/.R/Makevars' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='rstan.so'
make -f '/usr/lib/R/etc/Makeconf' -f 'Makefile' -f '/home/jq/.R/Makevars'
On Saturday, July 7, 2012 1:31:36 PM UTC-4, Ben Goodrich wrote:
The size will probably be even bigger on Windows. The only things that I know to do to reduce the size of compiled objects are
-- Use -Os instead of -O2 or -O3
-- Eliminate the -g flag
-- Include the -s flag
Is it feasible with this approach to make stanc small with -Os and -s but make libstan fast with -O3?
If I understood the previous exchange correctly, your plan is to
use -Os and -s for the RStan builds by default and let
users modify HOME/.R/Makevars if they want to build a fast
version of Stan?
Do you know how much slower -Os -s is than -O3?
If I understood the previous exchange correctly, your plan is to
use -Os and -s for the RStan builds by default and let
users modify HOME/.R/Makevars if they want to build a fast
version of Stan?
Do you know how much slower -Os -s is than -O3?