horvatovichlab / MSIWarp

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

Type conversion errors, while installing #9

Closed Livia-Rasp closed 2 years ago

Livia-Rasp commented 2 years ago

After trying to install MSIWarp with the command described in the README, I get a few errors due to type conversions in the code. The output is the following:

running install
running bdist_egg
running 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
reading manifest file 'src/python-bindings/msiwarp.egg-info/SOURCES.txt'
writing manifest file 'src/python-bindings/msiwarp.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
-- pybind11 v2.6.1 dev1
CMake Warning (dev) at /usr/local/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  ext/pybind11/CMakeLists.txt:91 (cmake_dependent_option)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/rasp/git/MSIWarp/build/temp.linux-x86_64-3.9
Consolidate compiler generated dependencies of target warplib
[ 25%] Building CXX object CMakeFiles/warplib.dir/src/lib/warp/warp_util.cpp.o
[ 25%] Building CXX object CMakeFiles/warplib.dir/src/lib/warp/warp.cpp.o
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   40 | std::vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:19: error: template argument 1 is invalid
   40 | std::vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:19: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   47 | std::vector<size_t> find_optimal_warping_pairs(
      |             ^~~~~~
      |             std::size_t
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   40 | std::vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:19: error: template argument 1 is invalid
   47 | std::vector<size_t> find_optimal_warping_pairs(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:19: error: template argument 2 is invalid
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                         ^~~~~~
      |                         std::size_t
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:19: error: template argument 1 is invalid
   40 | std::vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |                   ^
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:19: error: template argument 2 is invalid
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: template argument 1 is invalid
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                         ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:31: error: template argument 1 is invalid
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                               ^~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:31: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   47 | std::vector<size_t> find_optimal_warping_pairs(
      |             ^~~~~~
      |             std::size_t
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:39: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   63 |                     const std::vector<size_t>& moves);
      |                                       ^~~~~~
      |                                       std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:45: error: template argument 1 is invalid
   63 |                     const std::vector<size_t>& moves);
      |                                             ^
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:19: error: template argument 1 is invalid
   47 | std::vector<size_t> find_optimal_warping_pairs(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:45: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:19: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:74:21: error: ‘size_t’ has not been declared
   74 |                     size_t n_steps);
      |                     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                         ^~~~~~
      |                         std::size_t
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:86:45: error: ‘size_t’ has not been declared
   86 | peak_vec peaks_top_n(const peak_vec& peaks, size_t n);
      |                                             ^~~~~~
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:92:5: error: ‘size_t’ has not been declared
   92 |     size_t n);
      |     ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: template argument 1 is invalid
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                         ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:25: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:31: error: template argument 1 is invalid
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                               ^~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:31: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  102 | std::vector<size_t> optimal_warping(
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:39: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   63 |                     const std::vector<size_t>& moves);
      |                                       ^~~~~~
      |                                       std::size_t
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:19: error: template argument 1 is invalid
  102 | std::vector<size_t> optimal_warping(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:19: error: template argument 2 is invalid
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:45: error: template argument 1 is invalid
   63 |                     const std::vector<size_t>& moves);
      |                                             ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:104:5: error: ‘size_t’ has not been declared
  104 |     size_t n_steps);
      |     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:63:45: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:74:21: error: ‘size_t’ has not been declared
   74 |                     size_t n_steps);
      |                     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:86:45: error: ‘size_t’ has not been declared
   86 | peak_vec peaks_top_n(const peak_vec& peaks, size_t n);
      |                                             ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:92:5: error: ‘size_t’ has not been declared
   92 |     size_t n);
      |     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:46: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  132 |     const node_vec& nodes, const std::vector<size_t>& optimal_shifts);
      |                                              ^~~~~~
      |                                              std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:52: error: template argument 1 is invalid
  132 |     const node_vec& nodes, const std::vector<size_t>& optimal_shifts);
      |                                                    ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:52: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  102 | std::vector<size_t> optimal_warping(
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:19: error: template argument 1 is invalid
  102 | std::vector<size_t> optimal_warping(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:102:19: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  146 | std::vector<size_t> optimal_warping_impl(
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:104:5: error: ‘size_t’ has not been declared
  104 |     size_t n_steps);
      |     ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:19: error: template argument 1 is invalid
  146 | std::vector<size_t> optimal_warping_impl(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:19: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:148:5: error: ‘size_t’ has not been declared
  148 |     size_t n_steps);
      |     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:46: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  132 |     const node_vec& nodes, const std::vector<size_t>& optimal_shifts);
      |                                              ^~~~~~
      |                                              std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:52: error: template argument 1 is invalid
  132 |     const node_vec& nodes, const std::vector<size_t>& optimal_shifts);
      |                                                    ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:52: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:13: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
  146 | std::vector<size_t> optimal_warping_impl(
      |             ^~~~~~
      |             std::size_t
In file included from /usr/include/c++/11/cstdint:38,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: ‘std::size_t’ declared here
  280 |   typedef __SIZE_TYPE__         size_t;
      |                                 ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:19: error: template argument 1 is invalid
  146 | std::vector<size_t> optimal_warping_impl(
      |                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:146:19: error: template argument 2 is invalid
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:148:5: error: ‘size_t’ has not been declared
  148 |     size_t n_steps);
      |     ^~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:16:3: error: ‘size_t’ does not name a type
   16 |   size_t n_steps;
      |   ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:5:1: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
    4 | #include "warp.hpp"
  +++ |+#include <cstddef>
    5 | 
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:17:3: error: ‘size_t’ does not name a type
   17 |   size_t n_peaks;
      |   ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:17:3: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:18:3: error: ‘size_t’ does not name a type
   18 |   size_t max_nodes;
      |   ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:18:3: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:32:3: error: ‘size_t’ does not name a type
   32 |   size_t n_steps;
      |   ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:32:3: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:49:5: error: ‘size_t’ has not been declared
   49 |     size_t n_cores);
      |     ^~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp: In function ‘warp::node_vec warp::util::get_warping_nodes_uniform(const std::vector<std::pair<warp::peak, warp::peak> >&, const warp::util::params_uniform&)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:15:19: error: ‘const struct warp::util::params_uniform’ has no member named ‘n_peaks’
   15 |   if (n_pairs < p.n_peaks * 2 || p.max_nodes < 3) {
      |                   ^~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:15:36: error: ‘const struct warp::util::params_uniform’ has no member named ‘max_nodes’
   15 |   if (n_pairs < p.n_peaks * 2 || p.max_nodes < 3) {
      |                                    ^~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:20:27: error: ‘const struct warp::util::params_uniform’ has no member named ‘max_nodes’
   20 |     size_t n = std::min(p.max_nodes, n_pairs / p.n_peaks);
      |                           ^~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:20:50: error: ‘const struct warp::util::params_uniform’ has no member named ‘n_peaks’
   20 |     size_t n = std::min(p.max_nodes, n_pairs / p.n_peaks);
      |                                                  ^~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:41:16: error: ambiguating new declaration of ‘std::vector<long unsigned int> warp::find_optimal_warping(const peak_vec&, const peak_vec&, const node_vec&, double)’
   41 | vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |                ^~~~~~~~~~~~~~~~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:40:21: note: old declaration ‘int warp::find_optimal_warping(const peak_vec&, const peak_vec&, const node_vec&, double)’
   40 | std::vector<size_t> find_optimal_warping(const peak_vec& s_r,
      |                     ^~~~~~~~~~~~~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:39:42: error: ‘const struct warp::util::params_uniform’ has no member named ‘n_steps’
   39 |   return warp::init_nodes(mzs, slacks, p.n_steps);
      |                                          ^~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp: In function ‘warp::node_vec warp::util::get_warping_nodes_density(const std::vector<std::pair<warp::peak, warp::peak> >&, const warp::util::params_density&)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:42:66: warning: unused parameter ‘pairs’ [-Wunused-parameter]
   42 | node_vec get_warping_nodes_density(const std::vector<peak_pair>& pairs,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:43:58: warning: unused parameter ‘p’ [-Wunused-parameter]
   43 |                                    const params_density& p) {
      |                                    ~~~~~~~~~~~~~~~~~~~~~~^
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: In function ‘std::vector<long unsigned int> warp::find_optimal_warping(const peak_vec&, const peak_vec&, const node_vec&, double)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:47:36: error: could not convert ‘warp::find_optimal_warping_pairs(pairs, (* & nodes))’ from ‘int’ to ‘std::vector<long unsigned int>’
   47 |   return find_optimal_warping_pairs(pairs, nodes);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                    |
      |                                    int
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: At global scope:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:50:21: error: ambiguating new declaration of ‘std::vector<long unsigned int> warp::find_optimal_warping_pairs(const std::vector<std::pair<warp::peak, warp::peak> >&, const node_vec&)’
   50 | std::vector<size_t> find_optimal_warping_pairs(
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:47:21: note: old declaration ‘int warp::find_optimal_warping_pairs(const std::vector<std::pair<warp::peak, warp::peak> >&, const node_vec&)’
   47 | std::vector<size_t> find_optimal_warping_pairs(
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: In function ‘std::vector<long unsigned int> warp::find_optimal_warping_pairs(const std::vector<std::pair<warp::peak, warp::peak> >&, const node_vec&)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:64:25: error: could not convert ‘warp::optimal_warping(warping_surfs, ((int)n_steps))’ from ‘int’ to ‘std::vector<long unsigned int>’
   64 |   return optimal_warping(warping_surfs, n_steps);
      |          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         int
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: At global scope:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:67:24: error: ambiguating new declaration of ‘std::vector<std::vector<long unsigned int> > warp::find_optimal_warpings(const std::vector<std::vector<warp::peak> >&, const peak_vec&, const node_vec&, double)’
   67 | vector<vector<size_t>> find_optimal_warpings(const vector<peak_vec>& spectra,
      |                        ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:53:34: note: old declaration ‘int warp::find_optimal_warpings(const std::vector<std::vector<warp::peak> >&, const peak_vec&, const node_vec&, double)’
   53 | std::vector<std::vector<size_t>> find_optimal_warpings(
      |                                  ^~~~~~~~~~~~~~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: In function ‘std::vector<std::vector<long unsigned int> > warp::find_optimal_warpings(const std::vector<std::vector<warp::peak> >&, const peak_vec&, const node_vec&, double)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:74:10: error: could not convert ‘out’ from ‘vector<int,allocator<int>>’ to ‘vector<std::vector<long unsigned int>,allocator<std::vector<long unsigned int>>>’
   74 |   return out;
      |          ^~~
      |          |
      |          vector<int,allocator<int>>
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: In function ‘warp::peak_vec warp::warp_peaks(const peak_vec&, const node_vec&, const std::vector<long unsigned int>&)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:80:59: error: invalid initialization of reference of type ‘const int&’ from expression of type ‘const std::vector<long unsigned int>’
   80 |     return warp_peaks_unique(peaks, nodes_to_recal(nodes, moves));
      |                                                           ^~~~~
In file included from /home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:1:
/home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:132:55: note: in passing argument 2 of ‘warp::recalibration_function warp::nodes_to_recal(const node_vec&, const int&)’
  132 |     const node_vec& nodes, const std::vector<size_t>& optimal_shifts);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: At global scope:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:273:51: error: ‘std::vector<long unsigned int> warp::detail::optimal_warping_impl(std::vector<std::vector<double> >&, size_t)’ should have been declared inside ‘warp::detail’
  273 |                                     size_t n_steps) {
      |                                                   ^
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp: In instantiation of ‘warp::recalibration_function warp::util::find_optimal_warping_unique(const peak_vec&, const peak_vec&, double, Func, const Params&) [with Func = std::vector<warp::node> (*)(const std::vector<std::pair<warp::peak, warp::peak> >&, const warp::util::params_uniform&); Params = warp::util::params_uniform; warp::recalibration_function = std::vector<std::pair<double, double> >; warp::peak_vec = std::vector<warp::peak>]’:
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:87:57:   required from ‘warp::util::find_optimal_warpings_uni(const std::vector<std::vector<warp::peak> >&, const peak_vec&, const warp::util::params_uniform&, double, size_t)::<lambda(const auto:2&)> [with auto:2 = std::vector<warp::peak>]’
/home/rasp/git/MSIWarp/src/lib/util/parallel.hpp:12:23:   required from ‘auto par::for_each(size_t, RandomIt, RandomIt, Func) [with RandomIt = __gnu_cxx::__normal_iterator<const std::vector<warp::peak>*, std::vector<std::vector<warp::peak> > >; Func = warp::util::find_optimal_warpings_uni(const std::vector<std::vector<warp::peak> >&, const peak_vec&, const warp::util::params_uniform&, double, size_t)::<lambda(const auto:2&)>; size_t = long unsigned int]’
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:85:20:   required from here
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:70:74: error: subscripted value is neither array nor pointer
   70 |     recal_func.push_back({nodes[i].mz, nodes[i].mz_shifts[optimal_warping[i]]});
      |                                                           ~~~~~~~~~~~~~~~^
/home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:70:25: error: no matching function for call to ‘std::vector<std::pair<double, double> >::push_back(<brace-enclosed initializer list>)’
   70 |     recal_func.push_back({nodes[i].mz, nodes[i].mz_shifts[optimal_warping[i]]});
      |     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/vector:67,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp.hpp:5,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.hpp:4,
                 from /home/rasp/git/MSIWarp/src/lib/warp/warp_util.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<double, double>; _Alloc = std::allocator<std::pair<double, double> >; std::vector<_Tp, _Alloc>::value_type = std::pair<double, double>]’
 1187 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type&’ {aka ‘const std::pair<double, double>&’}
 1187 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<double, double>; _Alloc = std::allocator<std::pair<double, double> >; std::vector<_Tp, _Alloc>::value_type = std::pair<double, double>]’
 1203 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<std::pair<double, double> >::value_type&&’ {aka ‘std::pair<double, double>&&’}
 1203 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
gmake[2]: *** [CMakeFiles/warplib.dir/build.make:118: CMakeFiles/warplib.dir/src/lib/warp/warp_util.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp: In function ‘double warp::get_mz_scaling(double, warp::instrument)’:
/home/rasp/git/MSIWarp/src/lib/warp/warp.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
gmake[2]: *** [CMakeFiles/warplib.dir/build.make:104: CMakeFiles/warplib.dir/src/lib/warp/warp.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/warplib.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
  File "/home/rasp/git/MSIWarp/setup.py", line 61, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 23, in run
    self.build()
  File "/usr/lib/python3.9/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/rasp/git/MSIWarp/setup.py", line 31, in run
    self.build_extension(ext)
  File "/home/rasp/git/MSIWarp/setup.py", line 57, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args,
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

My cmake version is 3.22.1 and I have g++-11 installed

j-o-eriksson commented 2 years ago

Hi!

It looks like your compiler is treating warnings as errors. Try to ensure that you don't use -Werror or similar flags when you're compiling.

Hope you managed to solve it! BR, Jonatan

lguangyu commented 2 years ago

This error may depend on the compiler version (presumably compiler default header file changes). It occurred to me with GCC 11.3.0 and 12.1.0 but not with 9.4.0.

To those who got this error, inserting line #include <cstddef> to src/lib/warp/warp.hpp at line 5 can solve the problem.