Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation error #48

Open
cnxiaobo94 opened this issue Feb 21, 2023 · 6 comments
Open

installation error #48

cnxiaobo94 opened this issue Feb 21, 2023 · 6 comments

Comments

@cnxiaobo94
Copy link

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

@stschiff
Copy link
Owner

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

@tcztzy
Copy link

tcztzy commented Feb 24, 2023

  1. I noticed that your miniconda3 used ld and libgcc_s.so.1 from base environment, this way is not recommended. I created a new environment and compiled msmc2 successful. Notice that I replace dmd which ldc2 because the dmd in conda-forge channel doesn't the requirement to build source codes. here is my environment.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
  1. LIFESAVER: You can download the precompiled executables from release page. There is also msmc2 in bioconda channel.

REFERENCES:

@cnxiaobo94
Copy link
Author

  1. I noticed that your miniconda3 used ld and libgcc_s.so.1 from base environment, this way is not recommended. I created a new environment and compiled msmc2 successful. Notice that I replace dmd which ldc2 because the dmd in conda-forge channel doesn't the requirement to build source codes. here is my environment.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
  1. LIFESAVER: You can download the precompiled executables from release page. There is also msmc2 in bioconda channel.

REFERENCES:

Thank you for your very careful explanation. I will do it according to your process.

@charlesfeigin
Copy link

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?

@tcztzy
Copy link

tcztzy commented Mar 7, 2023

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

# Set this variable to your static gsl libraries

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.

@stschiff
Copy link
Owner

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants