I'm trying to install RStudio Desktop using these instructions. This requires boost >= v1.69. I'm running Ubuntu 18.10 in a Windows subsystem (WSL), and there is no repository for this version of boost. Consequently, I installed boost v1.70 from source using these instructions.
However, when I run the cmake command in the RStudio install instructions, I get this:
(base) balter#spectre3:~$ cmake .. -DRSTUDIO_TARGET=Desktop -DRSTUDIO_PACKAGE_BUILD=1
CMake Error: The source directory "/home" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
(base) balter#spectre3:~$ cd rstudio/build/
(base) balter#spectre3:~/rstudio/build$ cmake .. -DRSTUDIO_TARGET=Desktop -DRSTUDIO_PACKAGE_BUILD=1
-- CMake build type not set; defaulting to debug build
-- Found Boost 1.70.0 at /usr/lib/cmake/Boost-1.70.0
-- Requested configuration: QUIET REQUIRED
-- Found boost_headers 1.70.0 at /usr/lib/cmake/boost_headers-1.70.0
-- Boost 1.69.0 found.
-- Found Boost 1.70.0 at /usr/lib/cmake/Boost-1.70.0
-- Requested configuration: QUIET REQUIRED COMPONENTS atomic;chrono;date_time;filesystem;iostreams;program_options;random;regex;system;thread
-- Found boost_atomic 1.70.0 at /usr/lib/cmake/boost_atomic-1.70.0
-- No suitable boost_atomic variant has been identified!
-- libboost_atomic.so.1.70.0 (shared, Boost_USE_STATIC_LIBS=ON)
CMake Error at /usr/lib/cmake/Boost-1.70.0/BoostConfig.cmake:95 (find_package):
Found package configuration file:
/usr/lib/cmake/boost_atomic-1.70.0/boost_atomic-config.cmake
but it set boost_atomic_FOUND to FALSE so package "boost_atomic" is
considered to be NOT FOUND. Reason given by package:
No suitable build variant has been found.
Call Stack (most recent call first):
/usr/lib/cmake/Boost-1.70.0/BoostConfig.cmake:124 (boost_find_dependency)
/usr/share/cmake-3.12/Modules/FindBoost.cmake:261 (find_package)
src/cpp/CMakeLists.txt:235 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/balter/rstudio/build/CMakeFiles/CMakeOutput.log".
See also "/home/balter/rstudio/build/CMakeFiles/CMakeError.log".
The last bits of the log files are:
CMakeOutput.log
~~~~~~~~~~~~~~~~~~~~~~~~
Determining if the function inotify_init1 exists passed with the following output:
Change Dir: /home/balter/rstudio/build/CMakeFiles/CMakeTmp
Run Build Command:"/home/balter/conda/bin/make" "cmTC_bd56e/fast"
/home/balter/conda/bin/make -f CMakeFiles/cmTC_bd56e.dir/build.make CMakeFiles/cmTC_bd56e.dir/build
make[1]: Entering directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_bd56e.dir/CheckFunctionExists.c.o
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=inotify_init1 -fPIE -o CMakeFiles/cmTC_bd56e.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.12/Modules/CheckFunctionExists.c
Linking C executable cmTC_bd56e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bd56e.dir/link.txt --verbose=1
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=inotify_init1 -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -pie -Wl,-z,relro,-z,now CMakeFiles/cmTC_bd56e.dir/CheckFunctionExists.c.o -o cmTC_bd56e
make[1]: Leaving directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Determining if the function setresuid exists passed with the following output:
Change Dir: /home/balter/rstudio/build/CMakeFiles/CMakeTmp
Run Build Command:"/home/balter/conda/bin/make" "cmTC_af28b/fast"
/home/balter/conda/bin/make -f CMakeFiles/cmTC_af28b.dir/build.make CMakeFiles/cmTC_af28b.dir/build
make[1]: Entering directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_af28b.dir/CheckFunctionExists.c.o
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=setresuid -fPIE -o CMakeFiles/cmTC_af28b.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.12/Modules/CheckFunctionExists.c
Linking C executable cmTC_af28b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_af28b.dir/link.txt --verbose=1
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=setresuid -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -pie -Wl,-z,relro,-z,now CMakeFiles/cmTC_af28b.dir/CheckFunctionExists.c.o -o cmTC_af28b
make[1]: Leaving directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
CMakeOutput.log
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/balter/rstudio/build/CMakeFiles/CMakeTmp
Run Build Command:"/home/balter/conda/bin/make" "cmTC_6613e/fast"
/home/balter/conda/bin/make -f CMakeFiles/cmTC_6613e.dir/build.make CMakeFiles/cmTC_6613e.dir/build
make[1]: Entering directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6613e.dir/CheckSymbolExists.c.o
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -fPIE -o CMakeFiles/cmTC_6613e.dir/CheckSymbolExists.c.o -c /home/balter/rstudio/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_6613e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6613e.dir/link.txt --verbose=1
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -pie -Wl,-z,relro,-z,now CMakeFiles/cmTC_6613e.dir/CheckSymbolExists.c.o -o cmTC_6613e
/home/balter/conda/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/cmTC_6613e.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text.startup+0x3): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_6613e.dir/build.make:87: cmTC_6613e] Error 1
make[1]: Leaving directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_6613e/fast] Error 2
File /home/balter/rstudio/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/balter/rstudio/build/CMakeFiles/CMakeTmp
Run Build Command:"/home/balter/conda/bin/make" "cmTC_c8506/fast"
/home/balter/conda/bin/make -f CMakeFiles/cmTC_c8506.dir/build.make CMakeFiles/cmTC_c8506.dir/build
make[1]: Entering directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c8506.dir/CheckFunctionExists.c.o
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_c8506.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.12/Modules/CheckFunctionExists.c
Linking C executable cmTC_c8506
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c8506.dir/link.txt --verbose=1
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=pthread_create -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -pie -Wl,-z,relro,-z,now CMakeFiles/cmTC_c8506.dir/CheckFunctionExists.c.o -o cmTC_c8506 -lpthreads
/home/balter/conda/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_c8506.dir/build.make:87: cmTC_c8506] Error 1
make[1]: Leaving directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_c8506/fast] Error 2
Determining if the function getpeereid exists failed with the following output:
Change Dir: /home/balter/rstudio/build/CMakeFiles/CMakeTmp
Run Build Command:"/home/balter/conda/bin/make" "cmTC_b9b1c/fast"
/home/balter/conda/bin/make -f CMakeFiles/cmTC_b9b1c.dir/build.make CMakeFiles/cmTC_b9b1c.dir/build
make[1]: Entering directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b9b1c.dir/CheckFunctionExists.c.o
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=getpeereid -fPIE -o CMakeFiles/cmTC_b9b1c.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.12/Modules/CheckFunctionExists.c
Linking C executable cmTC_b9b1c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b9b1c.dir/link.txt --verbose=1
/home/balter/conda/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -DCHECK_FUNCTION_EXISTS=getpeereid -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -pie -Wl,-z,relro,-z,now CMakeFiles/cmTC_b9b1c.dir/CheckFunctionExists.c.o -o cmTC_b9b1c
/home/balter/conda/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/cmTC_b9b1c.dir/CheckFunctionExists.c.o: in function `main':
CheckFunctionExists.c:(.text.startup+0xd): undefined reference to `getpeereid'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_b9b1c.dir/build.make:87: cmTC_b9b1c] Error 1
make[1]: Leaving directory '/home/balter/rstudio/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_b9b1c/fast] Error 2
Related
I am trying to install cvxopt using the git option provided in the cvxopt documentation. When I run
..:~/cvxopt/$ python3 setup.py install
I get the following error:
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/src/C/umfpack.o -lumfpack -lcholmod -lamd -lcolamd -lsuitesparseconfig -llapack -lblas -lrt -o build/lib.linux-x86_64-3.4/cvxopt/umfpack.cpython-34m.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libsuitesparseconfig.a(SuiteSparse_config.o): relocation R_X86_64_PC32 against undefined symbol `malloc##GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
what to do about this?
I am unable to build rgdal (see output in code chunk below) on my AWS server. I understand from the discussion here, and here that this has something to do with missing libraries for geos and gdal, but none of the solutions suggested appears to work. If I run sudo yum install libgdal1 libgdal1-dev libgeos libgeos-dev I get the following output:
Loaded plugins: priorities, update-motd, upgrade-helper amzn-main
| 2.1 kB 00:00:00 amzn-updates
| 2.5 kB 00:00:00 1045 packages excluded due to repository
priority protections No package libgdal1 available. No package
libgdal1-dev available. Package geos-3.4.2-1.4.amzn1.x86_64 already
installed and latest version No package libgeos-dev available. Nothing
to do
I have already enabled EPEL, but it does not solve the problem.
Unfortunately I'm not very experienced with Linux, and have no idea how to move forward...
R output after attempting to install rgdal:
> install.packages("rgdal", type="source")
Installing package into ‘/home/andrea/R/x86_64-redhat-linux-gnu-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.3-2.tar.gz'
Content type 'application/x-gzip' length 1667049 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.3-2
checking for /usr/bin/svnversion... no
configure: svn revision: 755
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 g++ -m64 accepts -g... yes
checking whether g++ -m64 supports C++11 features by default... no
checking whether g++ -m64 supports C++11 features with -std=gnu++11... yes
configure: C++11 support available
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.0.0
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/local/share/gdal/pcs.csv readable... yes
checking proj_api.h presence and usability... yes
./configure: line 3395: test: =: unary operator expected
checking PROJ version >= 4.8.0... yes
checking projects.h presence and usability... yes
/tmp/ccV0TCuc.o: In function `main':
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test2.c:14: undefined reference to `pj_get_default_ctx'
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test2.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3511: ./proj_conf_test2: No such file or directory
checking PROJ.4: epsg found and readable... yes
/tmp/cczdLgSd.o: In function `main':
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test3.c:14: undefined reference to `pj_get_default_ctx'
/tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/proj_conf_test3.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3570: ./proj_conf_test3: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/local/include
configure: Package LIBS: -L/usr/local/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c OGR_write.cpp -o OGR_write.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c gdal-bindings.cpp -o gdal-bindings.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c init.c -o init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c inverser.c -o inverser.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c local_stubs.c -o local_stubs.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_geom.cpp -o ogr_geom.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_polygons.c -o ogr_polygons.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_proj.cpp -o ogr_proj.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrdrivers.cpp -o ogrdrivers.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrsource.cpp -o ogrsource.o
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I/usr/local/include -I"/home/andrea/R/x86_64-redhat-linux-gnu-library/sp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c projectit.cpp -o projectit.o
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -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 projectit.o -L/usr/local/lib -lgdal -lproj -L/usr/lib64/R/lib -lR
installing to /home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package ‘rgdal’
finding HTML links ... done
CRS-class html
GDALDataset-class html
GDALDriver-class html
GDALMajorObject-class html
GDALRasterBand-class html
GDALReadOnlyDataset-class html
GDALReadOnlyDataset-methods html
GDALTransientDataset-class html
GridsDatums html
RGB2PCT html
SGDF2PCT html
SpatialGDAL-class html
closeDataset-methods html
displayDataset html
llgrid html
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:11: missing file link ‘Spatial’
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:16: missing file link ‘gridat’
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/llgrid.Rd:17: missing file link ‘gridat’
make_EPSG html
nor2k html
projInfo html
project html
readGDAL html
Rd warning: /tmp/Rtmp52ge38/R.INSTALL4e4e42b08a4a/rgdal/man/readGDAL.Rd:136: missing file link ‘flipVertical’
readOGR html
showWKT html
spTransform-methods html
wrappers html
writeOGR html
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal/libs/rgdal.so':
libgdal.so.20: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/andrea/R/x86_64-redhat-linux-gnu-library/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpnAqQL2/downloaded_packages’
The issue is that, while GDAL is correctly built, rgdal cannot find its libraries. This is because the AWS ec2 AMI does not include /usr/local/lib in the default search path for libraries. The solution is provided in an answer to this question.
In brief:
edit /etc/ld.so.conf using sudo vi /etc/ld.so.conf to make it contain: include /etc/ld.so.conf.d/*.conf.
Edit / create a file /etc/ld.so.conf.d/libc.conf so that it contains: /usr/local/lib
Run sudo ldconfig to save changes
This makes the libraries searchable when building rgdal.
Upgrade gcc version to 5.x.x, and then run the followings (depending on the gcc version, you may have a different file of libstdc++.so.6.0.25):
cp /usr/local/lib64/libstdc++.so.6.0.25 /lib64
cd /lib64
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.25 libstdc++.so.6
I am incoperating a JNI fuction in my Android Project however it can not resolve the header which is located at /usr/local/include/opencv2.How to direct Android Studio to look for header file over there?
It's Android studio 3 under CentOS 7.
Build command failed.
Error while executing process /home/<username>/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/<username>/AndroidStudioProjects/<project_name>/app/.externalNativeBuild/cmake/debug/armeabi-v7a --target removebackground}
[1/2] Building CXX object CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o
FAILED: /home/<username>/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi --gcc-toolchain=/home/<username>/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/<username>/Android/Sdk/ndk-bundle/sysroot -Dremovebackground_EXPORTS -I/home/<username>/opencv-android-sdk/sdk/native/jni/include -isystem /home/<username>/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/<username>/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/<username>/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem /home/<username>/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -frtti -fexceptions -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o -MF CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o.d -o CMakeFiles/removebackground.dir/src/main/cpp/removebackground.cpp.o -c /home/<username>/AndroidStudioProjects/<project_name>/app/src/main/cpp/removebackground.cpp
/home/<username>/AndroidStudioProjects/<project_name>/app/src/main/cpp/removebackground.cpp:4:10: fatal error: 'opencv2/imgcodecs.hpp' file not found
#include <opencv2/imgcodecs.hpp>
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
In the /app/CMakeLists.txt add
include_directories(/usr/local/include)
and that's all you gota do。
Y(^_^)Y find solution to my own question all the time.
I have installed (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5) already and jave also installed yum install gcc-gfortran . (Package gcc-gfortran-4.4.7-18.el6.x86_64)
But I'm getting error like :
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [quadprog.so] Error 1
Please help me in installing -lgfortran. It seems like I need to install "Fortran -dev package providing the Fortran library". I do not know how to do that in RedHat/CentOS. Please help. I'm facing hard time in doing this.
I have tried installing libgfortran using:
yum install libgfortran
But it says:
Package libgfortran-4.4.7-18.el6.x86_64 already installed and latest version
Nothing to do
(Running in an interactive session, skipping clean step.)
More Info:
I tried installing package quadprog for R and below are the logs:
install.packages('https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz',dependencies = TRUE,repos = NULL,type ="source")
Installing package into '/usr/lib64/R/library'
(as 'lib' is unspecified)
trying URL 'https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz'
Content type 'application/x-gzip' length 33651 bytes (32 KB)
==================================================
downloaded 32 KB
* installing *source* package 'quadprog' ...
** package 'quadprog' successfully unpacked and MD5 sums checked
** libs
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -c aind.f -o aind.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c init.c -o init.o
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -ffloat-store -c -o solve.QP.compact.o solve.QP.compact.f
solve.QP.compact.f:254.3:
72 if (nvl .EQ. 0) then
1
Warning: Label 72 at (1) defined but not used
solve.QP.compact.f:302.2:
7 t1inf = .FALSE.
1
Warning: Label 7 at (1) defined but not used
solve.QP.compact.f: In function 'qpgen1':
solve.QP.compact.f:94: warning: 'it1' may be used uninitialized in this function
solve.QP.compact.f:98: warning: 't1' may be used uninitialized in this function
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -ffloat-store -c -o solve.QP.o solve.QP.f
solve.QP.f:245.3:
72 if (nvl .EQ. 0) then
1
Warning: Label 72 at (1) defined but not used
solve.QP.f:293.2:
7 t1inf = .FALSE.
1
Warning: Label 7 at (1) defined but not used
solve.QP.f: In function 'qpgen2':
solve.QP.f:85: warning: 'it1' may be used uninitialized in this function
solve.QP.f:89: warning: 't1' may be used uninitialized in this function
gfortran -m64 -fvisibility=hidden -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -c util.f -o util.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -o quadprog.so aind.o init.o solve.QP.compact.o solve.QP.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [quadprog.so] Error 1
ERROR: compilation failed for package 'quadprog'
* removing '/usr/lib64/R/library/quadprog'
Warning message:
In install.packages("https://cran.cnr.berkeley.edu/src/contrib/quadprog_1.5-5.tar.gz", :
installation of package '/tmp/Rtmpry5XTG/downloaded_packages/quadprog_1.5-5.tar.gz' had non-zero exit status
Edits :
bash-4.1# rpm -ql libgfortran
/usr/lib64/libgfortran.so.3
/usr/lib64/libgfortran.so.3.0.0
You showed us this:
# type -a gcc
gcc is /opt/centos/devtoolset-1.1/root/usr/bin/gcc
gcc is /usr/bin/gcc'
It means that you have installed Red Hat Developer Toolset and enabled it for this shell, using scl enable or a similar command. Do you still need it? If not, I suggest to disable it.
If you need DTS, you will have to install the Fortran compiler from DTS 1.1, using:
yum install devtoolset-1.1-gcc-gfortran
(Or download it directly from here, which seems to be the repository from where you got your DTS compiler.)
This will install the Fortran compiler which is compatible with the gcc compiler you have configured. Without that, the system Fortran compiler and the DTS gcc are used together, which does not work because the DTS gcc command (used for linking in the build process you quoted) is not able to locate the libgfortran.so library from the system Fortran compiler.
Alternatively, you can bring the two compilers into sync by deinstalling the DTS compiler:
yum install devtoolset-1.1-gcc-gfortran
The following compile line was looking for libgfortran at /usr/lib64/R/lib but the library is not there. Hence, the linker error.
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -o quadprog.so aind.o init.o solve.QP.compact.o solve.QP.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lgfortran -lm -L/usr/lib64/R/lib -lR
As we could not locate and modify the makefile. We created a symbolic link /usr/lib64/R/lib/libgfortran.so to /usr/lib64/libgfortran.so.3 and rerun the installation steps and it resolves the linker error.
This is a work around that we follow which resolves the issue
I am bumped into one intractable issue when I install opencv using linuxbrew.
Below is the error information, I googled it but found nothing works.
[ 44%] Built target opencv_features2d
[ 44%] Linking CXX shared library ../../lib/libopencv_objdetect.so
cd /tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild/modules/objdetect && /home/usrname/.linuxbrew/Cellar/cmake/3.6.0/bin/cmake -E cmake_link_script CMakeFiles/opencv_objdetect.dir/link.txt --verbose=1
/usr/bin/g++-5 -fPIC -Os -w -pipe -march=native -fsigned-char -W -Wall - Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format- security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow - Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type- template-args -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics- show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 - ffunction-sections -DNDEBUG -DNDEBUG -L/home/usrname/.linuxbrew/lib -Wl,-- dynamic-linker=/home/usrname/.linuxbrew/lib/ld.so -Wl,- rpath,/home/usrname/.linuxbrew/lib -shared -Wl,- soname,libopencv_objdetect.so.2.4 -o ../../lib/libopencv_objdetect.so.2.4.13 CMakeFiles/opencv_objdetect.dir/src/cascadedetect.cpp.o CMakeFiles/opencv_objdetect.dir/src/datamatrix.cpp.o CMakeFiles/opencv_objdetect.dir/src/distancetransform.cpp.o CMakeFiles/opencv_objdetect.dir/src/featurepyramid.cpp.o CMakeFiles/opencv_objdetect.dir/src/fft.cpp.o CMakeFiles/opencv_objdetect.dir/src/haar.cpp.o CMakeFiles/opencv_objdetect.dir/src/hog.cpp.o CMakeFiles/opencv_objdetect.dir/src/latentsvm.cpp.o CMakeFiles/opencv_objdetect.dir/src/latentsvmdetector.cpp.o CMakeFiles/opencv_objdetect.dir/src/linemod.cpp.o CMakeFiles/opencv_objdetect.dir/src/lsvmparser.cpp.o CMakeFiles/opencv_objdetect.dir/src/lsvmtbbversion.cpp.o CMakeFiles/opencv_objdetect.dir/src/matching.cpp.o CMakeFiles/opencv_objdetect.dir/src/objdetect_init.cpp.o CMakeFiles/opencv_objdetect.dir/src/resizeimg.cpp.o CMakeFiles/opencv_objdetect.dir/src/routine.cpp.o ../../lib/libopencv_highgui.so.2.4.13 -ldl -lm -lpthread -lrt ../../lib/libopencv_imgproc.so.2.4.13 ../../lib/libopencv_core.so.2.4.13 -ldl -lm -lpthread -lrt -Wl,-rpath,/home/usrname/.linuxbrew/Cellar/opencv/2.4.13/lib
cd /tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild/modules/objdetect && /home/usrname/.linuxbrew/Cellar/cmake/3.6.0/bin/cmake -E cmake_symlink_library ../../lib/libopencv_objdetect.so.2.4.13 ../../lib/libopencv_objdetect.so.2.4 ../../lib/libopencv_objdetect.so
make[2]: Leaving directory '/tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild'
[ 44%] Built target opencv_objdetect
make[1]: Leaving directory '/tmp/opencv-20160725-28945-vyl9j5/opencv-2.4.13/macbuild'
make: *** [Makefile:164: all] Error 2
READ THIS: https://github.com/Linuxbrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
https://github.com/Homebrew/homebrew-science/issues
These open issues may also help:
That's all.