Jan 22. 2013 biang Hoo
user privilege:root
1 uninstall openjdk and install sunjdk downloaded from oracle.com (http://www.oracle.com/technetwork/java/javase/downloads/)
(I) uninstall openjdk
1 rpm -qa | grep java
2 rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.el6.x86_64
3 rpm -qa | grep java (or -qa | grep gcj) and remove all objects relate to openjdk
(II)install sunjdk
unpack the package under the directory /usr/java and configure the user's("root" as we know) dedigated bash shell information(file .bashrc under root's home) ,its configuration is as following:
export JAVA_HOME=/usr/java/jdk1.7.0_11
export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
and execute "source ~/.bashrc" to make it works immediatelly.
(III) Verification
[root@s ~]# java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
2 install glpk
(I) unpack the package glpk-4.47.tar.gz to directory /opt ( download from http://ftp.gnu.org/gnu/glpk/)
(II) Install it according to the install guide in the package
(III)Verification
[root@s glpk-4.47]# glpsol -v
GLPSOL: GLPK LP/MIP Solver, v4.47
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics,
Moscow Aviation Institute, Moscow, Russia. All rights reserved.
This program has ABSOLUTELY NO WARRANTY.
This program is free software; you may re-distribute it under the terms
of the GNU General Public License version 3 or later
3 install libglpk-java
(I) unpack the package libglpk-java-1.0.22.tar.gz to directory /opt ( download from sourceforge.net)
(II) Install it according to the install guide in the package.In the processing of make check ,It will appear an error
which informs us the dynamic library can not be loaded automatically ,That's ok,cause we can load it manually.
(III) Verification
check the directory /usr/local/lib/jni wheather there are files libglpk_java.*
4 configure ldlibrary
add this line /usr/local/lib to /etc/ld.so.conf,and the following lines can be undone
create a new file glpk_related_lib.conf under the directory /etc/ld.so.conf.d/
add the path (shown in the following lines) where the libglpk.* and libglpk_java.* are in
/usr/local/lib
/usr/local/lib/jni
then run the command " ldconfig"
5 Install ALEVIN
(I) Modify build.xml
1) replace target="1.5" by “1.7” at Line 59
2)add <pathelement path="/usr/share/java/glpk-java.jar" /> and
replace <attribute name="Class-Path" value=". MuLaViTo.jar JUNG2.jar/>
with <attribute name="Class-Path" value=". MuLaViTo.jar JUNG2.jar /usr/local/share/java/glpk-java.jar" />
in the corresponding place
3)comment line 61 (<exclude name="vnreal/algorithms/utils/LpSolver.java" />)
(II)Modify the file LpSolver.java (/src/vnreal/algorithms/utils/)
1)Comment assertion line headed by throw (line 98 and 99)and
2)uncomment all for MCF, from Ln100 to Ln 182
3)Uncomment packages @ Ln 37 to Ln41
(III)copy ILP_LP_Models to directory ALEVIN-src
(IV)connect the internet and run command " ant" in the terminal
(V) run ALEVIN with with the command"java -Djava.library.path=/usr/local/lib/jni -jar ALEVIN.jar" under the directory ALEVIN-src ,we can write a script to make it more conveniently