Search code examples
linuxubuntucmakefortrantrilinos

Internal cmake error while building trilinos on ubuntu 32bit


I'm trying to build the library trilinos on a 32bit ubuntu virtual machine. I wrote the following configuration script:

cmake \
-D CMAKE_INSTALL_PREFIX:FILEPATH=./ \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraEXt:BOOL=ON \
-D Trilinos_ENABLE_Triutils:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
-D TPL_BLAS_LIBRARIES=/usr/lib/libblas.so.3 \
-D TPL_LAPACK_LIBRARIES=/usr/lib/liblapack.so.3 \
-D CMACKE_VERBOSE_MAKEFILE:BOOL=ON \
-D Trilinos_ENABLE_DEBUG:BOOL=ON \
-D CMACK_BUILD_TYPE:STRING=DEBUG \
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \
../

When I execute it with the ksh command in the terminal, I get the following error:

CMake Error: CMAKE_Fortran_Compiler not set, after EnableLanguage


Solution

  • It appears you do not have a Fortran compiler installed. This is why cmake cannot set CMAKE_Fortran_Compiler on its own, and requests you to manually specify one.

    Since you are using Ubuntu, I would recommend using gfortran from the GCC suite. If you install the compiler from the repository, cmake should be fine.

    You can install the compiler using

    sudo apt-get install gfortran