Installing EKOPath on Fedora 14

Xavier Fernández-i-Marín wrote to ask me about compiling JAGS with the EKOPath 4 compiler from PathScale  (a.k.a path64) which has recently become open source.  Pathscale has a reputation for producing very high performance compilers, so I wanted to see how it would work with JAGS.

Building the path64 compiler on Fedora 14 Linux was not easy, but I managed to collect enough hints from the BSD forums and the github site for the path64 compiler. I am putting my instructions here in case anyone else wants to try building the path64 compiler on Fedora.

  1. The path64 compiler is 64-bit only.  There is a hint is in the name, but if you try to compile it on 32-bit Linux you currently get a segmentation fault, not an  informative error message
  2. Use version 4.0.1 of the path64 compiler. This is the last stable version, which can be obtained as follows
  3. git clone https://github.com/path64/compiler.git
    cd compiler/
    git checkout 4.0.10

  4. You need to compile path64 with gcc 4.2.4. Later versions will not work as gcc complains about vector type  mismatches.  I installed gcc 4.2.4 by hand with the following configure options
  5. ./configure   --prefix=/opt/gcc-4.2.4  --enable-languages=c,c++,fortran

Having done this, the incantation required to configure the path64 compiler is

PATH=/opt/gcc-4.2.4/bin:$PATH
cmake -DCMAKE_BUILD_TYPE=Debug \
-DPATH64_ENABLE_TARGETS=x86_64 \
-DPATH64_ENABLE_MATHLIBS=ON \
-DPATH64_ENABLE_FORTRAN=ON \
-DPATH64_ENABLE_HUGEPAGES=OFF \
-DPSC_CRT_PATH_x86_64=/usr/lib64 \
-DPSC_DYNAMIC_LINKER_x86_64=/lib64/ld-linux-x86-64.so.2 \
-DPSC_LIBSUPCPP_PATH_x86_64=/opt/gcc-4.2.4/lib64 \
-DPSC_LIBSTDCPP_PATH_x86_64=/opt/gcc-4.2.4/lib64 \
-DPSC_LIBGCC_PATH_x86_64=/opt/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-gnu/4.2.4 \
-DPSC_LIBGCC_EH_PATH_x86_64=/opt/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-gnu/4.2.4 \
-DPSC_LIBGCC_S_PATH_x86_64=/opt/gcc-4.2.4/lib64 \
/path/to/source/compiler

This is followed by the usual “make” and “make install” steps.   The build process is long but it prints the percent progress as it goes, which is nice.  Parallel make with two processes (i.e. “make -j2”) allowed a faster compile but highly parallel make (-j4) tended to fail.

After this, you can use the installed path64 compiler to build a “release” version. The configuration is the same but with the flag

 -DCMAKE_BUILD_TYPE=Debug

replaced by

 -DCMAKE_BUILD_TYPE=Release 

To use the path64 compiler, you need to add both /opt/path64/bin and /opt/gcc-4.2.4/bin to the path. The latter ensures that you are using the right preprocessor for the version of the standard C++ library that comes with gcc 4.2.4. If you don’t do this, then the compiler will use the headers for the 4.5.1 version of the C++ library that comes with with Fedora 14, but these are incompatible.

Advertisements

One thought on “Installing EKOPath on Fedora 14

  1. Pingback: JAGS News » Blog Archive » GCC vs Path64

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s