hypertidy / vapour

GDAL API package for R
https://hypertidy.github.io/vapour/
80 stars 9 forks source link

Install failed: checking whether PROJ is available for linking:... no #188

Closed gremms1 closed 1 year ago

gremms1 commented 1 year ago

Hi there,

Tried to install the Vapour package on R version 4.2.2 on Fedora 37, but it failed with the below messages. Any idea what might be the issue? I tried searching the internet for "checking GDAL: /usr/share/gdal/pcs.csv readable... no", but to no avail. Cheers

> options(repos = c(
+     hypertidy = 'https://hypertidy.r-universe.dev',
+     CRAN = 'https://cloud.r-project.org'))
> install.packages("vapour")
Installing package into ‘/home/thomas/R/x86_64-redhat-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://hypertidy.r-universe.dev/src/contrib/vapour_0.9.3.tar.gz'
Content type 'application/x-gzip' length 1799704 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

* installing *source* package ‘vapour’ ...
** using staged installation
configure: CC: gcc
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.5.2
checking GDAL version >= 2.0.1... yes
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 we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... no
/usr/bin/ld: /tmp/ccFK3VYS.o: relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: cannot link projection code
ERROR: configuration failed for package ‘vapour’
* removing ‘/home/thomas/R/x86_64-redhat-linux-gnu-library/4.2/vapour’
Warning in install.packages :
  installation of package ‘vapour’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpfALS4P/downloaded_packages’
SarahGoslee-USDA commented 1 year ago

Came here with the exact problem. I tried both CRAN and GitHub installs with the same error.

GDAL3 no longer includes /usr/share/gdal/pcs.csv and isn't clear to me why the compilation process is performing that check given that the version of GDAL is correctly identified:

configure: GDAL: 3.5.2

I don't know what's going on with:

checking GDAL: checking whether PROJ is available for linking:... no

since PROJ should be available,

or with:

/usr/bin/ld: /tmp/ccFK3VYS.o: relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value

Specifying the various gdal and proj locations with configure.args did not help.

mdsumner commented 1 year ago

Thank you I'll try to figure it out.

I think the gdal/pcs.csv thing is not relevant, it just happens to be the last informative message (albeit unhelpful and irrelevant now) before the real problem. the configure.ac here is just adapted from the old rgdal one, I've not been able to update it well but it's definitely in need of a reboot!

mdsumner commented 1 year ago

what is the version of proj please?

I don't know any way of testing on fedora other than with {rhub} and that's not working atm - I'm exploring

mdsumner commented 1 year ago

I have managed to reproduce, I'm using 'NeCTAR Fedora 36 x86_64' on OpenStack.

GDAL is 3.4.3, PROJ is 8.2.1, R is 4.1.3

(As far as I can tell I can't get easy access to 37, I have otherwise no exp with Fedora. )


sudo dnf makecache --refresh

sudo dnf -y install gdal-devel

sudo dnf install R
sudo R

Then in R

install.packages("remotes")
remotes::install_github("hypertidy/vapour")
Downloading GitHub repo hypertidy/vapour@HEAD
Running `R CMD build`...
* checking for file ‘/tmp/RtmpOjmSqi/remotes39a070b6d913/hypertidy-vapour-6ba6e65/DESCRIPTION’ ... OK
* preparing ‘vapour’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running ‘cleanup’
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘vapour_0.9.3.tar.gz’
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘vapour’ ...
** using staged installation
configure: CC: gcc -m64
configure: CXX: g++ -m64 -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 3.4.3
checking GDAL version >= 2.0.1... yes
checking for gcc... gcc -m64
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 -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... no
/usr/bin/ld: /tmp/cczVYnKW.o: relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: cannot link projection code
mdsumner commented 1 year ago

I think it's fixed, by removing LDFLAGS use from configure.ac - please test by reinstall from github

remotes::install_github("hypertidy/vapour')

appreciate the feedback, and the opportunity to find my way around fedora, thanks! (at some point I'll clear up the configure stuff a lot more)

gremms1 commented 1 year ago

Thank you for the prompt reply and fix! It works like a charm. Cheers

SarahGoslee-USDA commented 1 year ago

Can confirm. Thank you!

mdsumner commented 1 year ago

excellent, these problems still scare me 😋 glad to see it's working 👌