Compiling Cmake

Issues related to applications and software problems and general support
Post Reply
bigrockcrasher
Posts: 6
Joined: 2018/06/06 15:48:32

Compiling Cmake

Post by bigrockcrasher » 2020/06/24 21:40:58

I am currently trying to compile cmake 3.17.3 on centos 8.1 I get the following error
CMake 3.17.3, Copyright 2000-2020 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: gmake
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
gmake: Warning: File 'Makefile' has modification time 34 s in the future
gmake: 'cmake' is up to date.
gmake: warning: Clock skew detected. Your build may be incomplete.
loading initial cache file /data/jsp/human2/fcMRI/Aaron/chopin/CMake-3.17.3/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at CMakeLists.txt:107 (message):
The C++ compiler does not support C++11 (e.g. std::unique_ptr).


-- Configuring incomplete, errors occurred!
See also "/data/jsp/human2/fcMRI/Aaron/chopin/CMake-3.17.3/CMakeFiles/CMakeOutput.log".
See also "/data/jsp/human2/fcMRI/Aaron/chopin/CMake-3.17.3/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
I am not the admin of the machine. I had the admin follow the instruction from the following URL

https://linuxhint.com/install_gcc_build_tools_centos8/

I am assuming i am missing some thing.

User avatar
TrevorH
Forum Moderator
Posts: 29662
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Compiling Cmake

Post by TrevorH » 2020/06/24 22:44:23

Yes. It's already packaged and available in the EPEL yum repository.

yum --enablerepo=extras install epel-release
yum install cmake3
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

bigrockcrasher
Posts: 6
Joined: 2018/06/06 15:48:32

Re: Compiling Cmake

Post by bigrockcrasher » 2020/06/24 23:00:51

Ya, knew about the repositories. I am more interested in knowing how to compile this. I enjoy the challenge.

User avatar
TrevorH
Forum Moderator
Posts: 29662
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Compiling Cmake

Post by TrevorH » 2020/06/24 23:18:25

This is an enterprise distribution in which recreatability is paramount along with stability. Packages are the preferred method to do things. Compilation is discouraged.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

mathog
Posts: 234
Joined: 2008/07/09 23:52:06

Re: Compiling Cmake

Post by mathog » 2020/06/25 19:11:28

Not exactly what you asked, but this is how I installed the binaries for what was at that time the most recent Cmake version on CentOS 8 and packaged it for Lmod. These binaries ran on this system. The script at the end is here:

https://saf.bio.caltech.edu/pub/softwar ... rectory.sh

Some of the commands will not apply in your case. Change 3.17.1 to 3.17.3.

Code: Select all

  pversion=3.17.1
  package=cmake
  TOPDIR=/usr/common/modules/el8/x86_64/software/${package}/${pversion}-CentOS-vanilla
  #as modules on 2020/04/21 on CentOS 8
  #remove CentOS 7 version
  rm -rf /usr/common/modules/el7/x86_64/software/cmake
  rm -rf /usr/common/modules/el7/x86_64/modules/all/cmake
  rm -rf /usr/common/src/cmake-*
  #this is for programs that need the absolute latest cmake
  cd /usr/common/src
  wget https://github.com/Kitware/CMake/releases/download/v${pversion}/${package}-${pversion}-Linux-x86_64.tar.gz
  gunzip -c ${package}-${pversion}-Linux-x86_64.tar.gz | tar -xf -
  /bin/rm ${package}-${pversion}-Linux-x86_64.tar.gz
  mv ${package}-${pversion}-Linux-x86_64 ${package}-${pversion}
  cd ${package}-${pversion}
  mkdir -p $TOPDIR
  rmdir $TOPDIR
  ln -s $PWD $TOPDIR
  module_generate_from_directory.sh \
     $package \
     $pversion \
     CentOS/vanilla \
     $TOPDIR \
     "Cross-Platform Makefile Generator." \
     "https://cmake.org/"
Using it:

Code: Select all

module load cmake
which cmake
~/el8/x86_64/software/cmake/3.17.1-CentOS-vanilla/bin/cmake
cmake --version
cmake version 3.17.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
ls -al `which cmake`
-rwxr-xr-x. 1 modules modules 11690712 Apr  9 05:53 /usr/common/modules/el8/x86_64/software/cmake/3.17.1-CentOS-vanilla/bin/cmake

