Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running CMake on Amazon Linux

I am trying to build OpenJpeg on an AWS Amazon Linux EC2 instance. I installed cmake and gcc and had no issues during installation. When I try to cmake openjpeg I get the following error:

-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):
  no suitable type found
Call Stack (most recent call first):
  CMakeLists.txt:164 (TEST_BIG_ENDIAN)


-- Configuring incomplete, errors occurred!

Checking the error logs it seems CMake is unable to determine the size of integers, shorts and longs. The full error log can be found in this gist

How can I work this out and make CMake work?

like image 765
Zaid Amir Avatar asked Aug 23 '26 14:08

Zaid Amir


2 Answers

Amazon has a guide: Preparing to Compile Software, which proposes the following command to install a C compiler.

sudo yum groupinstall "Development Tools"

Next, you can download and build Cmake yourself: Install Cmake 3.

wget https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
tar -xvzf cmake-3.18.0.tar.gz
cd cmake-3.18.0
./bootstrap
make
sudo make install

Note: the last make actually needs sudo.

like image 65
bvdb Avatar answered Aug 26 '26 22:08

bvdb


This works in the most recent Amazon Linux image (Nov 2021):

# Install sudo, wget and openssl, which is required for building CMake
yum install sudo wget openssl-devel -y

# Install development tools
sudo yum groupinstall "Development Tools" -y

# Download, build and install cmake
wget https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
tar -xvzf cmake-3.18.0.tar.gz
cd cmake-3.18.0
./bootstrap
make
sudo make install
like image 21
Leandro Barone Avatar answered Aug 26 '26 23:08

Leandro Barone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!