Question: Cannot run or build KING on Mac OS X
1
gravatar for gaelgarcia05
18 months ago by
gaelgarcia05190
UK
gaelgarcia05190 wrote:

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)
ibd error plink dylib king • 1.2k views
ADD COMMENTlink modified 18 months ago • written 18 months ago by gaelgarcia05190
1
gravatar for jbalberge
18 months ago by
jbalberge80
France/Nantes
jbalberge80 wrote:

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 COMMENTlink modified 18 months ago • written 18 months ago by jbalberge80

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 REPLYlink written 18 months ago by chrchang5235.8k

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 REPLYlink written 18 months ago by gaelgarcia05190
1

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 REPLYlink written 18 months ago by jbalberge80

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 REPLYlink modified 18 months ago • written 18 months ago by gaelgarcia05190

Great! Thanks for the updates!

ADD REPLYlink written 18 months ago by jbalberge80
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1945 users visited in the last hour