astamm / nloptr

nloptr provides an R interface to NLopt, a free/open-source library for nonlinear optimization providing a common interface to a number of different optimization routines which can handle nonlinear constraints and lower and upper bounds for the controls.

Home Page:https://astamm.github.io/nloptr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modification of test-C-API.cpp

jinghuazhao opened this issue · comments

I have seen this problem from 2.0.0 including 2.0.3 when compiling on our CentOS 7 system; with gcc 6.5.0; it appears that the calls at lines 107/8 to abs() should have been fabs(), i.e.,

expect_true(fabs(res[0] - 1./ 3) < 1.0e-4);
expect_true(fabs(res[1] - 8./27) < 1.0e-4);

Otherwise it would fail complaining changes need to be made on system libraries (screen output omitted) but an earlier one is here, https://cambridge-ceu.github.io/csd3/R/nloptr.html.

The entire test suite has been rebuilt. test-C-API.cpp was renamed (so as not to be called) in 230bdd3 and then deleted in ad0dc77.

Yes, I tried remotes::install_github("astamm/nloptr") with NLopt 2.7.1 and it installed smoothly as 2.0.4. I wondered if I used an earlier version of NLopt on our system but since it is resolved the issue can be closed now. Thank you so much!

@astamm, I think this one can be closed.

Thanks all.