A note on compiling Ken Clarkson's hull program for efficiently computing convex and concave hulls (alpha shapes) of point clouds, on newer Fedora
First, follow the fix described here which fixes the pasting errors given if using gcc compiler.
Then, go into hullmain.c and replace the line which says:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE *INFILE, *OUTFILE, *DFILE = stderr, *TFILE; | |
//to read: | |
FILE *INFILE, *OUTFILE, *TFILE, *DFILE; | |
//and in main() add the following lines | |
FILE *DFILE; | |
DFILE = stderr; |
at the end of the function declarations (before the first while loop)
Finally, rewrite the makefile so it reads as below It differs significantly from the one provided.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = gcc | |
AR = ar | |
OBJS = hull.o ch.o io.o rand.o pointops.o fg.o | |
HDRS = hull.h points.h pointsites.h stormacs.h | |
SRC = hull.c ch.c io.c rand.c pointops.c fg.c | |
PROG = hull | |
BINDIR = /usr/bin | |
LIBDIR = /usr/lib64 # or just /usr/lib on a 32 bit machine? | |
LIB = $(LIBDIR)/lib$(PROG).a | |
all : $(PROG) rsites | |
cp $(PROG) $(BINDIR)/. | |
cp rsites $(BINDIR)/. | |
$(OBJS) : $(HDRS) | |
hullmain.o : $(HDRS) | |
$(PROG) : $(OBJS) hullmain.o | |
$(CC) $(OBJS) hullmain.o -o $(PROG) -lm | |
$(AR) rcv $(LIB) $(OBJS) | |
rsites : rsites.c | |
$(CC) -o rsites rsites.c -lm | |
clean : | |
-rm -f $(OBJS) hullmain.o core a.out $(PROG) |
Notice how the CFLAGS have been removed. Compile as root (sudo make)
No comments:
Post a Comment