web-dev-qa-db-ja.com

おそらくMac OS Catalinaにアップグレードした後、さまざまなRパッケージをインストールできない

何日もグーグルしてきました。コマンドラインツールも含めてXcodeを更新しました。さまざまなSDKを試しましたが、失敗しました。まだ解決策を見つけた人はいますか? Appleが32ビットプログラムをサポートしていないため、さまざまなRパッケージが機能しなくなるという事実が原因でエラーが発生する可能性があります。

前もって感謝します!

Rstudioからの私のログ:

> install.packages("copula")
also installing the dependency ‘gsl’

trying URL 'https://cran.rstudio.com/src/contrib/gsl_2.1-6.tar.gz'
Content type 'application/x-gzip' length 189794 bytes (185 KB)
==================================================
downloaded 185 KB

trying URL 'https://cran.rstudio.com/src/contrib/copula_0.999-19.1.tar.gz'
Content type 'application/x-gzip' length 5529710 bytes (5.3 MB)
==================================================
downloaded 5.3 MB

* installing *source* package ‘gsl’ ...
** package ‘gsl’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gsl-config... /Users/Philip/opt/anaconda3/bin/gsl-config
checking if GSL version >= 2.1... checking for gcc... x86_64-Apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/v4/0ddh56_173b0vtx6gkypz1d00000gn/T/RtmpmcvvFa/R.INSTALL10b792e7e213f/gsl':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘gsl’
* removing ‘/Users/Philip/opt/anaconda3/lib/R/library/gsl’
Warning in install.packages :
  installation of package ‘gsl’ had non-zero exit status
ERROR: dependency ‘gsl’ is not available for package ‘copula’
* removing ‘/Users/Philip/opt/anaconda3/lib/R/library/copula’
Warning in install.packages :
  installation of package ‘copula’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/v4/0ddh56_173b0vtx6gkypz1d00000gn/T/RtmpC6BV8X/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

セッション:

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-Apple-darwin13.4.0 (64-bit)
Running under: macOS Catalina 10.15.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Users/Philip/opt/anaconda3/lib/R/lib/libRblas.dylib

locale:
[1] nl_NL.UTF-8/nl_NL.UTF-8/nl_NL.UTF-8/C/nl_NL.UTF-8/nl_NL.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.1 tools_3.6.1    yaml_2.2.0   

また、Home/R./Makevarsファイルに次の設定があります。

# clang: start
CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include

SHLIB_CXXLDFLAGS+=-Wl,-rpath,${R_HOME}/lib ${R_HOME}/lib/libc++abi.1.dylib
SHLIB_CXX14LDFLAGS+=-Wl,-rpath,${R_HOME}/lib ${R_HOME}/lib/libc++abi.1.dylib
# clang: end

Oo.oOの回答に続いて、同様のエラーが発生します。

(base) MacBook-Pro-van-Philip:gsl-2.6 Philip$ ./configure --prefix=$HOME/opt/usr/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a sed that does not truncate output... /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-Apple-darwin19.2.0
checking Host system type... x86_64-Apple-darwin19.2.0
checking for gcc... x86_64-Apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/Users/Philip/opt/src/gsl-2.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by gsl configure 2.6, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/Users/Philip/opt/usr/local

## --------- ##
## Platform. ##
## --------- ##

