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
subscription-manager repos --enable rhel-server-rhscl-7-rpmsyum install devtoolset-7 cmake3 gitscl enable devtoolset-7 bash2) 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
import liefGreat 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.
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.