From edd at debian.org  Sun Oct 16 17:42:55 2016
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 16 Oct 2016 10:42:55 -0500
Subject: [Rd] compile c++ code in an R package without -g
In-Reply-To: <CAFLer81kpd6_E4Lu=kYTvrYgzMpaHTQP3kg-vDot8B09o_4b1g@mail.gmail.com>
References: <CAFLer81sYXPQ8rkKj3+uXd8gXTfGHkmBUqP=3feCGE2rzvFXcQ@mail.gmail.com>
	<22531.35344.355506.984934@max.nulle.part>
	<CAFLer81kpd6_E4Lu=kYTvrYgzMpaHTQP3kg-vDot8B09o_4b1g@mail.gmail.com>
Message-ID: <22531.40959.267272.690340@max.nulle.part>


On 16 October 2016 at 10:52, Da Zheng wrote:
| The main reason I want to remove the debug info is that when I use R
| CMD check on my package, it gives the following info
| * checking installed package size ... NOTE
|   installed size is 223.6Mb
|   sub-directories of 1Mb or more:
|   libs 223.1Mb
| 
| CRAN requires an R package to pass all checks and fix all complaints
| including NOTEs.
| It seems R's default compilation options significantly increase the
| library size.
| Do you have any suggestions on fixing this NOTE?

As I tried to say to in my first reply, 'we know'.

I am somewhat involved with a number of packages using C++ (and sometimes
lots of it) and almost all of which trigger this NOTE.

There are several additional points here:

  i)   'R CMD check' really needs a white-listing facility. By permanently
       listing 'known and tolerated' features it downgrades the value in
       the 'reports' files off CRAN -- as I know beforehand Rcpp et all will
       tickle this.

       Then again, someone would need to step up, work with CRAN and implement
       a white-listing facility.

 ii)   You can hack a 'strip' facility into the package.  A friend and (now
       former) colleague did so in a package but I don't have the reference
       handy.  In essence, src/Makevars figures out if the host in 'amenable
       to this' (ie is not Solaris) and then strips

iii)   In the narrowest sense, just relax and mention the NOTE when you
       upload the packages. NOTES are tolerated, WARNINGS and ERRORS are more
       serious.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] compile c++ code in an R package without -g
Dirk Eddelbuettel