科学网

 找回密码
  注册

tag 标签: install

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

Matlab: install M_Map in mac
haibaraxx 2016-9-6 04:22
1. Download the M-Map zip archive file from https://www.eoas.ubc.ca/~rich/map.html 2. Unpack the zip archive and its sunfolder in the path: /Applications/MATLAB_R2015a.app/toolbox/ 1) find the Applications folder, right click it and left click Open Applications ; 2) find the icon Matlab_R2015a, right click it and left click Show Package Contents ; 3) double click the folder toolbox ; 4) move the unpacked M-Map folder to the folder toolbox . 3. Open Matlab GUI, and run the following command: addpath /Applications/MATLAB_R2015a.app/toolbox/m_map 4. Update the cache file using the command: rehash toolboxcache 5. Finish! Test M-Map using the commands: m_proj('oblique mercator'); m_coast; m_grid; M_map_GettingStarted.pdf
个人分类: Matlab|4775 次阅读|0 个评论
How To Install gpaw On Ubuntu 15.10 or 16.04
plgongcat 2016-6-8 14:07
ubuntu 16.04LTS 1. sudo apt-get update You can now install the package like this. Install gpaw 2. sudo apt-get install gpaw That is all! 这里安装的是0.11版本! From: http://installion.co.uk/ubuntu/wily/universe/g/gpaw/install/index.html more details about GPAW: https://wiki.fysik.dtu.dk/gpaw/ 如果需要最新版本1.0.0(查询依赖软件的版本),直接用上面的方法是不行额!因为还没有最新版本的deb。 我们也有办法: 1. $ sudo apt-get install python 查看版本: dpkg -l python (2.7.11) 2. $ sudo apt-get install python-numpy (1.11.0) 3. ase需要3.10以上的, https://packages.debian.org/sid/all/python-ase/download python-ase_3.11.0-1_all.deb 3.1. 安装这个deb用gdebi才可以。$ sudo apt-get install gdebi 然后选择 python-ase_3.11.0-1_all.deb,右键选择gdebi安装! 4. blas、lapack安装。 $ sudo apt-get install libblas-dev $ sudo apt-get install liblapack-dev 5. libxc安装 (可不用) $ sudo apt-get install libxc-dev 6. mpi环境 $ sudo apt-get install libopenmpi-dev 7. gpaw安装 https://wiki.fysik.dtu.dk/gpaw/gpaw-1.0.1b1.tar.gz 解压进入目录,$ python setup.py install --user 8. 安装gpaw-setups 9. $ sudo apt-get install python-matplotlib 下载 https://wiki.fysik.dtu.dk/gpaw-files/gpaw-setups-0.9.20000.tar.gz Set the environment variable GPAW_SETUP_PATH to point to the directory gpaw-setups- version / , e.g. for bash users, you would put into ~/.bashrc : export GPAW_SETUP_PATH=~/gpaw-setups-version ok!!! 8. pip安装 6.1 $ wget https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py 6.2 $ sudo python distribute_setup.py 6.3 $ which easy_install 6.4 $ /usr/local/bin/easy_install 6.5 $ sudo easy_install pip 6.6 $ which pip pip install -U gpaw
个人分类: 软件学习|5421 次阅读|0 个评论
[转载]linux不用sudo编译emacs
fredade 2016-1-1 11:54
1. Instead of starting with ./configure, use the configure options to tell the build system where you want the files to end up. For example: ./configure --prefix=/home/abhi/emacs --bindir=/home/abhi/bin will install all of emacs' support files under /home/abhi/emacs, and the emacs executables in /home/abhi/bin. If the latter is in your $PATH, which it usually is, then things should Just Work(sm). 2. After that you can make make install without worrying about the installation putting files other than in your home directory. (This is all based on your home directory being /home/abhi, of course. Edit as necessary.)
个人分类: 工具使用|3 次阅读|0 个评论
siesta-3.2安装
DonarF1 2015-10-16 06:45
Install siesta and transiesta (siesta-3.2-pl-5.tar.gz) on the HLRN-smp system 1) load related modules module unload sw.mpp1 module load sw.smp1 module load intel.studio/14.0.1.106 module load openmpi/1.8.4-intel 2) cd siesta-3.0-b/Obj/ 3) sh ../Src/obj_setup.sh 4) ../Src/configure 5) edit arch.make (changes in red) according to cluster's configuration, posting it as follows: # # This file is part of the SIESTA package. # # Copyright (c) Fundacion General Universidad Autonoma de Madrid: # E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal # and J.M.Soler, 1996- . # # Use of this software constitutes agreement with the full conditions # given in the SIESTA license, as signed by all legitimate users. # .SUFFIXES: .SUFFIXES: .f .F .o .a .f90 .F90 SIESTA_ARCH=x86_64-unknown-linux-gnu--Intel FPP= FPP_OUTPUT= FC=mpif90 RANLIB=ranlib SYS=nag SP_KIND=4 DP_KIND=8 KINDS=$(SP_KIND) $(DP_KIND) FFLAGS= -O3 -i-static FFLAGS_DEBUG= -g FPPFLAGS= -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI -DGRID_DP -DPHI_GRID_SP #FPPFLAGS= -DFC_HAVE_FLUSH -DFC_HAVE_ABORT LDFLAGS= ARFLAGS_EXTRA= FCFLAGS_fixed_f= FCFLAGS_free_f90= FPPFLAGS_fixed_F= FPPFLAGS_free_F90= #BLAS_LIBS=libblas.a #LAPACK_LIBS=dc_lapack.a liblapack.a #BLACS_LIBS= #SCALAPACK_LIBS= BLAS_LIBS= -L/sw/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_blacs_lp64 -lmkl_intel_thread -liomp5 -lpthread -lmkl_sequential -lmkl_core -i-static LAPACK_LIBS=-L/sw/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64 -lmkl_sequential -lmkl_core BLACS_LIBS=-L/sw/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64 -lmkl_blacs_openmpi_lp64 SCALAPACK_LIBS=-L/sw/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64 -lmkl_scalapack_lp64 #COMP_LIBS=dc_lapack.a liblapack.a libblas.a COMP_LIBS= #NETCDF_LIBS= #NETCDF_INTERFACE= LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS) #SIESTA needs an F90 interface to MPI #This will give you SIESTA's own implementation #If your compiler vendor offers an alternative, you may change #to it here. MPI_INTERFACE= libmpi_f90.a MPI_INCLUDE= /sw/comm/openmpi/1.8.4/smp1-intel/include #Dependency rules are created by autoconf according to whether #discrete preprocessing is necessary or not. .F.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $ .F90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $ .f.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $ .f90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $ make; (to get siesta executable) make clean; make transiesta (to get transiesta executable )
个人分类: siesta|6595 次阅读|0 个评论
win8.1 install on vmware workstation
yujianshengucas 2015-6-10 09:10
win8.1 资源 下载: http://www.itellyou.cn/ (含windows其他资源) 安装参考: http://www.jb51.net/softjc/159883.html http://jingyan.baidu.com/article/a24b33cd6aada119fe002ba1.html http://fashion.pconline.com.cn/article_source/218435.html#JjumpPos
个人分类: 小结|1655 次阅读|0 个评论
ubuntu/Centos7 下 matlab2009b 安装
yujianshengucas 2014-11-25 20:36
matlab_unix_2009b.iso 1. 建立挂载目录:sudo mkdir /mnt/ (此处挂载在/mnt/matlab下) 挂载:sudo mount -o loop /root/filename.iso /mnt/ 2.安装: cd /mnt/ sudo ./install 参考:crack中的install安装说明 具体过程参照安装说明 inst_doc.pdf 中的 Installing and Activating Without an Internet Connection这一节的介绍。可以改安装目录位置,自己详看英文部分。破解在crack standalone 1) choose install manually without using the internet 2) enter the file installation key 36322-23096-57999-54517-22630 3) use license_standalone.dat when asked for license file 错误: ./install: 1: ./install: /lib/libc.so.6: not found (极易出错的地方) libc.so.6 库的问题,一个是 java 的 jre 的问题 此处安装失败有两个原因: (1)是 libc.so.6库 的问题(即解决链接库错误问题) 解决方法: locate libc.so (我的是64位) /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so For 64 bit: sudo ln -s /lib64/x86_64-linux-gnu/libc-2.13.so /lib64/libc.so.6(我的)黑体部分换成自己的路径 For 32 bit: sudo ln -s /lib/i386-linux-gnu/libc-2.13.so /lib/libc.so.6 注:不能照搬命令,要着对链接 (2)java 的jre的问题 要安装java,matlab是在java环境下安装的 选择下面的“install manually without using the internet” 注意选择(凹陷下去的表示是选择项),此处选Linux(X86_64) 一定要出现continue选项,激活activae,不然安装不成功 选择 lic_standalone.dat 文件 3.卸载 sudo umount /mnt/ 4. 字体乱码问题: 主要是matlab缺少识别中文的字体,可以把ubuntu/centos系统的中文字体复制到matlab字体库。 具体参照: http://www.cnblogs.com/RigorosLee/archive/2011/03/10/1979602.html http://blog.csdn.net/gaotianyou/article/details/6770290 我的是centos7: cd /home/yu/apps/matlab2009b/sys/java/jre/glnxa64/jre/lib/fonts mkdir fallback cd /usr/share/fonts/ 将目录下的wqy-microhei/wqy-microhei.ttc,wqy-zenhei/wqy- zenhei.ttc,winfonts/simsun.ttc 复制到 fallback中 cd f allback ; mkfontscale;cd ../ ; 更改fonts.dir可写权限,sudo chmod 777 fonts.dir sudo cat fallback/fonts.scale fonts.dir 5. 命令启动matlab:sudo apps/matlab2009b/bin/matlab 设置桌面启动: 桌面右上角点击---启动应用程序---添加---输入name:matlab2009b command 编辑框中填带开matlab的路径:apps/matlab2009b/bin/matlab(我的) 拖动图标到桌面,右击鼠标属性,修改权限为可执行,点击属性的图标,还可修改图标为matlab图片格式,在matlab2009中查找 matlab.png 添加环境变量: export PATH=”$PATH:/usr/local/ matlab /R2010b/bin“ 主要参考: http://blog.csdn.net/matrix_laboratory/article/details/8702442 6. 运行 matlab -nodesktop -nosplash -r matlab_file 只用文件名 matlab_file ,不添加.m http://blog.csdn.net/ws_20100/article/details/48492307 7. 在matlab中调用linux命令 方法一:Unix命令 unix('mkdir test.txt'); unix('lammps'); 方法二:! 这种方法比较简便,推荐采用。 ! mkdir test.txt! lammps
个人分类: matlab|4252 次阅读|0 个评论
windows xp R 3.03 install ggplot2
xiangxing 2014-5-4 23:25
------------------------------------------------------------ 2014-04-26 13:29:17 下午 安装ggplot2失败记录(不喜欢的直接拉到底部看结论) ------------------------------------------------------------ #环境:windows XP + R 3.03 install.packages(ggplot2) --- 在此連線階段时请选用CRAN的鏡子 --- #选择的镜像是国内China(Beijing2) also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’ 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/colorspace_1.2-4.zip' Content type 'application/zip' length 384299 bytes (375 Kb) 打开了URL downloaded 375 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/Rcpp_0.11.1.zip' Content type 'application/zip' length 3009433 bytes (2.9 Mb) 打开了URL downloaded 4053 bytes 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/stringr_0.6.2.zip' Content type 'application/zip' length 75038 bytes (73 Kb) 打开了URL downloaded 73 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/RColorBrewer_1.0-5.zip' Content type 'application/zip' length 25286 bytes (24 Kb) 打开了URL downloaded 24 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/dichromat_2.0-0.zip' Content type 'application/zip' length 147536 bytes (144 Kb) 打开了URL downloaded 144 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/munsell_0.4.2.zip' Content type 'application/zip' length 126490 bytes (123 Kb) 打开了URL downloaded 123 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/labeling_0.2.zip' Content type 'application/zip' length 40403 bytes (39 Kb) 打开了URL downloaded 39 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/plyr_1.8.1.zip' Content type 'application/zip' length 1150878 bytes (1.1 Mb) 打开了URL downloaded 1.1 Mb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/digest_0.6.4.zip' Content type 'application/zip' length 136446 bytes (133 Kb) 打开了URL downloaded 12 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/gtable_0.1.2.zip' Content type 'application/zip' length 63558 bytes (62 Kb) 打开了URL downloaded 62 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/reshape2_1.4.zip' Content type 'application/zip' length 500016 bytes (488 Kb) 打开了URL downloaded 488 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/scales_0.2.4.zip' Content type 'application/zip' length 150525 bytes (146 Kb) 打开了URL downloaded 146 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/proto_0.3-10.zip' Content type 'application/zip' length 458271 bytes (447 Kb) 打开了URL downloaded 122 Kb 试开URL’http://ftp.ctex.org/mirrors/CRAN/bin/windows/contrib/3.0/ggplot2_0.9.3.1.zip' Content type 'application/zip' length 2656714 bytes (2.5 Mb) 打开了URL downloaded 929 Kb 程序包‘colorspace’打开成功,MD5和检查也通过 错误于read.dcf(file.path(pkgname, DESCRIPTION), c(Package, Type)) : 无法打开链结 此外: 警告信息: 1: In download.file(url, destfile, method, mode = wb, ...) : 下载的长度4053不等于报告的长度3009433 2: In download.file(url, destfile, method, mode = wb, ...) : 下载的长度12694不等于报告的长度136446 3: In download.file(url, destfile, method, mode = wb, ...) : 下载的长度125015不等于报告的长度458271 4: In download.file(url, destfile, method, mode = wb, ...) : 下载的长度951573不等于报告的长度2656714 5: In unzip(zipname, exdir = dest) : 从zip文件中抽取1时出了错 6: In read.dcf(file.path(pkgname, DESCRIPTION), c(Package, Type)) : 无法打开压缩文件'Rcpp/DESCRIPTION',可能是因为'No such file or directory' -------------------------------------------------------------------------------- 悲剧结束!!!想想五一快到啦! -------------------------------------------------------------------------------- ============================================================ 2014-05-04 22:36:17 安装ggplot2成功记录 ============================================================ Welcome at Sun May 04 22:08:34 2014 #选择厦门大学信息与网络中心开源软件镜像服务China(Xiamen) #http://mirrors.xmu.edu.cn/ #欢迎使用厦门大学信息与网络中心开源软件镜像服务 install.packages(ggplot2) --- 在此連線階段时请选用CRAN的鏡子 --- also installing the dependencies ‘colorspace’, ‘Rcpp’, ‘munsell’, ‘labeling’, ‘plyr’, ‘reshape2’, ‘scales’, ‘proto’ 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/colorspace_1.2-4.zip' Content type 'application/zip' length 384262 bytes (375 Kb) 打开了URL downloaded 375 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/Rcpp_0.11.1.zip' Content type 'application/octet-stream' length 3009433 bytes (2.9 Mb) 打开了URL downloaded 2.9 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/munsell_0.4.2.zip' Content type 'application/zip' length 126002 bytes (123 Kb) 打开了URL downloaded 123 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/labeling_0.2.zip' Content type 'application/zip' length 40403 bytes (39 Kb) 打开了URL downloaded 39 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/plyr_1.8.1.zip' Content type 'application/zip' length 1146073 bytes (1.1 Mb) 打开了URL downloaded 1.1 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/reshape2_1.4.zip' Content type 'application/zip' length 500182 bytes (488 Kb) 打开了URL downloaded 488 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/scales_0.2.4.zip' Content type 'application/zip' length 150718 bytes (147 Kb) 打开了URL downloaded 147 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/proto_0.3-10.zip' Content type 'application/octet-stream' length 457971 bytes (447 Kb) 打开了URL downloaded 447 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/ggplot2_0.9.3.1.zip' Content type 'application/octet-stream' length 2657534 bytes (2.5 Mb) 打开了URL downloaded 2.5 Mb 程序包‘colorspace’打开成功,MD5和检查也通过 程序包‘Rcpp’打开成功,MD5和检查也通过 程序包‘munsell’打开成功,MD5和检查也通过 程序包‘labeling’打开成功,MD5和检查也通过 程序包‘plyr’打开成功,MD5和检查也通过 程序包‘reshape2’打开成功,MD5和检查也通过 程序包‘scales’打开成功,MD5和检查也通过 程序包‘proto’打开成功,MD5和检查也通过 程序包‘ggplot2’打开成功,MD5和检查也通过 下载的二进制程序包在 C:\Documents and Settings\Administrator\Local Settings\Temp\RtmpCEWHT4\downloaded_packages里 #全部复制备份 ============================================================ 开始使用又遇到事故-程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装 ============================================================ #装载库文件 library(ggplot2) #装载库文件出现错误警告 Error : 程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装 错误: ‘ggplot2’程辑包或名字空间载入失败 #搜索解决方案如下 ##清除以前的文件夹,特别是配置文件,还有安装2.x后,在线更新一下,选国内的镜像。 ##已经换回2.15.3……,连2.15.2 都不行…… ##install.packages(ggplot2,type='source') ##一个最简单粗暴的方法就是你的RGUI上的工具栏上有一个packages的选项,下拉菜单里有一个update packages, ##把已安装的包卸掉,再从CRAN上重新下载再加载就行了 ##你好,您提的方法好像都无法再R3.02中安装mvtnorm包,换成以前版本是可以的,但是这个包是一个计量包的附带包,那个计量包在以前版本无法安装,实在无法解决这个问题,能否请高手指点迷津,谢谢! ##更新R版本的话,一般这些包好像都还在的 ##update.packages() 选择镜像后,可以选择y来更新你想要更新的包。 ##如果是重新安装R版本,不知道原来有的包还在不,不在的话,只有重安了,可以将你所要安的包,全部赋予pkgs,pkgs=c(,,...) ##在R 2.15.3环境下,我试了一下,安装是正常的。 ##开始尝试 library(ggplot2) ##错误依旧 Error : 程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装 错误: ‘ggplot2’程辑包或名字空间载入失败, ##更新 update.packages(ask='graphics',checkBuilt=TRUE) 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/boot_1.3-11.zip' Content type 'application/zip' length 587583 bytes (573 Kb) 打开了URL downloaded 573 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/class_7.3-10.zip' Content type 'application/zip' length 99786 bytes (97 Kb) 打开了URL downloaded 97 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/cluster_1.15.2.zip' Content type 'application/zip' length 511507 bytes (499 Kb) 打开了URL downloaded 499 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/digest_0.6.4.zip' Content type 'application/zip' length 136446 bytes (133 Kb) 打开了URL downloaded 133 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/foreign_0.8-61.zip' Content type 'application/zip' length 288417 bytes (281 Kb) 打开了URL downloaded 281 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/KernSmooth_2.23-12.zip' Content type 'application/zip' length 104992 bytes (102 Kb) 打开了URL downloaded 102 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/lattice_0.20-29.zip' Content type 'application/zip' length 726567 bytes (709 Kb) 打开了URL downloaded 709 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/MASS_7.3-32.zip' Content type 'application/zip' length 1086730 bytes (1.0 Mb) 打开了URL downloaded 1.0 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/Matrix_1.1-3.zip' Content type 'application/zip' length 3568556 bytes (3.4 Mb) 打开了URL downloaded 3.4 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/mgcv_1.7-29.zip' Content type 'application/zip' length 1601316 bytes (1.5 Mb) 打开了URL downloaded 1.5 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/nlme_3.1-117.zip' Content type 'application/zip' length 2135164 bytes (2.0 Mb) 打开了URL downloaded 2.0 Mb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/nnet_7.3-8.zip' Content type 'application/zip' length 118787 bytes (116 Kb) 打开了URL downloaded 116 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/rpart_4.1-8.zip' Content type 'application/zip' length 918643 bytes (897 Kb) 打开了URL downloaded 897 Kb 试开URL’http://mirrors.xmu.edu.cn/CRAN/bin/windows/contrib/3.0/spatial_7.3-8.zip' Content type 'application/zip' length 150470 bytes (146 Kb) 打开了URL downloaded 146 Kb 程序包‘boot’打开成功,MD5和检查也通过 程序包‘class’打开成功,MD5和检查也通过 程序包‘cluster’打开成功,MD5和检查也通过 程序包‘digest’打开成功,MD5和检查也通过 程序包‘foreign’打开成功,MD5和检查也通过 程序包‘KernSmooth’打开成功,MD5和检查也通过 程序包‘lattice’打开成功,MD5和检查也通过 程序包‘MASS’打开成功,MD5和检查也通过 程序包‘Matrix’打开成功,MD5和检查也通过 程序包‘mgcv’打开成功,MD5和检查也通过 程序包‘nlme’打开成功,MD5和检查也通过 程序包‘nnet’打开成功,MD5和检查也通过 程序包‘rpart’打开成功,MD5和检查也通过 程序包‘spatial’打开成功,MD5和检查也通过 下载的二进制程序包在 C:\Documents and Settings\Administrator\Local Settings\Temp\RtmpCEWHT4\downloaded_packages里 #备份下 library(ggplot2) Error : 程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装 错误: ‘ggplot2’程辑包或名字空间载入失败, ============================================================ 又遇到事故-程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装 ============================================================ ##强制更新update.packages(proto)没啥反应 update.packages(proto) ##源文件安装包文件 install.packages(proto,type=source) 试开URL’http://mirrors.xmu.edu.cn/CRAN/src/contrib/proto_0.3-10.tar.gz' Content type 'application/x-gzip' length 530758 bytes (518 Kb) 打开了URL downloaded 518 Kb Welcome at Sun May 04 22:34:14 2014 * installing *source* package 'proto' ... ** 成功将'proto'程序包解包并MD5和检查 ** R ** demo ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes 'proto.Rnw' 'protoref.Rnw' ** testing if installed package can be loaded Welcome at Sun May 04 22:34:16 2014 Goodnye at Sun May 04 22:34:16 2014 * DONE (proto) Goodnye at Sun May 04 22:34:17 2014 下载的程序包在 ‘C:\Documents and Settings\Administrator\Local Settings\Temp\RtmpCEWHT4\downloaded_packages’里 #备份 library(ggplot2) ##老大,终于没有错误了。 ## ggplot(yx) 错误: ggplot2 doesn't know how to deal with data of class numeric # #ggplot2只给dataframe面子 #ggplot(data=dat,aes(x=r_salary,y=r_sales))+geom_line() #ggplot example mydata - data.frame(x = -100:100) myfun - function(x) x^2 + x + 1 ggplot(data = mydata, aes(x = x)) + stat_function(fun = myfun, geom = point) #ggplot,散点图,用label在点上标注。但我想标注部分点,例如前10个,怎么做呢? 因为数据比较大,所有点都label,根本看不清标注带的内容。所以就想部分标注。 pointLabels - vector('character',length=nrow(mtcars)) pointLabels - rownames(mtcars) p - ggplot(mtcars, aes(x=wt, y=mpg, label=pointLabels, color=(pointLabels==))) p + geom_point() + geom_text(vjust=1.2) + theme(legend.position=none) ============================================================ #windows xp R 3.03 install ggplot2收工总结 01-选择镜像很重要 #选择厦门大学信息与网络中心开源软件镜像服务China(Xiamen) #http://mirrors.xmu.edu.cn/ 02-安装与装载检查 install.packages(ggplot2) library(ggplot2) 03-装载检查出错_更新 library(ggplot2)装载ggplot包时出现类似错误按照如下依次执行: e.g.程辑包‘digest’是在R版本3.0.0之前建的:你得重新安装 a.RGUI上的工具栏上有一个packages的选项,下拉菜单里有一个update packages,全部更新 b.全部更新之后,还是有个别需要重新安装的,使用源文件安装相应的包文件 e.g.程辑包‘proto’是在R版本3.0.0之前建的:你得重新安装 ##源文件安装包文件 install.packages(proto,type=source) 04-祝你享用ggplot愉快 ============================================================
个人分类: 数据生活|7913 次阅读|0 个评论
CentOS 6.5 yum install R
xiangxing 2014-5-2 00:48
$ yum install r Loaded plugins: fastestmirror, priorities, refresh-packagekit, security You need to be root to perform this command. $ su 密码: # yum install r Loaded plugins: fastestmirror, priorities, refresh-packagekit, security Loading mirror speeds from cached hostfile * epel: mirrors.neusoft.edu.cn Setting up Install Process No package r available. * Maybe you meant: R Error: Nothing to do # yum install R Loaded plugins: fastestmirror, priorities, refresh-packagekit, security Loading mirror speeds from cached hostfile * epel: mirrors.neusoft.edu.cn Setting up Install Process Resolving Dependencies -- Running transaction check --- Package R.i686 0:3.0.2-1.el6 will be installed -- Processing Dependency: libRmath-devel = 3.0.2-1.el6 for package: R-3.0.2-1.el6.i686 -- Processing Dependency: R-java = 3.0.2-1.el6 for package: R-3.0.2-1.el6.i686 -- Processing Dependency: R-devel = 3.0.2-1.el6 for package: R-3.0.2-1.el6.i686 -- Running transaction check --- Package R-devel.i686 0:3.0.2-1.el6 will be installed -- Processing Dependency: R-java-devel = 3.0.2-1.el6 for package: R-devel-3.0.2-1.el6.i686 -- Processing Dependency: R-core-devel = 3.0.2-1.el6 for package: R-devel-3.0.2-1.el6.i686 --- Package R-java.i686 0:3.0.2-1.el6 will be installed --- Package libRmath-devel.i686 0:3.0.2-1.el6 will be installed -- Processing Dependency: libRmath = 3.0.2-1.el6 for package: libRmath-devel-3.0.2-1.el6.i686 -- Running transaction check --- Package R-core-devel.i686 0:3.0.2-1.el6 will be installed -- Processing Dependency: zlib-devel for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: tk-devel for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: texinfo-tex for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: tcl-devel for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: pcre-devel for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: libX11-devel for package: R-core-devel-3.0.2-1.el6.i686 -- Processing Dependency: bzip2-devel for package: R-core-devel-3.0.2-1.el6.i686 --- Package R-java-devel.i686 0:3.0.2-1.el6 will be installed --- Package libRmath.i686 0:3.0.2-1.el6 will be installed -- Running transaction check --- Package bzip2-devel.i686 0:1.0.5-7.el6_0 will be installed --- Package libX11-devel.i686 0:1.5.0-4.el6 will be installed -- Processing Dependency: pkgconfig(xcb) = 1.1.92 for package: libX11-devel-1.5.0-4.el6.i686 -- Processing Dependency: pkgconfig(xproto) for package: libX11-devel-1.5.0-4.el6.i686 -- Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.5.0-4.el6.i686 -- Processing Dependency: pkgconfig(kbproto) for package: libX11-devel-1.5.0-4.el6.i686 --- Package pcre-devel.i686 0:7.8-6.el6 will be installed --- Package tcl-devel.i686 1:8.5.7-6.el6 will be installed --- Package texinfo-tex.i686 0:4.13a-8.el6 will be installed -- Processing Dependency: texinfo = 4.13a-8.el6 for package: texinfo-tex-4.13a-8.el6.i686 --- Package tk-devel.i686 1:8.5.7-5.el6 will be installed -- Processing Dependency: libXft-devel for package: 1:tk-devel-8.5.7-5.el6.i686 --- Package zlib-devel.i686 0:1.2.3-29.el6 will be installed -- Running transaction check --- Package libXft-devel.i686 0:2.3.1-2.el6 will be installed -- Processing Dependency: pkgconfig(xrender) for package: libXft-devel-2.3.1-2.el6.i686 -- Processing Dependency: pkgconfig(freetype2) for package: libXft-devel-2.3.1-2.el6.i686 -- Processing Dependency: pkgconfig(fontconfig) for package: libXft-devel-2.3.1-2.el6.i686 --- Package libxcb-devel.i686 0:1.8.1-1.el6 will be installed -- Processing Dependency: pkgconfig(xau) = 0.99.2 for package: libxcb-devel-1.8.1-1.el6.i686 --- Package texinfo.i686 0:4.13a-8.el6 will be installed --- Package xorg-x11-proto-devel.noarch 0:7.6-25.el6 will be installed -- Running transaction check --- Package fontconfig-devel.i686 0:2.8.0-3.el6 will be installed --- Package freetype-devel.i686 0:2.3.11-14.el6_3.1 will be installed --- Package libXau-devel.i686 0:1.0.6-4.el6 will be installed --- Package libXrender-devel.i686 0:0.9.7-2.el6 will be installed -- Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: R i686 3.0.2-1.el6 epel 20 k Installing for dependencies: R-core-devel i686 3.0.2-1.el6 epel 90 k R-devel i686 3.0.2-1.el6 epel 19 k R-java i686 3.0.2-1.el6 epel 20 k R-java-devel i686 3.0.2-1.el6 epel 20 k bzip2-devel i686 1.0.5-7.el6_0 base 250 k fontconfig-devel i686 2.8.0-3.el6 base 209 k freetype-devel i686 2.3.11-14.el6_3.1 base 364 k libRmath i686 3.0.2-1.el6 epel 104 k libRmath-devel i686 3.0.2-1.el6 epel 24 k libX11-devel i686 1.5.0-4.el6 base 1.0 M libXau-devel i686 1.0.6-4.el6 base 14 k libXft-devel i686 2.3.1-2.el6 base 19 k libXrender-devel i686 0.9.7-2.el6 base 16 k libxcb-devel i686 1.8.1-1.el6 base 174 k pcre-devel i686 7.8-6.el6 base 318 k tcl-devel i686 1:8.5.7-6.el6 base 162 k texinfo i686 4.13a-8.el6 base 660 k texinfo-tex i686 4.13a-8.el6 base 132 k tk-devel i686 1:8.5.7-5.el6 base 496 k xorg-x11-proto-devel noarch 7.6-25.el6 base 274 k zlib-devel i686 1.2.3-29.el6 base 44 k Transaction Summary ================================================================================ Install 22 Package(s) Total download size: 4.3 M Installed size: 14 M Is this ok : y Downloading Packages: (1/22): R-3.0.2-1.el6.i686.rpm | 20 kB 00:00 (2/22): R-core-devel-3.0.2-1.el6.i686.rpm | 90 kB 00:00 (3/22): R-devel-3.0.2-1.el6.i686.rpm | 19 kB 00:00 (4/22): R-java-3.0.2-1.el6.i686.rpm | 20 kB 00:00 (5/22): R-java-devel-3.0.2-1.el6.i686.rpm | 20 kB 00:00 (6/22): bzip2-devel-1.0.5-7.el6_0.i686.rpm | 250 kB 00:00 (7/22): fontconfig-devel-2.8.0-3.el6.i686.rpm | 209 kB 00:00 (8/22): freetype-devel-2.3.11-14.el6_3.1.i686.rpm | 364 kB 00:00 (9/22): libRmath-3.0.2-1.el6.i686.rpm | 104 kB 00:00 (10/22): libRmath-devel-3.0.2-1.el6.i686.rpm | 24 kB 00:00 (11/22): libX11-devel-1.5.0-4.el6.i686.rpm | 1.0 MB 00:01 (12/22): libXau-devel-1.0.6-4.el6.i686.rpm | 14 kB 00:00 (13/22): libXft-devel-2.3.1-2.el6.i686.rpm | 19 kB 00:00 (14/22): libXrender-devel-0.9.7-2.el6.i686.rpm | 16 kB 00:00 (15/22): libxcb-devel-1.8.1-1.el6.i686.rpm | 174 kB 00:00 (16/22): pcre-devel-7.8-6.el6.i686.rpm | 318 kB 00:00 (17/22): tcl-devel-8.5.7-6.el6.i686.rpm | 162 kB 00:00 (18/22): texinfo-4.13a-8.el6.i686.rpm | 660 kB 00:00 (19/22): texinfo-tex-4.13a-8.el6.i686.rpm | 132 kB 00:00 (20/22): tk-devel-8.5.7-5.el6.i686.rpm | 496 kB 00:00 (21/22): xorg-x11-proto-devel-7.6-25.el6.noarch.rpm | 274 kB 00:00 (22/22): zlib-devel-1.2.3-29.el6.i686.rpm | 44 kB 00:00 -------------------------------------------------------------------------------- Total 473 kB/s | 4.3 MB 00:09 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : xorg-x11-proto-devel-7.6-25.el6.noarch 1/22 Installing : 1:tcl-devel-8.5.7-6.el6.i686 2/22 Installing : zlib-devel-1.2.3-29.el6.i686 3/22 Installing : freetype-devel-2.3.11-14.el6_3.1.i686 4/22 Installing : fontconfig-devel-2.8.0-3.el6.i686 5/22 Installing : libXau-devel-1.0.6-4.el6.i686 6/22 Installing : libxcb-devel-1.8.1-1.el6.i686 7/22 Installing : libX11-devel-1.5.0-4.el6.i686 8/22 Installing : libXrender-devel-0.9.7-2.el6.i686 9/22 Installing : libXft-devel-2.3.1-2.el6.i686 10/22 Installing : 1:tk-devel-8.5.7-5.el6.i686 11/22 Installing : R-java-3.0.2-1.el6.i686 12/22 Installing : pcre-devel-7.8-6.el6.i686 13/22 Installing : bzip2-devel-1.0.5-7.el6_0.i686 14/22 Installing : libRmath-3.0.2-1.el6.i686 15/22 Installing : libRmath-devel-3.0.2-1.el6.i686 16/22 Installing : texinfo-4.13a-8.el6.i686 17/22 Installing : texinfo-tex-4.13a-8.el6.i686 18/22 Installing : R-core-devel-3.0.2-1.el6.i686 19/22 Installing : R-java-devel-3.0.2-1.el6.i686 20/22 Installing : R-devel-3.0.2-1.el6.i686 21/22 Installing : R-3.0.2-1.el6.i686 22/22 Verifying : R-java-devel-3.0.2-1.el6.i686 1/22 Verifying : libXrender-devel-0.9.7-2.el6.i686 2/22 Verifying : texinfo-4.13a-8.el6.i686 3/22 Verifying : libRmath-3.0.2-1.el6.i686 4/22 Verifying : bzip2-devel-1.0.5-7.el6_0.i686 5/22 Verifying : texinfo-tex-4.13a-8.el6.i686 6/22 Verifying : zlib-devel-1.2.3-29.el6.i686 7/22 Verifying : pcre-devel-7.8-6.el6.i686 8/22 Verifying : R-devel-3.0.2-1.el6.i686 9/22 Verifying : libXau-devel-1.0.6-4.el6.i686 10/22 Verifying : R-java-3.0.2-1.el6.i686 11/22 Verifying : freetype-devel-2.3.11-14.el6_3.1.i686 12/22 Verifying : 1:tcl-devel-8.5.7-6.el6.i686 13/22 Verifying : libXft-devel-2.3.1-2.el6.i686 14/22 Verifying : libX11-devel-1.5.0-4.el6.i686 15/22 Verifying : xorg-x11-proto-devel-7.6-25.el6.noarch 16/22 Verifying : 1:tk-devel-8.5.7-5.el6.i686 17/22 Verifying : R-core-devel-3.0.2-1.el6.i686 18/22 Verifying : libRmath-devel-3.0.2-1.el6.i686 19/22 Verifying : fontconfig-devel-2.8.0-3.el6.i686 20/22 Verifying : R-3.0.2-1.el6.i686 21/22 Verifying : libxcb-devel-1.8.1-1.el6.i686 22/22 Installed: R.i686 0:3.0.2-1.el6 Dependency Installed: R-core-devel.i686 0:3.0.2-1.el6 R-devel.i686 0:3.0.2-1.el6 R-java.i686 0:3.0.2-1.el6 R-java-devel.i686 0:3.0.2-1.el6 bzip2-devel.i686 0:1.0.5-7.el6_0 fontconfig-devel.i686 0:2.8.0-3.el6 freetype-devel.i686 0:2.3.11-14.el6_3.1 libRmath.i686 0:3.0.2-1.el6 libRmath-devel.i686 0:3.0.2-1.el6 libX11-devel.i686 0:1.5.0-4.el6 libXau-devel.i686 0:1.0.6-4.el6 libXft-devel.i686 0:2.3.1-2.el6 libXrender-devel.i686 0:0.9.7-2.el6 libxcb-devel.i686 0:1.8.1-1.el6 pcre-devel.i686 0:7.8-6.el6 tcl-devel.i686 1:8.5.7-6.el6 texinfo.i686 0:4.13a-8.el6 texinfo-tex.i686 0:4.13a-8.el6 tk-devel.i686 1:8.5.7-5.el6 xorg-x11-proto-devel.noarch 0:7.6-25.el6 zlib-devel.i686 0:1.2.3-29.el6 Complete! # r bash: r: command not found # R R version 3.0.2 (2013-09-25) -- Frisbee Sailing Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-redhat-linux-gnu (32-bit) R是自由软件,不带任何担保。 在某些条件下你可以将其自由散布。 用'license()'或'licence()'来看散布的详细条件。 R是个合作计划,有许多人为之做出了贡献. 用'contributors()'来看合作者的详细情况 用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。 用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或 用'help.start()'通过HTML浏览器来看帮助文件。 用'q()'退出R. demo(graphics) demo(graphics) ---- ~~~~~~~~ Type Return to start : # Copyright (C) 1997-2009 The R Core Team require(datasets) require(grDevices); require(graphics) ## Here is some code which illustrates some of the differences between ## R and S graphics capabilities. Note that colors are generally specified ## by a character string name (taken from the X11 rgb.txt file) and that line ## textures are given similarly. The parameter bg sets the background ## parameter for the plot and there is also an fg parameter which sets ## the foreground color. x - stats::rnorm(50) opar - par(bg = white) plot(x, ann = FALSE, type = n) 按Return键来看下一个图: abline(h = 0, col = gray(.90)) lines(x, col = green4, lty = dotted) points(x, bg = limegreen, pch = 21) title(main = Simple Use of Color In a Plot, + xlab = Just a Whisper of a Label, + col.main = blue, col.lab = gray(.8), + cex.main = 1.2, cex.lab = 1.0, font.main = 4, font.lab = 3) ## A little color wheel. This code just plots equally spaced hues in ## a pie chart. If you have a cheap SVGA monitor (like me) you will ## probably find that numerically equispaced does not mean visually ## equispaced. On my display at home, these colors tend to cluster at ## the RGB primaries. On the other hand on the SGI Indy at work the ## effect is near perfect. par(bg = gray) pie(rep(1,24), col = rainbow(24), radius = 0.9) 按Return键来看下一个图: title(main = A Sample Color Wheel, cex.main = 1.4, font.main = 3) title(xlab = (Use this as a test of monitor linearity), + cex.lab = 0.8, font.lab = 3) ## We have already confessed to having these. This is just showing off X11 ## color names (and the example (from the postscript manual) is pretty cute. pie.sales - c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12) names(pie.sales) - c(Blueberry, Cherry, + Apple, Boston Cream, Other, Vanilla Cream) pie(pie.sales, + col = c(purple,violetred1,green3,cornsilk,cyan,white)) 按Return键来看下一个图: title(main = January Pie Sales, cex.main = 1.8, font.main = 1) title(xlab = (Don't try this at home kids), cex.lab = 0.8, font.lab = 3) ## Boxplots: I couldn't resist the capability for filling the box. ## The use of color seems like a useful addition, it focuses attention ## on the central bulk of the data. par(bg=cornsilk) n - 10 g - gl(n, 100, n*100) x - rnorm(n*100) + sqrt(as.numeric(g)) boxplot(split(x,g), col=lavender, notch=TRUE) 按Return键来看下一个图: title(main=Notched Boxplots, xlab=Group, font.main=4, font.lab=1) ## An example showing how to fill between curves. par(bg=white) n - 100 x - c(0,cumsum(rnorm(n))) y - c(0,cumsum(rnorm(n))) xx - c(0:n, n:0) yy - c(x, rev(y)) plot(xx, yy, type=n, xlab=Time, ylab=Distance) 按Return键来看下一个图: polygon(xx, yy, col=gray) title(Distance Between Brownian Motions) ## Colored plot margins, axis labels and titles. You do need to be ## careful with these kinds of effects. It's easy to go completely ## over the top and you can end up with your lunch all over the keyboard. ## On the other hand, my market research clients love it. x - c(0.00, 0.40, 0.86, 0.85, 0.69, 0.48, 0.54, 1.09, 1.11, 1.73, 2.05, 2.02) par(bg=lightgray) plot(x, type=n, axes=FALSE, ann=FALSE) 按Return键来看下一个图: usr - par(usr) rect(usr , usr , usr , usr , col=cornsilk, border=black) lines(x, col=blue) points(x, pch=21, bg=lightcyan, cex=1.25) axis(2, col.axis=blue, las=1) axis(1, at=1:12, lab=month.abb, col.axis=blue) box() title(main= The Level of Interest in R, font.main=4, col.main=red) title(xlab= 1996, col.lab=red) ## A filled histogram, showing how to change the font used for the ## main title without changing the other annotation. par(bg=cornsilk) x - rnorm(1000) hist(x, xlim=range(-4, 4, x), col=lavender, main=) 按Return键来看下一个图: title(main=1000 Normal Random Variates, font.main=3) ## A scatterplot matrix ## The good old Iris data (yet again) pairs(iris , main=Edgar Anderson's Iris Data, font.main=4, pch=19) 按Return键来看下一个图: pairs(iris , main=Edgar Anderson's Iris Data, pch=21, + bg = c(red, green3, blue) ) 按Return键来看下一个图: ## Contour plotting ## This produces a topographic map of one of Auckland's many volcanic peaks. x - 10*1:nrow(volcano) y - 10*1:ncol(volcano) lev - pretty(range(volcano), 10) par(bg = lightcyan) pin - par(pin) xdelta - diff(range(x)) ydelta - diff(range(y)) xscale - pin /xdelta yscale - pin /ydelta scale - min(xscale, yscale) xadd - 0.5*(pin /scale - xdelta) yadd - 0.5*(pin /scale - ydelta) plot(numeric(0), numeric(0), + xlim = range(x)+c(-1,1)*xadd, ylim = range(y)+c(-1,1)*yadd, + type = n, ann = FALSE) 按Return键来看下一个图: usr - par(usr) rect(usr , usr , usr , usr , col=green3) contour(x, y, volcano, levels = lev, col=yellow, lty=solid, add=TRUE) box() title(A Topographic Map of Maunga Whau, font= 4) title(xlab = Meters North, ylab = Meters West, font= 3) mtext(10 Meter Contour Spacing, side=3, line=0.35, outer=FALSE, + at = mean(par(usr) ), cex=0.7, font=3) ## Conditioning plots par(bg=cornsilk) coplot(lat ~ long | depth, data = quakes, pch = 21, bg = green3) 按Return键来看下一个图: par(opar) x - c(1,2,3,4,5,6) x 1 2 3 4 5 6 plot(x) 按Return键来看下一个图: q() Save workspace image? : y #
个人分类: 数据生活|10473 次阅读|0 个评论
3D ReplicatorG
kathm 2013-12-25 12:59
Installation http://replicat.org/installation-windows Note:You may need to use the ReplicatorG preferences menu to manually specify where you’ve installed Python. Usage http://replicat.org/usage Note:ReplicatorG 每个小格 10mm*10mm
个人分类: 3D|1547 次阅读|0 个评论
Ubuntu系统下root的安装
kathm 2013-12-24 22:06
It's a pitty that root is not in repository anymore (applies for Ubuntu 11.04). Here is a way HOW-TO install root on Ubuntu Natty (x86): DEPENDENCIES: sudo apt-get install gcc g++ make binutils subversion dpkg-dev \ libx11-dev libxpm-dev libxft-dev libxext-dev OPTIONAL DEPENDENCIES: (I've this installed) sudo apt-get install cmake \ gsl-bin libgsl0-dev \ liblzma2 liblzma-dev \ libgmp3c2 libgmp3-dev \ libpcre3 libpcre3-dev \ zlib1g zlib1g-dev HOW TO INSTALL: wget ftp://root.cern.ch/root/root_v5.34.00.source.tar.gz tar -xzvpf root_v5.34.00.source.tar.gz cd root ./configure make sudo make install ## sudo needed at least for for /etc/root sudo cd root source bin/thisroot.sh root .Q // to quit root
个人分类: root|5304 次阅读|0 个评论
Seismic_Unix_install_on_Linux
Zhouwenju 2013-10-11 19:21
http://www.seismicunix.com/w/Seismic_Unix_install_on_Ubuntu 按照链接的说明,安装su成功。 seismic unix 安装在网上会找到很多的资料,但是有一点要注意: 软件常有更新,很多的安装资料都不是最新的。所以要去CWP主页里才能找到最合适的安装方式。
个人分类: linux|861 次阅读|0 个评论
[转载]madagascar install
Zhouwenju 2013-10-1 18:30
1\Installing SCons in ubuntu sudo apt-get install freeglut3-dev g++ gfortran libgd2-xpm-dev libx11-dev libxaw7-dev \ libnetpbm10-dev swig python-dev python-numpy libblas-dev libcairo2-dev liblapack-dev \ libavcodec-dev python-epydoc scons 2\ General instructions(Manual: http://reproducibility.org/wiki/Installation sh ./configure --prefix=/usr/local/madagascar 3\sh ./configure API=c++,f90,octave,matlab,python,java,perl --prefix=/usr/local/madagascar 4\make install
个人分类: madagascar|710 次阅读|0 个评论
[转载]tarball 與 rpm 的差別----安装软件的大致流程
plgongcat 2012-12-5 20:23
链接
个人分类: unix|1347 次阅读|0 个评论
install netcdf hdf5 antlr udunits in linux
yaozhixiong 2012-11-30 10:50
在集群上面安装软件netcdf hdf5 antlr udunits **************************************** Install hdf (hdf5-1.8.10) . / configure -- prefix = /public/userspace/yaozhixiong/program/hdf -- enable - shared -- enable - hl make make install **************************************** Install netcdf (netcdf-4.2.1) LDFLAGS =- L / public/userspace/yaozhixiong/program/hdf / lib CPPFLAGS =- I / public/userspace/yaozhixiong/program/hdf / include ./ configure -- enable - netcdf - 4 -- enable - dap -- enable - shared -- prefix = / public/userspace/yaozhixiong/program/netcdf make make install **************************************** Install antlr ( antlr2.7.7) 参考 http://blog.wamaker.net/post/antlr-installation ./configure –with-cxx=g++ –with-java –enable-cxx –prefix=/public/userspace/yaozhixiong/program/antlr make make install **************************************** install udunits (udunits-2.1.24) 参考 http://bla.sphemo.us/2011/03/18/compile-and-install-nco-netcdf-operators-on-linux/ CC=gcc CXX=' ' F77=gfortran ./configure --prefix=/public/userspace/yaozhixiong/program/udunits make make install
个人分类: linux|6644 次阅读|0 个评论
NetCDF安装记录
热度 2 PengJiDing 2012-3-20 20:56
1: NetCDF编译过程 cdnetcdf-4.1.3 ./configure --disable-dap --disable-netcdf-4 --prefix=/usr/local/netcdf ( 根据 http://hi.baidu.com/liuxiaogis/blog/item/6f662e38d5a03b3c96ddd81a.html 的说法,加上--disable-dap的原因是缺少一个‘curl’的lib, --disable-netcdf-4是报错中提出的解决办法 ) 但是连这一步都没有通过, ....................... checking whether ifort accepts -g... no checking for Fortran flag to compile .f90 files... unknown configure: error: Fortran could not compile .f90 files configure: error: ./configure failed for libcf 在 --prefix=/usr/local/netcdf之后加上FC=gfortran之后 ./configure --disable-dap --disable-netcdf-4--prefix=/usr/local/netcdfFC=gfortran 编译通过! 2: make 直接输入 make 出现 ....................... make : Nothing to be done for `all-am'. make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples' make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples' make : Entering directory `/home/dinghao/netcdf-4.1.3' make : Leaving directory `/home/dinghao/netcdf-4.1.3' make : Leaving directory `/home/dinghao/netcdf-4.1.3' 在/usr/local/netcdf/ 目录下没有出现任何东西!?confused! 3: make check 步骤 键入 make check 出现 ....................... ================== All 7 tests passed ================== make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples/CXX' make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples/CXX' make : Entering directory `/home/dinghao/netcdf-4.1.3/examples' make : Nothing to be done for `check-am'. make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples' make : Leaving directory `/home/dinghao/netcdf-4.1.3/examples' make : Entering directory `/home/dinghao/netcdf-4.1.3' make : Leaving directory `/home/dinghao/netcdf-4.1.3' check 居然通过! 4: make install 步骤 键入 sudomake install 最后显示 ........................... make install-data-hook make : Entering directory `/home/dinghao/netcdf-4.1.3' +-------------------------------------------------------------+ | Congratulations! You have successfully installed netCDF! | | | | You can use script "nc-config" to find out the relevant | | compiler options to build your application. Enter | | | | nc-config --help | | | | for additional information. | | | | CAUTION: | | | | If you have not already run "make check", then we strongly | | recommend you do so. It does not take very long. | | | | Before using netCDF to store important data, test your | | build with "make check". | | | | NetCDF is tested nightly on many platforms at Unidata | | but your platform is probably different in some ways. | | | | If any tests fail, please see the netCDF web site: | | http://www.unidata.ucar.edu/software/netcdf/ | | | | NetCDF is developed and maintained at the Unidata Program | | Center. Unidata provides a broad array of data and software | | tools for use in geoscience education and research. | | http://www.unidata.ucar.edu | +-------------------------------------------------------------+ make : Leaving directory `/home/dinghao/netcdf-4.1.3' make : Leaving directory `/home/dinghao/netcdf-4.1.3' make : Leaving directory `/home/dinghao/netcdf-4.1.3' 说明安装成功! 5: 测试 下面是一个已编好的用来测试NetCDF的小程序simple_xy_wr(由刘情操提供 http://blog.sina.com.cn/s/blog_4b1d9e7b0100zg89.html ,特此鸣谢)或者用/netcdf-4.1.3/example/F90/里面的例子来测试: program simple_xy_wr use netcdf implicit none ! 定义数据文件的名称 character (len = *), parameter :: FILE_NAME = "simple_xy.nc" ! 写一个12*6的二维数据 integer, parameter :: NDIMS = 2 integer, parameter :: NX = 6, NY = 12 ! 当创建netCDF文件的时候,变量和维数都有一个对应的ID integer :: ncid, varid, dimids(NDIMS) integer :: x_dimid, y_dimid integer :: x, y ! 要保存到文件的数据数组 integer, dimension(:,:), allocatable :: data_out ! 为数据数组分配内存 allocate(data_out(NY, NX)) ! 随意往数据数组里写一些数据 do x = 1, NX do y = 1, NY data_out(y, x) = (x - 1) * NY + (y - 1) end do end do ! 创建netCDF文件,返回文件对应的ID,如果存在则覆盖,check子程序用来检验执行是否成功 call check( nf90_create(FILE_NAME, NF90_CLOBBER, ncid) ) ! 定义维数,返回一个对应的ID call check( nf90_def_dim(ncid, "x", NX, x_dimid) ) call check( nf90_def_dim(ncid, "y", NY, y_dimid) ) ! 把上面得到的ID写到一个存放ID的数组里,注意,在fortran中,数组是以列为主存放数据的 dimids = (/ y_dimid, x_dimid /) ! 定义变量,返回一个对应的ID call check( nf90_def_var(ncid, "data", NF90_INT, dimids, varid) ) ! 定义完成,关闭定义模式 call check( nf90_enddef(ncid) ) ! 写入数据 call check( nf90_put_var(ncid, varid, data_out) ) ! 关闭文件 call check( nf90_close(ncid) ) !提示写文件成功 print *, "*** SUCCESS writing example file simple_xy.nc! " contains subroutine check(status) integer, intent ( in) :: status if(status /= nf90_noerr) then print *, trim(nf90_strerror(status)) stop 2 end if end subroutine check end program simple_xy_wr 在主目录下键入 gfortran cel-test.f90 -I/usr/local/netcdf/include -L/usr/local/netcdf/lib -lnetcdff -o test ( cel-test.f90为程序名, test为编译后生成的 ) 编译通过! 然后运行test,键入 ./test 结果无法运行,出现 Attempting netcdf-4 operation on netcdf-3 file STOP 2 再次郁闷! 打开.zshrc, 即打开所用shell的配置文件 gedit .zshrc 在文件后面加上 export NETCDF=/usr/local/ export DYLD_LIBRARY_PATH=$NETCDF/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH export PATH=$NETCDF/bin:$PATH 重新启动shell,然后再编译,运行test,得到 0 12 24 36 *** SUCCESS writing example file simple_xy.nc! 大功告成! 备注:以下为各个步骤执行命令的解释: $ ./configure The configuration script will set up the Makefiles that will be used to build the NetCDF libraries and utilities. It will also set up the installation directory for the default location of /usr/local. If you would like to install the libraries in another location, use this configure command: $ ./configure --prefix=/your/desired/install/directory) $ make----Make the libraries When the configuration step completes successfully, you can build the libraries using ‘make’. $ make check-----Testing NetCDF on Linux* You can test your NetCDF libraries using ‘make check’. $ make install------Installing NetCDF on Linux* Install NetCDF libraries using ‘make install’. This will install the NetCDF libraries, include files, and utilities in the default location of /usr/local or the location specified in the configuration step with the --prefix= option References: 1:http://bbs.sciencenet.cn/home.php?mod=spaceuid=237238do=blogid=547593 2: http://blog.sina.com.cn/s/blog_4b1d9e7b0100zg89.html 3:http://blog.sina.com.cn/s/articlelist_1260232315_3_1.html
个人分类: 备忘录|43256 次阅读|2 个评论
Ubuntu手动安装Adobe Flash Player
PengJiDing 2012-3-8 15:52
步骤如下: 1.从http://get.adobe.com/flashplayer/下载 adobe flash for linux;。 2.把下载的.gz文件解压出来,得到.so文件; 3.把.so文件复制到/usr/lib/mozilla/plugins/目录; 4.解决中文乱码问题: sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak sudo rm /etc/fonts/conf.d/49-sansserif.conf 5.重启firefox。
个人分类: 备忘录|4449 次阅读|0 个评论
Install CGAL on Ubuntu
热度 1 weihuayi 2010-9-3 22:33
下决心把CGAL学好, 专注于一件事情!不要把精力浪费在无关紧要的事情上。 目的是为了安装CGAL, 其它的辅助软件包和工具尽量用最便利的方式安装,不要像以前那样啦! 1, 首先安装Boost,下载最新的boost ,解压到某个目录,比如说: ~/boost1_42_0/ sudo ./bjam --layout=tagged --build-type=complete stage sudo cp -a ~/boost1_42_0/boost /usr/include sudo cp ~/boost1_42_0/stage/lib/* /usr/lib/ 上面的安装还不是很清楚明了,换成下面: 首先要编译生成boost安装工具bjam 进入boost目录执行: ./bootstrap.sh 然后执行刚生成的 ./bjam 编译开始,大约半小时,全部编译结束。 ./bjam install 将当前目录下编译好的头文件拷贝到相应位置:在/usr/include下有头文件夹boost,在/usr/lib下有boost的库 2, 安装MPFR、GMP、geomview(可视化)和 libQGLViewer sudo apt-get install libgmp3-dev libmpfr-dev sudo apt-get install geomview 下载 libqglviewer-devel_2.3.5_i386.deb (头文件及文档)和 libqglviewer_2.3.5_i386.deb (库文件),鼠标点击安装即可。 这时要重新做一个库文件的符号链接, cd /usr/lib/ ln -sf libQGLViewer.so.2.3.4 libqglviewer.so 3, 安装qt3, qt4 sudo apt-get install libqt4-dev sudo apt-get install libqt3-disigner 4, 下载最新的 CGAL -3.6.1, 它要要求boost要1.34.1以上。 cmake-gui . make sudo make install 默认头文件装在 usr/local/include/, 库文件装在 usr/local/lib/. 实际上你可以在cmake-gui . 时进行修改, 可以把头文件和库文件分别装到 usr/include 和 usr/lib 下, 这样你写的程序可以在编译链接时,可以自动找到这些文件。 5, 总结 软件包的基本结构和安装路径: 安装的软件包, 一般有四部分组成: 头文件, 库文件, 可执行程序,文档。 一般情况下,它们放的位置如下: /usr/include, /usr/lib, /usr/bin, /usr/share/doc/。 在软件包安装时,一般会自动安装到这些文件夹当中; 但有时候也需要用户自己把头文件、库文件等拷贝到相应的目录下, 或者做一个符号链接也可以。 ln -sf 被链接的目录或文件 链接目录或文件 -s: 符号链接 -f: 硬链接 当然有时会把 软件包放在 /usr/local/ 下(其目录结构和/usr/基本相同), 但要注意 记得将 /usr/local/lib 加入到缺省的共享库搜索路径中,就是在文件 /etc/ld.so.conf 中加入一行: /usr/local/lib 然后运行 /sbin/ldconfig 软件包安装后的常见问题及解决办法: 1, 软件包已经安装,但仍提示找不到库文件。 原因一般有二。 第一, 软件包没有安装在缺省的共享库 搜索路径中,系统不能自动找到它。 你可以通过添加缺省 搜索路径的办法解决, 也可以通过拷贝,链接 把文件放到系统能够自动找到的地方。 第二, 安装的库文件的名字和你需要的名字不同, 可能是大小写,也可能是因为有额外的版本号, 这时你只需要再做一个新的库文件的符号链接, 链接的名字和你需要的相同即可。 ln -sf 2,如何尽量快速的软件安装。 首选是在ubuntu的软件库中找,找到后用 sudo apt-get install 进行安装。 比如: apt-cache search emacs 就搜索了所有含有关键词emacs的软件名称。一大堆。如果要分屏,用 apt-cache search emacs|less 或者用grep更精确地定位 比如 apt-cache search emacs|grep emacs22 当然你也可以通过google, Baidu等来确定你相要的软件包在软件库中的具体名字。 另一个选择是通过google, baidu搜索 deb包, 然后下载下来进行安装。 最后的选择才是通过软件包的网站,下载源码进行编译安装, 安装之前要仔细阅读安装说明, 一般以INSTALL, README等命名的文本文件。 这是最verbose的安装过程, 你总会遇到一些意外的问题。
个人分类: CGAL|8541 次阅读|1 个评论
IRAF 安装 for Ubuntu 10.04
热度 1 dabing 2010-8-4 00:48
在网上搜集了最新的在Ubuntu 10.04 上安装iraf 步骤,这里列出来供大家安装iraf参考。 IRAF The version of iraf that we will install is v214. This one, unlike version v212 comes with the ecl terminal which allows autocompletion and using the up key to check previous commands. Okay, so, to begin with, we will install the tcsh package (that's in the universe repository) Code: sudo apt-get install tcsh Next, we make a folder were all of the iraf downloads will go (in order to keep things neat). Please keep yourself in the same terminal: Code: mkdir ~/iraf cd ~/iraf Then, we download the iraf files. These are: as.pcix.gen.gz, the architecture independent files ib.lnux.x86.gz, the linux dependent base files nb.lnux.x86.gz, the linux dependent noao files In the download directions, the v214 folder could be replaced by a more recent version in case it exists: Code: wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/as.pcix.gen.gz wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/ib.lnux.x86.gz wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/nb.lnux.x86.gz Next, I make iraf's directory tree: Code: sudo mkdir -p /iraf/{irafbin/{bin.linux,noao.bin.linux},iraf/local} Next i add the iraf user (this will ask you many things. The only important one is the password, the rest could be left in blank. The user is added at the admin group so he can sudo when installing iraf): Code: sudo adduser iraf --home /iraf/iraf/local --shell /bin/csh --ingroup admin And I move the downloaded files to the /iraf/iraf directory, and grant all permissions on the directories to the iraf user: Code: sudo mv ~/iraf/* /iraf/iraf sudo chown iraf -R /iraf Now I login as the iraf user: Code: su iraf We extract the iraf files: Code: cd ~/irafwget http://hea-www.harvard.edu/RD/ds9/download/linux/ds9.linux.7.2.tar.gztar -zxf ds9.linux.7.2.tar.gzsudo mv ds9 /usr/local/binsudo chmod +x /usr/local/bin/ds9 此时可能对不同的版本修改linux.7.2 And we remove the unneccesary files: Code: rm /iraf/iraf/as.pcix.gen.gz rm /iraf/iraf/ib.lnux.x86.gz rm /iraf/iraf/nb.lnux.x86.gz And we prepare things for the installation (from this point it is essential to keep the same terminal open until the end of the installation): Code: setenv iraf /iraf/iraf cd $iraf/unix/hlib/ source irafuser.csh We first test the install, to do this we run (from the same terminal of the step before): Code: sudo ./install -n Prompting yes to everything should be enough. In any case, the proccess can get stuck in a loop where it asks if it should configure iraf-networking , fail at trying to configure it, and asking again. The error message you should receive is: Code:不进行网络设置就不会有此提示。 Checking that iraf networking is properly enabled ... os.zgtenv: cannot open ‘/usr/include/iraf.h’ *** The NETSTATUS task claims that networking is disabled. *** Please contact site support (iraf@noao.edu) with questions *** or check the Site Manager’s Guide for details on how to *** properly configure networking. To solve this simply say no at this point .在询问是否进行网络设置的时候,建议输入 n 后回车 If the installation test went fine, you can install everything by omitting the -n argument: Code: sudo ./install Having installed iraf successfully, you can exit from the iraf user's shell bi doing (closing the terminal will work too ): Code: exit x11iraf Next we install x11iraf which is needed for irafs graphical support. The version to be installed is 1.3.1, but this could be replaced for a newer one with no problem only by changing the download. We download x11iraf files to our downloads folder: Code: cd ~/iraf wget http://iraf.noao.edu/iraf/ftp/iraf/x11iraf/x11iraf-v1.3.1/x11iraf-v1.3.1-bin.linux.tar.gz We extract it and install it: Code: cat x11iraf-v1.3.1-bin.linux.tar.gz | gunzip | tar -xf - sudo ./install ds9 The proccess is simple, download the file, extract it, and copy and give write permission to the binary. We install with this version 5.6 of ds9, but just as in the other steps, this can easily be updated by changing the download address: Code: cd ~/iraf wget http://hea-www.harvard.edu/saord/download/ds9/linux/ds9.linux.5.6.tar.gz tar -zxf ds9.linux.5.6.tar.gz sudo mv ds9 /usr/local/bin sudo chmod +x /usr/local/bin/ds9 Start-up script For convenience, we will make a start-up script (created by michael hutchinson http://mjhutchinson.com/ ) that will open an xgterm with an ecl promt and ds9. We use gedit or this, but any text editor (for example kate in kde or vim) could be used: Code: sudo gedit /usr/local/bin/irafshell And next we add this to the file: Code: #!/bin/bash PID=`pidof ds9` if ; then ds9 fi pushd ~/iraf /dev/null xgterm -iconic -geometry 80x24 -sb -title IRAF -bg black -fg green -e ecl popd /dev/null Here, the -bg and -fg options indicate respectively background and font colors for the xgterm where iraf will be run. Some of the available colors are lemon chiffon, black, darkslategrey, linen, red, green, blue, cyan, yellow, purple, magenta and slategray. I personally prefer the black on green layout... Then, add execution permission to the script: Code: sudo chmod +x /usr/local/bin/irafshell With this, iraf can be run just by running the command irafshell. Running iraf First, I clean the ~/iraf folder (THIS COMMAND WILL DELETE EVERYTHING ON THE FOLDER): Code: rm -rf ~/iraf/* to run iraf, we create the login.cl and use irafshell command. When mkiraf asks for terminal type, select xgterm. Code: cd ~/iraf mkiraf irafshell If you get the error xgterm: no available ptys, Then follow this steps (if iraf started correctly, then you dont need to this): Code: wget ftp://iraf.noao.edu/pub/xgterm.fedora sudo mv xgterm.fedora /usr/local/bin/xgterm sudo chmod +x /usr/local/bin/xgterm ----------------------------------------------------------------------------------------------------------------------- ds9: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory To find out which package provides (or contains) a certain file in Ubuntu, you can use the apt-file command. First, make sure apt-file is installed. sudo apt-get install apt-file Now, using apt-file is simple enough. apt-file search filename-to-search.for This outputs a list of packages that provide a file named filename-to-search.for , thus allowing you to install the necessary package(s) using apt-get. Real-life answer In your case, you would need to run the following command: apt-file search libXss.so.1 This outputs the following: libxss1: /usr/lib/i386-linux-gnu/libXss.so.1 libxss1: /usr/lib/i386-linux-gnu/libXss.so.1.0.0 libxss1-dbg: /usr/lib/debug/usr/lib/i386-linux-gnu/libXss.so.1.0.0 This indicates that the package you need to install in this specific case is most likely libxss1 . So, to install it, run the following command: sudo apt-get install libxss1 Now, try running DS9 again, and you should find that the error message is now gone. ---------------------------------------------------------------------------------------------------------------------- And now you should be able to run the command irafshell with no problems. Icon! This is a suggestion made by Elias Pizarro. You can download the iraf icon and use it to show an iraf icon in your application list wich will execute the irafshell script. First, download the iraf icon: Code: cd /usr/share/pixmaps/ sudo wget http://iraf.noao.edu/iraf/web/images/iraf.gif Then, create the desktop entry: Code: gedit ~/.local/share/applications/iraf.desktop And add to the file this: Code: Encoding=UTF-8 Version=1.0 Terminal=false Type=Application Categories=Application;Office;Astronomy; Exec=irafshell Name=IRAF Comment=Image reduction and analysis facility Icon=/usr/share/pixmaps/iraf.gif install ,OK! 仅需复制窗口内的命令到终端即可完成安装! References: www.ubuntuforums.org/showthread.php?t=912583 http://hi.baidu.com/feifei_1014/item/058cb2f13db1dd703c198b6c 承蒙协助,谨致谢忱! 2010-08-04于河北兴隆 2014-03-29修改于BNU
个人分类: LINUX&IRAF|12610 次阅读|1 个评论
[转载]PGPLOT安装-Install PGPLOT in Ubuntu
dabing 2009-9-23 11:11
PGPLOT working under Linux. Note that this is atwo step procedure: you need to install the graphic library first, and thendefine some environment variables that are needed in order to work comfortablywith PGPLOT. In this sense it is useful to check that the demo programs runproperly. Note that the previous command can take several minutes if the system detectsthe need of installing additional packages. The different versions of the PGPLOT library (libpgplot.* andlibcpgplot.*) are installed under: /opt/local/lib. The X11server is installed in /opt/local/bin/pgxwin_server, whereas auxiliaryfiles (including the demos) are placed under:/opt/local/share/pgplot. After the installation, make sure that the expected environment variables areproperly set (at least PGPLOT_DIR must exist; PGPLOT_DEV isalso quite useful). You can check this by executing: % echo %PGPLOT_DIR % echo %PGPLOT_DEV If the previous environment variables are not set, you can easily define them: % export PGPLOT_DIR=/opt/local/lib % export PGPLOT_DEV=/Xserve It is useful to introduce those definitions in the .bashrc file at thehome directory of the user. Execute any of the demos in order to check that everything is fine: % /opt/local/share/pgplot/examples/pgdemo1 % /opt/local/share/pgplot/examples/pgdemo2 % /opt/local/share/pgplot/examples/pgdemo3 ... Finally, compile your own code. For example, is gfortran was thefortran compiler employed to install PGPLOT, the following commandshould work: % gfortran -o outputFileName inputFotranFile.f -L/opt/local/lib -lpgplot-lX11 Note that you should use the same fortran compiler to install PGPLOT and tocompile your own files.In the above example the X11 library was assumed to be installed in/opt/local/lib. If this is not the case, include an extra-L/directory_path_to_libX11 in the compilation command before-lpgplot. (Mac users may find also useful the instructions provided by BenjaminWeiner ) Linux usersIn Linux I always download the original source code of PGPLOT from its homepage , and install the package manually (at the time of writting thesenotes, the latest version is pgplot5.2.tar.gz ).For this to work properly, theappropriate X11 files must be available in your machine. I also installgfortran as the Fortran compiler. Both tasks can be performed executing: Fedora: % sudo yum install libX11-devel % sudo yum install gcc-gfortran Ubuntu: % sudo apt-get install xorg-dev % sudo apt-get install gfortran CentOS: % sudo yum install libX11-devel % sudo yum install gcc-gfortran OpenSUSE: % sudo zypper install xorg-X11-devel % sudo zypper install gcc-fortran Debian: % sudo apt-get install libX11-dev % sudo apt-get install gfortran In order to install PGPLOT, I follow (with a minor but important modification:the use of gfortran instead of g77) the instructions given by T.J. Pearson toinstall this library under Linux, which can be summarized as follows: Download the distribution file pgplot5.2.tar.gz Decompress and extract the contents of the distribution file in a source directory. In this sense, I always place pgplot5.2.tar.gz under /usr/local/src. Note that for this opperation it is probably required that you have root privileges, unless you have write access to the directories.You can either log in as root (using su in Fedora and CentOS, or using sudo su in Ubuntu), or use sudo in front of the following commands: % cd /usr/local/src % mv ~/Downloads/pgplot5.2.tar.gz . % tar zxvf pgplot5.2.tar.gz The last command will create /usr/local/src/pgplot and subdirectories. Create the directory where PGPLOT will be actually installed: % mkdir /usr/local/pgplot % cd /usr/local/pgplot Copy the file drivers.list from the source directory to the installation directory: % cp /usr/local/src/pgplot/drivers.list . Edit that file and remove the exclamation mark (first column of each row) in front of the following graphic devices: /PS, /VPS, /CPS, /VCPS and /XServe. The resulting file is also available here: drivers.list . Create the makefile. From the installation directory /usr/local/pgplot execute: % /usr/local/src/pgplot/makemake /usr/local/src/pgplot linux g77_gcc_aout Edit the file makefile and change the line: FCOMPL=g77 by FCOMPL=gfortran Compile the source files: % make % make cpg % make clean Setting environment variables % sudo gedit ~/.bashrc ; add the following code : PATH=/usr/local/PGPLOT/bin:$PATH   PGPLOT_DIR=/usr/local/pgplot/;export PGPLOT_DIR   LD_LIBRARY_PATH=/usr/local/pgplot/;export LD_LIBRARY   PGPLOT_FONT=/usr/local/pgplot/grfont.dat ;export PGPLOT_FONT   PGPLOT_DEV=/xwine;export PGPLOT_DEV   PGPLOT_LIB=-L /usr/X11R6/lib -lX11 -L /usr/local/pgplot/ -lpgplot;export PGPLOT_LIB % source .bashrc After the installation, make sure that the expected environment variables areproperly set (at least PGPLOT_DIR must exist; PGPLOT_DEV isalso quite useful): % export PGPLOT_DIR=/usr/local/pgplot % export PGPLOT_DEV=/Xserve It is useful to introduce those definitions in the .bashrc file at thehome directory of the user. Execute any of the demos in order to check that everything is fine: % /usr/local/pgplot/pgdemo1 % /usr/local/pgplot/pgdemo2 % /usr/local/pgplot/pgdemo3 ... Finally, compile your own code. For example, is gfortran was thefortran compiler employed to install PGPLOT, the following commandshould work: % gfortran -o outputFileName inputFotranFile.f -L/usr/local/pgplot-L/usr/X11/lib -lpgplot -lX11 Note that you should use the same fortran compiler to install PGPLOT and tocompile your own files.In the above example the X11 library was assumed to be installed in/usr/X11/lib. If this is not the case, include the actual directoryusing -L/directory_path_to_libX11 in the compilation instead of-L/usr/X11/lib above. 另X11下载地址(X11R6版本):http://pan.baidu.com/s/1mWT9K 或者 http://ftp.vim.org/pub/OpenBSD/2.2/pmax/X11/X11R6.tar.gz 参考地址: http://pendientedemigracion.ucm.es/info/Astrof/software/howto/howto-pgplot.html 2013-10-09 于BNU
个人分类: Ubuntu软件安装|7108 次阅读|0 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-12 16:32

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部