# Build from source pointing to installed libs (e.g. pcre)

**URL:** <https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209>\
**Category:** NGINX\
**Created:** [March 7, 2013, 2:11pm UTC](https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209 "2013-03-07T14:11:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthony\_kerz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@anthony\_kerz](https://www.ruby-forum.com/u/anthony_kerz)\
**Post date:** [March 7, 2013, 2:11pm UTC](https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209/1 "2013-03-07T14:11:51Z")

</div>

hi,

i’m trying to build from source on an ubuntu system which has libpcre3  
installed:

tony@quantal:~/Downloads/nginx-1.3.14$ dpkg -l | grep pcre  
ii libpcre3:i386 1:8.30-5ubuntu1 i386 Perl 5 Compatible Regular  
Expression  
Library - runtime files

but i can’t for the life of me get the configure script to resolve to  
this,  
libpcre.so.3 is in /lib/i386-linux-gnu, so i’ve tried:

–with-ld-opt="-L/lib/i386-linux-gnu"

## but still get:

…  
checking for PCRE library … not found  
checking for PCRE library in /usr/local/ … not found  
checking for PCRE library in /usr/include/pcre/ … not found  
checking for PCRE library in /usr/pkg/ … not found  
checking for PCRE library in /opt/local/ … not found

./configure: error: the HTTP rewrite module requires the PCRE library.  
You can either disable the module by using --without-http\_rewrite\_module  
option, or install the PCRE library into the system, or build the PCRE  
library  
statically from the source with nginx by using --with-pcre=  
option.

---

<div class="post-metadata">

**Author:** ![anthony\_kerz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@anthony\_kerz](https://www.ruby-forum.com/u/anthony_kerz)\
**Post date:** [March 7, 2013, 4:05pm UTC](https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209/2 "2013-03-07T16:05:48Z")

</div>

On Thu, Mar 7, 2013 at 10:11 PM, anthony kerz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> libpcre.so.3 is in /lib/i386-linux-gnu, so i’ve tried:  
> checking for PCRE library in /opt/local/ … not found
> 
> ## ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http\_rewrite\_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre= option.
> 
> any guidance appreciated!

building stuff from source require installation of development  
(-dev/-devel) packages of its dependencies in ubuntu, rhel, and some  
other distros.

(read: try installing libpcre3-dev)

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)

---

<div class="post-metadata">

**Author:** ![anthony\_kerz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@anthony\_kerz](https://www.ruby-forum.com/u/anthony_kerz)\
**Post date:** [March 8, 2013, 6:40am UTC](https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209/3 "2013-03-08T06:40:11Z")

</div>

installing the related ‘dev’ packages was the ticket:

- libpcre3-dev
- libssl-dev
- zlib1g-dev

then acquiring source and static linking can be avoided…

thanks @edho!

---

<div class="post-metadata">

**Author:** ![anthony\_kerz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@anthony\_kerz](https://www.ruby-forum.com/u/anthony_kerz)\
**Post date:** [March 7, 2013, 4:14pm UTC](https://www.ruby-forum.com/t/build-from-source-pointing-to-installed-libs-e-g-pcre/227209/4 "2013-03-07T16:14:34Z")

</div>

On Mar 7, 2013, at 3:04 PM, Edho A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > but i can’t for the life of me get the configure script to resolve to this,  
> > checking for PCRE library in /usr/pkg/ … not found
> 
> building stuff from source require installation of development  
> (-dev/-devel) packages of its dependencies in ubuntu, rhel, and some  
> other distros.
> 
> (read: try installing libpcre3-dev)

cd /usr/src  
wget [http://nginx.org/download/nginx-1.3.14.tar.gz](http://nginx.org/download/nginx-1.3.14.tar.gz)  
tar xzvf ./nginx-1.3.14.tar.gz && rm -f ./nginx-1.3.14.tar.gz && cd  
nginx-1.3.14  
wget [http://nginx.org/patches/spdy/patch.spdy-66\_1.3.14.txt](http://nginx.org/patches/spdy/patch.spdy-66_1.3.14.txt) && patch -p1  
\< patch.spdy.txt

cd /usr/src  
wget [http://zlib.net/zlib127.zip](http://zlib.net/zlib127.zip)  
unzip zlib127.zip && rm -f zlib127.zip  
wget  
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz  
tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz  
wget [http://www.openssl.org/source/openssl-1.0.1c.tar.gz](http://www.openssl.org/source/openssl-1.0.1c.tar.gz)  
tar xzvf openssl-1.0.1c.tar.gz && rm -f openssl-1.0.1c.tar.gz

cd /usr/src/nginx-1.3.14  
./configure --prefix=/opt/nginx --with-pcre=/usr/src/pcre-8.30  
–with-zlib=/usr/src/zlib-1.2.7 --with-openssl=/usr/src/openssl-1.0.1c  
–with-http\_ssl\_module --with-http\_spdy\_module  
make && make install
