monero-project / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
8.86k stars 3.09k forks source link

Building under Solaris aka SunOS (OpenIndiana Hipster 2017.04) #2625

Closed acid-jack closed 6 years ago

acid-jack commented 6 years ago

Hello. I'm trying to build monero under this OS with illumos kernel. Now I'm stuck at 90% before which I had to do many dirty hacks. Maybe you will merge them to the code later after some reworking. And FYI, I'm not a C-programmer.

  1. Preparation.
    pkg install git cmake gcc-49 pkg-config system/header <don't remember all packages>
    wget https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp -O /usr/include/zmq.hpp
    git clone https://github.com/monero-project/monero.git

And here are my build iterations of cd monero && make

So can anybody help me to move forward or fix my hacks? Perhaps I'm doing wrong something.

hyc commented 6 years ago

On Solaris you must link with -lsocket. You might also need -lnsl.

acid-jack commented 6 years ago

Oh. Yes. Forgot to mention it. I already tried LDLIBS="-lsocket -lnsl -lresolv" make release-static with same result.

moneromooo-monero commented 6 years ago

Look in CMakeLists.txt in the root tree, from line 654, and add: set (EXTRA_LIBRARIES socket nsl resolv) instead of the set of tests. If that works, we need to detect SunOS there.

Thanks for the detailed report about the other failures.

acid-jack commented 6 years ago

Yahoo! Added in root CMakeLists.txt after DRAGONFLY section:

