skovaka / UNCALLED

Raw nanopore signal mapper that enables real-time targeted sequencing
MIT License
520 stars 44 forks source link

Installation on Ubuntu (issue with compiler) #54

Closed jennieli421 closed 1 year ago

jennieli421 commented 1 year ago

We have encountered similar errors using different approaches to install. We believe that it is related to compiling the c++ codes.

In the most recent approach, I run sudo apt installed g++, then created a conda environment with conda create -n UNCALLED python=3.7 pybind11=2.5.0. Next I run pip install git+https://github.com/skovaka/UNCALLED.git --user.

OS: Ubuntu 22.04.2 LTS g++: g++ (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

Here are some lines in the error message:

Building wheels for collected packages: uncalled
  Building wheel for uncalled (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [130 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing uncalled.egg-info/PKG-INFO
      writing dependency_links to uncalled.egg-info/dependency_links.txt
      writing requirements to uncalled.egg-info/requires.txt
      writing top-level names to uncalled.egg-info/top_level.txt
      reading manifest file 'uncalled.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENCE'
      writing manifest file 'uncalled.egg-info/SOURCES.txt'
      /home/tilgnerlab/miniconda3/envs/UNCALLED3/lib/python3.7/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'uncalled.conf' as data is deprecated, please list it in `packages`.
/home/tilgnerlab/miniconda3/envs/UNCALLED3/compiler_compat/ld: ./submods/bwa/libbwa.a(rope.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: multiple definition of `rle_auxtab'; ./submods/bwa/libbwa.a(bwtindex.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: first defined here
      /home/tilgnerlab/miniconda3/envs/UNCALLED3/compiler_compat/ld: ./submods/bwa/libbwa.a(rle.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: multiple definition of `rle_auxtab'; ./submods/bwa/libbwa.a(bwtindex.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: first defined here
      collect2: error: ld returned 1 exit status
      error: command '/usr/bin/g++' failed with exit code 1

Please let me know if you know what is the problem and how to troubleshoot. Thanks!

skovaka commented 1 year ago

It looks like the issue is coming from building BWA. Can you try running make from the directory UNCALLED/submods/bwa? If that returns an error then you may be able to troubleshoot via the BWA documentation. If not, let me know and I can take a closer look

jennieli421 commented 1 year ago
~/readuntil/UNCALLED/submods/bwa$ make
gcc -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwashm.o bwase.o bwaseqio.o bwtgap.o bwtaln.o bamlite.o bwape.o kopen.o pemerge.o maxk.o bwtsw2_core.o bwtsw2_main.o bwtsw2_aux.o bwt_lite.o bwtsw2_chain.o fastmap.o bwtsw2_pair.o main.o -o bwa -L. -lbwa -lm -lz -lpthread -lrt
/usr/bin/ld: ./libbwa.a(rope.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: multiple definition of `rle_auxtab'; ./libbwa.a(bwtindex.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: first defined here
/usr/bin/ld: ./libbwa.a(rle.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: multiple definition of `rle_auxtab'; ./libbwa.a(bwtindex.o):/home/tilgnerlab/git_repo/UNCALLED/submods/bwa/rle.h:33: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:30: bwa] Error 1

Is this what you mean?

skovaka commented 1 year ago

It looks like this was an issue with BWA which was fixed a couple years ago (https://github.com/lh3/bwa/issues/275), but I hadn't updated since then. I just updated the submodule, so if you re-pull and install it should hopefully work

jennieli421 commented 1 year ago

It is installed!!! Thanks and I really appreciate your help.

skovaka commented 1 year ago

Great, glad it worked!

daanishmahajan commented 1 month ago

Hi @skovaka, I am facing the following issue on CentOS:

error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Running from numpy source directory.
      <string>:419: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      Traceback (most recent call last):
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/setuptools/build_meta.py", line 373, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/setuptools/build_meta.py", line 503, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/home/daanish/miniforge3/lib/python3.10/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 444, in <module>
        File "<string>", line 423, in setup_package
        File "/tmp/pip-install-ofwahemr/numpy_2123492ef7f142e68d2dd2133f2c4f69/numpy/distutils/core.py", line 26, in <module>
          from numpy.distutils.command import config, config_compiler, \
        File "/tmp/pip-install-ofwahemr/numpy_2123492ef7f142e68d2dd2133f2c4f69/numpy/distutils/command/config.py", line 20, in <module>
          from numpy.distutils.mingw32ccompiler import generate_manifest
        File "/tmp/pip-install-ofwahemr/numpy_2123492ef7f142e68d2dd2133f2c4f69/numpy/distutils/mingw32ccompiler.py", line 34, in <module>
          from distutils.msvccompiler import get_build_version as get_build_msvc_version
      ModuleNotFoundError: No module named 'distutils.msvccompiler'
      [end of output]

Any suggestion on how to fix it?

Thanks

daanishmahajan commented 1 month ago

Hi @skovaka, previously I was using python 3.13. With python 3.9, I am getting the following error:

ModuleNotFoundError: No module named '_ctypes'

skovaka commented 1 month ago

Does import _ctypes work when run in your python interpreter? If not, it sounds like a problem with your python installation. Do you have libffi-dev installed, as described here? https://stackoverflow.com/questions/71474943/module-not-found-error-no-module-named-ctypes

Unfortunately that suggest's you'll need to uninstall python before you install the libffi-dev package, then re-install python.

daanishmahajan commented 1 month ago

Hi @skovaka, I could fix the above issue but landed up in the earlier issue: https://github.com/skovaka/UNCALLED/issues/54#issuecomment-2404573468