[R-sig-Geo] install rgdal from source macOS

Dominik Schneider do@c3612 @end|ng |rom co|or@do@edu
Sun Jun 9 21:52:55 CEST 2019


I'm trying to install rgdal from source on a fresh r 3.6 installation.
i setup a conda environment to install gdal, proj, geos

install.packages('rgdal', type = "source",
configure.args=c('--with-proj-include=/Users/dosc3612/Applications/miniconda3/envs/rgdal/include',
'--with-proj-lib=/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib',
'--with-gdal-config=/Users/dosc3612/Applications/miniconda3/envs/rgdal/bin/gdal-config'))

The full output is below but the first error I see is:
./configure: line 2101: pkg-config: command not found
configure: pkg-config proj not available
  set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj

which I don't understand because:
Sys.getenv('PKG_CONFIG_PATH')
[1] "/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib/pkgconfig"

and just to confirm:
(rgdal) Phoenix:~ $ ls `echo $PKG_CONFIG_PATH` | grep proj
proj.pc

*Is there another way to set PKG_CONFIG_PATH within install.packages?*

There are also some undefined symbols:
Undefined symbols for architecture x86_64:
  "_pj_ctx_fclose", referenced from:
      _main in proj_conf_test2-9a39dc.o
  "_pj_get_default_ctx", referenced from:
      _main in proj_conf_test2-9a39dc.o
  "_pj_open_lib", referenced from:
      _main in proj_conf_test2-9a39dc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
./configure: line 2422: ./proj_conf_test2: No such file or directory

I tried with gdal 2.4.1 and gdal 3.0.0 (after seeing
http://r-sig-geo.2731867.n2.nabble.com/GDAL-3-0-0-and-rgdal-tt7592822.html#a7592834
)
proj is 6.1
geos is 3.7.1

What did I miss? Please advise. Thanks.

FULL OUTPUT:
> install.packages('rgdal', type = "source",
configure.args=c('--with-proj-include=/Users/dosc3612/Applications/miniconda3/envs/rgdal/include',
'--with-proj-lib=/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib',
'--with-gdal-config=/Users/dosc3612/Applications/miniconda3/envs/rgdal/bin/gdal-config'))
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.4-4.tar.gz'
Content type 'application/x-gzip' length 1687518 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 833
configure: gdal-config set to
/Users/dosc3612/Applications/miniconda3/envs/rgdal/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 2.4.1
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL:
/Users/dosc3612/Applications/miniconda3/envs/rgdal/share/gdal/pcs.csv
readable... yes
./configure: line 2101: pkg-config: command not found
configure: pkg-config proj not available
  set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: proj CPP flags:
 -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
checking PROJ header API:... proj_api.h
checking proj_api.h presence and usability... yes
checking PROJ version >= 4.8.0... yes
Undefined symbols for architecture x86_64:
  "_pj_ctx_fclose", referenced from:
      _main in proj_conf_test2-9a39dc.o
  "_pj_get_default_ctx", referenced from:
      _main in proj_conf_test2-9a39dc.o
  "_pj_open_lib", referenced from:
      _main in proj_conf_test2-9a39dc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
./configure: line 2422: ./proj_conf_test2: No such file or directory
checking PROJ.4: proj.db found and readable... yes
Undefined symbols for architecture x86_64:
  "_pj_ctx_fclose", referenced from:
      _main in proj_conf_test3-9f8df7.o
  "_pj_get_default_ctx", referenced from:
      _main in proj_conf_test3-9f8df7.o
  "_pj_open_lib", referenced from:
      _main in proj_conf_test3-9f8df7.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
./configure: line 2482: ./proj_conf_test3: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags:
 -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
configure: Package LIBS:
 -L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lgdal
-L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c OGR_write.cpp -o OGR_write.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c gdal-bindings.cpp -o
gdal-bindings.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c init.c -o init.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c inverser.c -o inverser.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c local_stubs.c -o local_stubs.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c ogr_geom.cpp -o ogr_geom.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c ogr_polygons.c -o
ogr_polygons.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c ogr_proj.cpp -o ogr_proj.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c ogrdrivers.cpp -o ogrdrivers.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c ogrsource.cpp -o ogrsource.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c proj_info6.cpp -o proj_info6.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include"
-DNDEBUG -I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-I/Users/dosc3612/Applications/miniconda3/envs/rgdal/include
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sp/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-I/usr/local/include  -fPIC  -Wall -g -O2  -c projectit.cpp -o projectit.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names
-undefined dynamic_lookup -single_module -multiply_defined suppress
-L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o
rgdal.so OGR_write.o gdal-bindings.o init.o inverser.o local_stubs.o
ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o proj_info6.o
projectit.o -L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lgdal
-L/Users/dosc3612/Applications/miniconda3/envs/rgdal/lib -lproj
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
installing to
/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rgdal/00new/rgdal/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file,
DLLpath = DLLpath, ...):
 unable to load shared object
'/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so':

dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so,
6): Library not loaded: @rpath/libgdal.20.dylib
  Referenced from:
/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing
‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal’

The downloaded source packages are in
‘/private/var/folders/bb/13z2kq0j01jg5q_0ypjc76gr0000gn/T/RtmplsyMiu/downloaded_packages’
Warning message:
In install.packages("rgdal", type = "source", configure.args =
c("--with-proj-include=/Users/dosc3612/Applications/miniconda3/envs/rgdal/include",
 :
  installation of package ‘rgdal’ had non-zero exit status

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list