moneroexamples / onion-monero-blockchain-explorer

Onion Monero Blockchain Explorer
https://xmrchain.net
BSD 3-Clause "New" or "Revised" License
369 stars 269 forks source link

monero_crypto_amd64_64_24k_generate_subaddress_public_key #215

Closed moneroexamples closed 4 years ago

moneroexamples commented 4 years ago
/usr/bin/ld: /home/mwo2/monero/build/release/src/device/libdevice.a(device_default.cpp.o): in function `hw::core::device_default::derive_subaddress_public_key(crypto::public_key const&, crypto::key_derivation const&, unsigned long, crypto::public_key&)':
device_default.cpp:(.text+0x11e): undefined reference to `monero_crypto_amd64_64_24k_generate_subaddress_public_key'
/usr/bin/ld: /home/mwo2/monero/build/release/src/device/libdevice.a(device_default.cpp.o): in function `hw::core::device_default::generate_key_derivation(crypto::public_key const&, epee::mlocked<tools::scrubbed<crypto::ec_scalar> > const&, crypto::key_derivation&) [clone .localalias]':
device_default.cpp:(.text+0x3ac): undefined reference to `monero_crypto_amd64_64_24k_generate_key_derivation'
/usr/bin/ld: /home/mwo2/monero/build/release/src/device/libdevice.a(device_default.cpp.o): in function `hw::core::device_default::encrypt_payment_id(crypto::hash8&, crypto::public_key const&, epee::mlocked<tools::scrubbed<crypto::ec_scalar> > const&)':
device_default.cpp:(.text+0x74a): undefined reference to `monero_crypto_amd64_64_24k_generate_key_derivation'
/usr/bin/ld: /home/mwo2/monero/build/release/src/device/libdevice.a(device_default.cpp.o): in function `hw::core::device_default::generate_output_ephemeral_keys(unsigned long, cryptonote::account_keys const&, crypto::public_key const&, epee::mlocked<tools::scrubbed<crypto::ec_scalar> > const&, cryptonote::tx_destination_entry const&, boost::optional<cryptonote::account_public_address> const&, unsigned long, bool const&, std::vector<epee::mlocked<tools::scrubbed<crypto::ec_scalar> >, std::allocator<epee::mlocked<tools::scrubbed<crypto::ec_scalar> > > > const&, std::vector<crypto::public_key, std::allocator<crypto::public_key> >&, std::vector<rct::key, std::allocator<rct::key> >&, crypto::public_key&)':
device_default.cpp:(.text+0x2fb4): undefined reference to `monero_crypto_amd64_64_24k_generate_key_derivation'
/usr/bin/ld: device_default.cpp:(.text+0x30f3): undefined reference to `monero_crypto_amd64_64_24k_generate_key_derivation'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xmrblocks.dir/build.make:140: xmrblocks] Error 1
make[1]: *** [CMakeFiles/Makefile2:198: CMakeFiles/xmrblocks.dir/all] Error 2
moneroexamples commented 4 years ago

The current solution is to build monero with MONERO_WALLET_CRYPTO_LIBRARY=cn:

  1. Create ~/monero/build/release

In monero folder create build folder ~/monero/build/release. If one exists already, you will have delete it and create new one.

  1. Go to the folder

Configure monero build system to use MONERO_WALLET_CRYPTO_LIBRARY=cn

cd ~/monero/build/release
cmake -DMONERO_WALLET_CRYPTO_LIBRARY=cn ../..
  1. Compile
make

alternatievely make -j n where n is number of cores to use for compilation.

iDunk5400 commented 4 years ago

This might work for you with or without supercop. There is some unrelated stuff here because I don't have libunwind and libunbound installed.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ed028f..8a04fe7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,13 +76,17 @@ if(APPLE)
     link_directories(/usr/local/lib)
 endif()

-
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32)
+find_library (UNBOUND_LIBRARY unbound)
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR (${UNBOUND_LIBRARY} STREQUAL "UNBOUND_LIBRARY-NOTFOUND"))
     add_library(unbound STATIC IMPORTED)
     set_property(TARGET unbound PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/external/unbound/libunbound.a)
 endif()

-
+if("${Xmr_WALLET-CRYPTO_LIBRARIES}" STREQUAL "Xmr_WALLET-CRYPTO_LIBRARY-NOTFOUND")
+  set(WALLET_CRYPTO "")
+else()
+  set(WALLET_CRYPTO ${Xmr_WALLET-CRYPTO_LIBRARIES})
+endif()

 # include boost headers
 include_directories(${Boost_INCLUDE_DIRS})
@@ -125,6 +129,7 @@ set(LIBRARIES
         wallet
         blockchain_db
         device
+        ${WALLET_CRYPTO}
         cryptonote_core
         cryptonote_protocol
         cryptonote_basic
@@ -158,8 +163,16 @@ else()
     set(LIBRARIES ${LIBRARIES} atomic)
 endif()

+find_library(UNWIND_LIBRARY unwind)
+if (${UNWIND_LIBRARY} STREQUAL "UNWIND_LIBRARY-NOTFOUND")
+  message (STATUS "unwind library not found")
+  set (UNWIND_LIBRARY "")
+else ()
+  message (STATUS "Found unwind library: ${UNWIND_LIBRARY}")
+endif ()
+
 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32)
-    set(LIBRARIES ${LIBRARIES} unwind)
+    set(LIBRARIES ${LIBRARIES} ${UNWIND_LIBRARY})
 endif()

 if (WIN32)
diff --git a/cmake/FindMonero.cmake b/cmake/FindMonero.cmake
index 7ef5c44..f9b73ae 100644
--- a/cmake/FindMonero.cmake
+++ b/cmake/FindMonero.cmake
@@ -29,7 +29,7 @@
 #------------------------------------------------------------------------------

 set(LIBS common;blocks;cryptonote_basic;cryptonote_core;multisig;
-       cryptonote_protocol;daemonizer;mnemonics;epee;lmdb;device;
+       cryptonote_protocol;daemonizer;mnemonics;epee;lmdb;device;wallet-crypto;
        blockchain_db;ringct;wallet;cncrypto;easylogging;version;
         checkpoints;randomx;hardforks;miniupnpc)

@@ -45,7 +45,7 @@ foreach (l ${LIBS})
    find_library(Xmr_${L}_LIBRARY
        NAMES ${l}
        PATHS ${CMAKE_LIBRARY_PATH}
-       PATH_SUFFIXES "/src/${l}" "/src/" "/external/db_drivers/lib${l}" "/lib" "/src/crypto" "/contrib/epee/src" "/external/easylogging++/" "/external/${l}" "external/miniupnp/miniupnpc"
+       PATH_SUFFIXES "/src/${l}" "/src/" "/external/db_drivers/lib${l}" "/lib" "/src/crypto" "/src/crypto/wallet" "/contrib/epee/src" "/external/easylogging++/" "/external/${l}" "external/miniupnp/miniupnpc"
        NO_DEFAULT_PATH
    )

@@ -53,8 +53,10 @@ foreach (l ${LIBS})

    message(STATUS FindMonero " Xmr_${L}_LIBRARIES ${Xmr_${L}_LIBRARY}")

-   add_library(${l} STATIC IMPORTED)
-   set_property(TARGET ${l} PROPERTY IMPORTED_LOCATION ${Xmr_${L}_LIBRARIES})
+   if(NOT "${Xmr_${L}_LIBRARIES}" STREQUAL "${Xmr_${L}_LIBRARY-NOTFOUND}")
+     add_library(${l} STATIC IMPORTED)
+     set_property(TARGET ${l} PROPERTY IMPORTED_LOCATION ${Xmr_${L}_LIBRARIES})
+   endif()

 endforeach()

@@ -72,6 +74,7 @@ message(STATUS ${MONERO_SOURCE_DIR}/build)
 include_directories(
        ${MONERO_SOURCE_DIR}/src
                 ${MONERO_SOURCE_DIR}/src/crypto
+                ${MONERO_SOURCE_DIR}/src/crypto/wallet
        ${MONERO_SOURCE_DIR}/external
        ${MONERO_SOURCE_DIR}/external/randomx/src
        ${MONERO_SOURCE_DIR}/build
moneroexamples commented 4 years ago

@iDunk5400 Thank you! It compiles now. Should I close the issue on monero in this case?