make debug fails on Mac OSX 10.14.x #222

Closed
opened 5 years ago by rotavele · 2 comments
rotavele commented 5 years ago (Migrated from github.com)
Owner

I have tried to compile with make debug on several release tags as well as master. I am not sure if it is an issue with my local configuration, but when I make debug on the Monero master branch for instance, it works. I see the same issue on hyc's randomx branch, but not other branches on that repo, so I think it has something to do with the extra params being added to get_block_longhash for the randomx builds, but I am not sure where to look next. If anyone has any insight it would be much appreciated. I want to be able to step through the program with LLDB but I am unable to build with debug symbols.

output:

[ 65%] Linking CXX shared library libcryptonote_basic.dylib
Undefined symbols for architecture x86_64:
  "cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int)", referenced from:
      cryptonote::miner::worker_thread() in miner.cpp.o
      cryptonote::miner::find_nonce_for_given_block(cryptonote::Blockchain const*, cryptonote::block&, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0> const&, unsigned long long) in miner.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [src/cryptonote_basic/libcryptonote_basic.dylib] Error 1
make[2]: *** [src/cryptonote_basic/CMakeFiles/cryptonote_basic.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [debug] Error 2
I have tried to compile with `make debug` on several release tags as well as master. I am not sure if it is an issue with my local configuration, but when I `make debug` on the Monero master branch for instance, it works. I see the same issue on hyc's randomx branch, but not other branches on that repo, so I think it has something to do with the extra params being added to get_block_longhash for the randomx builds, but I am not sure where to look next. If anyone has any insight it would be much appreciated. I want to be able to step through the program with LLDB but I am unable to build with debug symbols. output: ``` [ 65%] Linking CXX shared library libcryptonote_basic.dylib Undefined symbols for architecture x86_64: "cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int)", referenced from: cryptonote::miner::worker_thread() in miner.cpp.o cryptonote::miner::find_nonce_for_given_block(cryptonote::Blockchain const*, cryptonote::block&, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0> const&, unsigned long long) in miner.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [src/cryptonote_basic/libcryptonote_basic.dylib] Error 1 make[2]: *** [src/cryptonote_basic/CMakeFiles/cryptonote_basic.dir/all] Error 2 make[1]: *** [all] Error 2 make: *** [debug] Error 2 ```
notmike-5 commented 4 years ago (Migrated from github.com)
Owner

This is an attempt to describe the issue and the location(s) of relevant parts. A solution is not given.

Description of the problem:
The error would appear to indicate that the linker is failing to link src/cryptonote_basic/libcryptonote_basic.dylib. Some certain symbols are undefined for the x86_64 architecture, which is odd since I recently built wownero on that architecture without issue. @rotavele: are you sure you have installed all of the dependencies?

Symbols in question:
cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int)

and

cryptonote::miner::find_nonce_for_given_block(cryptonote::Blockchain const*, cryptonote::block&, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0> const&, unsigned long long)

I have no idea what exact requirements are not being met here.

Relevant clips of code:
cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int) does not occur in the object built with <src/cryptonote_basic/miner.cpp>, where the linker appears to be looking for it.

<src/cryptonote_basic/miner.h>
Line 79:
static bool find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height);

<src/cryptonote_basic/miner.cpp>
Line 474:

 bool miner::find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height)
  {
    for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++)
    {
      crypto::hash h;
      gbh(bl, height, tools::get_max_concurrency(), h);

      if(check_hash(h, diffic))
      {
        bl.invalidate_hashes();
        return true;
      }
    }
    bl.invalidate_hashes();
    return false;
  }
This is an attempt to describe the issue and the location(s) of relevant parts. A solution is not given. **Description of the problem:** The error would appear to indicate that the linker is failing to link `src/cryptonote_basic/libcryptonote_basic.dylib`. Some certain symbols are undefined for the x86_64 architecture, which is odd since I recently built wownero on that architecture without issue. @rotavele: are you sure you have installed all of the dependencies? **Symbols in question:** `cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int)` and `cryptonote::miner::find_nonce_for_given_block(cryptonote::Blockchain const*, cryptonote::block&, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<128u, 128u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0> const&, unsigned long long)` I have no idea what exact requirements are not being met here. **Relevant clips of code:** `cryptonote::get_block_longhash(cryptonote::Blockchain const*, cryptonote::block const&, crypto::hash&, unsigned long long, int)` does not occur in the object built with _<src/cryptonote_basic/miner.cpp>_, where the linker appears to be looking for it. _<src/cryptonote_basic/miner.h>_ Line 79: `static bool find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height);` _<src/cryptonote_basic/miner.cpp>_ Line 474: ``` bool miner::find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height) { for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++) { crypto::hash h; gbh(bl, height, tools::get_max_concurrency(), h); if(check_hash(h, diffic)) { bl.invalidate_hashes(); return true; } } bl.invalidate_hashes(); return false; } ```
wowario commented 4 years ago (Migrated from github.com)
Owner

make debug with latest release builds on mac

`make debug` with latest release builds on mac
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: wownero/wownero#222
Loading…
There is no content yet.