Misp: Install steps for LIEF on Red Hat Enterprise Linux 7.4

Created on 17 Dec 2017  路  7Comments  路  Source: MISP/MISP

These are the steps that I took to install the lief library under Red hat Enterprise Linux 7.4.

0) Assumptions
Red Hat Enterprise Linux 7.4 (can be adapted for CentOS)
Python 2.7
SCL Repository

1) Install Dependencies

  • Enable the SCL repository
    subscription-manager repos --enable rhel-server-rhscl-7-rpms
  • Install git cmake3 devtoolset-7
    yum install devtoolset-7 cmake3 git
    *Enable SCL devtoolset-7
    scl enable devtoolset-7 bash

2) Set some environment variables and download LIEF source code

mkdir -p /tmp/LIEF
mkdir -p /tmp/LIEF_INSTALL
export LIEF_TMP=/tmp/LIEF
export LIEF_INSTALL=/tmp/LIEF_INSTALL
export LIEF_BRANCH=master
cd $LIEF_TMP
git clone --branch $LIEF_BRANCH --single-branch https://github.com/lief-project/LIEF.git LIEF

3) Compile LIEF and install

cd $LIEF_TMP/LIEF
mkdir -p build
cd build
scl enable devtoolset-7 'bash -c "cmake3 \
-DLIEF_PYTHON_API=on \
-DLIEF_DOC=off \
-DCMAKE_INSTALL_PREFIX=$LIEF_INSTALL \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_VERSION=2.7 \
.."'
make -j3
cd api/python
python setup.py install || :
cd $LIEF_TMP/LIEF/build
make install
make package

4) Testing

  • Open a Python interpreter
  • Import the lief library, if no errors, assuming the library installed.
    import lief
  • Run MISP diagnostics and confirm that lief is reported as installed.
documentation

Most helpful comment

I'm in the process of creating one for RHEL which I'll submit a PR in the coming days, which I'll include this as well.

All 7 comments

2740

Great feedback! Thank you very much.

Do you think it would be interesting to update the current CentOS 7 install guide with your procedure? or would it be better to make a new one for RHEL?

I'm in the process of creating one for RHEL which I'll submit a PR in the coming days, which I'll include this as well.

I've included the lief installation steps in my PR to add the RHEL 7.x installation documentation, so I'll close this off.

Thanks a lot!

im getting an error on the following step:

[ .... build]# scl enable devtoolset-7 'bash -c "cmake3 \
> -DLIEF_PYTHON_API=on \
> -DLIEF_DOC=off \
> -DCMAKE_INSTALL_PREFIX=$LIEF_INSTALL \
> -DCMAKE_BUILD_TYPE=Release \
> -DPYTHON_VERSION=2.7 \
> .."'
-- Could NOT find cppcheck (missing:  CPPCHECK_EXECUTABLE CPPCHECK_POSSIBLEERROR_ARG CPPCHECK_UNUSEDFUNC_ARG CPPCHECK_STYLE_ARG CPPCHECK_INCLUDEPATH_ARG CPPCHECK_QUIET_ARG)
fatal: No names found, cannot describe anything.
-- Tagged: 0
-- Current branch: master
CMake Error at cmake/LIEFGit.cmake:53 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:17 (include)


CMake Error at cmake/LIEFGit.cmake:54 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:17 (include)


CMake Error at cmake/LIEFGit.cmake:55 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:17 (include)


CMake Error at CMakeLists.txt:21 (project):
  VERSION ".." format invalid.


-- Configuring incomplete, errors occurred!

Install git.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leagueherald picture leagueherald  路  3Comments

ufo0531 picture ufo0531  路  4Comments

men-menouar picture men-menouar  路  5Comments

Applenice picture Applenice  路  3Comments

WakandaKing picture WakandaKing  路  5Comments