jmcmellen/splat

OS X installation tips?

Opened this issue · 9 comments

Hi there, do you where i can find tips on how to install SPLAT! on OS X (v10.9.4)?
I followed SPLAT!'s Unix instructions and failed with the following errors.
Wish there were a Homebrew formula for SPLAT!


Compiling SPLAT!... ld: warning: option -s is obsolete and being ignored
ld: internal error: atom not found in symbolIndex(__ZNSt3__14sqrtIdEENS_7complexIT_EERKS3_) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compilation failed!
Compiling SPLAT! HD... ld: warning: option -s is obsolete and being ignored
ld: internal error: atom not found in symbolIndex(__ZNSt3__14sqrtIdEENS_7complexIT_EERKS3_) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compilation failed!
Compiling citydecoder... ld: warning: option -s is obsolete and being ignored
Done!
Compiling usgs2sdf... ld: warning: option -s is obsolete and being ignored
Done!
Compiling srtm2sdf... ld: warning: option -s is obsolete and being ignored
Done!
Compiling fontdata... ld: warning: option -s is obsolete and being ignored
Done!
Compiling bearing... ld: warning: option -s is obsolete and being ignored
Done!

jsr38 commented

I've just written an Homebew Formula for splat which will eventually appear here: https://github.com/jsr38/homebrew-repo

Works fine on my OS X El Capitan, 10.11.6, llvm/clang:

