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

httpuv 1.6.4 compile failure on macOS Monterey 12.0.1 #325

Closed
mjsteinbaugh opened this issue Dec 16, 2021 · 8 comments
Closed

httpuv 1.6.4 compile failure on macOS Monterey 12.0.1 #325

mjsteinbaugh opened this issue Dec 16, 2021 · 8 comments

Comments

@mjsteinbaugh
Copy link

mjsteinbaugh commented Dec 16, 2021

Hi, I'm hitting a compilation issue with httpuv 1.6.4.

Here's my current R configuration, for reference:

I'm attempting to use fxcoudert's GNU Fortran 8.2 with CRAN R 4.1.2 (Homebrew cask).

Not totally sure how to debug this further and whether there are some compiler flags I should set differently. Any help is much appreciated!

> install.packages("httpuv")
Installing package into ‘/opt/koopa/app/r-packages/4.1’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
       binary source needs_compilation
httpuv  1.6.3  1.6.4              TRUE

installing the source package ‘httpuv’

trying URL 'https://cloud.r-project.org/src/contrib/httpuv_1.6.4.tar.gz'
Content type 'application/x-gzip' length 1814842 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

* installing *source* package ‘httpuv’ ...
** package ‘httpuv’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c RcppExports-legacy.cpp -o RcppExports-legacy.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c RcppExports.cpp -o RcppExports.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c callback.cpp -o callback.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c callbackqueue.cpp -o callbackqueue.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c filedatasource-unix.cpp -o filedatasource-unix.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c filedatasource-win.cpp -o filedatasource-win.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c fs.cpp -o fs.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c gzipdatasource.cpp -o gzipdatasource.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c http.cpp -o http.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c httprequest.cpp -o httprequest.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c httpresponse.cpp -o httpresponse.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c httpuv.cpp -o httpuv.o
/usr/local/gfortran/bin/gcc -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c md5.c -o md5.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c mime.cpp -o mime.o
/usr/local/gfortran/bin/gcc -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -c set_invalid_parameter.c -o set_invalid_parameter.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c socket.cpp -o socket.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c staticpath.cpp -o staticpath.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c thread.cpp -o thread.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c timegm.cpp -o timegm.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c utils.cpp -o utils.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c uvutil.cpp -o uvutil.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c webapplication.cpp -o webapplication.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c websockets-base.cpp -o websockets-base.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c websockets-hixie76.cpp -o websockets-hixie76.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c websockets-hybi03.cpp -o websockets-hybi03.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c websockets-ietf.cpp -o websockets-ietf.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c websockets.cpp -o websockets.o
/usr/local/gfortran/bin/g++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -Ilibuv/include -pthread -I'/opt/koopa/app/r-packages/4.1/Rcpp/include' -I'/opt/koopa/app/r-packages/4.1/later/include' -I/usr/local/include -I/usr/local/gfortran/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -O3 -Wall -Wno-unused -g -pedantic -pipe -mtune=native -c winutils.cpp -o winutils.o
cp -p -f libuv/m4/lt_obsolete.m4 libuv/m4/lt~obsolete.m4
cd libuv; \
if ! command -v automake >/dev/null 2>&1 ; then \
	echo "automake not found. Touching files so configure will not try to run automake."; \
	touch aclocal.m4; \
	touch -r aclocal.m4 configure Makefile.in; \
else \
	echo "automake found. Running autogen.sh."; \
	sh autogen.sh; \
fi; \
chmod +x configure; \
CC="/usr/local/gfortran/bin/gcc" CFLAGS="-Wall -g -O2  -O3 -Wall -g -pedantic -pipe -mtune=native -std=gnu99 -fPIC " AR="ar" RANLIB="ranlib" LDFLAGS="-L/usr/local/lib -L/usr/local/gfortran/lib -Wl,-rpath,/usr/local/gfortran/lib" ./configure "--quiet"
automake found. Running autogen.sh.
+ glibtoolize --copy
+ aclocal -I m4
+ autoconf
configure.ac:38: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:38: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:38: the top level
+ automake --add-missing --copy
rm: cannot remove 'conftest.dSYM': Is a directory
rm: cannot remove 'conftest.dSYM': Is a directory
rm: cannot remove 'conftest.dSYM': Is a directory
rm: cannot remove 'conftest.dSYM': Is a directory
make --directory=libuv \
	HAVE_DTRACE=0
