Elastic Beanstalk link/alias cmake3 to cmake

Viewed 87

I have installed cmake3 through yum on my AWS Elastic Beanstalk instance:

packages: 
  yum:
    cmake3: []

However when running a pip install that requires cmake, I'm getting an error:

FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'

How can I alias cmake3 for cmake? I have tried the following and it is resulting in the same error message.

container_commands:
  01_link_cmake:
    command: "ln -s /usr/bin/cmake3 /usr/bin/cmake"

The reason I do not install cmake: [] is because I need version 3.

1 Answers

I have solved it. I realized that the pip package install happened before the ln -s container command. So even if my alias was happening, it was happening too late in the process.

Instead, what I needed to do was

container_commands:
  01_link_cmake:
    command: ln -s /usr/bin/cmake3 /usr/bin/cmake
  02_upgrade_pip:
    command: "python -m pip install --upgrade pip"
    leader_only: true
  03_install_package:
    command: "python -m pip install <package that requires cmake>"
    leader_only: true
Related