I am a new user of Linux and trying to download Avogadro 1.2.0.
I'm having trouble using the command cmake ../
, when I do it says
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
I believe that I need to make some changes to the CMakeLists.txt in the package source directory, but have no idea how to do so.
I changed the minimum required from VERSION 2.8.9 to VERSION 2.8.12, maybe it has to something with it?
The code is very long so I just added the first 27 lines if need it.
cmake_minimum_required(VERSION 2.8.9)
project(Avogadro) # the name of your project
# The Avogadro version number, currently used by the Avogadro library too
set(Avogadro_VERSION_MAJOR 1)
set(Avogadro_VERSION_MINOR 2)
set(Avogadro_VERSION_PATCH 0)
set(Avogadro_VERSION "${Avogadro_VERSION_MAJOR}.${Avogadro_VERSION_MINOR}")
set(Avogadro_VERSION_FULL "${Avogadro_VERSION}.${Avogadro_VERSION_PATCH}")
set(CMAKE_MODULE_PATH ${Avogadro_SOURCE_DIR}/cmake/modules)
cmake_policy(SET CMP0003 NEW)
# this is adapted from KDE's FindKDE4Internal.cmake : default the build type to
# "release with debug info".
#
# We will define two other build types: Debug and Release.
# These names are case-insensitive i.e. you can do -DCMAKE_BUILD_TYPE=debug
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
message(STATUS "The build type is ${CMAKE_BUILD_TYPE}")
include(CheckCXXCompilerFlag)
include(MacroEnsureVersion)
include(TestIfWeNeedFPermissive)
Any suggestions of what can I do?
This answer is based on the assumption you are running Ubuntu, as you do not explicitly specify which Linux distribution you are running. I am assuming Ubuntu, since you have that as a tag.
CMake requires a working C or C++ compiler to compile code. The output you provided is telling you that CMake failed to find a C or C++ compiler installed on your computer.
Several compilers are available for Linux. A popular C++ compiler is
g++
.g++
,gcc
, andmake
can be installed on Ubuntu usingapt
by running the following two commands:I assume the Avogadro you are trying to install is this program. Please note that the installation instructions specify the tools required to build and install from the source code. You will need CMake (which you appear to already have installed), a working C++ compiler, GNU make, and the other two tools specified. Please install all build tools before you try to build Avogadro.