32bit ARM support
pfiszer opened this issue · comments
Hi, When I compiled the program, following the tutorial, I get an error
-bash: ./mcmap: No such file or directory
I checked and make
didn't make any files named mcmap
I also found this:
src/canvas.cpp:239:65: error: no matching function for call to ‘max(uint64_t, lo ng unsigned int)’
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
In file included from /usr/include/c++/8/algorithm:61,
from src/././helper.h:4,
from src/./canvas.h:4,
from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _ Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deductio n/substitution failed:
src/canvas.cpp:239:65: note: deduced conflicting types for parameter ‘const _T p’ (‘long long unsigned int’ and ‘long unsigned int’)
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
In file included from /usr/include/c++/8/algorithm:61,
from src/././helper.h:4,
from src/./canvas.h:4,
from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _ Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compa re)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deductio n/substitution failed:
src/canvas.cpp:239:65: note: deduced conflicting types for parameter ‘const _T p’ (‘long long unsigned int’ and ‘long unsigned int’)
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
In file included from /usr/include/c++/8/algorithm:62,
from src/././helper.h:4,
from src/./canvas.h:4,
from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: template argument deduction/s ubstitution failed:
src/canvas.cpp:239:65: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
In file included from /usr/include/c++/8/algorithm:62,
from src/././helper.h:4,
from src/./canvas.h:4,
from src/canvas.cpp:5:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: template argument deduction/s ubstitution failed:
src/canvas.cpp:239:65: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
make: *** [Makefile:40: src/canvas.default.o] Error 1
And I'm trying to run it on RaspberryPi 4B with 4GB of RAM
Hi ! Thanks for raising this issue.
The compilation failed, which means the mcmap
executable has not been generated, so ./mcmap
is correctly returning the warning that the file does not exist.
However the compilation error is interesting. I have no way of replicating the error on hand, but it looks like something changes in the ARM version of the stl. Let me write patches so you can test them, if you have some time.
Yeah, I've got some time, when you patch it I can test it
Can you clone and test the branch armFix ? I noticed an x86_64 assumption that might break on ARM, it might fix your issue.
The latest commit fixes the rendering errors. Expect a merge soon, then if no comments are made, I will close the issue.
src/canvas.cpp:239:65: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
std::max(uint64_t(ceil(log2(sectionPalette->size()))), 4ul);
^
make: *** [Makefile:40: src/canvas.default.o] Error 1
Well yes that is the error on the main branch. You have to use the armFix
branch, where I put the fixes to your specific situation. I mentionned it in the previous comments, but I prefer to reiterate as you seem to have overlooked it.
If you are not familiar with git, you can check which branch you are on using git branch
, and change to another branch using git checkout <branch name>
.
The armFix
branch executable created a full image with no errors in a reasonable time on a Raspberry Pi 4B 4g with stock RPiOs, so if you haven't made custom installs it should work for you.
It compiled fine, but when I tried to run it I got this error:
mcmap 3.0.0 32bit (compatible with Minecraft v1.13+)
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
Please give some more context. What did you run ? The mcmap
options are important.
I run ./mcmap ~/.minecraft/saves/Kebab
Well, if you are willing to, please send a compressed archive of the save file so that I can take a look.
In the meantime, try using the -from -to
options to reduce the load, as this is a raspberry after all it is not capable of doing too much. The usage of options is detailed in the README.
I run ./mcmap -from 0 0 -to 200 100 ~/.minecraft/saves/Kebab
and got :
mcmap 3.0.0 32bit (compatible with Minecraft v1.13+)
Loaded 44 colors out of the 731 declared
[Error] Nothing to output: canvas is empty
Job complete.
The output file has 0 bytes.
Here is the world:
https://mega.nz/file/uX5nEBYZ#RKl8EMr-PrXvRyCj4AjCOgWAwDA3ZZ55zXtUvnI_doE
Okay so this is what your world looks like (cropped):
mcmap creates an image for the whole world, which is pretty empty. Unfortunately, there is no way of knowing. On my beefy system, it squeezes out a 40,000x20,000 pixels image to fit everything, so you HAVE to tell it what to render or the pi will run out of memory.
Try with greater values: ./mcmap -from -1024 -1024 -to 1024 1024
. On my pi however it created an image from the coordinates you mentionned, try cleanng and recompiling: make clean && make -j
.
I got [Error] Nothing to output: canvas is empty
again, which pi are you using?
It doesn't detect any region files
oh wait
The exact same as you; the pi is not important.
Now I can only think that the world is different or not accessible, can you try with the save you provided ? Download it in another folder and try with this one.
I copied all of the region files to the pi again and It's working fine
Did you get an output ?
yes
Great then. Expect a merge this week-end, then the changes will be available in the main (NBT19133) branch.
After a bit of refactoring, the changes are merged into the main branch. Thanks for bringing that error up. Closing the issue.