make[1]: Entering directory '/private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpJiGX5N/R.INSTALL175df57ff7856/httpuv/src/libuv'
  CC       src/libuv_la-fs-poll.lo
  CC       src/libuv_la-idna.lo
  CC       src/libuv_la-inet.lo
  CC       src/libuv_la-random.lo
  CC       src/libuv_la-strscpy.lo
  CC       src/libuv_la-threadpool.lo
  CC       src/libuv_la-timer.lo
  CC       src/libuv_la-uv-data-getter-setters.lo
  CC       src/libuv_la-uv-common.lo
  CC       src/libuv_la-version.lo
  CC       src/unix/libuv_la-async.lo
  CC       src/unix/libuv_la-core.lo
src/unix/core.c: In function ‘uv__close_nocancel’:
src/unix/core.c:521:33: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 # pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/unix/core.c:523:14: warning: '$' in identifier or number
   extern int close$NOCANCEL(int);
              ^
  CC       src/unix/libuv_la-dl.lo
  CC       src/unix/libuv_la-fs.lo
src/unix/fs.c: In function ‘uv__mkostemp_initonce’:
src/unix/fs.c:280:18: warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
   uv__mkostemp = (int (*)(char*, int)) dlsym(RTLD_DEFAULT, "mkostemp");
                  ^
  CC       src/unix/libuv_la-getaddrinfo.lo
  CC       src/unix/libuv_la-getnameinfo.lo
  CC       src/unix/libuv_la-loop-watcher.lo
  CC       src/unix/libuv_la-loop.lo
  CC       src/unix/libuv_la-pipe.lo
  CC       src/unix/libuv_la-poll.lo
  CC       src/unix/libuv_la-process.lo
  CC       src/unix/libuv_la-random-devurandom.lo
  CC       src/unix/libuv_la-signal.lo
  CC       src/unix/libuv_la-stream.lo
In file included from src/unix/stream.c:23:
src/unix/stream.c: In function ‘uv__stream_try_select’:
src/unix/internal.h:85:44: warning: operand of ?: changes signedness from ‘int’ to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare]
   ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a))
                                            ^~~
