Hi fellows, I try to link nlopt with Rcpp/RcppArmadillo packages in R. So I follow the instructions on nloptr website ( https://github.com/jyypma/nloptr/blob/master/INSTALL.windows) to first install nlopt from source on windows. However, I encountered the following errors in make. Any help is very much appreciated! Thanks! make all-recursive make[1]: Entering directory `/c/temp/nlopt-2.4.2' Making all in util make[2]: Entering directory `/c/temp/nlopt-2.4.2/util' /bin/sh ../libtool --tag=CC --mode=compile c:/Rtools/mingw_64/bin/g++ -DHAVE_ CONFIG_H -I. -I.. -I../api -g -O2 -MT mt19937ar.lo -MD -MP -MF .deps/mt19937a r.Tpo -c -o mt19937ar.lo mt19937ar.c libtool: compile: c:/Rtools/mingw_64/bin/g++ -DHAVE_CONFIG_H -I. -I.. -I../api -g -O2 -MT mt19937ar.lo -MD -MP -MF .deps/mt19937ar.Tpo -c mt19937ar.c -o mt1993 7ar.o mt19937ar.c:62:6: error: #error No 32-bit unsigned integer type # error No 32-bit unsigned integer type ^ mt19937ar.c:76:8: error: 'THREADLOCAL' does not name a type static THREADLOCAL uint32_t mt[N]; /* the array for the state vector */ ^ mt19937ar.c:77:8: error: 'THREADLOCAL' does not name a type static THREADLOCAL int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ ^ mt19937ar.c: In function 'void nlopt_init_genrand(long unsigned int)': mt19937ar.c:82:5: error: 'mt' was not declared in this scope mt[0]= s & 0xffffffffUL; ^ mt19937ar.c:83:10: error: 'mti' was not declared in this scope for (mti=1; mti<N; mti++) { ^ mt19937ar.c: At global scope: mt19937ar.c:96:8: error: 'uint32_t' does not name a type static uint32_t nlopt_genrand_int32(void) ^ mt19937ar.c: In function 'double nlopt_genrand_res53()': mt19937ar.c:196:5: error: 'uint32_t' was not declared in this scope uint32_t a=nlopt_genrand_int32()>>5, b=nlopt_genrand_int32()>>6; ^ mt19937ar.c:197:12: error: 'a' was not declared in this scope return(a*67108864.0+b)*(1.0/9007199254740992.0); ^ mt19937ar.c:197:25: error: 'b' was not declared in this scope return(a*67108864.0+b)*(1.0/9007199254740992.0); ^ mt19937ar.c: In function 'int nlopt_iurand(int)': mt19937ar.c:211:33: error: 'nlopt_genrand_int32' was not declared in this scope return(nlopt_genrand_int32() % n); ^ make[2]: *** [mt19937ar.lo] Error 1 make[2]: Leaving directory `/c/temp/nlopt-2.4.2/util' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/c/temp/nlopt-2.4.2' make: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170826/96d71c30/attachment.html>
[Rcpp-devel] installation of nlopt on windows from source
3 messages · althu07, Dirk Eddelbuettel
Maybe try one of two things a) Use this advice to build as 64bit: https://github.com/jyypma/nloptr/blob/master/INSTALL.windows#L65 b) Use this advice to avoid all this trouble and a use a prebuilt version https://github.com/jyypma/nloptr/blob/master/INSTALL.windows#L72 But I don't really know as I work mostly on another platform... Dirk
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Hi Dirk, Thank you so much for your reply. The error message that I had is from a bash script where the 64 bit option is used. I also tried the prebuilt version. That didn't work out either when I attempted to link nlopt with Rcpp in my own package. I was able to build nlopt from source on Mac OS and have linked it with Rcpp successfully there. So I think it is more likely that the prebuilt nlopt is not working correctly.
On Sat, Aug 26, 2017 at 6:02 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
Maybe try one of two things a) Use this advice to build as 64bit: https://github.com/jyypma/nloptr/blob/master/INSTALL.windows#L65 b) Use this advice to avoid all this trouble and a use a prebuilt version https://github.com/jyypma/nloptr/blob/master/INSTALL.windows#L72 But I don't really know as I work mostly on another platform... Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170826/25373d8f/attachment.html>