ubuntu debian fedora Mac install pgplot steps!!
2011-06-08 19:37
393 查看
What follows is a description of the procedure I have followed to have PGPLOT working under Mac OS X and Linux. Note that this is a two step procedure: you need to install the graphic library first, and then define some environment variables that are needed in order to work comfortably with PGPLOT. In this sense it is useful to check that the demo programs run properly.
$ port installed pgplot
If the previous command does not work, you need to install MacPorts first.
I installed MacPorts downloading the "dmg" disk image installation file corresponding to my OS Version (Snow Leopard) from here. After the installation, one needs to execute (in order to ensure you have the latest revisions to the "Portfiles" needed when building and installing ports):
$ sudo port -v selfupdate
Once MacPorts is available, you can trivially install many packages, in particular PGPLOT:
$ sudo port install pgplot
Note that the previous command can take several minutes if the system detects the need of installing additional packages.
The different versions of the PGPLOT library (libpgplot.* and libcpgplot.*) are installed under: /opt/local/lib. The X11 server is installed in /opt/local/bin/pgxwin_server, whereas auxiliary files (including the demos) are placed under:/opt/local/share/pgplot.
After the installation, make sure that the expected environment variables are properly set (at least PGPLOT_DIR must exist; PGPLOT_DEV is also 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 the home directory of the user.
Finally, execute one 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
...
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 to install 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. I indicate that by changing the prompt symbol from $to #. 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
After the installation, make sure that the expected environment variables are properly set (at least PGPLOT_DIR must exist; PGPLOT_DEV is also quite useful):
$ export PGPLOT_DIR=/usr/local/pgplot
$ export PGPLOT_DEV=/Xserve
It is useful to introduce those definitions in the .bashrc file at the home directory of the user.
Finally, execute one of the demos in order to check that everything is fine:
$ /usr/local/pgplot/pgdemo1
$ /usr/local/pgplot/pgdemo2
$ /usr/local/pgplot/pgdemo3
...
Mac users
One of the easiest way to install PGPLOT is to make use of MacPorts. Check if MacPorts is already working in your system, and if PGPLOT is already installed, trying to execute:$ port installed pgplot
If the previous command does not work, you need to install MacPorts first.
I installed MacPorts downloading the "dmg" disk image installation file corresponding to my OS Version (Snow Leopard) from here. After the installation, one needs to execute (in order to ensure you have the latest revisions to the "Portfiles" needed when building and installing ports):
$ sudo port -v selfupdate
Once MacPorts is available, you can trivially install many packages, in particular PGPLOT:
$ sudo port install pgplot
Note that the previous command can take several minutes if the system detects the need of installing additional packages.
The different versions of the PGPLOT library (libpgplot.* and libcpgplot.*) are installed under: /opt/local/lib. The X11 server is installed in /opt/local/bin/pgxwin_server, whereas auxiliary files (including the demos) are placed under:/opt/local/share/pgplot.
After the installation, make sure that the expected environment variables are properly set (at least PGPLOT_DIR must exist; PGPLOT_DEV is also 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 the home directory of the user.
Finally, execute one 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
...
Linux users
In Linux I always download the original source code of PGPLOT from its homepage, and install the package manually (at the time of writting these notes, the latest version is pgplot5.2.tar.gz). For this to work properly, the appropriate X11 files must be available in your machine. I also install gfortran 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 to install 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. I indicate that by changing the prompt symbol from $to #. 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
After the installation, make sure that the expected environment variables are properly set (at least PGPLOT_DIR must exist; PGPLOT_DEV is also quite useful):
$ export PGPLOT_DIR=/usr/local/pgplot
$ export PGPLOT_DEV=/Xserve
It is useful to introduce those definitions in the .bashrc file at the home directory of the user.
Finally, execute one of the demos in order to check that everything is fine:
$ /usr/local/pgplot/pgdemo1
$ /usr/local/pgplot/pgdemo2
$ /usr/local/pgplot/pgdemo3
...
相关文章推荐
- ubuntu debian fedora Mac install pgplot steps!!
- ubuntu debian fedora Mac install pgplot steps!!
- Ubuntu、Debian、OpenSUSE、Fedora、Redhat和CentOS安装pgplot的步骤
- Ubuntu、Debian、OpenSUSE、Fedora、Redhat和CentOS安装pgplot的步骤
- 如何将你的linux打造成mac的桌面效果(支持Ubuntu,Debian,CentOS,Fedora,SUSE [Linux])
- Install Sublime Text (a Text Editor) in RHEL/CentOS/Fedora and Debian/Ubuntu
- Install Robot Framework on Linux Fedora20 or ubuntu /on Mac /on windows
- How to install Firefox 17 on Linux Mint, Ubuntu, Debian, CentOS, Fedora ... or any other Linux dist
- debian apt-get install的程序的安装目录如何确定 - [Ubuntu](转自:http://nicklj.blogbus.com/logs/33400628.html)
- Install OpenCV on Ubuntu or Debian
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- CentOS Redhat RHEL Fedora Ubuntu Debian 各系统简易说明
- Docker运行操作系统环境(BusyBox&Alpine&Debian/Ubuntu&CentOS/Fedora)
- Install Ubuntu Fonts on Fedora17
- ubuntu install mac os x on VMware
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distri
- 我的vimrc文件的配置(fedora、debian、ubuntu都可以用)
- Debian, Ubuntu,openSUSE,Fedora, CentOS包管理器命令速查表
- 如何区分一个系统是redhat centos ubuntu fedora debian中的哪一种