TileDB-SOMA: [Bug][R] Issue with local Conda install
Describe the bug I am trying to install the tiledb-soma R API into a conda environment. When I try to install, the error I get is:
/hpc/reference/gs-conda-envs/tiledb-soma-r/lib/R/library/RcppSpdlog/include/spdlog/sinks/ansicolor_sink-inl.h: In member function 'void spdlog::sinks::ansicolor_sink<ConsoleMutex>::print_range_(const memory_buf_t&, size_t, size_t) [with ConsoleMutex = spdlog::details::console_mutex]':
/hpc/reference/gs-conda-envs/tiledb-soma-r/lib/R/library/RcppSpdlog/include/spdlog/sinks/ansicolor_sink-inl.h:123:11: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
123 | fwrite(formatted.data() + start, sizeof(char), end - start, target_file_);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-conda-linux-gnu-c++ -std=gnu++17 -shared -L/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib -Wl,-rpath-link,/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib -L/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib -o tiledbsoma.so RcppExports.o nanoarrow.o rinterface.o riterator.o rutilities.o stats.o version.o -ltiledb -L../inst/tiledb/lib -Wl,-rpath,$ORIGIN/../tiledb/lib lib/libtiledbsoma.a -L/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib/R/lib -lR
/hpc/reference/gs-conda-envs/tiledb-soma-r/bin/../lib/gcc/x86_64-conda-linux-gnu/11.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find lib/libtiledbsoma.a: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/hpc/projects/upt/hgcb/managed-envs/tiledb-soma-r/lib/R/share/make/shlib.mk:10: tiledbsoma.so] Error 1
ERROR: compilation failed for package ‘tiledbsoma’
* removing ‘/hpc/reference/gs-conda-envs/tiledb-soma-r/lib/R/library/tiledbsoma’
The downloaded source packages are in
‘/tmp/RtmpyyvokH/downloaded_packages’
Warning message:
In install.packages("tiledbsoma", repos = c("https://tiledb-inc.r-universe.dev", :
installation of package ‘tiledbsoma’ had non-zero exit status
To Reproduce
$ mamba --version
mamba 0.22.1
conda 4.12.0
mamba create -n tiledb-soma-r
source activate tiledb-soma-r
mamba install -c conda-forge cmake cxx-compiler
mamba install -c conda-forge arrow tiledb
mamba install -c conda-forge r-arrow r-tiledb
mamba install -c conda-forge r-remotes
install.packages('tiledbsoma', repos = c('https://tiledb-inc.r-universe.dev', 'https://cloud.r-project.org'))
Versions (please complete the following information):
- TileDB-SOMA version:
- Language and language version (e.g. Python 3.8, R 4.2.2): R 4.2.3
- OS (e.g. MacOS, Ubuntu Linux): Centos
- Note: you can use
tiledbsoma.show_package_versions()(Python) ortiledbsoma::show_package_versions()®
Additional context This is on a HPC system, so don’t have sudo rights or ability to install things outside of a conda env.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- [r] Static Library Configured To Install To `lib` * This issue closes https://github.com/single-cell-data/TileDB-SOMA/issues/1220 * Different Linux distros install libraries to different directories.... — committed to single-cell-data/TileDB-SOMA by nguyenv 4 years ago
- [r] Static Library Configured To Install To `lib` (#1221) * This issue closes https://github.com/single-cell-data/TileDB-SOMA/issues/1220 * Different Linux distros install libraries to different dir... — committed to single-cell-data/TileDB-SOMA by nguyenv 4 years ago
@nguyenv @eddelbuettel it works! Thanks so much. I thought maybe it was conda, but guess it wasn’t. Thanks for being so responsive!
Looks like we’re there now – @nguyenv and I noodled a little more over this and have something.
The root cause was that we had not encountered
lib64/so now we take care of this. For once, Conda is not to blame. 😉We have a partial solution to this issue.
This problem doesn’t have to do with Conda, but with how different Linux distros install libraries into different lib folders. In
Makevars.in, we are linking tolib/libtiledbsoma.a. On Centos (and I believe all Fedora based distros), the static library actually gets installed intolib64/libtiledbsoma.a. We’ll need to updateMakevars.inwith the patch below to handle these different naming schemas;With this modification, we now link and build successfully. Unfortunately I am now running into a different problem (on RHEL9 EC2 instance running conda 23.1.0) when the build script runs the
CMD R CHECKstep.I do see the symbol present in the static library, and this check step works fine on other distros (specifically Ubuntu and I assume other Debian-based distros), so I am not sure why we are seeing an undefined symbol error here. I will continue to investigate today.
That is normal and expected. As a step in
R CMD INSTALL, when a fileconfigureis present (which does not need to be made byautoconf, just namedconfigureand executable) it is run. It then turns any filefoo.inintofoo.So please just run
./configureand lets look at thesrc/Makevarsit produces / errors it may encounter.(We are also looking into creating a feedstock for this to avoid these steps at your end.)
Note that inside the
configurescript I linked to we doand note especially that an ‘are we building for R or not’ variable is there. That always has been, and will continue to be, a problem with using one (shared or static) library for both.
@eddelbuettel Is it possible to build the R package using an existing system libtiledbsoma, analagous to how the r-tiledb recipe works?
--configure-args=--with-tiledb=${CONDA_PREFIX}@johnkerl Are there plans to add an output for the R client to tiledbsoma-feedstock?