g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ld -v
@(#)PROGRAM:ld  PROJECT:ld64-264.3.102
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 7.3.0

I have read elsewhere that not telling the linker to strip symbol table from binaries actually resolves this problem for some version of ld, even though the option should simply be ignored so try omitting the -s in the makefile or upgrading the compiler. I'm not an OS X expert but I think this is XCode Command Line Tools.

Reference: http://stackoverflow.com/questions/7408692/g-compiler-option-s-is-obsolete-and-being-ignored-c

Thanks for the tip, but i don't see how or where to omit the -s option from ld. There is no make file. I'll try your Homebrew formula when it's ready.

jsr38 commented

Sorry @araichev, I should have been more clear. The file is called build which gets invoked by configure.

After a quick test, I don't think I can produce a straightforward homebrew Formula without modifying the build system to be more conventional. I can do that but then we begin to diverge from John Magliacane's original code: http://www.qsl.net/kd2bd/splat.html I expected the code to diverge at some point anyway as I've said I have some features I'd like to add. It's probably a matter of defining a sensible versioning scheme to allow this codebase to have 'upstream' changes from John's original merged in periodically. My suggestion is to perhaps have a fourth version number or perhaps a single alphabetical character or string (maybe the minimal git guid) suffix the original version number the code is based off.

I wonder if @jmcmellen has any thoughts or preferences. @jmcmellen do you wish to keep this repository a straight mirror of the original or do you see it becoming some derivative work? I am happy to do everything in my fork for now and you can make that decision later, but if you want to absorb changes then now's the time to have your say how they look :-)

OK, i removed the -s flags from the build file and reran sudo ./configure and successfully compiled most of SPLAT!.
However, splat-hd did not compile.
Here is the log:

            *****************************************************
            *  Now building SPLAT! and associated utilities...  *
            *****************************************************

Compiling SPLAT!... Done!
Compiling SPLAT! HD... final section layout:
    __TEXT/__text addr=0x1000015A0, size=0x00024394, fileOffset=0x000015A0, type=1
    __TEXT/__stubs addr=0x100025934, size=0x00000192, fileOffset=0x00025934, type=27
    __TEXT/__stub_helper addr=0x100025AC8, size=0x00000290, fileOffset=0x00025AC8, type=31
    __TEXT/__const addr=0x100025D60, size=0x00002228, fileOffset=0x00025D60, type=0
    __TEXT/__gcc_except_tab addr=0x100027F88, size=0x000001D4, fileOffset=0x00027F88, type=0
    __TEXT/__cstring addr=0x10002815C, size=0x00004378, fileOffset=0x0002815C, type=12
    __TEXT/__unwind_info addr=0x10002C4D4, size=0x000002E8, fileOffset=0x0002C4D4, type=21
    __TEXT/__eh_frame addr=0x10002C7C0, size=0x00000840, fileOffset=0x0002C7C0, type=18
    __DATA/__got addr=0x10002D000, size=0x00000020, fileOffset=0x0002D000, type=28
    __DATA/__nl_symbol_ptr addr=0x10002D020, size=0x00000010, fileOffset=0x0002D020, type=28
    __DATA/__la_symbol_ptr addr=0x10002D030, size=0x00000218, fileOffset=0x0002D030, type=26
    __DATA/__data addr=0x10002D248, size=0x0000002A, fileOffset=0x0002D248, type=0
    __DATA/__bss addr=0x10002D280, size=0x00020271, fileOffset=0x00000000, type=24
    __DATA/__common addr=0x10004D500, size=0x000004F0, fileOffset=0x00000000, type=24
    __DATA/__huge addr=0x10004D9F0, size=0xC663B9A0, fileOffset=0x00000000, type=24
ld: unexpected bindingNone in '__Z7LoadPATPc' from /var/tmp/splat-4d951b.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compilation failed!
Compiling citydecoder... ld: warning: option -s is obsolete and being ignored
Done!
Compiling usgs2sdf... ld: warning: option -s is obsolete and being ignored
Done!
Compiling srtm2sdf... ld: warning: option -s is obsolete and being ignored
Done!
Compiling fontdata... ld: warning: option -s is obsolete and being ignored
Done!
Compiling bearing... ld: warning: option -s is obsolete and being ignored
Done!

Now installing SPLAT! and associated utilities...

SPLAT! installed!
citydecoder installed!
srtm2sdf and srtm2sdf-hd installed!
usgs2sdf installed!
fontdata installed!
utils installed!

Don't forget to read the documentation under the docs directory
as well as the various README files in the splat and splat/utils
directories.  Enjoy the program!  John, KD2BD
jsr38 commented

I can try to investigate, but without access to your OS and compiler/linker I won't be able to reproduce or verify I have a fix. Did you try to upgrade your compiler? Having a Homebrew Formula won't help if it doesn't compile manually on your system.

jsr38 commented

Oh and why sudo configure? Shouldn't make any difference, only to the install step.

No worries, you needn't investigate my error deeply. Just wanted to see if any quick tips sprung to your mind that i could try. I used sudo ./configure, because i found that executed everything in one go: configure, build, and install.

artob commented

I encountered similar errors building Splat 1.4.2 (using the ./configure script) on macOS 10.11.6 with clang-800.0.42.1:

ld: warning: option -s is obsolete and being ignored
final section layout:
    __TEXT/__text addr=0x100000D10, size=0x00026378, fileOffset=0x00000D10, type=1
    __TEXT/__stubs addr=0x100027088, size=0x00000180, fileOffset=0x00027088, type=28
    __TEXT/__stub_helper addr=0x100027208, size=0x0000027C, fileOffset=0x00027208, type=32
    __TEXT/__const addr=0x100027490, size=0x00002078, fileOffset=0x00027490, type=0
    __TEXT/__gcc_except_tab addr=0x100029508, size=0x000001D4, fileOffset=0x00029508, type=0
    __TEXT/__cstring addr=0x1000296DC, size=0x00004378, fileOffset=0x000296DC, type=13
    __TEXT/__unwind_info addr=0x10002DA54, size=0x000002EC, fileOffset=0x0002DA54, type=22
    __TEXT/__eh_frame addr=0x10002DD40, size=0x000002B8, fileOffset=0x0002DD40, type=19
    __DATA/__got addr=0x10002E000, size=0x00000020, fileOffset=0x0002E000, type=29
    __DATA/__nl_symbol_ptr addr=0x10002E020, size=0x00000010, fileOffset=0x0002E020, type=29
    __DATA/__la_symbol_ptr addr=0x10002E030, size=0x00000200, fileOffset=0x0002E030, type=27
    __DATA/__data addr=0x10002E230, size=0x0000002A, fileOffset=0x0002E230, type=0
    __DATA/__bss addr=0x10002E260, size=0x00020271, fileOffset=0x00000000, type=25
    __DATA/__common addr=0x10004E4E0, size=0x000004F0, fileOffset=0x00000000, type=25
    __DATA/__huge addr=0x10004E9D0, size=0xC663B9A0, fileOffset=0x00000000, type=25
ld: unexpected bindingNone in '__Z7LoadPATPc' from /var/folders/_y/y4csz0cs20n8ggq_zp8zh2440000gn/T/splat-5897c9.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Compilation failed!

Turns out that the above error goes away if I make a different selection for "Maximum Analysis Region" when running ./configure: Splat and Splat-HD build fine with the minimum choice of "2 x 2 Degrees", but not with the maximum choice of "8 x 8 Degrees".

hoche commented

The main issue is that the stock splat allocates a lot of stuff statically either on the stack or in the DATA section of the code. The stack in particular is limited in size and LoadPAT has a couple of ginormous arrays of floats that it tries to stick there. In this case it clang got pissy about it.

I was able to compile ok with both gcc and clang with on various linux distros and FreeBSD, but OSX (clang) and Windows (MS cl.exe) both blew up. I fixed this in my branch of the code by allocating many things on the heap instead.