matan Pleblist
matan Pleblist

Reputation: 49

How can I build on ubuntu something that was meant for FreeBSD?

I'm trying to build this: https://github.com/hselasky/hpsat_generate this is their makefile:

PROG_CXX=hpsat_generate
PREFIX?=/usr/local
MAN=
SRCS=   hpsat_generate.cpp
BINDIR?=${PREFIX}/bin

.if defined(HAVE_DEBUG)
CFLAGS+= -g -O0
.endif

CFLAGS+= -I${PREFIX}/include
LDFLAGS+= -L${PREFIX}/lib -lgmp -lgmpxx

.include <bsd.prog.mk>

using just make . results in

Makefile:7: *** missing separator.  Stop.

so after some searching I found that I need to use FreeBSD make, so I tried: bmake . hpsat_generate which complains that mergesort is not declared, which is a FreeBSD function so I can only assume it doesn't really includes it.

I tried finding a way to make it run but I'm out of ideas..

Upvotes: 0

Views: 409

Answers (2)

Ismael Luceno
Ismael Luceno

Reputation: 2119

The Makefile requires some changes for Linux (and NetBSD). The bsd.prog.mk implementation that comes with bmake on Linux is slightly off, and requires a workaround to link the program correctly, also, on Linux you need libbsd:

These issues are fixed by PR #1.

Upvotes: 1

Rob
Rob

Reputation: 15160

Instead of running the makefile just execute this:

g++ -o sat sat.cpp -lgmp -lgmpxx -l:libbsd.a

you may need to install the gmp and libbsd libraries

Upvotes: 0

Related Questions