Installing pcre on linux

PCRE-8.44

The PCRE package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.

This package is known to build and work properly using an LFS-10.1 platform.

Package Information

  • Download (HTTP): https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.bz2
  • Download (FTP): ftp://ftp.pcre.org/pub/pcre/pcre-8.44.tar.bz2
  • Download MD5 sum: cf7326204cc46c755b5b2608033d9d24
  • Download size: 1.5 MB
  • Estimated disk space required: 20 MB (with tests)
  • Estimated build time: 0.3 SBU (with tests)

PCRE Dependencies

Optional

Installation of PCRE

Install PCRE by running the following commands:

./configure --prefix=/usr \ --docdir=/usr/share/doc/pcre-8.44 \ --enable-unicode-properties \ --enable-pcre16 \ --enable-pcre32 \ --enable-pcregrep-libz \ --enable-pcregrep-libbz2 \ --enable-pcretest-libreadline \ --disable-static && make 

To test the results, issue: make check .

make install && mv -v /usr/lib/libpcre.so.* /lib && ln -sfv ../../lib/$(readlink /usr/lib/libpcre.so) /usr/lib/libpcre.so 

Command Explanations

—enable-unicode-properties : This switch enables Unicode properties support and includes the code for handling UTF-8/16/32 character strings in the library. You need this switch if you are going to build GLib-2.68.1 with the —with-pcre=system switch.

—enable-pcre16 : This switch enables 16 bit character support.

—enable-pcre32 : This switch enables 32 bit character support.

—enable-pcregrep-libz : This switch adds support to pcregrep to read .gz compressed files.

—enable-pcregrep-libbz2 : This switch adds support to pcregrep to read .bz2 compressed files.

—enable-pcretest-libreadline : This switch adds line editing and history features to pcretest program.

Читайте также:  Установить java linux debian

—disable-static : This switch prevents installation of static versions of the libraries.

mv -v /usr/lib/libpcre.so.* /lib : Moves the PCRE library on the root filesystem so that it is available in case grep gets reinstalled with PCRE support.

—enable-jit : this option enables Just-in-time compiling, which can greatly speed up pattern matching.

Источник

How to fix «configure: error: pcre.h not found»

Question:When I try to compile a program, it fails with the following error. How can I fix this error on [insert your Linux distro]?

configure: error: pcre.h not found .

pcre.h is a development header file for PCRE (Perl Compatible Regular Expressions), which is a C library for pattern-matching regular expressions whose syntax and semantics are inspired by the Perl language. More powerful and flexible than POSIX regular expressions, PCRE is popularly used by many open-source projects such as Apache HTTP server, PHP, Postfix, Nmap, etc. There are also PCRE wrappers written in different languages (e.g., C++, PHP, .NET, Java) and built around PCRE API specification.

The error «configure: error: pcre.h not found» indicates that your Linux system does not have PCRE development files installed.

To install PCRE library and development header files, do the following.

Install PCRE on Ubuntu, Debian, Linux Mint

$ sudo apt-get install libpcre3-dev

Install PCRE on CentOS, Fedora, RHEL

$ sudo yum install pcre-devel

Install PCRE from the Latest Source

If you want to build and install PCRE library and development files from the latest source, you can do the following.

Prior to building, install build dependencies on Debian-based system:

$ sudo apt-get install gcc g++ make

Prior to building, install build dependencies on Red Hat-based system:

$ sudo yum install gcc gcc-c++ make

Finally, compile and install PCRE as follows. To customize build options, you can pass additional parameters (e.g., —prefix=/opt ) to the configure script. To check available build options, you can run ./configure —help

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz $ tar -xf pcre-8.38.tar.gz $ cd pcre-8.38 $ ./configure $ make $ sudo make install

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Читайте также:  Установка web сервера на линукс

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Источник

How To Install pcre on CentOS 7

In this tutorial we learn how to install pcre on CentOS 7.

What is pcre

Perl-compatible regular expression library. PCRE has its own native API, but a set of “wrapper” functions that are based on the POSIX API are also supplied in the library libpcreposix. Note that this just provides a POSIX calling interface to PCRE Perl syntax and semantics. The header file for the POSIX-style functions is called pcreposix.h.

