Code Monkey home page Code Monkey logo

Comments (11)

eddelbuettel avatar eddelbuettel commented on August 30, 2024

Please provide more detail around the issue as this is one of the preferred / easier platforms.

Things you can do:

  1. Instll the (required for use of systme nlopt) package libnlopt-dev and reinstall. It should just work.
  2. Otherwise, or else, download the CRAN source package, unpack it in /tmp/ (or alike), and run ./configure. Tell us what it said.
  3. As you are on Ubuntu, learn about the avilability of over 4000 (!!) pre-built binary packages so that you can just say sudo apt-get install r-cran-nloptr. The fourth paragraph at the top of https://cloud.r-project.org/bin/linux/ubuntu/README.html has more, and there are other resources to google.

from nloptr.

eddelbuettel avatar eddelbuettel commented on August 30, 2024

For completeness:

  1. CRAN has no issues: https://cloud.r-project.org/web/checks/check_results_nloptr.html (the two macOS errors seem local/spurious/permissions based)
  2. When building from source, you must ensure other C++ parts in the toolchain, here Rcpp, are built consistently. If you got a prebuilt Rcpp, it may help to first install Rcpp from source and then install nloptr.

from nloptr.

comatrion avatar comatrion commented on August 30, 2024

I've moved to a clean Dockerfile built on Alpine 3.10.3 and still seeing an error.

Here's a log of actions including the output of ./configure log

Other things tried:

  1. installing nlopt first
  2. install.packages("nloptr")
  3. installing Rcpp first

from nloptr.

eddelbuettel avatar eddelbuettel commented on August 30, 2024

Idea One

Alpine famously does not offer full POSIX semantics. Do you know if nlopt works there?

Old debugging rule: "if it doesn't work yet, keep modifying". So try Ubuntu LTS or a Debian image. What you add in R is order of magnitude largers than any Alpine difference anyway.

And then you may know what causes it so maybe you want to work on Alpine compatibility first.

Idea Two

Also, check the logs of how nlopt is not found. Maybe you simply miss pkg-config. Details matter.

from nloptr.

comatrion avatar comatrion commented on August 30, 2024

Idea 1

I downloaded and installed nlopt from https://github.com/stevengj/nlopt v2.6.1 into my Alpine instance. Steps here.

I can compile and run the nlopt tutorial program program, with output

/tmp # ./test
found minimum at f(0.333333,0.296296) = 0.5443310474

in agreement with https://nlopt.readthedocs.io/en/latest/NLopt_Tutorial

So I am thinking, there is nothing that should prevent nloptr installing on Alpine.

However if I now try

R -e 'install.packages("nloptr", repos="https://cloud.r-project.org")'

I get the much the same error as before

libtool: link: false cru .libs/libutil.a .libs/mt19937ar.o .libs/sobolseq.o .libs/timer.o .libs/stop.o .libs/redblack.o .libs/qsort_r.o .libs/rescale.o 
make[2]: *** [Makefile:371: libutil.la] Error 1
make[2]: Leaving directory '/tmp/RtmpHQpmAv/R.INSTALL33c932b61fe1/nloptr/src/nlopt_src/util'
make[1]: *** [Makefile:574: all-recursive] Error 1
make[1]: Leaving directory '/tmp/RtmpHQpmAv/R.INSTALL33c932b61fe1/nloptr/src/nlopt_src'
make: *** [Makefile:438: all] Error 2
ERROR: configuration failed for package ‘nloptr’
* removing ‘/opt/conda/lib/R/library/nloptr’
* restoring previous ‘/opt/conda/lib/R/library/nloptr’

The downloaded source packages are in
	‘/tmp/Rtmpb549cE/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("nloptr", repos = "https://cloud.r-project.org") :
  installation of package ‘nloptr’ had non-zero exit status

Idea 2

Is it obvious from the error that the R package installer is NOT finding nlopt.h?
The error doesn't suggest that to me, rather that there was some linking problem.

from nloptr.

eddelbuettel avatar eddelbuettel commented on August 30, 2024

You are jumping over details you actually need to look at. Don't do install.packages(). Download the tar.gz. Unpack it. Run ./configure by hand. Is nlopt found when installed? THAT is the question.

Also, I see conda URLs in there. I hope you are not mixing conda and non-conda? If you are using conda, why don't you install the conda package for nloptr? (Asumming it exists...)

from nloptr.

beew avatar beew commented on August 30, 2024