src/unix/stream.c:333:14: note: in expansion of macro ‘ROUND_UP’
   sread_sz = ROUND_UP(max_fd + 1, sizeof(uint32_t) * NBBY) / NBBY;
              ^~~~~~~~
  CC       src/unix/libuv_la-tcp.lo
  CC       src/unix/libuv_la-thread.lo
  CC       src/unix/libuv_la-tty.lo
  CC       src/unix/libuv_la-udp.lo
  CC       src/unix/libuv_la-bsd-ifaddrs.lo
  CC       src/unix/libuv_la-darwin.lo
  CC       src/unix/libuv_la-darwin-proctitle.lo
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:29,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:39,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7: error: variably modified ‘bytes’ at file scope
  char bytes[kAuthorizationExternalFormLength];
       ^~~~~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:21,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h:391:15: error: expected identifier or ‘(’ before ‘^’ token
 typedef void (^CGPathApplyBlock)(const CGPathElement * element);
               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h:393:53: error: unknown type name ‘CGPathApplyBlock’
 CG_EXTERN void CGPathApplyWithBlock(CGPathRef path, CGPathApplyBlock CF_NOESCAPE block)
                                                     ^~~~~~~~~~~~~~~~
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:14,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h:15,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h:16,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:23,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h:103:15: error: expected identifier or ‘(’ before ‘^’ token
 typedef bool (^CGPDFArrayApplierBlock)(size_t index,
               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h:113:5: error: unknown type name ‘CGPDFArrayApplierBlock’; did you mean ‘CFArrayApplierFunction’?
     CGPDFArrayApplierBlock cg_nullable block, void * __nullable info)
     ^~~~~~~~~~~~~~~~~~~~~~
     CFArrayApplierFunction
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h:15,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h:16,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:23,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:116:15: error: expected identifier or ‘(’ before ‘^’ token
 typedef bool (^CGPDFDictionaryApplierBlock)(const char * key,
               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h:126:5: error: unknown type name ‘CGPDFDictionaryApplierBlock’; did you mean ‘CGPDFDictionaryApplierFunction’?
     CGPDFDictionaryApplierBlock cg_nullable block, void * __nullable info)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     CGPDFDictionaryApplierFunction
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:23,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:39,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h:380:27: error: expected ‘)’ before ‘^’ token
  bool                    (^ _Nullable registrationHandler)(CFArrayRef errors, bool done) ) CT_AVAILABLE(ios(13.0)) API_UNAVAILABLE(macos, watchos, tvos);
                           ^
                           )
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h:20,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:47,
                 from src/unix/darwin-proctitle.c:34:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h:42:15: error: expected identifier or ‘(’ before ‘^’ token
 typedef void (^CGImageSourceAnimationBlock)(size_t index, CGImageRef image, bool* stop);
               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h:50:107: error: unknown type name ‘CGImageSourceAnimationBlock’; did you mean ‘CGImageAnimationStatus’?
 IMAGEIO_EXTERN OSStatus CGAnimateImageAtURLWithBlock(CFURLRef url, CFDictionaryRef _iio_Nullable options, CGImageSourceAnimationBlock block) IMAGEIO_AVAILABLE_STARTING(10.15, 13.0);
                                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                           CGImageAnimationStatus
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h:58:108: error: unknown type name ‘CGImageSourceAnimationBlock’; did you mean ‘CGImageAnimationStatus’?
 IMAGEIO_EXTERN OSStatus CGAnimateImageDataWithBlock(CFDataRef data, CFDictionaryRef _iio_Nullable options, CGImageSourceAnimationBlock block) IMAGEIO_AVAILABLE_STARTING(10.15, 13.0);
                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                            CGImageAnimationStatus
make[1]: *** [Makefile:2865: src/unix/libuv_la-darwin-proctitle.lo] Error 1
make[1]: Leaving directory '/private/var/folders/l1/8y8sjzmn15v49jgrqglghcfr0000gn/T/RtmpJiGX5N/R.INSTALL175df57ff7856/httpuv/src/libuv'
make: *** [Makevars:87: libuv/.libs/libuv.a] Error 2
ERROR: compilation failed for package ‘httpuv’
* removing ‘/opt/koopa/app/r-packages/4.1/httpuv’
* restoring previous ‘/opt/koopa/app/r-packages/4.1/httpuv’
Warning in install.packages("httpuv") :
  installation of package ‘httpuv’ had non-zero exit status
@mjsteinbaugh
Copy link
Author

This seems potentially related #260

@mjsteinbaugh
Copy link
Author

mjsteinbaugh commented Dec 16, 2021

As recommended in that other thread, Rcpp, fs, and igraph build from source with this compiler configuration.

CC:

❯ "$(R CMD config CC)" -v

Using built-in specs.
COLLECT_GCC=/usr/local/gfortran/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
Target: x86_64-apple-darwin18
Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
gcc version 8.2.0 (GCC)

CXX:

❯ "$(R CMD config CXX)" -v

Using built-in specs.
COLLECT_GCC=/usr/local/gfortran/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
Target: x86_64-apple-darwin18
Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
gcc version 8.2.0 (GCC)

@mjsteinbaugh
Copy link
Author

mjsteinbaugh commented Dec 16, 2021

Also for reference, these Apple clang compiler settings work:

CC = clang -mmacosx-version-min=10.13
CFLAGS = -Wall -g -O2 $(LTO)
CPPFLAGS = -I/usr/local/include
CXX = clang++ -mmacosx-version-min=10.13 -std=gnu++14
CXXFLAGS = -Wall -g -O2 $(LTO)
CXX11 = clang++ -mmacosx-version-min=10.13
CXX11FLAGS = -Wall -g -O2 $(LTO)
CXX14 = clang++ -mmacosx-version-min=10.13
CXX14FLAGS = -Wall -g -O2 $(LTO)
CXX17 = clang++ -mmacosx-version-min=10.13
CXX17FLAGS = -Wall -g -O2 $(LTO)
CXX20 = clang++ -mmacosx-version-min=10.13
CXX20FLAGS = -Wall -g -O2 $(LTO)
FC = gfortran -mmacosx-version-min=10.13
FCFLAGS = -Wall -g -O2 $(LTO_FC)
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
LDFLAGS = -L/usr/local/lib

But I'd like to use fxcoudert's GNU Fortran build instead if possible, since it has better compile support for a number of data science / bioinformatics packages.

@wch
Copy link
Collaborator

wch commented Dec 16, 2021

It looks like it's failing when building libuv. Libuv is a very commonly used library (it's used in node.js), so it seems likely that someone would have gotten it to compile using your toolchain.

