slowkow/snpsea

Pre-compiled binary error on OSX, also cannot compile

Opened this issue · 12 comments

Hi!

Downloaded a fresh clone of the repo then tried ./snpsea-osx64 --help and got:


dyld[33963]: Library not loaded: /usr/local/lib/libgsl.0.dylib
  Referenced from: /Users/avoda/Desktop/Snpsea/snpsea/snpsea-master/bin/snpsea-osx64
  Reason: tried: '/usr/local/lib/libgsl.0.dylib' (no such file), '/usr/lib/libgsl.0.dylib' (no such file)
Abort trap: 6

After I installed the library with brew install gsl (as indicated here) but it still throws the same error even after macbook restart.

Do you know by any chance why this would happen?

Also, is there any chance this will compile on Windows?

Have you tried compiling?

Yes:

(base) KIR-Alex-Voda:snpsea avoda$ cd src
(base) KIR-Alex-Voda:src avoda$ ls
Makefile         common.h         option.cpp       zfstream.h
Makefile-linux   data.cpp         snpsea.h
Makefile-osx     ezOptionParser.h zfstream.cpp
(base) KIR-Alex-Voda:src avoda$ make
git clone 'https://github.com/slowkow/intervaltree.git' ../ext/intervaltree
Cloning into '../ext/intervaltree'...
remote: Enumerating objects: 68, done.
remote: Total 68 (delta 0), reused 0 (delta 0), pack-reused 68
Receiving objects: 100% (68/68), 11.86 KiB | 5.93 MiB/s, done.
Resolving deltas: 100% (40/40), done.
hg clone 'https://bitbucket.org/eigen/eigen' ../ext/eigen
make: hg: No such file or directory
make: *** [../ext/eigen] Error 1

Looks like you're getting stuck at the step when hg is used to clone Eigen. Have you tried installing hg (mercurial)?

I now made sure hg was installed:

(base) 192:src avoda$ hg --version
Mercurial Distributed SCM (version 6.1.2)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2022 Olivia Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However, it keeps erroring out because the Eigen repository link does not exist:

(base) 192:src avoda$ pwd
/Users/avoda/snpsea/snpsea/src
(base) 192:src avoda$ make
hg clone 'https://bitbucket.org/eigen/eigen' ../ext/eigen
abort: HTTP Error 404: Not Found
make: *** [../ext/eigen] Error 255

If you access https://bitbucket.org/eigen/eigen it returns a 404 error on other computers & browsers too

So it's because of this line in the Makefile:

hg clone 'https://bitbucket.org/eigen/eigen' $@

Could you please statically-compile it (so that all libraries are included by default into the binary, as opposed to them depending on shared system libraries being available with the preferred versions and such) for linux, mac and windows?

Ok, after changing these lines:

hg clone 'https://bitbucket.org/eigen/eigen' $@

hg clone 'https://bitbucket.org/eigen/eigen' $@

hg clone 'https://bitbucket.org/eigen/eigen' $@

to:
git clone 'https://gitlab.com/libeigen/eigen.git' $@

It seems to work through the previous parts, but I get this error on my macbook:

(base) 192:src avoda$ make
git clone 'https://gitlab.com/libeigen/eigen.git' ../ext/eigen
Cloning into '../ext/eigen'...
remote: Enumerating objects: 115973, done.
remote: Counting objects: 100% (1035/1035), done.
remote: Compressing objects: 100% (442/442), done.
remote: Total 115973 (delta 630), reused 928 (delta 593), pack-reused 114938
Receiving objects: 100% (115973/115973), 103.21 MiB | 389.00 KiB/s, done.
Resolving deltas: 100% (95440/95440), done.
Makefile:40: *** You must use GCC 4.6.3 or greater.  Stop.

Looks like my g++ isn't the right version:

(base) 192:src avoda$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: x86_64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(base) KIR-Alex-Voda:src avoda$ make
Makefile:40: *** You must use GCC 4.6.3 or greater.  Stop.
(base) KIR-Alex-Voda:src avoda$ g++ --version
g++-6 (Homebrew GCC 6.5.0_7) 6.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

so even though I have the right version of g++, it still outputs compilation errors.

Also, the bitbucket/mercurial links above are dead, @slowkow. Could you please fix them, as I indicated in previous messages?

Sorry for writing this on a Sunday, I hope I don't bother you too much, please take your time! I'll come back to this, but right now I cannot compile SNPsea.

after I manually edit both the mercury Eigen library link and the g++ path in the Makefile to gcc6 or gcc11, I get this error:

(base) KIR-Alex-Voda:src avoda$ make
/usr/local/bin/g++-11  -w -O3 -m64 -static -fopenmp -std=c++0x -I ../ext/intervaltree -I ../ext/eigen -DEIGEN_NO_DEBUG -c option.cpp
In file included from ../ext/eigen/Eigen/Core:19,
                 from ../ext/eigen/Eigen/Dense:1,
                 from snpsea.h:9,
                 from option.cpp:5:
../ext/eigen/Eigen/src/Core/util/Macros.h:674:2: error: #error This compiler appears to be too old to be supported by Eigen
  674 | #error This compiler appears to be too old to be supported by Eigen
      |  ^~~~~
In file included from snpsea.h:11,
                 from option.cpp:5:
common.h:25:10: fatal error: gsl/gsl_randist.h: No such file or directory
   25 | #include <gsl/gsl_randist.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [option.o] Error 1

Hmm

Brb 4h, boarding a flight

Hi @slowkow ! Did you manage to take a look at this? Does snpsea compile on your mac?

Hi Alex, thanks for documenting your progress. As you can imagine, a lot of things have changed in the 8 years since I released this code.

Some folks might appreciate your contributions to updating the source code and documentation.