Respected Sir,
Thank you very much for your reply.The installation logic is now quite
clear to me. Just to make sure that I understood it properly I used an
example of AmberTools14/15:
1. export AMBERHOME = 'pwd' : *will set the 'pwd' as AMBERHOME*
2. doing ./configure gnu: *will configure the application*
3. export amber.sh : *will *
* (a) export AMBERHOME and *
* (b) check if LD_LIBRARY_PATH (for example) is set or not, if *NOT*
then it will set LD_LIBRARY_PATH="${AMBERHOME}/lib", *else* it
will append the **"${AMBERHOME}/lib" to the
LD_LIBRARY_PATH.*
4. make install : install the Amber
5. export "source $AMBERHOME/amber.sh" >> ~/.bashrc" :
*will add* **exactly** this "source $AMBERHOME/amber.sh" line to
.bashrc. *So if I open .bashrc I will find that line written in the
.bashrc.* *This will ensure that when ever I login the login shell source
the respective amber.sh file.*
***********************************************************************************************
I have one more technical question and I hope you will not mind If I
discussed :
I want to install, 1. Amber12 coupled with AmberTools13, 2.AmberTools14 and
3. AmberTools15 one by one in a system:
1. *For Amber12+AmberTools13*
export AMBERHOME ='pwd'
./configure gnu
make install
the add these lines to .bashrc
export AMBERHOME=/home/aditya/applications/amber12
export PATH=$AMBERHOME/bin:$PATH
2. *Then for AmberTools14*
*comment out following lines in .bashrc*
#export AMBERHOME=/home/aditya/applications/amber12
#export PATH=$AMBERHOME/bin:$PATH
*then do:*
export AMBERHOME='pwd'
./configure gnu
source amber.sh
make install
echo "source $AMBERHOME/amber.sh" >> ~/.bashrc
This will add /home/user/ambertools14/amber.sh to .bashrc
3.*Then for AmberTools15*
*Comment out following lines in .bashrc*
#export AMBERHOME=/home/aditya/applications/amber12
#export PATH=$AMBERHOME/bin:$PATH
#source /home/user/ambertool14/amber.sh
*the repeat the same as above*
*Now to use only Amber12 and AmberTools13:*
Changing the following lines in .bashrc
export AMBERHOME=/home/aditya/applications/amber12
export PATH=$AMBERHOME/bin:$PATH
#source /home/user/ambertool14/amber.sh
#source /home/user/ambertool15/amber.sh
*Now to use only AmberTools14*
Changing the following lines in .bashrc
#export AMBERHOME=/home/aditya/applications/amber12
#export PATH=$AMBERHOME/bin:$PATH
source /home/user/ambertool14/amber.sh
#source /home/user/ambertool15/amber.sh
Sorry to bother you for this repeatedly. Looking forward for your reply.
Regards
On Mon, Feb 8, 2016 at 6:45 PM, Jason Swails <jason.swails.gmail.com> wrote:
> On Mon, Feb 8, 2016 at 3:15 AM, A kS <aks25121986.gmail.com> wrote:
>
> > Dear AMBER user,
> >
> > I am new to AMBER. I am trying to install the AmberTools14 and
> AmberTools15
> > in Ubuntu 12.04 64 bit system. After reading the Jason Swails
> installation
> > instruction and doing some trials with both the AmberTools I found that
> the
> > amber.sh file have these lines :
> >
> >
> >
> >
> *********************************************************************************************************in
> > AmberTools14:*
> >
> > if [ -z "${LD_LIBRARY_PATH}" ]; then
> > export LD_LIBRARY_PATH="${AMBERHOME}/lib"
> > else
> > export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${AMBERHOME}/lib"
> > fi
> >
> > *in AmberTools15*:
> >
> > if [ -z "$PYTHONPATH" ]; then
> > export PYTHONPATH="${AMBERHOME}/lib/python2.7/site-packages"
> > else
> > export
> > PYTHONPATH="${AMBERHOME}/lib/python2.7/site-packages:${PYTHONPATH}"
> > fi
> > if [ -z "${LD_LIBRARY_PATH}" ]; then
> > export LD_LIBRARY_PATH="${AMBERHOME}/lib"
> > else
> > export LD_LIBRARY_PATH="${AMBERHOME}/lib:${LD_LIBRARY_PATH}"
> > fi
> >
> >
> >
> *******************************************************************************************************************
> >
> > *Instruction says that after doing ./configure we can do "source
> amber.sh"
> > and after make install "echo "source $AMBERHOME/amber.sh" >> ~/.bashrc"*
> >
> > My problems are:
> >
> > 1. I am unable to clearly understand the meaning of that "if else loop".
> > What I found out that, if [ -z "something" ] means: if "something" is
> > absent then do task1 else task2. So when I source that amber.sh in
> terminal
> > how exactly it add all paths to my .bashrc file, at least the syntax.
> >
>
> There are two scenarios that can happen with an environment variable that
> specifies a path -- it can either be set or it can be *not* set. The "if [
> -z $VARIABLE ]" is true if the variable is *not* set. So what that logic
> is doing is testing to see if LD_LIBRARY_PATH or PYTHONPATH (which are
> environment variables controlling where the ld loader looks for shared
> libraries at runtime and where Python looks for modules at runtime,
> respectively) are set. If they are *not* set, they get set to the values
> that Amber needs. If they *are* set, we don't want to overwrite their
> original values, so the values that Amber needs are prepended to the list.
> The main difference between what that script does and the lines in your
> .bashrc file:
>
> export LD_LIBRARY_PATH=${AMBERHOME}/lib:$LD_LIBRARY_PATH
>
> is that if LD_LIBRARY_PATH is *not* set at that time, the resulting value
> is "/path/to/amber14:", with a trailing :. It doesn't ruin things, but I
> don't like stuff like that which is why I implemented that logic in
> amber.sh and amber.csh
>
>
> > 2. Doing "*echo "source $AMBERHOME/amber.sh" >> ~/.bashrc*" will add the
> > "source $AMBERHOME/amber.sh" line to .bashrc and how it will help to run
> > AMBER in future.
> >
>
> If your main shell is bash, then login shells source the commands in your
> .bashrc (or .profile/.bash_profile) file. So that command will put the
> line "source /path/to/amber14/amber.sh" in your .bashrc file, making sure
> that when you start a new shell that file is sourced. ("sourcing" a file
> is the logical equivalent of copying the contents of the sourced file at
> the point where it is sourced).
>
>
> 3. I learned little bit of old style of adding path to .bashrc. So I add
> > these lines to .bashrc for all the AmberTools
> >
> >
> >
> *********************************************************************************
> > export AMBERHOME=/home/a/application/ambertools15
> > #export AMBERHOME=/home/a/application/ambertools14
> > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AMBERHOME/lib
> > export PATH=$AMBERHOME/bin:$PATH
> > export DO_PARALLEL='mpiexec.hydra -n 8'
> >
> >
> **************************************************************************************
> >
>
> This is *exactly* what "source $AMBERHOME/amber.sh" would do, except it
> would do a better job. First of all, the fact that you didn't add the
> PYTHONPATH part means that Python programs (like MMPBSA.py) won't work.
> Second, DO_PARALLEL is *not* an environment variable that Amber requires.
> It's only used for *parallel* tests, and could cause problems when trying
> to run serial tests. You should remove the declaration of that environment
> variable and only set it when it is specifically needed.
>
> I highly recommend running the above-mentioned command:
>
> echo "source $AMBERHOME/amber.sh" >> ~/.bashrc
>
> and removing the lines you mentioned above from your .bashrc file.
>
> so that whenever I need any of the amberttools (i know its silly cause now
> > AmberTools15 have all the features of its previous version) I just
> comment
> > the other AMBERHOME containing line.
> > Is it correct one??
> >
>
> I'm not exactly sure what you're asking here. Changes to your .bashrc
> file will only affect terminals that you open *after* saving those
> changes. If you change your .bashrc, it won't affect any shells that are
> already running. So just "commenting out" a line in your .bashrc
>
> won't affect terminal windows that are already open.
>
> If you have the amber.sh file sourced in your .bashrc, you will be able to
> use Amber in any terminal you start.
>
> HTH,
> Jason
>
> --
> Jason M. Swails
> BioMaPS,
> Rutgers University
> Postdoctoral Researcher
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Feb 09 2016 - 11:30:04 PST