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

Test hardwires version

eddelbuettel opened this issue · comments

Here we have

> Sys.setenv(PKG_LIBS="-lnlopt")
> Rcpp::cppFunction("std::vector<int> ver() { int ma, mi, bu; nlopt_version(&ma, &mi, &bu); std::vector<int> v = {ma, mi, bu}; return v; }", depends="nloptr", include="#include <nlopt.h>")
> ver()
[1] 2 7 1
> 

yet the test hard wires 2, 7, and 0 which is bound to fail.

I believe your last commit on the PR #88 that I just merged fixes this issue, is that correct?

Yup. Had to to pass the tests (as I provided 2.7.1). Issue mostly filed to not forget about it and to give you a chance to think about what you want here. The >= may be the best answer -- the minimum version tests is typically done at build time anyway.

I added the >= to major and minor version number as well to pass the unit test for any version >= 2.7.0 in 6e9ec94.