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.
https://astamm.github.io/nloptr/
Other
106 stars 34 forks source link

Modification of test-C-API.cpp #155

Closed jinghuazhao closed 6 months ago

jinghuazhao commented 6 months ago

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.

aadler commented 6 months ago

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.

jinghuazhao commented 6 months ago

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!

aadler commented 6 months ago

@astamm, I think this one can be closed.

astamm commented 6 months ago

Thanks all.