Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.0] fails to build on R 3.6.0 #105

Closed
tuxmaster5000 opened this issue Feb 1, 2022 · 8 comments
Closed

[2.0.0] fails to build on R 3.6.0 #105

tuxmaster5000 opened this issue Feb 1, 2022 · 8 comments

Comments

@tuxmaster5000
Copy link

The build fails with:

[ 90%] Building CXX object CMakeFiles/nlopt.dir/src/algs/ags/solver.cc.o
[ 92%] Building CXX object CMakeFiles/nlopt.dir/src/algs/ags/local_optimizer.cc.o
[ 94%] Building CXX object CMakeFiles/nlopt.dir/src/algs/ags/ags.cc.o
[ 96%] Linking CXX static library libnlopt.a
Error running link command: No such file or directory
make[2]: *** [libnlopt.a] Error 2
make[1]: *** [CMakeFiles/nlopt.dir/all] Error 2
gmake: *** [all] Error 2

build.log

I think the config step don't resect the fact, that R 3.6.0 don't have variables AR and RANLIB. And so the cmake defaults are overwritten with invalid values.
I have attached an full build log.

@tuxmaster5000
Copy link
Author

building the bundled nlopt-2.7.1 works well.

cmake3 -DBUILD_SHARED_LIBS=OFF ..
 81%] Building CXX object CMakeFiles/nlopt.dir/src/algs/ags/local_optimizer.cc.o
[ 82%] Building CXX object CMakeFiles/nlopt.dir/src/algs/ags/ags.cc.o
[ 84%] Linking CXX static library libnlopt.a
[ 87%] Built target nlopt
Scanning dependencies of target t_tutorial
Scanning dependencies of target testopt
[ 89%] Building CXX object test/CMakeFiles/t_tutorial.dir/t_tutorial.cxx.o
[ 91%] Building C object test/CMakeFiles/testopt.dir/testfuncs.c.o
[ 93%] Building C object test/CMakeFiles/testopt.dir/testopt.c.o
[ 94%] Building C object test/CMakeFiles/testopt.dir/__/src/util/timer.c.o
[ 96%] Building C object test/CMakeFiles/testopt.dir/__/src/util/mt19937ar.c.o
[ 98%] Linking CXX executable testopt
[ 98%] Built target testopt
[100%] Linking CXX executable t_tutorial
[100%] Built target t_tutorial

So the problem is the overwritten cmake variables.

@tuxmaster5000
Copy link
Author

Of course the lib will work.
test.log

@astamm
Copy link
Owner

astamm commented Feb 1, 2022

Thanks for reporting this. I will provide a solution in the next release, either by requiring R >= 4.0.x or by setting AR and RANLIB only if the detected version of R is >= 4.0.x. I will let you know if I implement the latter if you are willing to test if it works on your system.

@tuxmaster5000
Copy link
Author

Thanks, yes of course I can test it.

@tuxmaster5000
Copy link
Author

Here is the working patch, which can you use as an reference.
r.patch.txt

@astamm
Copy link
Owner

astamm commented Feb 1, 2022

Would you mind contributing it as a PR please?

@tuxmaster5000
Copy link
Author

I will try it tomorrow, because I must look how to detect the R major version.

@eddelbuettel
Copy link
Contributor

because I must look how to detect the R major version.

> getRversion()
[1] ‘4.1.2> getRversion() > "3.6.0"
[1] TRUE
> getRversion() > "4.2.0"
[1] FALSE
> 

To a first appromixation, I wouldn't though. We are at 4.1.2 and 2 1/2 months away from R 4.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants