OpenCMISS/iron

segmentation fault when trying to install OpenCMISS iron on ubuntu 18.04

Closed this issue · 3 comments

Trying to install opencmiss iron on ubuntu 18.04, gnu toolchain, gcc-7, gfortran-7, g++-7, mpich (compiled against gcc-7). Note, this issue occurs with gcc-8 toolchain as well.

After executing inside setup-build/:
cmake -DOPENCMISS_LIBRARIES=iron -DOPENCMISS_ROOT=../opencmiss ../setup
make VERBOSE=1

I get the following error at OC_IRON:
[ 0%] Building Fortran object CMakeFiles/iron.dir/src/fieldml_output_routines.F90.o
/home/unimelb.edu.au/vrajagopal/applications/opencmiss_install/opencmiss/src/iron/src/fieldml_output_routines.F90:182:0:

   FIELDML_OUTPUT_IMPORT_FML = Fieldml_AddImport( FML_HANDLE, IMPORT_INDEX, cchar(REMOTE_NAME), cchar(REMOTE_NAME) )

internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
CMakeFiles/iron.dir/build.make:1739: recipe for target 'CMakeFiles/iron.dir/src/fieldml_output_routines.F90.o' failed
make[2]: *** [CMakeFiles/iron.dir/src/fieldml_output_routines.F90.o] Error 1
CMakeFiles/Makefile2:77: recipe for target 'CMakeFiles/iron.dir/all' failed
make[1]: *** [CMakeFiles/iron.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Hi Vijay,
yes, there appears to be a bug with the compilers on 18.04. You can install the gcc-9 compilers to fix this. Try something like

sudo apt-get install gcc-9 g++-9 gfortran-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortan-9 90

then test it with

gcc --version
gfortran --version

This suggestion resolved the issue, thanks.