Can't compile bitcoin for SmartOS - recipe for target 'leveldb/util/leveldb_libleveldb_a-env_posix.o' failed #13585

issue stacepellegrino opened this issue on July 2, 2018
  1. stacepellegrino commented at 12:56 AM on July 2, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

    After fixing #13581 my build still fails with...

    leveldb/util/env_posix.cc: In member function 'virtual leveldb::Status leveldb::{anonymous}::PosixSequentialFile::Read(std::size_t, leveldb::Slice*, char*)':
    leveldb/util/env_posix.cc:105:51: error: 'fread_unlocked' was not declared in this scope
         size_t r = fread_unlocked(scratch, 1, n, file_);
                                                       ^
    leveldb/util/env_posix.cc: In member function 'virtual leveldb::Status leveldb::{anonymous}::PosixWritableFile::Append(const leveldb::Slice&)':
    leveldb/util/env_posix.cc:234:66: error: 'fwrite_unlocked' was not declared in this scope
         size_t r = fwrite_unlocked(data.data(), 1, data.size(), file_);
                                                                      ^
    leveldb/util/env_posix.cc: In member function 'virtual leveldb::Status leveldb::{anonymous}::PosixWritableFile::Flush()':
    leveldb/util/env_posix.cc:251:30: error: 'fflush_unlocked' was not declared in this scope
         if (fflush_unlocked(file_) != 0) {
                                  ^
    leveldb/util/env_posix.cc: In member function 'virtual leveldb::Status leveldb::{anonymous}::PosixWritableFile::Sync()':
    leveldb/util/env_posix.cc:290:30: error: 'fflush_unlocked' was not declared in this scope
         if (fflush_unlocked(file_) != 0 ||
                                  ^
    Makefile:5044: recipe for target 'leveldb/util/leveldb_libleveldb_a-env_posix.o' failed
    make[2]: *** [leveldb/util/leveldb_libleveldb_a-env_posix.o] Error 1
    make[2]: Leaving directory '/opt/local/src/bitcoin/src'
    Makefile:9824: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/opt/local/src/bitcoin/src'
    Makefile:757: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1
    
    
  2. stacepellegrino commented at 1:00 AM on July 2, 2018: none

    My compiler build details (POSIX threads enabled)...

    # g++ -v
    Using built-in specs.
    COLLECT_GCC=/opt/local/gcc49/bin/g++
    COLLECT_LTO_WRAPPER=/opt/local/gcc49/libexec/gcc/x86_64-sun-solaris2.11/4.9.3/lto-wrapper
    Target: x86_64-sun-solaris2.11
    Configured with: ../gcc-4.9.3/configure --enable-languages='c obj-c++ objc go fortran c++' --enable-shared --enable-long-long --with-local-prefix=/opt/local --enable-libssp --enable-threads=posix --with-boot-ldflags='-static-libstdc++ -static-libgcc -Wl,-R/opt/local/lib ' --disable-nls --with-gxx-include-dir=/opt/local/gcc49/include/c++/ --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/opt/local/bin/gas --prefix=/opt/local/gcc49 --build=x86_64-sun-solaris2.11 --host=x86_64-sun-solaris2.11 --infodir=/opt/local/gcc49/info --mandir=/opt/local/gcc49/man
    Thread model: posix
    gcc version 4.9.3 (GCC) 
    
  3. Empact commented at 2:44 AM on July 2, 2018: member

    @stacepellegrino Could you also try building leveldb master, and open this against them if it fails: https://github.com/google/leveldb/

  4. stacepellegrino commented at 6:23 AM on July 2, 2018: none

    leveldb requires cmake and the pre-build pkgsrc binaries distributed for SmartOS was under the version requirement. Howver, cloned latest cmake from GitHub and built the latest leveldb master without issue.

    NOTE: This is the relevant cmake output...

    
    ...
    [ 23%] Building CXX object CMakeFiles/leveldb.dir/util/env_posix.cc.o
    ...
    Scanning dependencies of target env_posix_test
    [ 28%] Building CXX object CMakeFiles/env_posix_test.dir/util/testharness.cc.o
    [ 28%] Building CXX object CMakeFiles/env_posix_test.dir/util/testutil.cc.o
    [ 29%] Building CXX object CMakeFiles/env_posix_test.dir/util/env_posix_test.cc.o
    [ 30%] Linking CXX executable env_posix_test
    [ 30%] Built target env_posix_test
    
    
    
  5. MarcoFalke commented at 6:59 PM on July 9, 2018: member
  6. Empact commented at 6:40 AM on July 10, 2018: member

    @stacepellegrino could you post the full log output including configure?

  7. stacepellegrino commented at 2:36 PM on July 10, 2018: none

    The original SmartOS build instance I had has now been destroyed. I had numerous other problems compiling other coins, e.g. Ethereum. I decided to use Linux instead of SmartOS for my blockchain daemons and data in the end. You can get SmartOS for free and install it under a Solaris configuration in VirtualBox to set-up a build environment to try and reproduce/fix this.

  8. Empact commented at 2:42 PM on July 10, 2018: member

    Yeah I tried and had many problems as well. Seems there are environment issues in the mix.

  9. Empact commented at 2:54 PM on July 10, 2018: member

    My current failure point, fwiw

    # ./configure --with-gui=no --disable-tests  --disable-wallet --disable-pic --disable-shared
    ...
    checking for boostlib >= 1.47.0... yes
    checking whether the Boost::System library is available... yes
    checking for exit in -lboost_system... yes
    checking whether the Boost::Filesystem library is available... no
    checking whether the Boost::Program_Options library is available... yes
    checking for exit in -lboost_program_options... yes
    checking whether the Boost::Thread library is available... no
    checking whether the Boost::Chrono library is available... yes
    checking for exit in -lboost_chrono... yes
    checking for mismatched boost c++11 scoped enums... ok
    configure: error: No working boost sleep implementation found.
    
    # pkgin search boost
    p5-Type-Tiny-XS-0.012  XS boost for some of Type::Tiny's type constraints
    boost-python-1.57.0 = Free, peer-reviewed portable C++ source libraries (Boost.Python binary library)
    boost-libs-1.57.0 =  Free, peer-reviewed portable C++ source libraries (binary libraries)
    boost-jam-1.57.0 =   Free, peer-reviewed portable C++ source libraries (Boost.Jam utility)
    boost-headers-1.57.0 = Free, peer-reviewed portable C++ source libraries (build-time headers)
    boost-docs-1.57.0 =  Free, peer-reviewed portable C++ source libraries (documentation)
    boost-build-1.57.0 = Free, peer-reviewed portable C++ source libraries (Boost.Build framework)
    boost-1.57.0 =       Free, peer-reviewed portable C++ source libraries
    
    =: package is installed and up-to-date
    <: package is installed but newer version is available
    >: installed package has a greater version than available package
    
  10. MarcoFalke commented at 2:59 PM on July 10, 2018: member

    You could try building from depends for now?

  11. Empact commented at 3:00 AM on July 11, 2018: member

    @MarcoFalke thanks for the suggestion! Output:

    [bitcoin/depends]# make
    Makefile:72: hosts/solaris2.11.mk: No such file or directory
    Makefile:74: builders/solaris2.11.mk: No such file or directory
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: line 1: Makefile: not found
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    /bin/sh: syntax error at line 1: `|' unexpected
    make: config.site.in: Command not found
    /bin/sh: syntax error at line 1: `|' unexpected
    make: config.site.in: Command not found
    /bin/sh: syntax error at line 1: `|' unexpected
    make: *** No rule to make target 'builders/solaris2.11.mk'.  Stop.
    
  12. theuni commented at 6:50 PM on July 13, 2018: member

    This should fix the leveldb build failure:

    diff --git a/configure.ac b/configure.ac
    index 95acd2bd86..19376f48c2 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -498,6 +498,9 @@ case $host in
        *netbsd*)
          LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
          ;;
    +   *solaris*)
    +     LEVELDB_TARGET_FLAGS="-DOS_SOLARIS"
    +     ;;
        *)
          OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
          AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.])
    

    @stacepellegrino If you can confirm the fix, I'll PR it.

  13. MarcoFalke commented at 7:38 PM on July 13, 2018: member

    Can confirm that bitcoind compiles on SmartOS with your patch. Didn't check anything else.

  14. theuni commented at 8:06 PM on July 13, 2018: member

    @MarcoFalke thanks!

  15. sipa closed this on Jul 14, 2018

  16. sipa referenced this in commit 90b1c7e5c5 on Jul 14, 2018
  17. PastaPastaPasta referenced this in commit 92a6550b4f on Jul 19, 2020
  18. PastaPastaPasta referenced this in commit db8327c2a8 on Jul 24, 2020
  19. PastaPastaPasta referenced this in commit a1c8cac741 on Jul 27, 2020
  20. UdjinM6 referenced this in commit e443c34ac1 on Jul 27, 2020
  21. UdjinM6 referenced this in commit 545d157d14 on Jul 27, 2020
  22. gades referenced this in commit 6ecfacd026 on Jun 26, 2021
  23. PastaPastaPasta referenced this in commit 727caa8d20 on Jun 27, 2021
  24. PastaPastaPasta referenced this in commit b8a2358812 on Jun 28, 2021
  25. PastaPastaPasta referenced this in commit 1aaa509013 on Jun 29, 2021
  26. DrahtBot locked this on Sep 8, 2021
  27. gades referenced this in commit f57fd8af69 on Mar 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me