Cannot run or build KING on Mac OS X
1
1
Entering edit mode
3.7 years ago
gaelgarcia05 ▴ 270

I'm having an issue running KING on Mac OS X . It has to do with a dylib, I think. Does anybody have any suggestions on how to fix this error?

Thanks!

  > ./king -b ./ex/ex.bed

Returns:

dyld: Symbol not found: __ZdaPvm
  Referenced from: /Users/gaelgarcia/Downloads/./king (which was built for Mac OS X 10.13)
  Expected in: /usr/local/lib/libstdc++.6.dylib
 in /Users/gaelgarcia/./king
Abort trap: 6

UPDATE: Have been following valuable suggestions, but I'm still stuck in the dreadful circle of missing libraries/broken symlinks... any help is greatly appreciated.

I've tried building my own KING as suggested, and got the error:

clang: error: unsupported option '-fopenmp'. I further tried to install a new version of gcc via Homebrew, but get: gcc 8.1.0 is already installed, it's just not linked.

Then, I ran brew link --overwrite gcc, which returns: Could not symlink include/c++/8.1.0 /usr/local/include/c++ is not writable.

Also followed a suggestion somebody else gave on stackoverflow, to run clang++ -L /opt/local/lib/libomp/ -lm -lz -O2 -fopenmp -o king *.cpp , alas to no avail. Yikes... 😫


UPDATE:

Having installed llvm via Homebrew (brew install llvm), the command that got KING properly built and running on my Mac OS 10.12 was:

/usr/local/Cellar/llvm/6.0.0/bin/clang++ -I /usr/local/Cellar/llvm/6.0.0/include -L /usr/local/Cellar/llvm/6.0.0/lib -O2 -fopenmp -lm -lz -o king *.cpp

Running the newly built executable with the example .bed file provided:

> ./king -b ../ex/ex.bed

KING 2.1.3 - (c) 2010-2018 Wei-Min Chen

The following parameters are in effect:
Binary File :    ../ex/ex.bed (-bname)
KING PLINK IBD dylib error • 2.6k views
ADD COMMENT
1
Entering edit mode
3.7 years ago
jbalberge ▴ 170

KING was probably built with gcc 6.x and is looking for a gcc 6 library. Try build your own KING with the C++ source code with http://people.virginia.edu/~wc9c/KING/KINGcode.tar.gz as mentioned in http://people.virginia.edu/~wc9c/KING/Download.htm

cd Downloads/KINGcode/
c++ -lm -lz -O2 -fopenmp -o king *.cpp

PS: found more details on https://www.ncl.ucar.edu/Download/macosx.shtml#ZdaPvmNotFound

ADD COMMENT
0
Entering edit mode

Yup. I found it necessary to use Homebrew to install a newer version of gcc in order to build/run KING on my Mac.

ADD REPLY
0
Entering edit mode

Thanks @jbalberge and @chrchang523 - I've tried building my own KING as suggested, and got the error: clang: error: unsupported option '-fopenmp'. I further tried to install a new version of gccvia Homebrew, but get gcc 8.1.0 is already installed, it's just not linked. Then, I ran brew link --overwrite, which returns: Could not symlink include/c++/8.1.0 /usr/local/include/c++ is not writable. Also followed a suggestion somebody else gave on stackoverflow, to run clang++ -L /opt/local/lib/libomp/ -lm -lz -O2 -fopenmp -o king *.cpp , alas to no avail. Yikes... 😫

ADD REPLY
1
Entering edit mode

My bad, building c++ code with the Open MP lib on Mac OS X seems quite hard. Let's go back to the compiled version. I managed to have it work after setting the dyld library path

brew install gcc
brew link gcc
export DYLD_LIBRARY_PATH=/usr/local/lib/gcc/8/:$DYLD_LIBRARY_PATH
./king -b ex/ex.bed

Let me know if this works for you

ADD REPLY
0
Entering edit mode

Thank you, @jbalberge! I managed to get it working via the source build alternative (See Update). Thank you for all your time and help!

ADD REPLY
0
Entering edit mode

Great! Thanks for the updates!

ADD REPLY

Login before adding your answer.

Traffic: 1858 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6