Cmake tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:


== Build cmake from source ==
== Build cmake from source<ref>https://cmake.org/download/</ref> ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
#If another version if cmake is installed, uninstall it. A compiler such as g++ must be installed.
#If another version if cmake is installed, uninstall it. A compiler such as g++ must be installed.
Line 23: Line 23:
== CMake x.yy or higher is required<ref>https://stackoverflow.com/questions/49859457/how-to-reinstall-the-latest-cmake-version</ref> ==
== CMake x.yy or higher is required<ref>https://stackoverflow.com/questions/49859457/how-to-reinstall-the-latest-cmake-version</ref> ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
#Install latest cmake  
# Install latest cmake  
$apt remove cmake -y
$apt remove cmake -y
$pip install cmake --upgrade
$pip install cmake --upgrade


#Or specific version
# Or specific version
sudo pip install cmake==3.22
sudo pip install cmake==3.22
# Find location of cmake and crate symbolic link to default /usr/bin folder
# or add cmake location in your environment path
sudo ln -s /usr/local/bin/cmake /usr/bin/cmake
</syntaxhighlight>
</syntaxhighlight>


== References ==
== References ==
<references />
<references />

Latest revision as of 13:58, 6 June 2024

Build cmake from source[1]

#If another version if cmake is installed, uninstall it. A compiler such as g++ must be installed.
sudo apt remove cmake

#Install prerequisite
sudo apt install libssl-dev

# Download the latest archive from https://cmake.org/download/
# Extract, build and install.

tar -zxvf cmake-x.yy.z.tar.gz
cd cmake-x.yy.z
./bootstrap
make -j $(nproc)
sudo make install
sudo ldconfig

CMake x.yy or higher is required[2]

# Install latest cmake 
$apt remove cmake -y
$pip install cmake --upgrade

# Or specific version
sudo pip install cmake==3.22

# Find location of cmake and crate symbolic link to default /usr/bin folder 
# or add cmake location in your environment path
sudo ln -s /usr/local/bin/cmake /usr/bin/cmake

References