We can use yum or dnf to install pcre on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install pcre.

Install pcre on CentOS 7 Using yum

Update yum database with yum using the following command.

After updating yum database, We can install pcre using yum by running the following command:

Install pcre on CentOS 7 Using dnf

If you don’t have dnf installed you can install dnf first. Update yum database with dnf using the following command.

After updating yum database, We can install pcre using dnf by running the following command:

How To Uninstall pcre on CentOS 7

To uninstall only the pcre package we can use the following command:

pcre Package Contents on CentOS 7

/usr/lib/libpcre.so.1 /usr/lib/libpcre.so.1.2.0 /usr/lib/libpcre16.so.0 /usr/lib/libpcre16.so.0.2.0 /usr/lib/libpcre32.so.0 /usr/lib/libpcre32.so.0.0.0 /usr/lib/libpcrecpp.so.0 /usr/lib/libpcrecpp.so.0.0.0 /usr/lib/libpcreposix.so.0 /usr/lib/libpcreposix.so.0.0.1 /usr/share/doc/pcre-8.32 /usr/share/doc/pcre-8.32/AUTHORS /usr/share/doc/pcre-8.32/COPYING /usr/share/doc/pcre-8.32/ChangeLog /usr/share/doc/pcre-8.32/LICENCE /usr/share/doc/pcre-8.32/NEWS /usr/share/doc/pcre-8.32/README /usr/lib64/libpcre.so.1 /usr/lib64/libpcre.so.1.2.0 /usr/lib64/libpcre16.so.0 /usr/lib64/libpcre16.so.0.2.0 /usr/lib64/libpcre32.so.0 /usr/lib64/libpcre32.so.0.0.0 /usr/lib64/libpcrecpp.so.0 /usr/lib64/libpcrecpp.so.0.0.0 /usr/lib64/libpcreposix.so.0 /usr/lib64/libpcreposix.so.0.0.1 /usr/share/doc/pcre-8.32 /usr/share/doc/pcre-8.32/AUTHORS /usr/share/doc/pcre-8.32/COPYING /usr/share/doc/pcre-8.32/ChangeLog /usr/share/doc/pcre-8.32/LICENCE /usr/share/doc/pcre-8.32/NEWS /usr/share/doc/pcre-8.32/README 

References

Summary

In this tutorial we learn how to install pcre on CentOS 7 using yum and dnf.

Читайте также:  Software installation on linux

Источник

PCRE-8.45

The PCRE package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.

[Note]

Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

  • Download (HTTP): https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2
  • Download MD5 sum: 4452288e6a0eefb2ab11d36010a1eebb
  • Download size: 1.5 MB
  • Estimated disk space required: 23 MB (with tests)
  • Estimated build time: 0.3 SBU (with tests)

PCRE Dependencies

Optional

Installation of PCRE

Install PCRE by running the following commands:

./configure --prefix=/usr \ --docdir=/usr/share/doc/pcre-8.45 \ --enable-unicode-properties \ --enable-pcre16 \ --enable-pcre32 \ --enable-pcregrep-libz \ --enable-pcregrep-libbz2 \ --enable-pcretest-libreadline \ --disable-static && make

To test the results, issue: make check .

Command Explanations

—enable-unicode-properties : This switch enables Unicode properties support and includes the code for handling UTF-8/16/32 character strings in the library. You need this switch if you are going to build GLib-2.76.4.

—enable-pcre16 : This switch enables 16 bit character support.

—enable-pcre32 : This switch enables 32 bit character support.

—enable-pcregrep-libz : This switch adds support to pcregrep to read .gz compressed files.

—enable-pcregrep-libbz2 : This switch adds support to pcregrep to read .bz2 compressed files.

—enable-pcretest-libreadline : This switch adds line editing and history features to pcretest program.

—disable-static : This switch prevents installation of static versions of the libraries.

—enable-jit : this option enables Just-in-time compiling, which can greatly speed up pattern matching.

Источник

Оцените статью
Adblock
detector