What is the correct location of gcc is on my Ubuntu 16.04 computer?

I am trying to build the software package Trilinos, and I think it failed because it couldn't locate the C compiler directory correctly. Can anyone tell what the correct location of gcc is on my Ubuntu 16.04 computer? I actually need the C, C++ and fortran directory locations.

I am using the build script:

cmake \ -DCMAKE_C_COMPILER=<path to C compiler> \ -DCMAKE_CXX_COMPILER=<path to C++ compiler> \ -DCMAKE_Fortran_COMPILER=<path to Fortran compiler> \ -DTrilinos_ENABLE_ALL_PACKAGES=ON \ -DCMAKE_INSTALL_PATH=<path to install Trilinos into> \ <path to Trilinos source> make -j<n> install 

I used directories:

<path to C compiler> = /usr/bin <path to C++ compiler> = /usr/bin <path to Fortran compiler> = /usr/bin 

I assume C is gcc-5, C++ is g++-5 and fortran is gfortran-5?

Should the directory be /usr/lib/gcc/x86_64-linux-gnu from Linux C Compiler?

The cmake build gave error message (end part of build output):

-- The C compiler identification is unknown -- Check for working C compiler: /usr/bin -- Check for working C compiler: /usr/bin -- broken CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/bin" is not able to compile a simple test program. 

1 Answer

The path requires the full path including filename, using:

which gcc /usr/bin/gcc which g++ /usr/bin/g++ 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like