On 17 July 2020 at 14:58, Benjamin Christoffersen wrote:
| Quick guess. After changing
| > SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -O3 -Wextra 
-Wall -Wno-unknown-pragmas -Wno-return-type -Wno-ignored-attributes 
-Wno-cast-function-type -Wno-error=cast-function-type")
| 
| to
| > SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -O3 -Wextra 
-Wall")
| 
| I managed to `R CMD INSTALL` the package with gcc-8 on Ubuntu. Then
| doing `cd ~/R/x86_64-pc-linux-gnu-library/3.6/gpboost/libs/` and
|  - nm *.so -C | grep exit
|  - nm *.so -C | grep abort
|  - nm *.so -C | grep printf
| 
| yields nothing. However, doing `nm *.so -C | grep assert` yields
|                  U __assert_fail@@GLIBC_2.2.5
| 
| and doing `grep "assert" -nr .` shows that `assert` is being called.
| Thus, is everything build with `-NDEBUG`? See
| https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#DOCF76

Very nice catch!

Given the package (and underlying library) has a joint repo, it is pretty
easy to search directly at GitHub too, and it looks like all the required
legwork has been done to #ifdef printf() statements and alike.

Now, I had to do the same work for packages of mine too in the past, and I
don't recall the test output "crossing". So if it really were only assert
coming back in via -NDEBUG then the tests for printf would NOT be triggered.
So something else must likely be hiding.  Which is ... difficult to check in
a codebase that includes duplicate copies of Eigen, LighGBM, ... and more.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to