I also encounter problem trying to upgrade from 1.2.1 to 1.2.2. with update.packages()

> update.packages()
nloptr :
 Version 1.2.1 installed in /usr/lib/R/library 
 Version 1.2.2 available at https://cloud.r-project.org
Update? (Yes/no/cancel) y
trying URL 'https://cloud.r-project.org/src/contrib/nloptr_1.2.2.tar.gz'
Content type 'application/x-gzip' length 2450959 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++11 accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
configure: Need to configure and build NLopt
configure: Starting to install library to /tmp/RtmpwnZ0OZ/R.INSTALL1f3814defe31/nloptr/src/nlopt_src
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether gcc -std=gnu99 understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc -std=gnu99... gcc3
checking for gcc -std=gnu99 option to accept ISO C99... none needed
checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) none needed
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++11 accepts -g... yes
checking dependency style of g++ -std=gnu++11... gcc3
checking how to run the C++ preprocessor... g++ -std=gnu++11 -E
checking for ld used by g++ -std=gnu++11... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ -std=gnu++11 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ -std=gnu++11 option to produce PIC... -fPIC -DPIC
checking if g++ -std=gnu++11 PIC flag -fPIC -DPIC works... yes
checking if g++ -std=gnu++11 static flag -static works... yes
checking if g++ -std=gnu++11 supports -c -o file.o... yes
checking if g++ -std=gnu++11 supports -c -o file.o... (cached) yes
checking whether the g++ -std=gnu++11 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for unistd.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdint.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for C thread-local keyword... __thread
checking size of unsigned int... 4
checking size of unsigned long... 8
checking for uint32_t... yes
checking for sin in -lm... yes
checking for BSDgettimeofday... no
checking for gettimeofday... yes
checking for time... yes
checking for qsort_r... yes
checking for getpid... yes
checking for gettid syscall... yes
checking for isnan... yes
checking for isinf... yes
checking for copysign... yes
checking for mkoctfile... mkoctfile
checking for mex... mex
checking for working HUGE_VAL... ok
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating nlopt.pc
config.status: creating api/Makefile
config.status: creating util/Makefile
config.status: creating octave/Makefile
config.status: creating direct/Makefile
config.status: creating cdirect/Makefile
config.status: creating stogo/Makefile
config.status: creating praxis/Makefile
config.status: creating luksan/Makefile
config.status: creating crs/Makefile
config.status: creating mlsl/Makefile
config.status: creating mma/Makefile
config.status: creating cobyla/Makefile
config.status: creating newuoa/Makefile
config.status: creating neldermead/Makefile
config.status: creating auglag/Makefile
config.status: creating bobyqa/Makefile
config.status: creating isres/Makefile
config.status: creating slsqp/Makefile
config.status: creating esch/Makefile
config.status: creating test/Makefile
config.status: creating swig/Makefile
config.status: creating swig/nlopt.scm
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make  all-recursive
make[1]: Entering directory '/tmp/RtmpwnZ0OZ/R.INSTALL1f3814defe31/nloptr/src/nlopt_src'
Making all in util
make[2]: Entering directory '/tmp/RtmpwnZ0OZ/R.INSTALL1f3814defe31/nloptr/src/nlopt_src/util'
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT mt19937ar.lo -MD -MP -MF .deps/mt19937ar.Tpo -c -o mt19937ar.lo mt19937ar.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT mt19937ar.lo -MD -MP -MF .deps/mt19937ar.Tpo -c mt19937ar.c  -fPIC -DPIC -o .libs/mt19937ar.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT mt19937ar.lo -MD -MP -MF .deps/mt19937ar.Tpo -c mt19937ar.c -o mt19937ar.o >/dev/null 2>&1
mv -f .deps/mt19937ar.Tpo .deps/mt19937ar.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT sobolseq.lo -MD -MP -MF .deps/sobolseq.Tpo -c -o sobolseq.lo sobolseq.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT sobolseq.lo -MD -MP -MF .deps/sobolseq.Tpo -c sobolseq.c  -fPIC -DPIC -o .libs/sobolseq.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT sobolseq.lo -MD -MP -MF .deps/sobolseq.Tpo -c sobolseq.c -o sobolseq.o >/dev/null 2>&1
mv -f .deps/sobolseq.Tpo .deps/sobolseq.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c -o timer.lo timer.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.c  -fPIC -DPIC -o .libs/timer.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT timer.lo -MD -MP -MF .deps/timer.Tpo -c timer.c -o timer.o >/dev/null 2>&1
mv -f .deps/timer.Tpo .deps/timer.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT stop.lo -MD -MP -MF .deps/stop.Tpo -c -o stop.lo stop.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT stop.lo -MD -MP -MF .deps/stop.Tpo -c stop.c  -fPIC -DPIC -o .libs/stop.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT stop.lo -MD -MP -MF .deps/stop.Tpo -c stop.c -o stop.o >/dev/null 2>&1
mv -f .deps/stop.Tpo .deps/stop.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT redblack.lo -MD -MP -MF .deps/redblack.Tpo -c -o redblack.lo redblack.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT redblack.lo -MD -MP -MF .deps/redblack.Tpo -c redblack.c  -fPIC -DPIC -o .libs/redblack.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT redblack.lo -MD -MP -MF .deps/redblack.Tpo -c redblack.c -o redblack.o >/dev/null 2>&1
mv -f .deps/redblack.Tpo .deps/redblack.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT qsort_r.lo -MD -MP -MF .deps/qsort_r.Tpo -c -o qsort_r.lo qsort_r.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT qsort_r.lo -MD -MP -MF .deps/qsort_r.Tpo -c qsort_r.c  -fPIC -DPIC -o .libs/qsort_r.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT qsort_r.lo -MD -MP -MF .deps/qsort_r.Tpo -c qsort_r.c -o qsort_r.o >/dev/null 2>&1
mv -f .deps/qsort_r.Tpo .deps/qsort_r.Plo
/bin/bash ../libtool  --tag=CC   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT rescale.lo -MD -MP -MF .deps/rescale.Tpo -c -o rescale.lo rescale.c
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT rescale.lo -MD -MP -MF .deps/rescale.Tpo -c rescale.c  -fPIC -DPIC -o .libs/rescale.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -I../api -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT rescale.lo -MD -MP -MF .deps/rescale.Tpo -c rescale.c -o rescale.o >/dev/null 2>&1
mv -f .deps/rescale.Tpo .deps/rescale.Plo
/bin/bash ../libtool  --tag=CC   --mode=link g++ -std=gnu++11  -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs   -o libutil.la  mt19937ar.lo sobolseq.lo timer.lo stop.lo redblack.lo qsort_r.lo rescale.lo  -lm 
libtool: link: ar cru .libs/libutil.a .libs/mt19937ar.o .libs/sobolseq.o .libs/timer.o .libs/stop.o .libs/redblack.o .libs/qsort_r.o .libs/rescale.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ar: .libs/mt19937ar.o: plugin needed to handle lto object
ar: .libs/sobolseq.o: plugin needed to handle lto object
ar: .libs/timer.o: plugin needed to handle lto object
ar: .libs/stop.o: plugin needed to handle lto object
ar: .libs/redblack.o: plugin needed to handle lto object
ar: .libs/qsort_r.o: plugin needed to handle lto object
ar: .libs/rescale.o: plugin needed to handle lto object
libtool: link: ranlib .libs/libutil.a
ranlib: mt19937ar.o: plugin needed to handle lto object
ranlib: sobolseq.o: plugin needed to handle lto object
ranlib: timer.o: plugin needed to handle lto object
ranlib: stop.o: plugin needed to handle lto object
ranlib: redblack.o: plugin needed to handle lto object
ranlib: qsort_r.o: plugin needed to handle lto object
ranlib: rescale.o: plugin needed to handle lto object
libtool: link: ( cd ".libs" && rm -f "libutil.la" && ln -s "../libutil.la" "libutil.la" )
g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..  -I../api   -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -MT redblack_test.o -MD -MP -MF .deps/redblack_test.Tpo -c -o redblack_test.o redblack_test.c
mv -f .deps/redblack_test.Tpo .deps/redblack_test.Po
/bin/bash ../libtool  --tag=CC   --mode=link g++ -std=gnu++11  -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs   -o redblack_test redblack_test.o libutil.la -lm 
libtool: link: g++ -std=gnu++11 -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -Wno-unused-local-typedefs -o redblack_test redblack_test.o  ./.libs/libutil.a -lm
/tmp/ccdBBJZZ.ltrans0.ltrans.o: In function `main':
<artificial>:(.text.startup+0x4c): undefined reference to `rb_tree_init'
<artificial>:(.text.startup+0x86): undefined reference to `rb_tree_check'
<artificial>:(.text.startup+0xce): undefined reference to `rb_tree_insert'
<artificial>:(.text.startup+0x1a7): undefined reference to `rb_tree_find'
<artificial>:(.text.startup+0x201): undefined reference to `rb_tree_min'
<artificial>:(.text.startup+0x23c): undefined reference to `rb_tree_succ'
<artificial>:(.text.startup+0x2ae): undefined reference to `rb_tree_min'
<artificial>:(.text.startup+0x2c0): undefined reference to `rb_tree_max'
<artificial>:(.text.startup+0x2f9): undefined reference to `rb_tree_pred'
<artificial>:(.text.startup+0x350): undefined reference to `rb_tree_find'
<artificial>:(.text.startup+0x377): undefined reference to `rb_tree_resort'
<artificial>:(.text.startup+0x38a): undefined reference to `rb_tree_check'
<artificial>:(.text.startup+0x4d1): undefined reference to `rb_tree_find_le'
<artificial>:(.text.startup+0x4e3): undefined reference to `rb_tree_find_gt'
<artificial>:(.text.startup+0x4f0): undefined reference to `rb_tree_min'
<artificial>:(.text.startup+0x56e): undefined reference to `rb_tree_succ'
<artificial>:(.text.startup+0x62e): undefined reference to `rb_tree_find'
<artificial>:(.text.startup+0x644): undefined reference to `rb_tree_remove'
<artificial>:(.text.startup+0x662): undefined reference to `rb_tree_check'
<artificial>:(.text.startup+0x68b): undefined reference to `rb_tree_destroy'
collect2: error: ld returned 1 exit status
Makefile:383: recipe for target 'redblack_test' failed
make[2]: *** [redblack_test] Error 1
make[2]: Leaving directory '/tmp/RtmpwnZ0OZ/R.INSTALL1f3814defe31/nloptr/src/nlopt_src/util'
Makefile:574: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/RtmpwnZ0OZ/R.INSTALL1f3814defe31/nloptr/src/nlopt_src'
Makefile:438: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: configuration failed for package ‘nloptr’
* removing ‘/usr/lib/R/library/nloptr’
* restoring previous ‘/usr/lib/R/library/nloptr’

The downloaded source packages are in
	‘/tmp/Rtmp4dCAos/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘nloptr’ had non-zero exit status

R 3.6.3 on Ubuntu 16.04

from nloptr.

eddelbuettel avatar eddelbuettel commented on August 30, 2024

We see

checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no

Were you using a system libnlopt-dev before? It saves you the time to download and build nlopt. (Then again, you are on a soon-to-be-four-year-old OS that is soon to be twice-obsolete so the version there may not work.)

It all works swimmingly here with Ubuntu 19.10 (where I also use R 3.6.3):

edd@rob:~$ install.r nloptr     ## simple wrapper script from littler aka r-cran-littler
trying URL 'https://cloud.r-project.org/src/contrib/nloptr_1.2.2.tar.gz'
Content type 'application/x-gzip' length 2450959 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether ccache g++ accepts -g... yes
checking how to run the C++ preprocessor... ccache g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether ccache g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... yes
checking nlopt.h presence... yes
checking for nlopt.h... yes
configure: Now testing for NLopt version 2.4.0 or greater.
configure: Suitable NLopt library found.
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/PkgFlags.R
** libs
ccache g++ -I"/usr/share/R/include" -DNDEBUG     -fpic  -g -O3 -Wall -pipe -pedantic  -c dummy.cpp -o dummy.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fpic  -g -O3 -Wall -pipe -pedantic  -std=gnu99 -c init_nloptr.c -o init_nloptr.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fpic  -g -O3 -Wall -pipe -pedantic  -std=gnu99 -c nloptr.c -o nloptr.o
ccache g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o nloptr.so dummy.o init_nloptr.o nloptr.o -lnlopt -lm -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-nloptr/00new/nloptr/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (nloptr)

The downloaded source packages are in
	‘/tmp/downloaded_packages’
edd@rob:~$ 

from nloptr.

beew avatar beew commented on August 30, 2024

Somehow libnlopt-dev wasn't installed (might have been autoremoved at some point) Installed it and it works now. Thanks.

from nloptr.

eddelbuettel avatar eddelbuettel commented on August 30, 2024

Yes indeed -- autoremove will purge it because it sees no other system package using it :-/

from nloptr.

astamm avatar astamm commented on August 30, 2024

We just released 2.0.0. Hopefully, you should be good now. Can you please try it?

from nloptr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.