mathog
Posts: 234
Joined: 2008/07/09 23:52:06

Re: Compiling Cmake

Post by mathog » 2020/06/25 19:30:00

Perhaps your compiler install is borked? This worked here using the system's usual compilers and cmake:

Code: Select all

g++ --version
#g++ (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4)
set | grep FLAG
#none
cd /tmp
mkdir /tmp/cmake_root
wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3.tar.gz
gunzip -c cmake-3.17.3.tar.gz | tar -xf - 
/bin/rm cmake-3.17.3.tar.gz 
cd cmake-3.17.3
mkdir build
cd build
cmake \
  -DCMAKE_INSTALL_PREFIX=/tmp/cmake_root \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON  \
  .. 2>&1 | tee cmake_2020_06_25.log
make -j 4 2>&1 | tee build_2020_06_25.log
make install 2>&1 | tee install_2020_06_25.log
/tmp/cmake_root/bin/cmake --version
#cmake version 3.17.3
These are the compilers used:

Code: Select all

 rpm -qa | grep ^gcc | grep -v toolset
gcc-gdb-plugin-8.3.1-4.5.el8.x86_64
gcc-8.3.1-4.5.el8.x86_64
gcc-gfortran-8.3.1-4.5.el8.x86_64
gcc-c++-8.3.1-4.5.el8.x86_64

bigrockcrasher
Posts: 6
Joined: 2018/06/06 15:48:32

Re: Compiling Cmake

Post by bigrockcrasher » 2020/06/25 22:30:29

Ok I got it to work. I was compiling over nfs on a zfs system. I read a post that had a similar issue. They solved it by compiling it locally. I tried it out and it worked. I have no idea why. If any one has a reason this worked I would love to know.

TrevorH, I told you I like the challenge. There is a reason for my efforts. Not all software is found in a repository forcing me to learn how to install software the old fashion way which is what i am forced to do after this. In this case I needed cmake version 3.16. The repositories had 3.11. now I got the useful version installed and I learned a lesson which will help me install some software I know it is not found in any repositories.

User avatar
TrevorH
Forum Moderator
Posts: 29662
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Compiling Cmake

Post by TrevorH » 2020/06/26 00:56:05

No, EPEL has 3.17
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
jlehtone
Posts: 3088
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Compiling Cmake

Post by jlehtone » 2020/06/26 05:53:23

More specifically, epel-playground has it at this moment:

Code: Select all

[CentOS 8]$ sudo yum --enablerepo=epel\* list cmake\*
Installed Packages
cmake.x86_64                3.11.4-7.el8               @AppStream               
cmake-data.noarch           3.11.4-7.el8               @AppStream               
cmake-filesystem.x86_64     3.11.4-7.el8               @AppStream               
cmake-rpm-macros.noarch     3.11.4-7.el8               @AppStream               
Available Packages
cmake-doc.noarch            3.11.4-7.el8               AppStream                
cmake-filesystem.i686       3.11.4-7.el8               AppStream                
cmake-gui.x86_64            3.11.4-7.el8               AppStream                
cmake3.x86_64               3.17.2-1.epel8.playground  epel-playground          
cmake3-data.noarch          3.17.2-1.epel8.playground  epel-playground          
cmake3-doc.noarch           3.17.2-1.epel8.playground  epel-playground          
cmake3-gui.x86_64           3.17.2-1.epel8.playground  epel-playground          
...

Jean-Pierre
Posts: 9
Joined: 2020/05/31 16:36:25

Re: Compiling Cmake

Post by Jean-Pierre » 2020/06/26 06:42:05

Ok I got it to work. I was compiling over nfs on a zfs system. I read a post that had a similar issue. They solved it by compiling it locally. I tried it out and it worked. I have no idea why.
The reason if that the system times are not synced. See your first post :

Code: Select all

gmake: Warning: File 'Makefile' has modification time 34 s in the future
gmake: 'cmake' is up to date.
gmake: warning: Clock skew detected. Your build may be incomplete.
make bases its decisions on the time stamps. Files are on different servers not time synced lead to wrong decisions.

Post Reply

Return to “CentOS 8 - General Support”