Compiling C floating point arithmetic in OSX for Shevchuk's triangle program

This question suggests that the best way to triangulate a polygon with holes is to use the Shevchuk Triangle library , but I had problems compiling it on my Mac OSX. This is a very popular program that has existed for some time, and therefore it needs to be relatively easy to compile, I'm just inexperienced with C.

This is the error I get:

$ make
cc -O -DLINUX -I/usr/X11R6/include -L/usr/X11R6/lib -o ./triangle ./triangle.c -lm
Undefined symbols:
  "__FPU_SETCW", referenced from:
   _exactinit in ccrEJvxc.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [triangle] Error 1

I try to comment on specific flags (i.e. #define LINUX, etc.), but I get a different set of errors for each combination.

Can someone through me step by step comment (and possibly call) this program on mac?

+3
source share
2

OS X, -DLINUX CSWITCHES make , fpu_control.h Linux.

+4

, , , , Mac.., Intel SSE.. 387- FPU.

, Linux. linux, .

, :

$ cat > /usr/include/fpu_control.h

#define _FPU_SETCW(cw) // nothing
#define _FPU_GETCW(cw) // nothing

. FPU.

0

Source: https://habr.com/ru/post/1787099/


All Articles