elseif (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
  set (EXTRA_LIBRARIES socket nsl resolv)

Now dealing with next error.

acid-jack commented 6 years ago

Iteration 14 Result:

[ 93%] Generating blocksdat.o
ld: fatal: file binary: open failed: No such file or directory
*** Error code 1
The following command caused the error:
cd /root/monero.build/build/release/src/daemon && cd /root/monero.build/src/daemon && cp ../blocks/checkpoints.dat blocks.dat && /usr/bin/ld -r -b bina
ry -o /root/monero.build/build/release/src/daemon/blocksdat.o blocks.dat && rm -f blocks.dat
make: Fatal error: Command failed for target `src/daemon/blocksdat.o'

Solution is the same as in Iteration 9: override CMAKE_LINKER in src/daemon/CMakeLists.txt

moneromooo-monero commented 6 years ago

Iteration 2 seems because cmake fails to detect getaddrinfo. Could you check whether this works as a replacement ?

diff --git a/external/unbound/configure_checks.cmake b/external/unbound/configure_checks.cmake
index 258f281..69fd269 100644
--- a/external/unbound/configure_checks.cmake
+++ b/external/unbound/configure_checks.cmake
@@ -108,6 +108,9 @@ check_function_exists(writev HAVE_WRITEV)
 check_function_exists(_beginthreadex HAVE__BEGINTHREADEX)

 set(getaddrinfo_headers)
+if (HAVE_SYS_SOCKET_H)
+  list(APPEND getaddrinfo_headers "sys/socket.h")
+endif ()
 if (HAVE_NETDB_H)
   list(APPEND getaddrinfo_headers "netdb.h")
 endif ()
acid-jack commented 6 years ago

Iteration 15 Result:

[ 96%] Building CXX object src/blockchain_utilities/CMakeFiles/blockchain_export.dir/blockchain_export.cpp.o
In file included from /usr/include/boost/asio/detail/socket_types.hpp:81:0,
                 from /usr/include/boost/asio/detail/impl/pipe_select_interrupter.ipp:31,
                 from /usr/include/boost/asio/detail/pipe_select_interrupter.hpp:82,
                 from /usr/include/boost/asio/detail/select_interrupter.hpp:27,
                 from /usr/include/boost/asio/detail/dev_poll_reactor.hpp:31,
                 from /usr/include/boost/asio/detail/reactor.hpp:25,
                 from /usr/include/boost/asio/detail/impl/task_io_service.ipp:24,
                 from /usr/include/boost/asio/detail/task_io_service.hpp:198,
                 from /usr/include/boost/asio/impl/io_service.hpp:71,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /root/monero.build/src/cryptonote_core/blockchain.h:32,
                 from /root/monero.build/src/blockchain_utilities/bootstrap_file.h:38,
                 from /root/monero.build/src/blockchain_utilities/blockchain_export.cpp:29:
/usr/include/net/if.h:97:9: error: template argument required for ‘struct map’
  struct map *if_memmap;  /* rmap for interface specific memory */
         ^

Solution: put #include "cryptonote_core/blockchain.h" in src/blockchain_utilities/bootstrap_file.h above the #include "cryptonote_basic/cryptonote_basic.h"

acid-jack commented 6 years ago

Tried to add + list(APPEND getaddrinfo_headers "sys/socket.h") Result is same error.

acid-jack commented 6 years ago

Iteration 16 Result:

[ 97%] Building CXX object src/blockchain_utilities/CMakeFiles/blockchain_export.dir/bootstrap_file.cpp.o
In file included from /usr/include/boost/asio/detail/socket_types.hpp:81:0,
                 from /usr/include/boost/asio/detail/impl/pipe_select_interrupter.ipp:31,
                 from /usr/include/boost/asio/detail/pipe_select_interrupter.hpp:82,
                 from /usr/include/boost/asio/detail/select_interrupter.hpp:27,
                 from /usr/include/boost/asio/detail/dev_poll_reactor.hpp:31,
                 from /usr/include/boost/asio/detail/reactor.hpp:25,
                 from /usr/include/boost/asio/detail/impl/task_io_service.ipp:24,
                 from /usr/include/boost/asio/detail/task_io_service.hpp:198,
                 from /usr/include/boost/asio/impl/io_service.hpp:71,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /root/monero.build/src/cryptonote_core/blockchain.h:32,
                 from /root/monero.build/src/blockchain_utilities/bootstrap_file.h:37,
                 from /root/monero.build/src/blockchain_utilities/bootstrap_file.cpp:33:
/usr/include/net/if.h:97:9: error: template argument required for ‘struct map’
  struct map *if_memmap;  /* rmap for interface specific memory */
         ^

Solution: move #include "bootstrap_file.h" above #include "bootstrap_serialization.h" in src/blockchain_utilities/bootstrap_file.cpp

acid-jack commented 6 years ago

Iteration 17 Result:

[ 97%] Building CXX object src/blockchain_utilities/CMakeFiles/blockchain_export.dir/blocksdat_file.cpp.o
In file included from /usr/include/boost/asio/detail/socket_types.hpp:81:0,
                 from /usr/include/boost/asio/detail/impl/pipe_select_interrupter.ipp:31,
                 from /usr/include/boost/asio/detail/pipe_select_interrupter.hpp:82,
                 from /usr/include/boost/asio/detail/select_interrupter.hpp:27,
                 from /usr/include/boost/asio/detail/dev_poll_reactor.hpp:31,
                 from /usr/include/boost/asio/detail/reactor.hpp:25,
                 from /usr/include/boost/asio/detail/impl/task_io_service.ipp:24,
                 from /usr/include/boost/asio/detail/task_io_service.hpp:198,
                 from /usr/include/boost/asio/impl/io_service.hpp:71,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /root/monero.build/src/cryptonote_core/blockchain.h:32,
                 from /root/monero.build/src/blockchain_utilities/blocksdat_file.h:39,
                 from /root/monero.build/src/blockchain_utilities/blocksdat_file.cpp:29:
/usr/include/net/if.h:97:9: error: template argument required for ‘struct map’
  struct map *if_memmap;  /* rmap for interface specific memory */
         ^

Solution: move #include "cryptonote_core/blockchain.h" above #include "cryptonote_basic/cryptonote_basic.h" in src/blockchain_utilities/blocksdat_file.h

acid-jack commented 6 years ago

Iteration 18 Result:

[ 97%] Linking CXX executable ../../bin/monero-blockchain-export
[ 98%] Built target blockchain_export
[ 98%] Generating blocksdat.o
ld: fatal: file binary: open failed: No such file or directory
*** Error code 1
The following command caused the error:
cd /root/monero.build/build/release/src/blockchain_utilities && cd /root/monero.build/src/blockchain_utilities && cp ../blocks/checkpoints.dat blocks.dat && /usr/bin/ld -r -b binary -o /root/monero.build/build/release/src/blockchain_utilities/blocksdat.o blocks.dat && rm -f blocks.dat
make: Fatal error: Command failed for target `src/blockchain_utilities/blocksdat.o'

Solution is the same as in Iteration 9: override CMAKE_LINKER in src/blockchain_utilities/CMakeLists.txt

acid-jack commented 6 years ago

Bingo!

# ./monerod
2017-10-10 14:29:21.108                1        INFO    global  src/daemon/main.cpp:283 Monero 'Helium Hydra' (v0.11.0.0-86e9de58)
2017-10-10 14:29:21.109                1        INFO    global  src/daemon/protocol.h:55        Initializing cryptonote protocol...
2017-10-10 14:29:21.109                1        INFO    global  src/daemon/protocol.h:60        Cryptonote protocol initialized OK
2017-10-10 14:29:21.110                1        INFO    global  src/daemon/p2p.h:63     Initializing p2p server...
2017-10-10 14:29:25.944                1        INFO    global  src/daemon/p2p.h:68     P2p server initialized OK
2017-10-10 14:29:25.945                1        INFO    global  src/daemon/rpc.h:58     Initializing core rpc server...
2017-10-10 14:29:25.945                1        INFO    global  contrib/epee/include/net/http_server_impl_base.h:70     Binding on 127.0.0.1:18081
2017-10-10 14:29:25.945                1        INFO    global  src/daemon/rpc.h:63     Core rpc server initialized OK on port: 18081
2017-10-10 14:29:25.945                1        INFO    global  src/daemon/core.h:73    Initializing core...
2017-10-10 14:29:25.947                1        INFO    global  src/cryptonote_core/cryptonote_core.cpp:320     Loading blockchain from folder /root/.bitmonero/lmdb ...
2017-10-10 14:29:25.966                1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:72   Error attempting to retrieve a hard fork version at height 0 from the db: MDB_NOTFOUND: No matching key/data pair found
2017-10-10 14:29:26.466                1        INFO    global  src/cryptonote_core/cryptonote_core.cpp:418     Loading checkpoints
[1507645766] libunbound[194:0] error: outgoing tcp: connect: No such file or directory for 78.140.142.137
[1507645766] libunbound[194:0] error: serviced_tcp_initiate: failed to send tcp query
2017-10-10 14:29:26.775                1        WARN    net.dns src/common/dns_utils.cpp:492    WARNING: no two valid MoneroPulse DNS checkpoint records were received
2017-10-10 14:29:26.775                1        INFO    global  src/daemon/core.h:78    Core initialized OK
2017-10-10 14:29:26.776                1        INFO    global  src/daemon/rpc.h:68     Starting core rpc server...
2017-10-10 14:29:26.776 [SRV_MAIN]      INFO    global  src/daemon/rpc.h:73     Core rpc server started ok
2017-10-10 14:29:26.778 [SRV_MAIN]      INFO    global  src/daemon/p2p.h:78     Starting p2p net loop...
2017-10-10 14:29:27.787 [P2P9]  INFO    global  src/cryptonote_core/cryptonote_core.cpp:1254
**********************************************************************
The daemon will start synchronizing with the network. This may take a long time to complete.

You can set the level of process detailization* through "set_log <level|categories>" command*,
where <level> is between 0 (no details) and 4 (very verbose), or custom category based levels (eg, *:WARNING)

Use the "help" command to see the list of available commands.
**********************************************************************

2017-10-10 14:29:27.840 [P2P9]  WARN    net.dns src/common/dns_utils.cpp:492    WARNING: no two valid MoneroPulse DNS checkpoint records were received
moneromooo-monero commented 6 years ago

Nice :)