In httpuv 1.6.4, we changed things so that when building libuv, it tries to run automake before configure, as per the official libuv build instructions: https://github.com/libuv/libuv#build-instructions

In previous versions, it did not run automake, but that sometimes caused other problems. If you try to install httpuv 1.6.3 from source, what happens?

@mjsteinbaugh
Copy link
Author

Thanks I'll take a look and get back to you. Is there a way to point to libuv already installed with Homebrew to avoid this step?

@wch
Copy link
Collaborator

wch commented Dec 16, 2021

In order to link to the already-included libuv, I think you'd need to modify src/Makevars so that instead of this:

PKG_LIBS = ./libuv/.libs/libuv.a ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread

It would have this:

PKG_LIBS = -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread

And then also remove the stuff for building the local copy of libuv. Here's a rough attempt at what it would look like (I have not tested this):

## Use the R_HOME indirection to support installations of multiple R version

# Use C++11 if available
CXX_STD=CXX11

UNAME := $(shell uname)

PKG_LIBS = -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread

ifeq ($(UNAME), Darwin)
PKG_LIBS += -framework CoreServices
endif

ifeq ($(UNAME), SunOS)
PKG_LIBS += -lkstat -lsendfile -lsocket -lxnet
endif
ifeq ($(UNAME), FreeBSD)
PKG_LIBS += -lkvm
endif
ifeq ($(UNAME), OpenBSD)
PKG_LIBS += -lkvm
endif

PKG_CFLAGS = $(C_VISIBILITY) -DSTRICT_R_HEADERS
PKG_CXXFLAGS = $(CXX_VISIBILITY) -DSTRICT_R_HEADERS
PKG_CPPFLAGS = -Ilibuv/include -pthread

$(SHLIB): http-parser/http_parser.o sha1/sha1.o base64/base64.o

clean:
	$(MAKE) --directory=libuv distclean

@zeloff
Copy link

zeloff commented Aug 29, 2022

This works, but it's risky. If you only stop using the packaged libuv at the linking level, there might be a mismatch between the libuv headers #included in the source code, which will still point to the packaged version (e.g. #include "libuv/include/uv.h") and the system-wide library.
To completely drop the packaged libuv you need to change src/Makevars as @wch indicated, also change the PKG_CPPFLAGS, removing the-Ilibuv/include (which will become useless after the next step), and also changing the #includes on the source files on the src folder, to point to the system-wide libuv headers (e.g. changing from #include "libuv/include/uv.h" to #include <uv.h>.
(FWIW, I've just successfully did this with v1.6.3 on OpenBSD)

@jcheng5
Copy link
Member

jcheng5 commented May 22, 2023

Thanks to #368 and #376, httpuv will now use the system-wide libuv. This change is not in the 1.6.11 release we just pushed to CRAN in recent weeks, but should be in the next one.

@jcheng5 jcheng5 closed this as completed May 22, 2023
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

4 participants