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

Make #3

Closed
Jonlysun opened this issue Oct 29, 2020 · 10 comments
Closed

Make #3

Jonlysun opened this issue Oct 29, 2020 · 10 comments

Comments

@Jonlysun
Copy link

Hello,thank you for sharing the source code. But When I executed the "make" command,such a error occured:
/ext/preprocess/preprocess.cpp:272:74: error: converting to ‘std::tuple<pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16> >’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16>}; <template-parameter-2-2> = void; _Elements = {pybind11::array_t<float, 16>, pybind11::array_t<float, 16>, pybind11::array_t<float, 16>}]’ {n_views, 1, patch_height, patch_width})};

is there some wrong in preprocess.cpp?

@griegler
Copy link
Contributor

What system are you on, what compiler are you using? Could you maybe post your cmake output?

@Jonlysun
Copy link
Author

i am using Ubuntu 16.04.4 LTS. And this is output:
image

@griegler
Copy link
Contributor

I suspect that your compiler version is too old, but I can not currently set up a similar env to test. Could you try to try a more recent compiler, not sure which version ships with ubuntu 16.04. Note, I tested only with Ubuntu 18.04 and macOS.

@Jonlysun
Copy link
Author

hi, i checkouted this error carefully, and found that perhaps there was something wrong in "return" of function 'get_sampling_map'.
return {create_arrayN<float>(maps, {n_views, patch_height, patch_width, 2}), create_arrayN<float>(valid_depth_masks, {n_views, 1, patch_height, patch_width}), create_arrayN<float>(valid_map_masks, {n_views, 1, patch_height, patch_width})};
the return type should be 'std::tuple', i am not sure '{ }' can create a tuple, so i use 'std::make_tuple' instead, and it finally succeeded. the code is like this:
return std::make_tulpe(create_arrayN<float>(maps, {n_views, patch_height, patch_width, 2}), create_arrayN<float>(valid_depth_masks, {n_views, 1, patch_height, patch_width}), create_arrayN<float>(valid_map_masks, {n_views, 1, patch_height, patch_width}));

@griegler
Copy link
Contributor

I see. That is due to the compiler version. A return {...} requires a C++17 compiler, if the compiler only supports C++11,14 you need to write std::make_tuple as you suggested.

@avani17101
Copy link

avani17101 commented Dec 4, 2020

hello, I am on a C++ 17 supported compiler, I still got that same error mentioned, I tried making tuple, it still gives me error.
Screenshot from 2020-12-04 19-15-12
@griegler @Jonlysun can you please help

@griegler
Copy link
Contributor

griegler commented Dec 8, 2020

You can change in line 37 in common.h from {data.size()} to {long(data.size())}`. This should fix your error.

@visonpon
Copy link

visonpon commented Dec 10, 2020

Hello @griegler after compile it succesfully, I try g++ -std=c++11 main.cpp but got errors like below:

undefined reference to `Py_GetVersion'
undefined reference to `PyExc_ImportError'
undefined reference to `PyErr_Format'
undefined reference to `PyExc_ImportError'
undefined reference to `PyErr_SetString'
undefined reference to `PyExc_ImportError'
undefined reference to `PyErr_SetString'

@griegler
Copy link
Contributor

@visonpon If you already compiled it sucessfully, why are you running g++?

@visonpon
Copy link

@griegler got it, thanks~

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