Tools & SDKs
- Heterogeneous Computing
- Aparapi
- Accelerated Parallel Processing (APP) SDK
- Accelerated Parallel Processing Math Libraries (APPML)
- CodeXL
- Archived Tools
- CPU Development
- Graphics Development
- Open Source
Home > Tools & SDKs > CPU Development > Core Math Library (ACML) > Downloads & Resources > How to use ACML with different versions of GCC/GFORTRAN
Chip Freitag | 9/16/2009 |
A very common question we receive through the ACML support channels is how to use ACML with different versions of GCC/GFORTRAN. Since the ACML team does not have the resources to provide a current version of ACML built with every possible GCC version, we have to choose which GCC version to build with. In general the choices are driven by which GCC is available through the common distributions, but it can also be driven by features provided by those compilers.
Many systems have GCC 4.1.2 as the default. Recent ACML versions are built with newer compilers, since 4.1.2 did not support OpenMP.
A primary incompatibility is the version of libgfortran required by the ACML library. Newer versions require libgfortran.so.3. GCC4.1.2 included libgfortran.so.1. It might be possible to copy a recent libgfortran.so.3 from another machine, but this is not a recommended solution. A better solution is to install or build a new GCC/GFORTRAN.
Not every user has the luxury of being able to install a new compiler on the computer being used. But there is a relatively simple way to build a private copy of a GCC version when it is needed to resolve compatibility issues for ACML and other applications. These private c90opies can be built and installed in a user directory, and kept isolated from the system libraries.
Here are the steps for building GCC versions in ways that are known to work properly for ACML. These steps are for a 64-bit build.
The mpfr source package can be downloaded from www.mpfr.org. The build steps that worked for me were
./configure
make
make install
Of course the install step requires root privilege if installing into the default locations. the –prefix options can specify different install locations.
On some REDHAT systems, I ran into a compatibility issue with the default libmpfr.a.
I had to remove the existing file from /usr/lib/libmpfr.a and then ensure LD_LIBRARY_PATH and LD_RUN_PATH included paths to the location of the new mpfr, usually /usr/local/lib.
-------- #!/bin/bash # # Set GCC environment variables. GCCPATH=/home/acmluser/gcc441 GCCVER=4.4.1 GCCARCH=x86_64-unknown-linux-gnu if [ -z "${PATH}" ] then export PATH=$GCCPATH/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin else export PATH=$GCCPATH/bin:${PATH} fi if [ -z "${LIBRARY_PATH}" ] then export LIBRARY_PATH=$GCCPATH/lib64:$GCCPATH/lib/gcc/x86_64-unknown-linux-gnu /$GCCVER else export LIBRARY_PATH=$GCCPATH/lib64:$GCCPATH/lib/gcc/x86_64-unknown-linux-gnu /$GCCVER:${LIBRARY_PATH} fi if [ -z "${LD_LIBRARY_PATH}" ] then export LD_LIBRARY_PATH=$GCCPATH/lib64:/usr/local/lib64 else export LD_LIBRARY_PATH=$GCCPATH/lib64:${LD_LIBRARY_PATH} fi if [ -z "${LD_RUN_PATH}" ] then export LD_RUN_PATH=$LIBRARY_PATH else export LD_RUN_PATH=$LIBRARY_PATH:${LD_RUN_PATH} fi if [ -z "${MANPATH}" ] then export MANPATH=$GCCPATH/man else export MANPATH=$GCCPATH/man:$MANPATH fi if [ -z "${INFOPATH}" ] then export INFOPATH=$GCCPATH/info else export INFOPATH=$GCCPATH/info:$INFOPATH fi export CPATH=$GCCPATH/include:$GCCPATH/lib/gcc/$GCCARCH/$GCCVER/include export CPLUS_INCLUDE_PATH=$GCCPATH/include/c++/$GCCVER:$GCCPATH/lib/gcc/$GCCARCH/$GCCVER/include --------
Your email address:
©2013 Advanced Micro Devices, Inc. OpenCL and the OpenCL logo are trademarks of Apple, Inc., used with permission by Khronos.