hostname = MacBook-Pro-van-Philip.local
uname -m = x86_64
uname -r = 19.2.0
uname -s = Darwin
uname -v = Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/Arch              = unknown
/usr/bin/Arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 16.00 gigabytes
Default processor set: 370 tasks, 1330 threads, 8 processors
Load average: 2.01, Mach factor: 6.01
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/opt/anaconda3/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /Users/Philip/anaconda3/bin
PATH: /Users/Philip/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/3.6/bin
PATH: /Users/Philip/anaconda/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Library/TeX/texbin
PATH: /usr/local/MacGPG2/bin
PATH: /opt/X11/bin
PATH: /usr/local/opt/anaconda3/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /Users/Philip/anaconda3/bin
PATH: /Users/Philip/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/3.6/bin
PATH: /Users/Philip/opt/anaconda3/bin/r
PATH: /usr/local/clang8/bin
PATH: /Users/Philip/opt/anaconda3/bin
PATH: /usr/local/opt/anaconda3/condabin
PATH: ../../usr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2381: checking for a BSD-compatible install
configure:2449: result: /usr/bin/install -c
configure:2460: checking whether build environment is sane
configure:2515: result: yes
configure:2666: checking for a thread-safe mkdir -p
configure:2705: result: ./install-sh -c -d
configure:2712: checking for gawk
configure:2742: result: no
configure:2712: checking for mawk
configure:2742: result: no
configure:2712: checking for nawk
configure:2742: result: no
configure:2712: checking for awk
configure:2728: found /usr/bin/awk
configure:2739: result: awk
configure:2750: checking whether make sets $(MAKE)
configure:2772: result: yes
configure:2801: checking whether make supports nested variables
configure:2818: result: yes
configure:2905: checking whether to enable maintainer-specific portions of Makefiles
configure:2914: result: no
configure:2952: checking for a sed that does not truncate output
configure:3016: result: /usr/bin/sed
configure:3028: checking whether make sets $(MAKE)
configure:3050: result: yes
configure:3064: checking build system type
configure:3078: result: x86_64-Apple-darwin19.2.0
configure:3098: checking Host system type
configure:3111: result: x86_64-Apple-darwin19.2.0
configure:3186: checking for gcc
configure:3213: result: x86_64-Apple-darwin13.4.0-clang
configure:3442: checking for C compiler version
configure:3451: x86_64-Apple-darwin13.4.0-clang --version >&5
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-Apple-darwin13.4.0
Thread model: posix
InstalledDir: /Users/Philip/opt/anaconda3/bin
configure:3462: $? = 0
configure:3451: x86_64-Apple-darwin13.4.0-clang -v >&5
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-Apple-darwin13.4.0
Thread model: posix
InstalledDir: /Users/Philip/opt/anaconda3/bin
configure:3462: $? = 0
configure:3451: x86_64-Apple-darwin13.4.0-clang -V >&5
clang-4.0: error: argument to '-V' is missing (expected 1 value)
clang-4.0: error: no input files
configure:3462: $? = 1
configure:3451: x86_64-Apple-darwin13.4.0-clang -qversion >&5
clang-4.0: error: unknown argument: '-qversion'
clang-4.0: error: no input files
configure:3462: $? = 1
configure:3482: checking whether the C compiler works
configure:3504: x86_64-Apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs conftest.c  >&5
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3508: $? = 1
configure:3546: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "gsl"
| #define PACKAGE_TARNAME "gsl"
| #define PACKAGE_VERSION "2.6"
| #define PACKAGE_STRING "gsl 2.6"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "gsl"
| #define VERSION "2.6"
| #define RELEASED /**/
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3551: error: in `/Users/Philip/opt/src/gsl-2.6':
configure:3553: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-Apple-darwin19.2.0
ac_cv_env_CC_set=set
ac_cv_env_CC_value=x86_64-Apple-darwin13.4.0-clang
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_Host_alias_set=
ac_cv_env_Host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_Host=x86_64-Apple-darwin19.2.0
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=x86_64-Apple-darwin13.4.0-clang
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${Shell} /Users/Philip/opt/src/gsl-2.6/missing aclocal-1.13'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-ar'
AS='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-as'
AUTOCONF='${Shell} /Users/Philip/opt/src/gsl-2.6/missing autoconf'
AUTOHEADER='${Shell} /Users/Philip/opt/src/gsl-2.6/missing autoheader'
AUTOMAKE='${Shell} /Users/Philip/opt/src/gsl-2.6/missing automake-1.13'
AWK='awk'
CC='x86_64-Apple-darwin13.4.0-clang'
CCDEPMODE=''
CFLAGS='-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe'
CPP=''
CPPFLAGS='-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9'
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
GSLCBLAS_LDFLAGS=''
GSL_CFLAGS=''
GSL_LDFLAGS=''
GSL_LIBADD=''
GSL_LIBM=''
GSL_LIBS=''
GSL_LT_CBLAS_VERSION='0:0:0'
GSL_LT_VERSION='25:0:0'
GSL_MAJOR_VERSION='2'
GSL_MINOR_VERSION='6'
HAVE_AIX_IEEE_INTERFACE=''
HAVE_DARWIN86_IEEE_INTERFACE=''
HAVE_DARWIN_IEEE_INTERFACE=''
HAVE_FREEBSD_IEEE_INTERFACE=''
HAVE_GNUM68K_IEEE_INTERFACE=''
HAVE_GNUPPC_IEEE_INTERFACE=''
HAVE_GNUSPARC_IEEE_INTERFACE=''
HAVE_GNUX86_IEEE_INTERFACE=''
HAVE_HPUX11_IEEE_INTERFACE=''
HAVE_HPUX_IEEE_INTERFACE=''
HAVE_IRIX_IEEE_INTERFACE=''
HAVE_NETBSD_IEEE_INTERFACE=''
HAVE_OPENBSD_IEEE_INTERFACE=''
HAVE_OS2EMX_IEEE_INTERFACE=''
HAVE_SOLARIS_IEEE_INTERFACE=''
HAVE_SUNOS4_IEEE_INTERFACE=''
HAVE_TRU64_IEEE_INTERFACE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-ld'
LDFLAGS='-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs'
LIBM=''
LIBOBJS=''
LIBS=''
LIBTOOL='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-libtool'
LIPO='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${Shell} /Users/Philip/opt/src/gsl-2.6/missing makeinfo'
MANIFEST_TOOL=''
MKDIR_P='./install-sh -c -d'
NM='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-nm'
NMEDIT='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-nmedit'
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-otool'
PACKAGE='gsl'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='gsl'
PACKAGE_STRING='gsl 2.6'
PACKAGE_TARNAME='gsl'
PACKAGE_URL=''
PACKAGE_VERSION='2.6'
PATH_SEPARATOR=':'
RANLIB='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-ranlib'
SED='/usr/bin/sed'
SET_MAKE=''
Shell='/bin/sh'
STRIP='/Users/Philip/opt/anaconda3/bin/x86_64-Apple-darwin13.4.0-strip'
VERSION='2.6'
ac_ct_AR=''
ac_ct_CC='x86_64-Apple-darwin13.4.0-clang'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-Apple-darwin19.2.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin19.2.0'
build_vendor='Apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
Host='x86_64-Apple-darwin19.2.0'
Host_alias=''
Host_cpu='x86_64'
Host_os='darwin19.2.0'
Host_vendor='Apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${Shell} /Users/Philip/opt/src/gsl-2.6/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/Users/Philip/opt/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "gsl"
#define PACKAGE_TARNAME "gsl"
#define PACKAGE_VERSION "2.6"
#define PACKAGE_STRING "gsl 2.6"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "gsl"
#define VERSION "2.6"
#define RELEASED /**/

configure: exit 77
4
phageman
> mkdir -p ~/opt/src
> cd ~/opt/src
> curl -O http://mirror.us-midwest-1.nexcess.net/gnu/gsl/gsl-2.6.tar.gz
> tar zxf gsl-2.6.tar.gz
> cd gsl-2.6
> ./configure --prefix=$HOME/opt/usr/local
> make
> make install

> export CFLAGS="-I$HOME/opt/usr/local/include"
> export LDFLAGS="-L$HOME/opt/usr/local/lib -lgsl -lgslcblas" 
> R 

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-Apple-darwin15.6.0 (64-bit)
...
...
> install.packages("gsl")
...
...
...
There is a binary version available but the source version is later:
      binary source needs_compilation
gsl 1.9-10.3  2.1-6              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
...
...
> install.packages("copula")
> library(copula)
>

更新

あなたの場合、状況は少し厄介です。 gccx86_64-Apple-darwin13.4.0-clangとして解決されます。

このコードをコンパイルしてみてください

/* confdefs.h */
#define PACKAGE_NAME "gsl"
#define PACKAGE_TARNAME "gsl"
#define PACKAGE_VERSION "2.6"
#define PACKAGE_STRING "gsl 2.6"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "gsl"
#define VERSION "2.6"
#define RELEASED /**/
/* end confdefs.h.  */

int
main ()
{
  ;
  return 0;
}

次の方法

> clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs main.c

XCodeインストールのツールを使用

次に、このようにCコンパイラを設定してみます。

export CC="/usr/bin/clang"

GSLを構成する前。

0
Oo.oO