I think I know what causes the error in if.h. Can you apply the last patch in https://github.com/moneromooo-monero/bitmonero/tree/solaris and see if it fixes it, instead of moving the includes around ?

acid-jack commented 6 years ago

I cloned solaris branch. Had to repeat iterations 2, 9, 14 and override CMAKE_LINKER in src/blockchain_utilities.

But now I have a problem with lmdb:

2017-10-10 15:46:07.127  [P2P2]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1150    [xx.xxx.xxx.xx:18080 OUT]  Synced 82096/1417686
2017-10-10 15:46:07.162  [P2P2]  INFO    global  src/blockchain_db/lmdb/db_lmdb.cpp:578  [batch] DB resize needed
2017-10-10 15:46:07.378  [P2P2]  WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:72   Failed to set new mapsize: No such device
Segmentation Fault
jack@xxxxxx:~/monero$ ./monerod
2017-10-10 15:57:16.655                    1        INFO    global  src/daemon/main.cpp:283 Monero 'Helium Hydra' (v0.11.0.0-86e9de58)
2017-10-10 15:57:16.655                 1        INFO    global  src/daemon/protocol.h:55        Initializing cryptonote protocol...
2017-10-10 15:57:16.655                 1        INFO    global  src/daemon/protocol.h:60        Cryptonote protocol initialized OK
2017-10-10 15:57:16.656                 1        INFO    global  src/daemon/p2p.h:63     Initializing p2p server...
2017-10-10 15:57:21.470                 1        INFO    global  src/daemon/p2p.h:68     P2p server initialized OK
2017-10-10 15:57:21.470                 1        INFO    global  src/daemon/rpc.h:58     Initializing core rpc server...
2017-10-10 15:57:21.471                 1        INFO    global  contrib/epee/include/net/http_server_impl_base.h:70     Binding on 127.0.0.1:18081
2017-10-10 15:57:21.471                 1        INFO    global  src/daemon/rpc.h:63     Core rpc server initialized OK on port: 18081
2017-10-10 15:57:21.471                 1        INFO    global  src/daemon/core.h:73    Initializing core...
2017-10-10 15:57:21.472                 1        INFO    global  src/cryptonote_core/cryptonote_core.cpp:320     Loading blockchain from folder /home/jack/.bitmonero/lmdb ...
2017-10-10 15:57:21.485                 1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:72   Failed to open lmdb environment: Device busy
2017-10-10 15:57:21.502                 1        ERROR   cn      src/cryptonote_core/cryptonote_core.cpp:396     Error opening database: Failed to open lmdb environment: Device busy
2017-10-10 15:57:21.502                 1        INFO    global  src/daemon/rpc.h:90     Deinitializing rpc server...
2017-10-10 15:57:21.519                 1        INFO    global  src/daemon/p2p.h:90     Deinitializing p2p...
2017-10-10 15:57:25.523                 1        INFO    global  src/daemon/core.h:89    Deinitializing core...
2017-10-10 15:57:25.611                 1        ERROR   daemon  src/daemon/core.h:94    Failed to deinitialize core...
2017-10-10 15:57:25.629                 1        INFO    global  src/daemon/protocol.h:77        Stopping cryptonote protocol...
2017-10-10 15:57:25.629                 1        INFO    global  src/daemon/protocol.h:81        Cryptonote protocol stopped successfully

