Re: [AMBER-Developers] AT 1.3 config fails for alternate gnu location

From: Mark Williamson <mjw.sdsc.edu>
Date: Tue, 24 Nov 2009 19:43:34 -0800

Lachele Foley wrote:

> Can't use the gcc/gfortran that came with the kernel because programs like AMBER frequently employ bleeding edge compiler features. Even upgrading to the absolutely newest kernel typically doesn't get me a sufficiently recent gcc version.

Hi Lachele,

I don't know if this will answer your problem directly, but I've dug out
my own howto for testing out arbitrary versions of the gcc compiler with
AMBER; specifically the compiler compiling instructions. This method
compiles the gcc suite from scratch and then sets paths accordingly. It
assumes version 4.4.2.





This mini-howto explains how to build the gnu compiler suite on a RHEL4
x86_64 machine and how to set certain environment variables to enable
the freshly compiled compilers to override existing system gcc
components. This process assumes gmp (GNU MP, a library for arbitrary
precision arithmetic) has already been installed. This can be done as
root using this command:

         yum install gmp


0) Get gcc 4.4.2:
         wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.4.2/gcc-4.4.2.tar.bz2

1) Untar it:
         tar xfj gcc-4.4.2.tar.bz2

2) Make a tmp build directory *and* change to it:
         mkdir build ; cd build

3) Run the gcc configure script from the tmp build dir and tell it to
only build c, c++ and fortran and then where to put the built code
*after* the "make install" step:

         ../gcc-4.4.2/configure --enable-languages=c,c++,fortran
--prefix=/server-home/mjw/code/gcc/4.4.2

4) Compile it; (the -j8 is to tell the make process to use 8 threads; I
have 8 cores on my compile machine; adjust to the number of cores on
your machine)
         make -j8

5) Make some tea and wait for the compile to finish; this can take some
time :(

6) Now that it is compiled, install it to the --prefix directory:
         make install

6b) Clean up the build directories and source... you don't need them now
and they are quite big:

         cd .. ; rm -Rf build/ gcc-4.4.2

7) Set the binary and library paths (This assumes you're running bash)
so that gcc 4.4.2 gets priority over existing older gcc installs:

  export
LD_LIBRARY_PATH=/server-home/mjw/code/gcc/4.4.2/lib64:$LD_LIBRARY_PATH
  export PATH=/server-home/mjw/code/gcc/4.4.2/bin:$PATH
  export MANPATH=/server-home/mjw/code/gcc/4.4.2/man:$MANPATH

8) Check it:
[19:43][bunny:0.01][mjw:gcc]$ gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.4.2/configure --enable-languages=c,c++,fortran
--prefix=/server-home/mjw/code/gcc/4.4.2
Thread model: posix
gcc version 4.4.2 (GCC)


9) Remember, you will need to set those environment variables in step 7
if you create new shell. These will also be needed if you attempt to run
a binary that has been built with these compilers since they will be
dynamically linked against the libraries in LD_LIBRARY_PATH .



Hope this is of help to you or anyone else on the list.

-- 
Mark Williamson, Post Doc
Walker Molecular Dynamics Group
Room 395E
San Diego Supercomputer Center
9500 Gilman Drive
La Jolla, CA 92093-0505
Email:  mjw at sdsc.edu
Office: 858-246-0827
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Tue Nov 24 2009 - 20:00:02 PST
Custom Search