在使用 enrichplot 包解决 openssl 包依赖的时候,发现提示 libssl.so.1.0.0 动态库找不到:

    1. > install.packages("openssl")
    2. --- Please select a CRAN mirror for use in this session ---
    3. trying URL 'http://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/openssl_1.3.tar.gz'
    4. Content type 'application/x-gzip' length 1218896 bytes (1.2 MB)
    5. ==================================================
    6. downloaded 1.2 MB
    7. * installing *source* package openssl ...
    8. ** package openssl successfully unpacked and MD5 sums checked
    9. ** using staged installation
    10. Found pkg-config cflags and libs!
    11. Using PKG_CFLAGS=-I/Bioinfo/Pipeline/SoftWare/Anaconda2/include
    12. Using PKG_LIBS=-L/Bioinfo/Pipeline/SoftWare/Anaconda2/lib -l:libssl.so.1.0.0 -l:libcrypto.so.1.0.0
    13. ** libs
    14. ......
    15. ** R
    16. ** inst
    17. ** byte-compile and prepare package for lazy loading
    18. ** help
    19. *** installing help indices
    20. ** building package indices
    21. ** installing vignettes
    22. ** testing if installed package can be loaded from temporary location
    23. Error: package or namespace load failed for openssl in dyn.load(file, DLLpath = DLLpath, ...):
    24. unable to load shared object '/Bioinfo/Pipeline/SoftWare/R/R-3.6.0/lib64/R/library/00LOCK-openssl/00new/openssl/libs/openssl.so':
    25. libssl.so.1.0.0: cannot open shared object file: No such file or directory
    26. Error: loading failed
    27. Execution halted
    28. ERROR: loading failed
    29. * removing ‘/Bioinfo/Pipeline/SoftWare/R/R-3.6.0/lib64/R/library/openssl
    30. The downloaded source packages are in
    31. ‘/tmp/RtmpTySsWL/downloaded_packages
    32. Updating HTML index of packages in '.Library'
    33. Making 'packages.html' ... done
    34. Warning message:
    35. In install.packages("openssl") :
    36. installation of package openssl had non-zero exit status

    仔细翻查 log 才发现我所用的 R-3.6.0 在安装 R 包的时候,默认调用了 Anaconda2 下面的 PKG_CFLAGS 和 PKG_LIBS,想要更改这两个变量需要更改在安装 R 包时调用的 pkg-config,我的 R-3.6.0 默认使用的是 /Bioinfo/Pipeline/SoftWare/Anaconda2/bin/pkg-config。

    重新安装 pkg-config-0.29.2:

    1. $ wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz --no-check-certificate
    2. $ tar zvxf pkg-config-0.29.2.tar.gz
    3. $ cd pkg-config-0.29.2
    4. $ ./configure --prefix=/Bioinfo/Pipeline/SoftWare/pkg-config-0.29.2
    5. $ make
    6. $ make install

    把 pkg-config-0.29.2 添加到环境变量:

    1. export PATH="/Bioinfo/Pipeline/SoftWare/pkg-config-0.29.2/bin:$PATH

    最后,source ~/.bashrc,使用 install.packages(“openssl”) 安装,一切正常。