I am trying to install lalsuite on ubuntu according to the instructions here:


Everything went smoothly until I ran

./configure --prefix=${VIRTUAL_ENV}/opt/lalsuite --enable-swig-python

And the error I get is:

configure: error: could not find the zlib library

I am doing all this inside a virtual environment using virtualenv. I'm fairly certain I have the zlib library as I installed it with:

$ sudo apt install zlib1g

After a thorough search for a solution I found someone with the same problem:


But I do not really understand their solution. My interpretation of their fix was to do the following:

First reinstall pkg-config:

sudo apt-get update
sudo apt-get install pkg-config

Then write the line suggested by the answer:

echo 'export PKG_CONFIG=/usr/bin/pkg-config' >> ~/.bashrc

(I am doing all this inside the virtualenv by the way).

Then restart everything and try the same thing again:

./configure --prefix=${VIRTUAL_ENV}/opt/lalsuite --enable-swig-python

Sadly the same error appears.

Any help is appreciated.


You need to install -dev package for zlib1g - it is named zlib1g-dev:

sudo apt-get install zlib1g-dev

and it will install zlib.pc file for pkg-config along with zlib.h header.

  • Excellent, thank you. – MystMan Sep 1 '19 at 0:25

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.