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

Installation fails on Alpine Linux #795

Open
bastistician opened this issue Jan 7, 2025 · 2 comments
Open

Installation fails on Alpine Linux #795

bastistician opened this issue Jan 7, 2025 · 2 comments

Comments

@bastistician
Copy link

The configure script decides to download a pre-built binary, but that is linked against glibc not musl, and loading fails with

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'tiledb' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/runner/R-patched/lib/00LOCK-tiledb/00new/tiledb/libs/tiledb.so':
  Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /home/runner/R-patched/lib/00LOCK-tiledb/00new/tiledb/libs/../tiledb/lib/libtiledb.so.2.26)

So I tried to install the R package with --configure-args=--enable-building, but that fails from TileDB's bootstrap script with "cannot find cplusplus compiler", see the log below (note also how configuration ignores that error and proceeds to no avail). The culprit seems to be

cxx_compiler=`which ${CXX}`

when CXX = g++ -std=gnu++17.

Installation log with '--enable-building'
* installing to library '/tmp/user/lib'
* installing *source* package 'tiledb' ...
** package 'tiledb' 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 the compiler supports GNU C++... yes
checking whether g++ -std=gnu++17 accepts -g... yes
checking for g++ -std=gnu++17 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++17 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ -std=gnu++17 accepts -g... (cached) yes
checking for g++ -std=gnu++17 option to enable C++11 features... (cached) none needed
checking whether g++ -std=gnu++17 supports C++17 features by default... yes
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows TileDB... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for filesystem... yes
checking for tiledb/tiledb... no
checking for cmake... yes
checking for curl... yes
checking for git... yes
installing TileDB via building locally...
Downloading default: https://github.com/TileDB-Inc/TileDB/archive/2.26.2.tar.gz  ...
Argument '--force-build-all-deps' has no effect and will be removed in a future version. Vcpkg builds all dependencies by default, please consult the guide in doc/dev/BUILD.md or vcpkg's documentation to see how to provide your own dependencies.
which: unrecognized option: s
BusyBox v1.37.0 (2024-12-13 21:18:49 UTC) multi-call binary.

Usage: which [-a] COMMAND...

Locate COMMAND

	-a	Show all matches
cannot find cplusplus compiler
using inst/tiledb/{lib,include}
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C compiler: 'gcc (Alpine 14.2.0) 14.2.0'
using C++ compiler: 'g++ (Alpine 14.2.0) 14.2.0'
using C++17
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I. -I../inst/include/  -I../inst/tiledb/include   -DTILEDB_SILENT_BUILD  -I'/home/runner/R-patched/lib/Rcpp/include' -I'/home/runner/R-patched/lib/RcppInt64/include' -I'/home/runner/R-patched/lib/nanoarrow/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
../inst/include/tiledb.h:8:10: fatal error: tiledb/tiledb: No such file or directory
    8 | #include <tiledb/tiledb>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [/home/runner/R-patched/build/etc/Makeconf:204: RcppExports.o] Error 1
ERROR: compilation failed for package 'tiledb'
* removing '/tmp/user/lib/tiledb'
@johnkerl johnkerl changed the title installation fails on Alpine Linux Installation fails on Alpine Linux Jan 7, 2025
@ihnorton
Copy link
Member

ihnorton commented Jan 7, 2025

Hi @bastistician, thanks for opening the issue.

when CXX = g++ -std=gnu++17.

Is there a reason to put the flag in CXX instead of in CXXFLAGS? (I believe that will fail in a number of tools, including some versions of cmake)

that fails from TileDB's bootstrap script with "cannot find cplusplus compiler",

We can probably remove the extraneous calls to which (sc-61423) - although it may be some time before such change is available in a release.

@bastistician
Copy link
Author

bastistician commented Jan 7, 2025

I don't know the reason, but CXX is where R's etc/Makeconf includes the configured C++ standard since R 3.4.0. AFAICS, this is also what the vanilla Autoconf macro AC_PROG_CXX would do when "checking for g++ option to enable C++11 features" (nowadays almost surely "none needed"):

If necessary, options are added to CXX to enable support for ISO Standard C++ features with extensions, preferring the newest edition of the C++ standard that is supported.

Addendum: the m4 macro AX_CXX_COMPILE_STDCXX([17]) included in configure.ac (from tools/m4/ax_cxx_compile_stdcxx.m4) does it, too. For example, using g++ 10.2, I get

checking whether g++ supports C++17 features by default... no
checking whether g++ supports C++17 features with -std=gnu++17... yes

and CXX = g++ -std=gnu++17.

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