8

I am trying to compile admesh found here

https://github.com/admesh/admesh

I am following thier install instructions which basically is configure and make. But when i run the make command in my mac, its giving the following error,

MacBook-Pro:admesh mk$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
CC       connect.lo
CC       normals.lo
CC       shared.lo
CC       stlinit.lo
CC       stl_io.lo
CC       util.lo
CCLD     libadmesh.la
ld: unknown option: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libadmesh.la] Error 1
make: *** [all] Error 2

MacBook-Pro:admesh mk$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

Can anyone help me to fix this error.

rhytha mk
  • 178
  • 2
  • 7
  • 1
    I'm guessing that `--gc-sections` relates to garbage collection which is no longer supported. You could try removing the option within the `Makefile`, however it might be that the code won't work in a non-garbage-collected-environment. It might also be possible to fix by specifying a lower version of OSX using `-mmacosx-version-min=10.X`. – trojanfoe Jul 14 '14 at 10:45
  • 1
    @trojanfoe, can you kindly guide me where i should set this mmacosx-version-min=10.X? I mean in the make file or in commandline? – rhytha mk Jul 14 '14 at 11:10
  • 1
    Looking at the following SO question, it looks like it is deprecated in 10.8, so try 10.7. Apple might have removed the runtime support for it as well, however. http://stackoverflow.com/questions/5466899/xcode-4-garbage-collection-removed – trojanfoe Jul 14 '14 at 11:59

1 Answers1

7

I got this fixed with help of hroncok of admesh.

You need to after configure command, in Makefile.in replace line number 351,352 from

-Wl,--gc-sections \
-Wl,--as-needed \

to

-Wl,-dead_strip \
-Wl,-dead_strip \

and fixed the error as per your hroncok suggestion. Look here for more details https://github.com/admesh/admesh/issues/7

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
rhytha mk
  • 178
  • 2
  • 7