Editing
Software Development Platforms
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===gcc including gfortran=== gcc is included in XCode, however gfortran is not included, so we have to obtain gcc another way. ====binary installer ==== Get from http://hpc.sourceforge.net . This is now the recommended method. ====from source==== I really don't recommend installing gcc from source, since it is non-trivial to do so. Install it with macports if at all possible. However, if for some reason you are unable to build gcc with macports, these instructions may be useful. We require the 4.3 or newer gcc series, since it supports some Fortran 2003 features that we need (for cross-language building). Also, the auto-vectorization of 4.3 is superior to earlier versions. Installing and building gcc from source is not trivial, but it can be done as follows. I recommend having a dedicated source-code build directory in your home direectory: mkdir -p Documents/source cd Documents/source * Install GMP wget ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.4.tar.bz2 tar xvjf gmp-4.2.4.tar.bz2 cd gmp-4.2.4 ./configure ABI=32 make -j 8 make check sudo make install cd .. NOTE: The -j 8 flag tells make to launch up to 8 building threads when possible. This is to maximize the use of the 8 cores on the MacPro. *Install MPFR wget http://www.mpfr.org/mpfr-current/mpfr-2.3.2.tar.bz2 tar xvjf mpfr-2.3.2.tar.bz2 cd mpfr-2.3.2 ./configure --with-gmp-build=../source/gmp-4.2.4 make -j 8 make check sudo make install cd .. *Install gcc wget http://gcc-ca.internet.bs/releases/gcc-4.3.2/gcc-4.3.2.tar.bz2 tar xvjf gcc-4.3.2.tar.bz2 mkdir build-gcc-4.3.2 cd build-gcc-4.3.2 ../gcc-4.3.2/configure --prefix=/opt/gcc-4.3.2 --enable-languages=c,c++,fortran --with-mpfr=../mpfr-2.3.2 --build=i686-apple-darwin9 --host=i686-apple-darwin9 --target=i686-apple-darwin9 make -j 8 # Now go have coffee, maybe lunch :) sudo make install ====Note on using custom-built gcc==== Generally, to use a custom-built gcc, you just have to specify the complete path to the compiler, like this: /opt/gcc-4.3.2/bin/gcc myprogram.c Most build-systems will respect the environment variables CC, CXX and FC, so to set the default compilers, this will generally work: export CC=/opt/gcc-4.3.2/bin/gcc export CXX=/opt/gcc-4.3.2/bin/g++ export FC=/opt/gcc-4.3.2/bin/gfortran In addition, similarly-named variables exist by default for make files, so you can generally also do this: make CC=/opt/gcc-4.3.2/bin/gcc CXX=/opt/gcc-4.3.2/bin/g++ FC=/opt/gcc-4.3.2/bin/gfortran o specify the complete path to the compiler, like this: /opt/gcc-4.3.2/bin/gcc myprogram.c Most build-systems will respect the environment variables CC, CXX and FC, so to set the default compilers, this will generally work: export CC=/opt/gcc-4.3.2/bin/gcc export CXX=/opt/gcc-4.3.2/bin/g++ export FC=/opt/gcc-4.3.2/bin/gfortran In addition, similarly-named variables exist by default for make files, so you can generally also do this: make CC=/opt/gcc-4.3.2/bin/gcc CXX=/opt/gcc-4.3.2/bin/g++ FC=/opt/gcc-4.3.2/bin/gfortran
Summary:
Please note that all contributions to bone.wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BoneWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Documents
Recent changes
Help
Tools
What links here
Related changes
Page information