目标:无需root访问权限即可在Centos 7中安装spacespaceite
先决条件,
我想我缺少一些PATH规范或预期的测试文件conftest.c,但是经过20次尝试后还是无法弄清,因为我是在UNIX下安装软件包的新手。
安装spacealite的脚本
###load the library to run Mplus for continuous data simulation
library(MplusAutomation)
###Parameter settings for the data transformation to create skew
cc <- -(54*sqrt(2)+81)^(1/3)
xx <- -(3+cc+9/cc)/3
a <- exp(sqrt(log(xx)))
###Run Mplus models
runModels()
###Transform all the simulated data into skewed data
for(k in 1:500){ d <- read.table(paste('data000rep',k,'.DAT',sep=''))
write.table(a^d,paste('data000rep',k,'.DAT',sep=''),col.names = F,row.names = F)}
错误
#!/bin/bash
# define a root directory for downloading packages
root=$HOME/gdal_temp
# define a directory for download and unpacked packages
downloaddir=${root}/originals
packagedir=${root}/packages
installdir=$HOME/gdal
threads=2 # I've 12 threads available in 6 cores
#######################################################
# setup environment variables
export PATH=${installdir}/bin:$PATH
export CPATH=${installdir}/include:$CPATH
export LDFLAGS=${installdir}/lib:${installdir}/lib64:/usr/lib:$LDFLAGS
export LD_LIBRARY_PATH=${installdir}/lib:${installdir}/lib64:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=${installdir}/lib:${installdir}/lib64:$PKG_CONFIG_PATH
export DSQLITE3_INCLUDE_DIR=${installdir}/include:$DSQLITE3_INCLUDE_DIR
export DSQLITE3_LIBRARY=${installdir}/lib:$DSQLITE3_LIBRARY
export CFLAGS=${installdir}/include:$CFLAGS
#######################################################
# download and unpack
cd ${downloaddir}
wget http://www.gaia-gis.it/gaia-sins/libspatialite-4.3.0a.tar.gz
rm -r ${packagedir}/libspatialite*/
for package in ${downloaddir}/libspatialite*.tar.gz; do
tar xfvz ${package} -C ${packagedir}
done
#######################################################
# install spatialite
cd ${packagedir}/libspatialite*
# PROJ now uses a new API, using the old deprecated one (as done by spatialite) needs to be indicated explicitly
./configure --prefix=${installdir} LDFLAGS=-static CC=${installdir}/bin/gcc
# CFLAGS=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
make check
#make -j${threads}
#make install
exit
Config.log(错误的核心部分)
checking for gcc... $installdir/bin/gcc
checking whether the C compiler works... no
configure: error: in `${packagedir}/libspatialite-4.3.0a':
configure: error: C compiler cannot create executables
See `config.log' for more details
问题
似乎在抱怨没有获取路径(gcc)或文件(conftest.c)。据我了解:
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2516: checking for a BSD-compatible install
configure:2584: result: /usr/bin/install -c
configure:2595: checking whether build environment is sane
configure:2650: result: yes
configure:2688: WARNING: 'missing' script is too old or missing
configure:2801: checking for a thread-safe mkdir -p
configure:2840: result: /usr/bin/mkdir -p
configure:2847: checking for gawk
configure:2863: found /usr/bin/gawk
configure:2874: result: gawk
configure:2885: checking whether make sets $(MAKE)
configure:2907: result: yes
configure:2936: checking whether make supports nested variables
configure:2953: result: yes
configure:3080: checking whether to enable maintainer-specific portions of Makefiles
configure:3089: result: no
configure:3151: checking for style of include used by make
configure:3179: result: GNU
configure:3250: checking for gcc
configure:3277: result: $HOME/gdal/bin/gcc
configure:3506: checking for C compiler version
configure:3515: $HOME/gdal/bin/gcc --version >&5
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3526: $? = 0
configure:3515: $HOME/gdal/bin/gcc -v >&5
Using built-in specs.
COLLECT_GCC=$HOME/gdal/bin/gcc
COLLECT_LTO_WRAPPER=$HOME/gdal/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=$HOME/gdal --disable-multilib --enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)
configure:3526: $? = 0
configure:3546: checking whether the C compiler works
configure:3568: $HOME/gdal/bin/gcc $HOME/gdal/include: -static conftest.c >&5
gcc: error: $HOME/gdal/include:: No such file or directory
configure:3572: $? = 1
configure:3610: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libspatialite"
| #define PACKAGE_TARNAME "libspatialite"
| #define PACKAGE_VERSION "4.3.0a"
| #define PACKAGE_STRING "libspatialite 4.3.0a"
| #define PACKAGE_BUGREPORT "a.furieri@lqt.it"
| #define PACKAGE_URL ""
| #define PACKAGE "libspatialite"
| #define VERSION "4.3.0a"
| #define _LARGE_FILE 1
| #define _FILE_OFFSET_BITS 64
| #define _LARGEFILE_SOURCE 1
| #define NDEBUG 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3615: error: in `$HOME/gdal_temp/packages/libspatialite-4.3.0a':
configure:3617: error: C compiler cannot create executables
See `config.log' for more details
如果某人已经对此有所经验或可以带头,将非常感谢您的帮助。谢谢