I'm trying to build this repo for neural networks implemented in CUDA.

I've followed the instructions in that link and performed the following actions on a shell:

git clone https://github.com/ANNetGPGPU/ANNetGPGPU.git
mkdir build
cd build
cmake .. && make

However, when I write that last line, the following error is returned:

CMake Error at /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
Call Stack (most recent call first):
  /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindBZip2.cmake:62 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:7 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/iibm/Documents/martins/ANNetGPGPU/build/CMakeFiles/CMakeOutput.log".

But bzip2 is definitely installed, as bzip2 --version returns:

bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.

   Copyright (C) 1996-2010 by Julian Seward.

So how can I fix this issue, and why is it happening?


When you build software that uses libraries such as bzip2, you need to have the -dev package installed, which includes the header files (*.h) needed by the compiler and the library files needed by the linker.

In your case, for bzip2, on Ubuntu, the name of the package with the files you need is libbz2-dev, so you can solve this problem by installing this package:

sudo apt-get install libbz2-dev
  • 1
    Thank you so much! Very clear and it indeed solved the problem. – Tendero Sep 3 '18 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.