horvatovichlab / MSIWarp

MAss spectra alignment tool for MSI data
MIT License
16 stars 5 forks source link

Failing to build #12

Open EmersonHernly opened 2 years ago

EmersonHernly commented 2 years ago

I have been trying to install MSIWarp using the following code.

I have:

>>>git clone --recursive https://github.com/horvatovichlab/MSIWarp.git
>>>cd MSIWarp
>>>C:\Home\MSIWarp>python setup.py install --user

This gave me the following output.

running install
C:\Home\mambaforge\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
C:\Home\mambaforge\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating src\python-bindings\msiwarp.egg-info
writing src/python-bindings\msiwarp.egg-info\PKG-INFO
writing dependency_links to src/python-bindings\msiwarp.egg-info\dependency_links.txt
writing requirements to src/python-bindings\msiwarp.egg-info\requires.txt
writing top-level names to src/python-bindings\msiwarp.egg-info\top_level.txt
writing manifest file 'src/python-bindings\msiwarp.egg-info\SOURCES.txt'
reading manifest file 'src/python-bindings\msiwarp.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src/python-bindings\msiwarp.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\msiwarp
copying src\python-bindings\msiwarp\__init__.py -> build\lib.win-amd64-cpython-310\msiwarp
creating build\lib.win-amd64-cpython-310\msiwarp\util
copying src\python-bindings\msiwarp\util\parabolic_centroid.py -> build\lib.win-amd64-cpython-310\msiwarp\util
copying src\python-bindings\msiwarp\util\read_sbd.py -> build\lib.win-amd64-cpython-310\msiwarp\util
copying src\python-bindings\msiwarp\util\warp.py -> build\lib.win-amd64-cpython-310\msiwarp\util
copying src\python-bindings\msiwarp\util\__init__.py -> build\lib.win-amd64-cpython-310\msiwarp\util
running build_ext
C:\Home\MSIWarp\setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)',
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.31.31107.0
-- The CXX compiler identification is MSVC 19.31.31107.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- pybind11 v2.6.1 dev1
-- Found PythonInterp: C:/Home/mambaforge/python.exe (found version "3.10.6")
-- Found PythonLibs: C:/Home/mambaforge/libs/python310.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Home/MSIWarp/build/temp.win-amd64-cpython-310/Release
MSBuild version 17.3.1+2badb37d1 for .NET Framework
  Checking Build System
  Building Custom Rule C:/Home/MSIWarp/CMakeLists.txt
  serialization.cpp
C:\Home\MSIWarp\src\lib\util\serialization.cpp(77,25): warning C4244: '=': conversion from 'int'
 to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\w
arplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(85,20): warning C4244: '=': conversion from 'int'
 to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\w
arplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(98,25): warning C4244: '=': conversion from 'uint
32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rele
ase\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(99,25): warning C4244: '=': conversion from 'uint
32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rele
ase\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(100,25): warning C4244: '=': conversion from 'uin
t32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(108,20): warning C4244: '=': conversion from 'uin
t32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(109,20): warning C4244: '=': conversion from 'uin
t32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(110,20): warning C4244: '=': conversion from 'uin
t32_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(123,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(124,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(125,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(126,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(127,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(128,25): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(137,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(138,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(139,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(140,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(141,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\util\serialization.cpp(142,20): warning C4244: '=': conversion from 'uin
t64_t' to 'uint8_t', possible loss of data [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Rel
ease\warplib.vcxproj]
  msi_triplet.cpp
  warp.cpp
C:\Home\MSIWarp\src\lib\warp\warp.cpp(375,19): error C2039: 'back_inserter': is not a member of
'std' [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\warplib.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\future(37): m
essage : see declaration of 'std' [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\warp
lib.vcxproj]
C:\Home\MSIWarp\src\lib\warp\warp.cpp(375,32): error C3861: 'back_inserter': identifier not foun
d [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\warplib.vcxproj]
  warp_util.cpp
C:\Home\MSIWarp\src\lib\warp\warp_util.cpp(43,58): warning C4100: 'p': unreferenced formal param
eter [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\warplib.vcxproj]
C:\Home\MSIWarp\src\lib\warp\warp_util.cpp(42,66): warning C4100: 'pairs': unreferenced formal p
arameter [C:\Home\MSIWarp\build\temp.win-amd64-cpython-310\Release\warplib.vcxproj]
  ransac.cpp
  Generating Code...
Traceback (most recent call last):
  File "C:\Home\MSIWarp\setup.py", line 61, in <module>
    setup(
  File "C:\Home\mambaforge\lib\site-packages\setuptools\__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\command\install.py", line 74, in run
    self.do_egg_install()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\command\install.py", line 123, in do_egg_install
    self.run_command('bdist_egg')
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\command\bdist_egg.py", line 165, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\command\bdist_egg.py", line 151, in call_command
    self.run_command(cmdname)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\command\install_lib.py", line 112, in build
    self.run_command('build_ext')
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\dist.py", line 1217, in run_command
    super().run_command(command)
  File "C:\Home\mambaforge\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.run()
  File "C:\Home\MSIWarp\setup.py", line 31, in run
    self.build_extension(ext)
  File "C:\Home\MSIWarp\setup.py", line 57, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args,
  File "C:\Home\mambaforge\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.

I have very little experience with C++ so I have no idea why this command keeps failing to build the project.

Any advice would be greatly appreciated.

NeoNexusX commented 6 months ago

I encountered the same problem as you. You need to add a header file reference in the file warp.cpp, #include <iterator>, and then you should be able to compile successfully. It's important to note that his setup script only supports nmake on the Windows platform, which means you need the Visual Studio suite to compile. The project seems to have some issues that could benefit from better maintenance. I hope the author can work on improving the quality and consistency of the code to ensure a smoother experience for users." 用中文就是有妈生,没妈养,The author's C++ project could benefit from further refinement and maintenance. It appears that the project hasn't been actively updated since the associated paper was published. Ongoing attention and improvements would help enhance the project's quality and usability,You should specify the name of the compiler suite and the compilation methods for each platform; otherwise, I can only wonder whether the paper reviewers actually ran your code or just fiddled with it.