0

I want to compile the following project that's hosted on GitHub. I'm on MacOs High Sierra 10.13.5.

When I run make on the solver directory, it gives the following error after running gcc with the -static option:

g++ -o dapcstp src/bbnode.o src/bbtree.o src/bounds.o src/cputime.o 
src/heur.o src/inst.o src/main.o src/options.o src/prep.o 
src/procstatus.o src/sol.o src/stats.o src/timer.o src/util.o -static - 
lboost_timer -lboost_system -lboost_chrono -lboost_program_options - 
lboost_filesystem
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
make: *** [dapcstp] Error 1

In the answer to ld: library not found for -lcrt0.o on OSX 10.6 with gcc/clang -static flag it says the following:

This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people.

Is there a way I could circumvent this limitation and compile the project correctly on Mac ?

edoreld
  • 303
  • 1
  • 17

1 Answers1

1

Looking at the project, the -static option is superfluous and counterproductive (even on system where static linking is supported). You can just remove it.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
  • Thank you. The Makefile appeared as a binary on my system, so I didn't know I could edit it. I removed the -static option and it compiled flawlessly. – edoreld Jul 20 '18 at 07:03