Home » Building and installing OPAL on Linux (Fedora 27)

Building and installing OPAL on Linux (Fedora 27)

(note: this page has been superseded by the Ubuntu version, found here)

The OPAL project homepage, including the link to subscribe to the forum mailing list is found here.

I had problems with both the Mac and the Linux executables, so I decided to build it.  I use Homebrew on my Mac and this seemed more designed to work with MacPorts, so I elected to build it on my linux VM (Fedora 27).

I generally followed the instructions here.  I installed or updated all of the prerequisite packages with “yum” except “H5hut” (see below),  with the following notes:

  • GMP = ‘sudo yum install R-gmp’
  • GNU scientific library = ‘sudo yum install gsl’
  • In addition to ‘gsl’, must also install ‘gsl-devel’
  • In addition to ‘openmpi’, must also need to install ‘openmpi-devel’
  • In addition to ‘boost’, must need to install ‘boost-devel’ and ‘boost-static’

H5hut needs to be built and installed by hand, by following the instructions here. Before doing ‘autogen.sh’, I typed “libtoolize”, which gave me the option of installing that package.  I ran ./configure –enable-fortran and –prefix=/usr/local/ options.  It’s suppose to default to /usr/local, but it didn’t without that option.  I had to do “sudo make install” to have permission to install there.

When following the OPAL build instructions, I  replaced the “git clone git@gitlab.psi.ch:OPAL/src.git” command with “git clone https://gitlab.psi.ch/OPAL/src.git” to avoid a permission error.

When I got to the “cmake” part,  I initially got an error that it couldn’t find “mpicc”. To fix this, I added the openmpi directory to the path with “export PATH=/usr/lib64/openmpi/bin:${PATH}”.

I’m not a cmake expert, so I kludged together workarounds for the following problems:

  • When I first tried to build it, I got a bunch of errors that it couldn’t find the mpi header files.  I fixed this by linking everything in the /usr/include/openmpi-x86_64/ directory up one directory into /usr/include/
  • When it went to link ‘opal’, I got pages of errors that it couldn’t find a bunch of stuff in the hdf5 libraries.  I worked around this by editing the file build/src/CMakeFiles/opal.dir/link.txt and adding ‘-lhdf5’ by hand: “….-lgslcblas -lhdf5 /usr/local/lib/libH5hut.a…”.

After this, it compiled and made the opal executable.

I attempted to run the example here, but got the following errors for each pass

Error> *** User error detected by function “Distribution::setDistType()”
Error> The attribute DISTRIBUTION isn’t supported any more, use TYPE instead
Error> The attribute DISTRIBUTION isn’t supported any more, use TYPE instead

I edited the cyclotron1.in file and made the following change

< Dist1:DISTRIBUTION, DISTRIBUTION=FROMFILE, FNAME=”dist1.dat”;
> Dist1:DISTRIBUTION, TYPE=FROMFILE, FNAME=”dist1.dat”;

After that, I was able to reproduce the tune plot on the web page.