0

I'm having issues getting cmake installed onto my machine. Here is what I am running:

sudo apt-get -f install cmake

And here is the output:

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 cmake : Depends: libjsoncpp1 but it is not installable

I have tried running apt-get update but it doesn't seem to help. Please let me know what I should try. Would be happy to provide more information.

Thanks! :)

Edit: The output of "apt-cache policy cmake" is as follows:

    cmake:
  Installed: (none)
  Candidate: 3.5.2-2ubuntu1~ubuntu16.04.1~ppa1
  Version table:
     3.5.2-2ubuntu1~ubuntu16.04.1~ppa1 0
        500 http://ppa.launchpad.net/thomas-schiex/blender/ubuntu/ trusty/main amd64 Packages
     3.2.2-2~ubuntu14.04.1~ppa1 0
        500 http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu/ trusty/main amd64 Packages
     2.8.12.2-0ubuntu3 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Thanks!

Update: Thanks! I was able to install cmake. However, I can't seem to make anything with it. I'm running

cmake ../

in an empty directory which I created inside the project I'm trying to make. Here is the output:

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.

Would anybody have any idea on what to do next? I have tried uninstalling and reinstalling as well as apt-get update. Again, I can post more information on here if needed.

Thanks!

0

You can install cmake from main repository by specifying its version:

sudo apt-get install cmake=2.8.12.2-0ubuntu3

If it fails, try one of the following methods:

  • remove PPAs from system with their packages and then install version from main repository

    sudo ppa-purge ppa:thomas-schiex/blender
    sudo ppa-purge ppa:george-edison55/cmake-3.x
    sudo apt-get install cmake
    
  • temporary disable PPAs, install cmake then enable PPAs:

    sudo add-apt-repository -r ppa:thomas-schiex/blender
    sudo add-apt-repository -r ppa:george-edison55/cmake-3.x
    sudo apt-get update
    sudo apt-get install cmake
    sudo add-apt-repository ppa:thomas-schiex/blender
    sudo add-apt-repository ppa:george-edison55/cmake-3.x
    

Then you can try to build simple cmake example. Fast googling gave me the cmake-example.git repository. I do not know what is this, but it compiles fast and runs normally:

sudo apt-get install cmake git build-essential gfortran
git clone https://github.com/bast/cmake-example.git
cd cmake-example/
mkdir build
cd build
cmake ..
make

You can test it by executing compiled programs:

./hello.x
./main.x
./unit_tests

If it fails then you have other problems in your system.

  • Thanks! I was able to install cmake version 2.8 but now I'm having problems using it...I will update my post. – ellen Mar 12 '18 at 18:51
  • I updated my answer - added cmake-example. – N0rbert Mar 12 '18 at 20:14
  • Thanks @N0rbert - I had already cloned the repository I wanted to make, but I didn't have build-essential gfortran installed. I tried installing gfortran and running cmake but I got the same error as before. Do I need to clone the repository again? – ellen Mar 12 '18 at 23:20
-1

There is an unofficial repository that has a version for 14.04.

sudo add-apt-repository ppa:mantid/mantid
sudo apt-get update

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.