自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(1)
  • 资源 (1)
  • 收藏
  • 关注

原创 算法笔记(40)

1 斐波拉契数列,递归,复杂度2的n次方e 二分查找:O(logn) 二叉树的遍历:O(n) 每个节点遍历仅遍历一次 排序的二维矩阵的查找:O(n) 快排:O(nlogn) 2 优先队列 正常入,按优先级出。实现机制:1) 堆(二叉堆,多项式堆,斐波拉契堆),二叉搜索树。 小顶堆:最小的在最上面 3 Hashmap:平均时间复杂度:查找,删除,插入复杂度O(1)。最差的时间复...

2019-12-28 16:23:38 117

R-3.2.2.tar.gz linux 版本

2)安装: 解压: cd /software tar -zxvf R-3.3.2.tar.gz mkdir -p /home/liyg/software/R cd R-3.3.2 ./configure --prefix=/home/liyg/software/R --enable-R-shlib 3) 报错和解决方法:./configure --prefix=/home/liyg/software/R --enable-R-shlib a) 报错如下: configure:5783: result: no configure:5846: checking for cc configure:5893: result: no configure:5949: checking for cl.exe configure:5979: result: no configure:6003: error: in `/software/R-3.3.2': configure:6005: error: no acceptable C compiler found in $PATH See `config.log' for more details 解决方法:yum install gcc b) 报错如下: checking for fc... no configure: error: No F77 compiler found 解决方法:yum install gcc-gfortran c)报错如下: checking how to run the C++ preprocessor... /lib/cpp configure: error: in `/software/R-3.3.2': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details 解决方法:yum install gcc gcc-c++ d)报错如下: --with-readline=yes (default) and headers/libs are not available 解决方法:yum install readline-devel e)报错如下: –with-x=yes (default) and X11 headers/libs are not available 解决方法:yum install libXt-devel f)报错如下: checking for rpc/xdr.h... yes checking for XDR support... yes checking for inflateInit2_ in -lz... no checking whether zlib support suffices... configure: error: zlib library and headers are required 解决方法:yum install zlib-devel yum -y install bzip2-devel g)报错如下:zlib版本太低! checking if zlib version >= 1.2.5... no checking whether zlib support suffices... configure: error: zlib library and headers are required 解决方法:下载:http://zlib.NET/zlib-1.2.8.tar.gz tar xzvf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure --prefix=$HOME/packages 设置环境变量: export PATH=/software/packages/bin:$PATH export LD_LIBRARY_PATH=/software/packages/lib:$LD_LIBRARY_PATH export CFLAGS="-fPIC -I/software/packages/include" export LDFLAGS="-fPIC -L/software/packages/lib" h) 报错如下:bzip2 版本太低 checking bzlib.h presence... yes checking for bzlib.h... yes checking if bzip2 version >= 1.0.6... no checking whether bzip2 support suffices... configure: error: bzip2 library and headers are required 解决方法:下载:http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz tar -zxvf bzip2-1.0.6.tar.gz cd bzip2-1.0.6 make make install PREFIX=/software/packages make -f Makefile-libbz2_so //建立共享library,可能会报错!后面有解决方法! i) 报错如下: checking for lzma_version_number in -llzma... no configure: error: "liblzma library and headers are required" 解决方法:yum -y install xz-devel.x86_64 j)报错如下:版本太低 checking if lzma version >= 5.0.3... no configure: error: "liblzma library and headers are required" 解决方法:下载:http://tukaani.org/xz/xz-5.2.2.tar.gz tar xzvf xz-5.2.2.tar.gz cd xz-5.2.2 ./configure --prefix=/software/packages make -j3 make install k)报错如下:版本太低 checking if PCRE version >= 8.10, < 10.0 and has UTF-8 support... no checking whether PCRE support suffices... configure: error: pcre >= 8.10 library and headers are required 解决方法:下载:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz tar xzvf pcre-8.38.tar.gz cd pcre-8.38 ./configure --prefix=/software/packages make -j3 make install l)报错如下:编码不对 checking if PCRE version >= 8.10, < 10.0 and has UTF-8 support... no checking whether PCRE support suffices... configure: error: pcre >= 8.10 library and headers are required 解决方法: cd pcre-8.38 ./configure --enable-utf8 --prefix=/software/packages make make install m)错误如下: checking for curl-config... no checking curl/curl.h usability... no checking curl/curl.h presence... no checking for curl/curl.h... no configure: error: libcurl >= 7.28.0 library and headers are required with support for https 解决办法:下载: https://curl.haxx.se/download/curl-7.47.1.tar.gz ./configure --prefix=/software/packages make -j3 make install n)错误如下:https是安全的需要安装:openssl checking if libcurl is version 7 and >= 7.28.0... yes checking if libcurl supports https... no configure: error: libcurl >= 7.28.0 library and headers are required with support for https 解决方法:下载:openssl-1.0.1u.tar.gz tar -xzvf openssl-1.0.1u.tar.gz cd openssl-1.0.1u ./config -fPIC --prefix=/usr/local/openssl enable-shared ./config -t make && make install 设置环境变量: export OPENSSL=/usr/local/openssl/bin export PATH=$OPENSSL:$PATH:$HOME/bin 重新安装curl:指定openssl ./configure --prefix=/software/packages --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib make -j3 make install 4)重新编译: cd R-3.3.2 ./configure --prefix=/home/liyg/software/R --enable-R-shlib 编译成功:结果如下: Source directory: . Installation directory: /home/liyg/software/R C compiler: gcc -std=gnu99 -I/software/packages/include Fortran 77 compiler: gfortran -g -O2 C++ compiler: g++ -g -O2 C++11 compiler: g++ -std=c++0x -g -O2 Fortran 90/95 compiler: gfortran -g -O2 Obj-C compiler: Interfaces supported: X11 External libraries: readline, curl Additional capabilities: NLS Options enabled: shared R library, shared BLAS, R profiling Capabilities skipped: PNG, JPEG, TIFF, cairo, ICU Options not enabled: memory profiling Recommended packages: yes configure: WARNING: you cannot build info or HTML versions of the R manuals configure: WARNING: you cannot build PDF versions of the R manuals configure: WARNING: you cannot build PDF versions of vignettes and help pages 5)执行编译: make 报错如下: gcc -std=gnu99 -shared -fopenmp -L/software/packages/lib -o libR.so CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o radixsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o `ls ../unix/*.o ../appl/*.o ../nmath/*.o` ../extra/tre/libtre.a -L../../lib -lRblas -lgfortran -lm -lreadline -lpcre -llzma -lbz2 -lz -lrt -ldl -lm /usr/bin/ld: /software/packages/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC /software/packages/lib/libbz2.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[3]: *** [libR.so] Error 1 make[3]: Leaving directory `/software/R-3.3.2/src/main' make[2]: *** [R] Error 2 make[2]: Leaving directory `/software/R-3.3.2/src/main' make[1]: *** [R] Error 1 make[1]: Leaving directory `/software/R-3.3.2/src' make: *** [R] Error 1 -fPIC --prefix=/usr/local/openssl enable-shared 解决方法:重新编译安装libbz2!并指定 -fPIC!!!共享library 步骤: 第一:设置环境变量:注意:CFLAGS和LDFLAGS 加上 -fPIC 如下: export PATH=/software/packages/bin:$PATH export LD_LIBRARY_PATH=/software/packages/lib:$LD_LIBRARY_PATH export CFLAGS="-fPIC -I/software/packages/include" export LDFLAGS="-fPIC -L/software/packages/lib" 第二:指定-fPIC编译:重新编译步骤:h) cd bzip2-1.0.6 make CC='gcc -fPIC' make install PREFIX=/software/packages make -f Makefile-libbz2_so //建立共享library,不会报错说明正确 第三:重新编译R: cd /software/R-3.3.2 ./configure --prefix=/home/liyg/software/R --enable-R-shlib make //需要等比较长时间 结果:终于编译成功!!!!!太不容易了!! 结果信息如下: trying to compile and link a JNI program detected JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/Linux detected JNI linker flags : -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm make[2]: Entering directory `/tmp/Rjavareconf.BzLkuk' gcc -std=gnu99 -I/software/R-3.3.2/include -DNDEBUG -I/usr/Java/jdk1.7.0_67-cloudera/include -I/usr/java/jdk1.7.0_67-cloudera/include/linux -I/usr/local/include -fpic -fPIC -I/software/packages/include -c conftest.c -o conftest.o gcc -std=gnu99 -shared -L/software/R-3.3.2/lib -fPIC -L/software/packages/lib -o conftest.so conftest.o -L/usr/java/jdk1.7.0_67-cloudera/jre/lib/amd64/server -ljvm -L/software/R-3.3.2/lib -lR make[2]: Leaving directory `/tmp/Rjavareconf.BzLkuk' JAVA_HOME : /usr/java/jdk1.7.0_67-cloudera Java library path: $(JAVA_HOME)/jre/lib/amd64/server JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux JNI linker flags : -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm Updating java configuration in /software/R-3.3.2 Done. make[1]: Leaving directory `/software/R-3.3.2' 6) 执行make install 即可: 结果如下: make[3]: Leaving directory `/software/R-3.3.2/src/modules/internet' make[3]: Entering directory `/software/R-3.3.2/src/modules/lapack' make[3]: Leaving directory `/software/R-3.3.2/src/modules/lapack' make[3]: Entering directory `/software/R-3.3.2/src/modules/X11' make[3]: Leaving directory `/software/R-3.3.2/src/modules/X11' make[2]: Leaving directory `/software/R-3.3.2/src/modules' make[2]: Entering directory `/software/R-3.3.2/src/library' mkdir -p -- /home/liyg/software/R/lib64/R/library installing packages ... building HTML index ... make[2]: Leaving directory `/software/R-3.3.2/src/library' make[1]: Leaving directory `/software/R-3.3.2/src' make[1]: Entering directory `/software/R-3.3.2/tests' make[1]: Nothing to be done for `install'. make[1]: Leaving directory `/software/R-3.3.2/tests' 此时:终于在redhat6上安装成功!R语言编译安装太不容易了! 建议:如果是redhat6的系统,为了避免版本问题:可以安装低一点版本的R,可能不会有这么多问题吧! 谢谢大家!

2017-08-31

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除