Search code examples
c++macosgcclinkerhpx

HPX build on Mac gives linker errors


I'm trying to build build HPX on OS X Yosemite. I'm getting the following linker errors on running the command 'make'.

I'm using gcc as my compiler.

    Linking CXX shared library ../lib/libhpx.dylib
0  0x1056e66a0  __assert_rtn + 144
1  0x105791989  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 3169
2  0x105775331  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 375
3  0x1056e9344  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 784
4  0x1056eb1fc  ld::tool::InputFiles::parseWorkerThread() + 484
5  0x7fff945d9268  _pthread_body + 131
6  0x7fff945d91e5  _pthread_body + 0
A linker snapshot was created at:
        /tmp/libhpx.0.9.11.dylib-2015-06-18-214035.ld-snapshot
ld: Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function parse, file src/ld/parsers/macho_relocatable_file.cpp, line 1741.
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libhpx.0.9.11.dylib] Error 1
make[1]: *** [src/CMakeFiles/hpx.dir/all] Error 2
make: *** [all] Error 2

Solution

  • Try configuring hpx as follows;

    /Users/hpx > ./configure --with-hwloc=contrib --prefix=/Users/hpx/install CC=clang
    
    
    /Users/hpx > make
    

    Error you posted has something to do with gcc and linker in Yosemite. Still not sure how to exactly solve the error. But as a work around you can use the clang compiler when compiling HPX.