New build also have problem with lmdb:

2017-10-10 16:40:28.956                 1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:73   Failed to open lmdb environment: Device busy
moneromooo-monero commented 6 years ago

Are you running this on a local hard drive ? mmap can return ENODEV if the underlying FS/HW can't. But then it should have done so earlier. Maybe remapping fails. hyc should have a better idea what could go wrong here.

acid-jack commented 6 years ago

Yes. It's a physical local disk. I tried to remove ~/.bitmonero/lmdb/lock.mdb Now error is more interesting:

2017-10-10 16:53:45.098                 1        INFO    global  src/cryptonote_core/cryptonote_core.cpp:320     Loading blockchain from folder /home/jack/.bitmonero/lmdb ...
2017-10-10 16:53:45.191                 1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:1162 LMDB memory map needs to be resized, doing that now.
2017-10-10 16:53:45.191                 1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:73   Failed to set new mapsize: Value too large for defined data type
2017-10-10 16:53:45.216                 1        ERROR   cn      src/cryptonote_core/cryptonote_core.cpp:396     Error opening database: Failed to set new mapsize: Value too large for defined data type

data.mdb size is 1.1GB btw

moneromooo-monero commented 6 years ago

I pushed the namespace reorg to https://github.com/monero-project/monero/pull/2629

