Больше не могу устанавливать пакеты R - PullRequest
1 голос
/ 26 марта 2020

Я использую для анализа биологических данных. Я на Mac OS Catalina 10.15.4. Я недавно обновил R до version 3.6.3, потому что думал, что это решит мою неспособность установить определенный пакет: DESeq2. Огромная ошибка - среди многих, которые я, вероятно, сделал, пытаясь устранить неполадки, не понимая, в чем проблема. Я не могу установить ЛЮБЫЕ пакеты сейчас. Я обновил свою версию Clang, когда спустился в кроличью нору потенциальных решений на inte rnet. Я собирался обновить , но я хочу понять, в чем проблема на самом деле, прежде чем слепо попробовать еще.

Теперь я понизился до R 3.5.3 (я бы хотел придерживаться этой версии R).

Qst: Используя R 3.5.3, как мне снова успешно установить пакеты из CRAN? А также из биокондуктора, как пакет DESeq2?

Предупреждение об ошибке ниже:

install.packages("readr")
    Warning in install.packages :
      unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5:
      cannot open URL 'http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
    Package which is only available in source form, and may need compilation of
      C/C++/Fortran: ‘readr’
    Do you want to attempt to install these from sources? (Yes/no/cancel) y
    installing the source package ‘readr’

    trying URL 'http://cran.rstudio.com/src/contrib/readr_1.3.1.tar.gz'

    Content type 'application/x-gzip' length 268853 bytes (262 KB)
    ==================================================
    downloaded 262 KB

    * installing *source* package ‘readr’ ...
    ** package ‘readr’ successfully unpacked and MD5 sums checked
    ** libs
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c Collector.cpp -o Collector.o
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c CollectorGuess.cpp -o CollectorGuess.o
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c Iconv.cpp -o Iconv.o
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c LocaleInfo.cpp -o LocaleInfo.o
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
    clang++  -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"
-I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include"
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -I. -Ircon -fPIC  -Wall -g -O2  -c Reader.cpp -o Reader.o
    In file included from Reader.cpp:1:
    In file included from ./Reader.h:3:
    In file included from ./Collector.h:5:
    In file included from ./DateTimeParser.h:6:
    In file included from ./QiParsers.h:4:
    In file included from ./boost.h:6:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:655:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/gethostuuid.h:39:17:
error: unknown type name 'uuid_t'
    int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
                    ^
    In file included from Reader.cpp:1:
    In file included from ./Reader.h:3:
    In file included from ./Collector.h:5:
    In file included from ./DateTimeParser.h:6:
    In file included from ./QiParsers.h:4:
    In file included from ./boost.h:6:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:662:27:
error: unknown type name 'uuid_t'; did you mean 'uid_t'?
    int      getsgroups_np(int *, uuid_t);
                                  ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31:
note: 'uid_t' declared here
    typedef __darwin_uid_t        uid_t;
                                  ^
    In file included from Reader.cpp:1:
    In file included from ./Reader.h:3:
    In file included from ./Collector.h:5:
    In file included from ./DateTimeParser.h:6:
    In file included from ./QiParsers.h:4:
    In file included from ./boost.h:6:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:664:27:
error: unknown type name 'uuid_t'; did you mean 'uid_t'?
    int      getwgroups_np(int *, uuid_t);
                                  ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31:
note: 'uid_t' declared here
    typedef __darwin_uid_t        uid_t;
                                  ^
    In file included from Reader.cpp:1:
    In file included from ./Reader.h:3:
    In file included from ./Collector.h:5:
    In file included from ./DateTimeParser.h:6:
    In file included from ./QiParsers.h:4:
    In file included from ./boost.h:6:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:727:31:
error: unknown type name 'uuid_t'; did you mean 'uid_t'?
    int      setsgroups_np(int, const uuid_t);
                                      ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31:
note: 'uid_t' declared here
    typedef __darwin_uid_t        uid_t;
                                  ^
    In file included from Reader.cpp:1:
    In file included from ./Reader.h:3:
    In file included from ./Collector.h:5:
    In file included from ./DateTimeParser.h:6:
    In file included from ./QiParsers.h:4:
    In file included from ./boost.h:6:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/interprocess/file_mapping.hpp:15:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config.hpp:57:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/platform/macos.hpp:28:
    In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/detail/posix_features.hpp:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:729:31:
error: unknown type name 'uuid_t'; did you mean 'uid_t'?
    int      setwgroups_np(int, const uuid_t);
                                      ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h:31:31:
note: 'uid_t' declared here
    typedef __darwin_uid_t        uid_t;
                                  ^
    5 errors generated.
    make: *** [Reader.o] Error 1
    ERROR: compilation failed for package ‘readr’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/readr’
    Warning in install.packages :
      installation of package ‘readr’ had non-zero exit status

    The downloaded source packages are in
      ‘/private/var/folders/49/18qlr0bn7xg_mk2pzxvrb0f80000gn/T/RtmpN5hCja/downloaded_packages’

Благодарим вас за помощь.

Ответы [ 3 ]

0 голосов
/ 27 марта 2020

Мне кажется, проблема в том, что тип uuid_t нигде не определен. Поэтому объявление в строка 662 в файле / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / usr / include / unistd.h вызовет ошибку, например.

В первой попытке я попытался добавить одну строку в этот файл unistd.h: # include at line 83 . Но это не помогает.

Поскольку я не хочу go глубже редактировать многие системные файлы, я добавляю еще одну строку в unistd.h, чтобы вручную определить тип uuid_t, основываясь на определении в _uuid_t.h. typedef __darwin_uuid_t uuid_t; в строка 661 , после "# endif" .

Тогда это сработало.

Я не уверен, если это ошибка в исходном коде MacOSX.10.15.sdk или нет. Но если вы хотите исправить это таким образом, убедитесь, что у вас есть разрешение root при редактировании этих файлов.

0 голосов
/ 27 марта 2020

Я использовал эти 2 сообщения для решения своей проблемы:

https://www.nistara.net/post/compile-issues-r/

https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/

Спасибо профессору без одежды и Нистаре Рандхаве

0 голосов
/ 26 марта 2020

У меня была такая же проблема на моей маме c! Я бегу Мохаве. Похоже, что недавно была проблема с CRAN. Добавить следующий аргумент репо сработал для меня:

install.packages("readr", repo = 'https://mac.R-project.org')

Дополнительная информация: https://community.rstudio.com/t/i-can-t-install-packages-on-r-studio-non-zero-exit-status/52135

...