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

The installation of httpuv failed with "configure: error: could not determine ar interface" on AIX7.2 #278

Open
bergen288 opened this issue Jun 1, 2020 · 12 comments

Comments

@bergen288
Copy link

I am trying to install R packages on AIX7.2 server. The installation of httpuv failed with "configure: error: could not determine ar interface".

R CMD INSTALL -l /software/R/site-library httpuv 
* installing *source* package 'httpuv' ...
file 'src/libuv/Makefile.in' has the wrong MD5 checksum
** using staged installation
** libs
make[1]: Entering directory '/software/R/source1/httpuv/src'
make --directory=libuv \
	HAVE_DTRACE=0
make[2]: Entering directory '/software/R/source1/httpuv/src/libuv'
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure CC=gcc -maix64 CFLAGS=-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM    LDFLAGS=-L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib --no-create --no-recursion
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... Could not load program /usr/opt/freeware/bin/rpm:
	Dependent module /opt/freeware/lib64/libintl.a(libintl.so.8) could not be loaded.
	The module has an invalid magic number.
powerpc-ibm-aix7.2.3.0
checking host system type... powerpc-ibm-aix7.2.3.0
checking for gcc... gcc -maix64
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 -maix64 accepts -g... yes
checking for gcc -maix64 option to accept ISO C89... none needed
checking whether gcc -maix64 understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc -maix64... gcc3
checking for gcc -maix64 way to treat warnings as errors... -Werror
checking if gcc -maix64 supports -fvisibility=hidden... yes
checking if gcc -maix64 supports -g flag... yes
checking if gcc -maix64 supports -std=gnu89 flag... yes
checking if gcc -maix64 supports -Wall flag... yes
checking if gcc -maix64 supports -Wextra flag... yes
checking if gcc -maix64 supports -Wno-long-long flag... yes
checking if gcc -maix64 supports -Wno-unused-parameter flag... yes
checking if gcc -maix64 supports -Wstrict-prototypes flag... yes
checking for ar... ar
checking the archiver (ar) interface... unknown
configure: error: could not determine ar interface
make[2]: *** [Makefile:1493: config.status] Error 1
make[2]: Leaving directory '/software/R/source1/httpuv/src/libuv'
make[1]: *** [Makevars:73: libuv/.libs/libuv.a] Error 2
make[1]: Leaving directory '/software/R/source1/httpuv/src'
ERROR: compilation failed for package 'httpuv'
* removing '/software/R/site-library/httpuv'
make: *** [makefile:2: all] Error 1

I have AR & RANLIB defined in my .R/Makevars and you can see they are in /usr/ccs/bin

AR = /usr/ccs/bin/ar 
RANLIB=/usr/ccs/bin/ranlib

Login=root: Line=585 > ls -l ar
-r-xr-xr-x    1 bin      bin           84415 May 07 2018  ar
Login=root: Line=586 > ls -l ranlib
-r-xr-xr-x    1 bin      bin            2126 Sep 21 2015  ranlib
Login=root: Line=587 > pwd
/usr/ccs/bin

Why it can't determine AR interface? Can you please help?

Thanks.

@wch
Copy link
Collaborator

wch commented Jun 1, 2020

FWIW, the problem is with libuv. We don't have access to an AIX machine, but I suggest trying to download and build libuv 1.37.0 on your machine and see if the same thing happens.

@bergen288
Copy link
Author

I already have libuv1.x compiled with cmake in /software/aixtools/libuv-1.x/build. How do I point libuv to this directory?

Thanks.

@wch
Copy link
Collaborator

wch commented Jun 3, 2020

There's probably a way to point it to your already-built copy of libuv, but I don't know offhand how to do it, sorry

What I'm wondering is if you are able to use ./configure and make to build libuv by itself, because that is what httpuv does to build libuv (although there are some additional compiler flags which are passed along from R). If you are able to build that way, that points to one kind of problem; if not, that points to another kind of problem.

What version of httpuv are you trying to install?

@wch
Copy link
Collaborator

wch commented Jun 3, 2020

One more thing: you can use R CMD config to ask R about settings it uses when building packages. For example, on my computer:

$ R CMD config AR
ar

That value for AR gets passed to the libuv configure system here:

&& CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS))

@bergen288
Copy link
Author

The httpuv_1.5.3.1.tar.gz file is untared and I can finish ./configure and make commands successfully in httpuv/src/libuv subdirectory. Below are last few lines at the end of "make". What's the next step to install httpuv package?

CC       src/unix/libuv_la-aix.lo
  CC       src/unix/libuv_la-aix-common.lo
src/unix/aix-common.c: In function 'uv_exepath':
src/unix/aix-common.c:133:50: warning: '%s' directive output may be truncated writing up to 1022 bytes into a region of size 1021 [-Wformat-truncation=]
       snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
                                                  ^~          ~~~~
src/unix/aix-common.c:133:7: note: 'snprintf' output 2 or more bytes (assuming 1024) into a destination of size 1022
       snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CCLD     libuv.la

The AR config gives me the "ar" path defined in R/etc/Makeconf file

R CMD config AR
/usr/ccs/bin/ar -X32_64

@wch
Copy link
Collaborator

wch commented Jun 4, 2020

Normally you would download the tar file, then run:

R CMD install httpuv_1.5.3.1.tar.gz

But in your case, you'd want do do something like:

R CMD install httpuv

Assuming httpuv is the directory where the unzipped package lives.

If running ./configure in the src/libuv directory works, but it fails when you install from the tar file, then there's something about passing along R's various build flags (from the Makevars file that I showed above) that is causing the configure to fail.

@bergen288
Copy link
Author

I tried to install httpuv package with R CMD install httpuv, but it failed at the very last step. My AIX7.2 doesn't have MUTEX so I have "-DARMA_DONT_USE_CXX11_MUTEX" option. It looks like to me the issue might be related with MUTEX. Can you please take a look?

Thanks.

** R
** demo
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'httpuv' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so':
  rtld: 0712-001 Symbol uv_mutex_destroy/software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so was referenced
      from module /software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol uv_cond_destroy was referenced
      from module /software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol uv_mutex_init was referenced
      from module /software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol uv_cond_init was referenced
      from module /software/R/site-library/00LOCK-httpuv/00new/httpuv/libs/httpuv.so(), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol uv_buf_ini
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/software/R/site-library/httpuv'

@bergen288
Copy link
Author

@wch:

Can you tell me what's wrong in my last log?
Thanks.

@wch
Copy link
Collaborator

wch commented Jun 10, 2020

Sorry, I really don't know what the cause of the problem is. Those errors are ones I haven't seen before.

@bergen288
Copy link
Author

The HTTPUV package calls some MUTEX functions such as uv_mutex_destroy and uv_mutex_init. Unfortunately, my AIX7.2 server doesn't have MUTEX and I can't find MUTEX source file to let me compile on AIX server. Do you know where to download MUTEX source file?

@bergen288
Copy link
Author

Does HTTPUV have an older version that won't call MUTEX functions?

@wch
Copy link
Collaborator

wch commented Jun 11, 2020

The uv_mutex_ functions are in libuv. libuv is also written in C, not C++, so the -DARMA_DONT_USE_CXX11_MUTEX probably has no effect on it. I wonder if you're having a problem with linking libuv with the other httpuv code.

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

2 participants