msmc2
msmc2 copied to clipboard
installation error
Hi, I met a problem with installation of msmc2. Before this installation, DMD and gsl have been installed correctly, and the path of gsl also has been added to makefile of msmc2. Could you do me a favor?
(base) xiaobo@xiaoboLinux:~/bioinformatics/msmc2-master$ make dmd -O /home/xiaobo/bioinformatics/gsl-2.6/lib/libgsl.a /home/xiaobo/bioinformatics/gsl-2.6/lib/libgslcblas.a -odbuild/test -ofbuild/release/msmc2 model/data.d model/gsl_matrix_vector.d model/propagation_core.d model/psmc_hmm.d model/psmc_model.d model/stateVecAllocator.d model/stateVec.d model/time_intervals.d model/transition_rate.d powell.d brent.d maximization_step.d expectation_step.d msmc2.d logger.d /home/xiaobo/bioinformatics/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/xiaobo/bioinformatics/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/lib/../lib64/libgcc_s.so.1: undefined reference to `memcpy@GLIBC_2.14' collect2: error: ld returned 1 exit status Error: linker exited with status 1 make: *** [Makefile:20:build/release/msmc2] 错误 1
It seems the linker can't fine GLIBC. I can't really support that. Have you tried one of the precompiled executables in releases? https://github.com/stschiff/msmc2/releases/tag/v2.1.4
- I noticed that your miniconda3 used
ldandlibgcc_s.so.1frombaseenvironment, this way is not recommended. I created a new environment and compiledmsmc2successful. Notice that I replacedmdwhichldc2because thedmdinconda-forgechannel doesn't the requirement to build source codes. here is myenvironment.yml
name: msmc2
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- gsl=2.7=he838d99_0
- ldc=1.28.1=hcf88599_0
- msmc2=2.1.4=hdfd78af_0
- binutils=2.40=hdd6e379_0
You can reproduce the environment via conda env create -f environment.yml. After creating environment, assume the environment path is ~/miniconda3/envs/msmc2, you should modify the Makefile via
$ sed -i 's/dmd/ldc2/g' Makefile
$ sed -i 's/\/usr\/local\/lib/~\/miniconda3\/envs\/msmc2\/lib/g' Makefile
Or even tricky, create symbol links
$ ln -s $(which ldc2) $(dirname -- $(which ldc2))/dmd
$ ln -s ~/miniconda3/envs/msmc2/lib/libgsl.a /usr/local/lib
$ ln -s ~/miniconda3/envs/msmc2/lib/libgslcblas.a /usr/local/lib
- LIFESAVER: You can download the precompiled executables from release page. There is also
msmc2inbiocondachannel.
REFERENCES:
- https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
- https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html
- I noticed that your miniconda3 used
ldandlibgcc_s.so.1frombaseenvironment, this way is not recommended. I created a new environment and compiledmsmc2successful. Notice that I replacedmdwhichldc2because thedmdinconda-forgechannel doesn't the requirement to build source codes. here is myenvironment.ymlname: msmc2 channels: - conda-forge - bioconda - defaults dependencies: - gsl=2.7=he838d99_0 - ldc=1.28.1=hcf88599_0 - msmc2=2.1.4=hdfd78af_0 - binutils=2.40=hdd6e379_0You can reproduce the environment via
conda env create -f environment.yml. After creating environment, assume the environment path is~/miniconda3/envs/msmc2, you should modify theMakefilevia$ sed -i 's/dmd/ldc2/g' Makefile $ sed -i 's/\/usr\/local\/lib/~\/miniconda3\/envs\/msmc2\/lib/g' MakefileOr even tricky, create symbol links
$ ln -s $(which ldc2) $(dirname -- $(which ldc2))/dmd $ ln -s ~/miniconda3/envs/msmc2/lib/libgsl.a /usr/local/lib $ ln -s ~/miniconda3/envs/msmc2/lib/libgslcblas.a /usr/local/lib
- LIFESAVER: You can download the precompiled executables from release page. There is also
msmc2inbiocondachannel.REFERENCES:
- https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
- https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html
Thank you for your very careful explanation. I will do it according to your process.
I'm having a somewhat similar issue:
dmd -O /usr/local/lib/libgsl.a /usr/local/lib/libgslcblas.a -odbuild/test -ofbuild/release/msmc2 model/data.d model/gsl_matrix_vector.d model/propagation_core.d model/psmc_hmm.d model/psmc_model.d model/stateVecAllocator.d model/stateVec.d model/time_intervals.d model/transition_rate.d powell.d brent.d maximization_step.d expectation_step.d msmc2.d logger.d /usr/bin/ld: cannot find /usr/local/lib/libgsl.a: No such file or directory /usr/bin/ld: cannot find /usr/local/lib/libgslcblas.a: No such file or directory collect2: error: ld returned 1 exit status Error: linker exited with status 1 make: *** [Makefile:20: build/release/msmc2] Error 1
I'm happy to use the precompiled binary to run msmc2, but this doesn't appear to come with the necessary scripts like bamcaller.py. The source code also doesn't seem to have the scripts when I git clone or download the .tar.gz. How is the best way to use the precompiled binary and also get the scripts needed to prepare inputs?
I'm having a somewhat similar issue:
dmd -O /usr/local/lib/libgsl.a /usr/local/lib/libgslcblas.a -odbuild/test -ofbuild/release/msmc2 model/data.d model/gsl_matrix_vector.d model/propagation_core.d model/psmc_hmm.d model/psmc_model.d model/stateVecAllocator.d model/stateVec.d model/time_intervals.d model/transition_rate.d powell.d brent.d maximization_step.d expectation_step.d msmc2.d logger.d /usr/bin/ld: cannot find /usr/local/lib/libgsl.a: No such file or directory /usr/bin/ld: cannot find /usr/local/lib/libgslcblas.a: No such file or directory collect2: error: ld returned 1 exit status Error: linker exited with status 1 make: *** [Makefile:20: build/release/msmc2] Error 1
You might check the Makefile
https://github.com/stschiff/msmc2/blob/5fc12bcd3afc74569cfc9d457b74497fbf441012/Makefile#L1
I'm happy to use the precompiled binary to run msmc2, but this doesn't appear to come with the necessary scripts like bamcaller.py. The source code also doesn't seem to have the scripts when I git clone or download the .tar.gz. How is the best way to use the precompiled binary and also get the scripts needed to prepare inputs?
You might check the README
This program implements MSMC2, a method to infer population size history and population separation history from whole genome sequencing data. For a general guide, see here.
For the record, a user contributed an MSMC2 package to conda: https://bioconda.github.io/recipes/msmc2/README.html?highlight=msmc2#package-package%20'msmc2'