【学习cmake-cookbook/chapter-03/recipe-04/cxx-example】

遇到找不到Fortran编译器的问题:

root@kirinai-15-g5000pro:/workspace/cmake/cmake-cookbook/chapter-03/recipe-04/cxx-example# cmake .
-- The CXX compiler identification is GNU 7.5.0
-- The C compiler identification is GNU 7.5.0
-- The Fortran compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:5 (project):
  No CMAKE_Fortran_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/workspace/cmake/cmake-cookbook/chapter-03/recipe-04/cxx-example/CMakeFiles/CMakeOutput.log".
See also "/workspace/cmake/cmake-cookbook/chapter-03/recipe-04/cxx-example/CMakeFiles/CMakeError.log".

解决办法:cmake - how to solve No CMAKE_Fortran_COMPILER could be found.? - Ask Ubuntu

        it's probably missing gfortran Try installing the gfortran using the following command:

sudo apt install gfortran

解决了:

        

root@kirinai-15-g5000pro:/workspace/cmake/cmake-cookbook/chapter-03/recipe-04/cxx-example# cmake .
-- The Fortran compiler identification is GNU 7.5.0
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Verifying Fortran/CXX Compiler Compatibility
-- Verifying Fortran/CXX Compiler Compatibility - Success
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- A library with BLAS API found.
-- A library with BLAS API found.
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/cmake/cmake-cookbook/chapter-03/recipe-04/cxx-example

你可能感兴趣的:(编译和调试,camke,Fortran,LAPACK)