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

Build fails if patch not installed #201

Open
infotroph opened this issue Mar 6, 2023 · 1 comment
Open

Build fails if patch not installed #201

infotroph opened this issue Mar 6, 2023 · 1 comment

Comments

@infotroph
Copy link

Apparently there exist systems that have GNU Make but not any flavor of patch, making hdf5r fail compilation at Makevars.in line 28:

R -e 'install.packages("hdf5r")
[...]
trying URL 'https://cloud.r-project.org/src/contrib/hdf5r_1.3.8.tar.gz'
[...]
using C compiler: ‘gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0’
cp 1_10_3/*.c 1_10_3/*.h .
if [ "1.10.6" != "" ]; then patch -p2 < patch_1.10.6; fi
/bin/bash: line 1: patch: command not found
make: *** [Makevars:28: copy_auto_files] Error 127
ERROR: compilation failed for package ‘hdf5r’
* removing ‘/usr/local/lib/R/site-library/hdf5r’

The message is clear enough and I was able to get past it today by installing patch for myself, but is this something that (1) ought to be detected and handled in the configure step (a la WRE's "Usage of external commands should always be conditional on a test for presence") , or (2) should the need for patch be noted in SystemRequirements?

@royfrancis
Copy link

royfrancis commented Nov 14, 2023

I get the same error about patch when installing in an Ubuntu 22.04 docker container, libhdf5-dev is already installed.

Click here
> remotes::install_github("hhoeflin/hdf5r")
Downloading GitHub repo hhoeflin/hdf5r@HEAD
── R CMD build ───────────────────────────────────────────────────────────
   checking for file ‘/tmp/RtmpA7GpSG/remotes96120a9dfc1/hhoeflin-hdf5r-45✔  checking for file ‘/tmp/RtmpA7GpSG/remotes96120a9dfc1/hhoeflin-hdf5r-450d483/DESCRIPTION’ (748ms)
─  preparing ‘hdf5r’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘hdf5r_1.3.8.tar.gz’
   
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘hdf5r’ ...
** using staged installation
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... no
checking for mawk... mawk
checking for grep that handles long lines and -e... /usr/bin/grep
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
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 h5cc... /usr/bin/h5cc
checking for HDF5 libraries... yes (version 1.10.7)
checking for hdf5.h... yes
checking for H5Fcreate in -lhdf5... yes
checking for hdf5_hl.h... yes
checking for H5LTpath_valid in -lhdf5_hl... yes
checking for main in -lhdf5_hl... yes
checking for matching HDF5 Fortran wrapper... /usr/bin/h5fc
Found hdf5 with version: 1.10.7
checking for ggrep... /usr/bin/grep
checking whether /usr/bin/grep accepts -o... yes
checking for ggrep... (cached) /usr/bin/grep
checking whether /usr/bin/grep accepts -o... yes
Using variables:
HDF5_LIBS= -L/usr/lib/x86_64-linux-gnu/hdf5/serial  -lcrypto  -lcurl  -lpthread  -lsz  -lz  -ldl  -lm  -L. -lhdf5_hl -lhdf5 -lz -lm
HDF5_CFLAGS=
HDF5_CPPFLAGS=-I/usr/include/hdf5/serial 
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
cp 1_10_3/*.c 1_10_3/*.h .
if [ "1.10.6" != "" ]; then patch -p2 < patch_1.10.6; fi
/bin/bash: line 1: patch: command not found
make: *** [Makevars:28: copy_auto_files] Error 127
ERROR: compilation failed for package ‘hdf5r’
* removing ‘/usr/local/lib/R/site-library/hdf5r’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/RtmpA7GpSG/file96127fef41/hdf5r_1.3.8.tar.gz’ had non-zero exit status

Resolved by sudo apt-get install patch

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