Closed zeeshanali33096 closed 6 years ago
Hi @zeeshanali33096, what compiler are you trying to build with?
Hello @tylerkaraszewski , I am trying to build with gcc 6.3.0 on Raspbian stretch.
BedrockServer.cpp:226:64: error: no matching function for call to 'max(int64_t&, long int)'
@zeeshanali33096 can you try changing that call to read std::max
. I don't know if there's some sort of VM or cross-compiler setup I can use to test for Raspberry Pi. Is there a quick start guide somewhere to doing this? We haven't tested Bedrock on any ARM-based platform.
Ah, @zeeshanali33096, my previous comment is wrong, I know what it is. max(int64_t&, long int)'
int64_t
and long
are the same length on x86-64, but I assume a long
is 32 bits on ARM. Adding a cast to int64_t
to the second param to max
in that function call should fix that. It may happen in more than one place. If you'd like to make the change I can review and merge it, but without a raspberry pi development environment, I can't test it.
Hey @tylerkaraszewski , casting the second parameter to long int gives me this error,
g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/BedrockServer.d -include libstuff/libstuff.h -o .build/BedrockServer.o -c BedrockServer.cpp
BedrockServer.cpp: In static member function 'static void BedrockServer::sync(SData&, std::atomic
no matching function for call to 'max(int64_t&, uint64_t)'
The issue is that std::max
expects both parameters to be the exact same type, and the second parameter there seems to be an unsigned integer. If you cast it to the exact same type as the first parameter it should compile.
https://github.com/Expensify/Bedrock/pull/508 should fix the the no matching function for call to 'max(int64_t&, uint64_t)'
errors
hey, I was able to compile Bedrock db. Now whenever I run it, I get a
./bedrock
Protip: check syslog for details, or run 'bedrock -?' for help
Aborted
I have attached the compile logs and the stack trace.
Thanks strace.txt
Can you check /var/log/syslog? It'll typically tell you exactly what is wrong. Perhaps there was already a process running and it's unable to bind the ports? Or perhaps there ins't a database named bedrock.db
in the current folder (just touch bedrock.db
to solve that).
Yeah that works,
I was running ./bedrock -clean & that clears out the bedrock.db file.
Thanks Guys!
So bedrock runs on a raspberry pi? can you post what was needed to compile it? Thanks
I tried cloning the repo, like 6-7 months ago and it just compiled.
On Saturday, June 22, 2019, Marcelo Ruiz Camauër notifications@github.com wrote:
So bedrock runs on a raspberry pi? can you post what was needed to compile it? Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Expensify/Bedrock/issues/506?email_source=notifications&email_token=ADTW5FABIL2SH2SHQBKKCCLP3Y6FBA5CNFSM4FW2ADBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKLJ2Q#issuecomment-504673514, or mute the thread https://github.com/notifications/unsubscribe-auth/ADTW5FFCW6DDIT4EKU3OHYTP3Y6FBANCNFSM4FW2ADBA .
I tried cloning the repo, like 6-7 months ago and it just compiled.
Thanks!
Hello,
I am trying to build bedrock db on the raspberry pi 2. When I try to run make, I get an error "no rule to make .build/BedrockServer.d required by .build/BedrockServer.o
~/Bedrock $ make git submodule init Submodule 'mbedtls' (https://github.com/ARMmbed/mbedtls.git) registered for path 'mbedtls' git submodule update Cloning into '/home/pi/Bedrock/mbedtls'... Submodule path 'mbedtls': checked out 'c49b808ae490f03d665df5faae457f613aa31aaf' cd mbedtls && git checkout -q c49b808ae490f03d665df5faae457f613aa31aaf cd mbedtls && make no_test && touch library/libmbedcrypto.a && touch library/libmbedtls.a && touch library/libmbedx509.a make[1]: Entering directory '/home/pi/Bedrock/mbedtls' make[2]: Entering directory '/home/pi/Bedrock/mbedtls/library' CC aes.c CC aesni.c CC arc4.c CC asn1parse.c CC asn1write.c CC base64.c CC bignum.c CC blowfish.c CC camellia.c CC ccm.c CC cipher.c CC cipher_wrap.c CC ctr_drbg.c CC des.c CC dhm.c CC ecdh.c CC ecdsa.c CC ecjpake.c CC ecp.c CC ecp_curves.c CC entropy.c CC entropy_poll.c CC error.c CC gcm.c CC havege.c CC hmac_drbg.c CC md.c CC md2.c CC md4.c CC md5.c CC md_wrap.c CC memory_buffer_alloc.c CC oid.c CC padlock.c CC pem.c CC pk.c CC pk_wrap.c CC pkcs12.c CC pkcs5.c CC pkparse.c CC pkwrite.c CC platform.c CC ripemd160.c CC rsa.c CC sha1.c CC sha256.c CC sha512.c CC threading.c CC timing.c CC version.c CC version_features.c CC xtea.c AR libmbedcrypto.a RL libmbedcrypto.a CC certs.c CC pkcs11.c CC x509.c CC x509_create.c CC x509_crl.c CC x509_crt.c CC x509_csr.c CC x509write_crt.c CC x509write_csr.c AR libmbedx509.a RL libmbedx509.a CC debug.c CC net.c CC ssl_cache.c CC ssl_ciphersuites.c CC ssl_cli.c CC ssl_cookie.c CC ssl_srv.c CC ssl_ticket.c CC ssl_tls.c AR libmbedtls.a RL libmbedtls.a make[2]: Leaving directory '/home/pi/Bedrock/mbedtls/library' make[2]: Entering directory '/home/pi/Bedrock/mbedtls/programs' CC aes/aescrypt2.c CC aes/crypt_and_hash.c CC hash/hello.c CC hash/generic_sum.c CC pkey/dh_client.c CC pkey/dh_genprime.c CC pkey/dh_server.c CC pkey/ecdh_curve25519.c CC pkey/ecdsa.c CC pkey/gen_key.c CC pkey/key_app.c CC pkey/key_app_writer.c CC pkey/mpi_demo.c CC pkey/pk_decrypt.c CC pkey/pk_encrypt.c CC pkey/pk_sign.c CC pkey/pk_verify.c CC pkey/rsa_genkey.c CC pkey/rsa_decrypt.c CC pkey/rsa_encrypt.c CC pkey/rsa_sign.c CC pkey/rsa_verify.c CC pkey/rsa_sign_pss.c CC pkey/rsa_verify_pss.c CC ssl/dtls_client.c CC ssl/dtls_server.c CC ssl/ssl_client1.c CC ssl/ssl_client2.c CC ssl/ssl_server.c CC ssl/ssl_server2.c CC ssl/ssl_fork_server.c CC ssl/mini_client.c CC ssl/ssl_mail_client.c CC random/gen_entropy.c CC random/gen_random_havege.c CC random/gen_random_ctr_drbg.c CC test/ssl_cert_test.c CC test/benchmark.c CC test/selftest.c CC test/udp_proxy.c CC util/pem2der.c CC util/strerror.c CC x509/cert_app.c CC x509/crl_app.c CC x509/cert_req.c CC x509/cert_write.c CC x509/req_app.c make[2]: Leaving directory '/home/pi/Bedrock/mbedtls/programs' make[1]: Leaving directory '/home/pi/Bedrock/mbedtls' g++-6 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF libstuff/libstuff.d -MT libstuff/libstuff.h.gch -c libstuff/libstuff.h g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/main.d -include libstuff/libstuff.h -o .build/main.o -c main.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/sqlitecluster/SQLiteNode.d -include libstuff/libstuff.h -o .build/sqlitecluster/SQLiteNode.o -c sqlitecluster/SQLiteNode.cpp In file included from /usr/include/c++/6/map:60:0, from ./libstuff/libstuff.h:30, from:0:
/usr/include/c++/6/bits/stl_tree.h: In member function 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator) [with _Key = std::cxx11::basic_string; _Val = std::pair<const std:: cxx11::basic_string, SQLiteCommand>; _KeyOfValue = std::_Select1st<std::pair<const std::cxx11::basic_string, SQLiteCommand> >; _Compare = std::less<std:: cxx11::basic_string >; _Alloc = std::allocator<std::pair<const std::cxx11::basic_string, SQLiteCommand> >]':
/usr/include/c++/6/bits/stl_tree.h:1047:2: note: parameter passing for argument of type 'std::_Rb_tree<std:: cxx11::basic_string, std::pair<const std::cxx11::basic_string, SQLiteCommand>, std::_Select1st<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >, std::less<std::cxx11::basic_string >, std::allocator<std::pair<const std::cxx11::basic_string, SQLiteCommand> > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >}' will change in GCC 7.1
_M_erase_aux(position);
^; _Val = std::pair<const std::__cxx11::basic_string, SQLiteCommand>; _KeyOfValue = std::_Select1st<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >; _Compare = std::less<std::cxx11::basic_string >; _Alloc = std::allocator<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >]':
/usr/include/c++/6/bits/stl_tree.h:2268:5: note: parameter passing for argument of type 'std::_Rb_tree<std::cxx11::basic_string, std::pair<const std::cxx11::basic_string, SQLiteCommand>, std::_Select1st<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >, std::less<std:: cxx11::basic_string >, std::allocator<std::pair<const std::cxx11::basic_string, SQLiteCommand> > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const std:: cxx11::basic_string, SQLiteCommand> >}' will change in GCC 7.1
_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
^&, std::atomic&, std::atomic<std::cxx11::basic_string >&, BedrockServer::CommandQueue&, BedrockServer&)':
BedrockServer.cpp:226:64: error: no matching function for call to 'max(int64_t&, long int)'
server._syncNode->beginShutdown(max(timeAllowed, 1l));
^
In file included from /usr/include/c++/6/algorithm:61:0,
from ./libstuff/libstuff.h:23,
from :0:
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: template constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& b)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
BedrockServer.cpp:226:64: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
server._syncNode->beginShutdown(max(timeAllowed, 1l));
^
In file included from /usr/include/c++/6/algorithm:61:0,
from ./libstuff/libstuff.h:23,
from :0:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& a, const _Tp& __b, _Compare comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
BedrockServer.cpp:226:64: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
server._syncNode->beginShutdown(max(timeAllowed, 1l));
^
In file included from /usr/include/c++/6/algorithm:62:0,
from ./libstuff/libstuff.h:23,
from :0:
/usr/include/c++/6/bits/stl_algo.h:3459:5: note: candidate: template constexpr _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> l)
^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note: template argument deduction/substitution failed:
BedrockServer.cpp:226:64: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
server._syncNode->beginShutdown(max(timeAllowed, 1l));
^
In file included from /usr/include/c++/6/algorithm:62:0,
from ./libstuff/libstuff.h:23,
from :0:
/usr/include/c++/6/bits/stl_algo.h:3465: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++/6/bits/stl_algo.h:3465:5: note: template argument deduction/substitution failed:
BedrockServer.cpp:226:64: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
server._syncNode->beginShutdown(max(timeAllowed, 1l));
^
g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/BedrockPlugin.d -include libstuff/libstuff.h -o .build/BedrockPlugin.o -c BedrockPlugin.cpp
g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/BedrockCore.d -include libstuff/libstuff.h -o .build/BedrockCore.o -c BedrockCore.cpp
In file included from /usr/include/c++/6/list:63:0,
from ./libstuff/libstuff.h:29,
from :0:
/usr/include/c++/6/bits/stl_list.h: In member function 'void std::cxx11::list<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int>}; _Tp = std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int>; _Alloc = std::allocator<std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int> >]':
/usr/include/c++/6/bits/stl_list.h:1108:11: note: parameter passing for argument of type 'std::_List_iterator<std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int> >' will change in GCC 7.1
{ this->_M_insert(end(), std::forward<_Args>(__args)...); }
^~~~
/usr/include/c++/6/bits/stl_list.h: In member function 'void std::cxx11::list<_Tp, _Alloc>::_M_insert(std::cxx11::list<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int>}; _Tp = std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int>; _Alloc = std::allocator<std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int> >':
/usr/include/c++/6/bits/stl_list.h:1768:8: note: parameter passing for argument of type 'std::cxx11::list<std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int> >::iterator {aka std::_List_iterator<std::tuple<BedrockCommand::TIMING_INFO, long long unsigned int, long long unsigned int> >}' will change in GCC 7.1
_M_insert(iterator __position, _Args&&... __args)
^
~~~ /usr/include/c++/6/bits/stl_tree.h: In member function 'void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_erase_aux(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator) [with _Key = std::cxx11::basic_string~~~~~~~~~~g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/sqlitecluster/SQLite.d -include libstuff/libstuff.h -o .build/sqlitecluster/SQLite.o -c sqlitecluster/SQLite.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/sqlitecluster/SQLiteCommand.d -include libstuff/libstuff.h -o .build/sqlitecluster/SQLiteCommand.o -c sqlitecluster/SQLiteCommand.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/sqlitecluster/SQLiteCore.d -include libstuff/libstuff.h -o .build/sqlitecluster/SQLiteCore.o -c sqlitecluster/SQLiteCore.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/plugins/Jobs.d -include libstuff/libstuff.h -o .build/plugins/Jobs.o -c plugins/Jobs.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/plugins/DB.d -include libstuff/libstuff.h -o .build/plugins/DB.o -c plugins/DB.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/plugins/MySQL.d -include libstuff/libstuff.h -o .build/plugins/MySQL.o -c plugins/MySQL.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/plugins/Cache.d -include libstuff/libstuff.h -o .build/plugins/Cache.o -c plugins/Cache.cpp g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/BedrockServer.d -include libstuff/libstuff.h -o .build/BedrockServer.o -c BedrockServer.cpp BedrockServer.cpp: In static member function 'static void BedrockServer::sync(SData&, std::atomic~~~~ g++-6 -g -DSVERSION="\"44dda038ab29f33406346854390fa90bd466f483\"" -Wall -O0 -std=gnu++14 -I/home/pi/Bedrock -I/home/pi/Bedrock/mbedtls/include -Werror -Wno-unused-result -MMD -MF .build/BedrockCommandQueue.d -include libstuff/libstuff.h -o .build/BedrockCommandQueue.o -c BedrockCommandQueue.cpp BedrockCommandQueue.cpp: In member function 'bool BedrockCommandQueue::removeByID(const string&)': BedrockCommandQueue.cpp:111:32: note: parameter passing for argument of type 'std::_Rb_tree_iterator<std::pair<const long long unsigned int, BedrockCommand> ' will change in GCC 7.1 queue.erase(it); ^ BedrockCommandQueue.cpp: In member function 'void BedrockCommandQueue::abandonFutureCommands(int)': BedrockCommandQueue.cpp:144:40: note: parameter passing for argument of type 'std::_Rb_tree_iterator<std::pair<const long long unsigned int, BedrockCommand> ' will change in GCC 7.1 size_t numberToErase = distance(commandMapIt, queueMapIt->second.end());