hyc commented 6 years ago

Failed to open lmdb environment: Device busy

Sorry about this, it's a known issue with robust mutexes on Solaris. Was fixed upstream over a year ago and I never merged the patch here. You need https://github.com/LMDB/lmdb/commit/c367c1f69685a4d307acb8cea6945c1d67e1cc7e

I'll PR it here shortly.

acid-jack commented 6 years ago

Thnaks for your efforts. So I applied patch to mdb.c, made new build, removed ~/.bitmonero and received next error:

2017-10-11 08:28:42.556  [P2P4]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1150    [xxx.xxx.xxx.xx:18080 OUT]  Synced 82097/1418160
2017-10-11 08:28:42.557  [P2P4]  INFO    global  src/blockchain_db/lmdb/db_lmdb.cpp:579  [batch] DB resize needed
2017-10-11 08:28:42.684  [P2P4]  WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:73   Failed to set new mapsize: No such device
Segmentation Fault (core dumped)

UPD: still can't make build without disabling fake-rfc2553 UPD: and still have to redefine CMAKE_LINKER for src/blocks and src/daemon and src/blockchain_utilities

acid-jack commented 6 years ago

Tried to build all targets:

Scanning dependencies of target performance_tests
[ 71%] Building CXX object tests/performance_tests/CMakeFiles/performance_tests.dir/main.cpp.o
In file included from /home/jack/bitmonero/tests/performance_tests/main.cpp:32:0:
/home/jack/bitmonero/tests/performance_tests/performance_utils.h: In function ‘void set_process_affinity(int)’:
/home/jack/bitmonero/tests/performance_tests/performance_utils.h:53:3: error: ‘cpu_set_t’ was not declared in this scope
   cpu_set_t cpuset;
   ^
/home/jack/bitmonero/tests/performance_tests/performance_utils.h:54:13: error: ‘cpuset’ was not declared in this scope
   CPU_ZERO(&cpuset);
             ^
/home/jack/bitmonero/tests/performance_tests/performance_utils.h:54:19: error: ‘CPU_ZERO’ was not declared in this scope
   CPU_ZERO(&cpuset);
                   ^
/home/jack/bitmonero/tests/performance_tests/performance_utils.h:55:24: error: ‘CPU_SET’ was not declared in this scope
   CPU_SET(core, &cpuset);
                        ^
/home/jack/bitmonero/tests/performance_tests/performance_utils.h:56:12: error: ‘::pthread_setaffinity_np’ has not been declared
   if (0 != ::pthread_setaffinity_np(::pthread_self(), sizeof(cpuset), &cpuset))
            ^
