Building AmberTools 1.4 with pre-built compilers on Mac OS X 10.6 Snow Leopard
I have been using the pre-built compilers for Amber projects from time to time, but I've never settled down with any of these binary packages. The most obvious reason was that I really like to build it by myself, part of me deep inside my paranoid mind, I was just afraid of pre-built packages.
However when it comes to preparing documentation for the broad range of Amber users, suggesting an solution of requiring users to build compilers themselves seems to be ridiculous in some level a hassle for users. If you want to change the status quo, go to Apple's bugs report website and suggest them to bundle gfortran with Xcode. I can even envision Professors writing letter to Steve Jobs and having a very civilized discussion back and forth.
Before we convince Apple to begin hiring FORTRAN people, for users with limited experience of mac and unix, I can only introduce pre-built binary packages from third-party providers. Now I am going to write down the steps I have tried to work on Amber with a pre-built compiler package. Gaurav Khanna of "HPC on Mac OS X" project has done a great job providing binary packages for Mac community for a long time. To download the package, you can visit the homepage at http://hpc.sf.net and find the download link. My experience on the gfortran-only package was not successful, it failed on linking the fftw and nab. I also failed to finish the configure script with the other "llvm-gfortran-intel-bin.tar.gz" package. So I am going to recommend you to use the gcc+gfortran package.
Here are the steps:
- If you already tried MacPorts and fink, you should uninstall them to prevent them interfering your following procedures. (updated: no I am not bad mouthing MacPorts or fink in the previous version of the document, I was trying to be funny.)
- If you want to keep your gcc/gfortran from MacPorts, try this:
(for more information, dosudo gcc_select gcc42 sudo port deactivate gcc44
man gcc_select
andman port
, please.) - If you already install the package of "gfortran-snwleo-intel-bin.tar.gz (Snow Leopard gfortran only)", you should uninstall it. To uninstall it, do
cd /; tar ztf ~/Downloads/gfortran-snwleo-intel-bin.tar.gz | grep -v -e '/$' -e '/\._' | xargs sudo rm -f
- gcc+gfortran binary package "gcc-snwleo-intel-bin.tar.gz (Snow Leopard)" from the same site indeed does work, so you should download that gcc-snwleo-intel-bin.tar.gz file. To install it, do:
(this will extract the files in /usr/local )sudo tar zxvf ~/Downloads/gcc-snwleo-intel-bin.tar.gz -C /
- Now it comes to be the tedious part of the work, try to make sure you are running the right compilers when you type gcc and gfortran. First type
gcc -v
command, if your output looks like this, you are using the right C compiler:[localhost:amber11/AmberTools/src] mjhsieh% gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin10/4.5.0/lto-wrapper Target: x86_64-apple-darwin10 Configured with: ../gcc-4.5-20100107/configure --enable-languages=fortran --host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 : (reconfigured) ../gcc-4.5-20100107/configure --enable-languages=fortran,c++ --host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 Thread model: posix gcc version 4.5.0 20100107 (experimental) (GCC)
- If your
gfortran -v
output looks like this, you are using the right gfortran.[localhost:amber11/AmberTools/src] mjhsieh% gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin10/4.5.0/lto-wrapper Target: x86_64-apple-darwin10 Configured with: ../gcc-4.5-20100107/configure --enable-languages=fortran --host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 : (reconfigured) ../gcc-4.5-20100107/configure --enable-languages=fortran,c++ --host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 Thread model: posix gcc version 4.5.0 20100107 (experimental) (GCC)
- If they are not what you got, please make sure you have set the correct path environment variable, it should contain "/usr/local/bin"; my path variable looks like this:
% echo $PATH
/opt/local/bin:/opt/local/sbin:/opt/intel/Compiler/11.1/084/bin/intel64:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/X11/bin:/Users/mjhsieh/bin - If you still can't have the correct output, ask us in the Amber mail reflector.
- start to configure:
cd /usr/local/amber11 cd AmberTools/src; ./configure -macAccelerate gnu
- If everything printed out looks okay, start building AmberTools by typing
make install
- Also go to the path where amber11 is at, start the building process:
cd ../../src; make install
- Now you have it, please make sure it passes the test cases in amber11/test and amber11/AmberTools/test.
- GOOD LUCK playing AMBER/AMBERTOOLS!
- This is my result:
Finished test suite for AmberTools at Sun May 16 02:58:11 PDT 2010. 318 file comparisons passed 0 file comparisons failed 0 tests experienced errors Finished serial test suite for Amber 11 at Sun May 16 03:53:37 PDT 2010. 492 file comparisons passed 0 file comparisons failed 0 tests experienced errors
- If you are not satisfied with this binary package, do this to uninstall:
cd /; tar ztf ~/Downloads/gcc-snwleo-intel-bin.tar.gz | grep -v -e '/$' -e '/\._' | xargs sudo rm -f