Home » Networking Tools » Compiling irrtoolset5 / peval on Ubuntu

If you wish to get recent versions of irrtoolset5 and Ubuntu to play nicely, you need some patches.
Eg: I tried to compile irrtoolset-5.0.1 under Ubuntu 14.04.3 LTS and failed miserably with:

libtool: link: g++ -g -O2 -o peval peval.o  ../.libs/libirrtoolset.a -lhistory -lreadline -ltermcap
../.libs/libirrtoolset.a(object.o): In function `Object::parse()':
/tmp/irrtoolset-5.0.1/src/rpsl/object.cc:131: undefined reference to `rpslparse(void*)'
collect2: error: ld returned 1 exit status
make[3]: *** [peval] Error 1
make[3]: Leaving directory `/tmp/irrtoolset-5.0.1/src/peval'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/irrtoolset-5.0.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/irrtoolset-5.0.1/src'
make: *** [all-recursive] Error 1

In short:

1. Download irrtoolset5 source from the official FTP, or just get irrtoolset-5.0.1.tar.gz, or start from http://irrtoolset.isc.org/wiki/IRRToolSetInstallation.
2. Download the two patches found here – http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/irrtoolset5/patches/.
3. Patch, compile, install.

In detail:

sudo apt-get install -y build-essential libtool subversion bison flex libreadline-dev autoconf automake
cd /tmp
wget ftp://ftp.isc.org/isc/IRRToolSet/IRRToolSet-5.0.1/irrtoolset-5.0.1.tar.gz
tar xvzf irrtoolset-5.0.1.tar.gz
cd irrtoolset-5.0.1/
wget http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/irrtoolset5/patches/patch-src_rpsl_Makefile.in
wget http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/irrtoolset5/patches/patch-src_rpsl_object.cc
patch src/rpsl/Makefile.in patch-src_rpsl_Makefile.in
patch src/rpsl/object.cc patch-src_rpsl_object.cc
./configure
make
sudo make install
cd ~
rm -rf /tmp/irrtoolset-5.0.1

It is hoped that these patches will make it into the trunk … but if they haven’t, I guess that’ll be what has brought you here.
Enjoy!

PS: In case the patches become unavailable, here they are…


patch-src_rpsl_Makefile.in
$NetBSD: patch-src_rpsl_Makefile.in,v 1.1 2013/08/31 08:44:49 joerg Exp $

--- src/rpsl/Makefile.in.orig	2013-08-30 22:54:56.000000000 +0000
+++ src/rpsl/Makefile.in
@@ -37,6 +37,8 @@
 #
 #  Author(s): Nick Hilliard 
 
+object.cc: rpsl.y.cc
+
 VPATH = @srcdir@
 am__make_dryrun = \
   { \

patch-src_rpsl_object.cc
$NetBSD: patch-src_rpsl_object.cc,v 1.1 2013/08/31 08:44:49 joerg Exp $

--- src/rpsl/object.cc.orig	2013-08-30 22:49:31.000000000 +0000
+++ src/rpsl/object.cc
@@ -53,11 +53,11 @@
 #include 
 
 #include "object.hh"
+#include "rpsl.y.hh"
 #include "schema.hh"
 
 using namespace std;
 
-extern int rpslparse(void *);
 extern void rpsl_scan_object(Object *);
 
 Object::~Object() {
@@ -128,7 +128,7 @@ bool Object::read(Buffer &buf, istream &
 
 void Object::parse() {
    rpsl_scan_object(this);
-   rpslparse(this);
+   rpslparse();
    validate();
 
    if (type) {