*** Error code 1
make: Fatal error: Command failed for target `tests/performance_tests/CMakeFiles/performance_tests.dir/main.cpp.o'
moneromooo-monero commented 6 years ago

Is GNU ld installed in /usr/gnu/bin by default ?

acid-jack commented 6 years ago

No.

$ ld --version
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1755 (illumos)
hyc commented 6 years ago

Failed to set new mapsize: No such device

Have never seen this before. This means the mmap() call failed, but the error code means that the underlying filesystem doesn't support mmap() at all. Which is weird because if the error code was legit it should have failed at startup/db open time. Not at resize. What filesystem are you using?

acid-jack commented 6 years ago

zfs — native Solaris FS

BTW, there was one successful DB resize

2017-10-11 10:03:44.435  [P2P4]  INFO    global  src/blockchain_db/lmdb/db_lmdb.cpp:579  [batch] DB resize needed
2017-10-11 10:03:45.281  [P2P4]  INFO    global  src/blockchain_db/lmdb/db_lmdb.cpp:495  LMDB Mapsize increased.  Old: 1024MiB, New: 1536MiB

And on the second resize I'm receiving our error Failed to set new mapsize: No such device

moneromooo-monero commented 6 years ago

Does it work if you omit -b in the ld command line (and use the default Soiaris linker) ?

hyc commented 6 years ago

Looks to me like the resize is failing because of the requested size - hitting 2GB.

acid-jack commented 6 years ago

After removing '-b binary' option:

[ 71%] Generating blocks.o
ld: fatal: file blocks.dat: unknown file type
ld: fatal: file processing errors. No output written to /home/jack/bitmonero/build/release/src/blocks/blocks.o

blocks.dat have 0 size Solaris linker don't like it.

acid-jack commented 6 years ago

Now data.mdb size is 1230188544 bytes.

hyc commented 6 years ago

Try using UFS instead and see if it behaves any differently.

moneromooo-monero commented 6 years ago

Does the following patch work for getaddrinfo ?

diff --git a/external/unbound/configure_checks.cmake b/external/unbound/configure_checks.cmake
index 258f281..85de6a3 100644
--- a/external/unbound/configure_checks.cmake
+++ b/external/unbound/configure_checks.cmake
@@ -114,6 +114,9 @@ endif ()
 if (HAVE_WS2TCPIP_H)
   list(APPEND getaddrinfo_headers "ws2tcpip.h")
 endif ()
+if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
+  set(CMAKE_REQUIRED_LIBRARIES socket nsl)
+endif ()
 check_symbol_exists(getaddrinfo "${getaddrinfo_headers}" HAVE_GETADDRINFO)

 check_function_exists(getaddrinfo HAVE_GETADDRINFO)
acid-jack commented 6 years ago

I can't create UFS. I have no free disks for experiments.

acid-jack commented 6 years ago
+if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
+  set(CMAKE_REQUIRED_LIBRARIES socket nsl)
+endif ()

not helps, same redifinition error

hyc commented 6 years ago

LMDB Mapsize increased. Old: 1024MiB, New: 1536MiB

So it successfully resized to 1.5GB.

Now data.mdb size is 1230188544 bytes.

The actual file size is not expected to be identical to the map size. The map size is a maximum size, the actual size grows toward it.

I can't create UFS. I have no free disks for experiments.

Since the resize to 1.5GB succeeded and the next resize attempt failed, I'm assuming your system has a problem with 2GB or larger mmap on ZFS. Probably there's some ZFS parameter you need to tune. Since I don't have any Solaris systems or documentation to check, you're on your own here.

acid-jack commented 6 years ago

I don't understand which problem it could be:

$ dd if=/dev/zero of=zeroes bs=100M count=40
40+0 records in
40+0 records out
4194304000 bytes transferred in 6.403784 secs (654972775 bytes/sec)

$ dd if=/dev/zero bs=100M count=1>>zeroes
1+0 records in
1+0 records out
104857600 bytes transferred in 0.226117 secs (463731403 bytes/sec)
acid-jack commented 6 years ago

I found set(DATABASE memory) in root CMakeLists.txt Switched from 'lmdb' to 'memory' and received:

-- DATABASE set: memory
CMake Error at CMakeLists.txt:48 (message):
  Invalid database type: memory
moneromooo-monero commented 6 years ago

lmdb is the only valid type.

acid-jack commented 6 years ago

lmdb is the only valid type.

And I investigated BerkeleyDB right now. So it useless?

moneromooo-monero commented 6 years ago

It is obsolete now.

moneromooo-monero commented 6 years ago

About the getaddrinfo one, it looks like cmake isn't detecting it, so you'd have to work out why it doesn't do so. It seems to be present and usable, since monerod builds and runs, so it's the test that seems wrong. It could be a missing header (unlikely, Solaris' man page lists the same headers), or a lib (seems to be socket, but we just tried that), or maybe the variables used are the wrong ones.

acid-jack commented 6 years ago

Looks like without fake-rfc2553 it works good enought. But main problem is in lmdb now.

moneromooo-monero commented 6 years ago

Yes, but ideally it'd be omitted because HAVE_GETADDRINFO is defined. I suppose checking for Solaris/SunOS is an acceptable fallback though.

acid-jack commented 6 years ago

lmdb: I enabled --log-level 4 to get more details Here they are:

2017-10-12 07:29:22.749                1        TRACE   blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:2552 BlockchainLMDB::batch_start
2017-10-12 07:29:22.749                1        TRACE   blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:554  BlockchainLMDB::check_and_resize_for_batch
2017-10-12 07:29:22.749                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:555  [check_and_resize_for_batch] checking DB size
2017-10-12 07:29:22.749                1        TRACE   blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:503  BlockchainLMDB::need_resize
2017-10-12 07:29:22.751                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:519  DB map size:     1610612736
2017-10-12 07:29:22.751                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:520  Space used:      1230184448
2017-10-12 07:29:22.751                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:521  Space remaining: 380428288
2017-10-12 07:29:22.752                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:522  Size threshold:  0
2017-10-12 07:29:22.752                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:524  Percent used: 0.7638  Percent threshold: 0.8000
2017-10-12 07:29:22.752                1        INFO    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:543  Threshold met (percent-based)
2017-10-12 07:29:22.752                1        INFO    global  src/blockchain_db/lmdb/db_lmdb.cpp:579  [batch] DB resize needed
2017-10-12 07:29:22.752                1        TRACE   blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:435  BlockchainLMDB::do_resize
2017-10-12 07:29:22.756                1        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:73   Failed to set new mapsize: Value too large for defined data type

I could give the full log but it's size is 3 MB.

UPD: HA! I found almost the same issue 402. UPD2: my uname -a — SunOS <my hostname> 5.11 illumos-7c4ab494ff i86pc i386 i86pc Solaris Strange. Looks like my system is 32-bit...

moneromooo-monero commented 6 years ago

Could you actually retry the library change, but with a clean build, because cmake tends to miscache: remove all CMakeCache.txt in the monero tree first. I've found another project which does essentially the same thing, so it looks like the right way to do it.

diff --git a/external/unbound/configure_checks.cmake b/external/unbound/configure_checks.cmake
index 258f281..2acf556 100644
--- a/external/unbound/configure_checks.cmake
+++ b/external/unbound/configure_checks.cmake
@@ -49,6 +49,11 @@ if (WIN32)
     iphlpapi
     ws2_32)
 endif ()
+if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
+  set(CMAKE_REQUIRED_LIBRARIES
+    socket
+    nsl)
+endif ()

 check_function_exists(_beginthreadex HAVE__BEGINTHREADEX)
 check_function_exists(arc4random HAVE_ARC4RANDOM)
acid-jack commented 6 years ago

Remove all CMakeLists.txt? From all subdirs?

moneromooo-monero commented 6 years ago

No. Just the files I mentioned. Keep the CMakeLists.txt, they're needed.

acid-jack commented 6 years ago
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release ../.. && make
CMake Error: The source directory "/home/jack/bitmonero" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
*** Error code 1
make: Fatal error: Command failed for target `release-static'
moneromooo-monero commented 6 years ago

That looks like you removed CMakeLists.txt ?

acid-jack commented 6 years ago

Yes. I renamed root CMakeLists.txt

moneromooo-monero commented 6 years ago

Then don't. As I said, keep those, they're needed.

acid-jack commented 6 years ago

remove all CMakeCache.txt in the monero tree first So what did you mean? Which tree?