randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 567 forks source link

MacOS Mojave: cannot compile #1745

Closed mouse07410 closed 5 years ago

mouse07410 commented 5 years ago

MacOS 10.14.1 Mojave, Xcode-10.1, Boost and other dependencies installed via Macports 2.5.4.

$ port installed boost
The following ports are currently installed:
  boost @1.66.0_3+no_single+no_static+python27+regex_match_extra (active)
$ ./configure.py --prefix=/opt/local --with-commoncrypto --with-os-features=security_framework,commoncrypto,getentropy --with-openssl --with-boost --with-lzma --with-bzip2 --with-zlib --with-sqlite3 --with-python-version=2.7 --with-sphinx --with-pdf --cc-abi-flags='-maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include'
   INFO: ./configure.py invoked with options "--prefix=/opt/local --with-commoncrypto --with-os-features=security_framework,commoncrypto,getentropy --with-openssl --with-boost --with-lzma --with-bzip2 --with-zlib --with-sqlite3 --with-python-version=2.7 --with-sphinx --with-pdf --cc-abi-flags=-maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include"
   INFO: Autodetected platform information: OS="Darwin" machine="x86_64" proc="i386"
   INFO: Guessing target OS is darwin (use --os to set)
   INFO: Guessing target processor is a x86_64 (use --cpu to set)
   INFO: Auto-detected compiler version 7.0
   INFO: Auto-detected compiler arch x86_64
   INFO: Target is clang:7.0-darwin-x86_64
   INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 pmull sha1_armv8 sha2_32_armv8 sm4_armv8
   INFO: Skipping (incompatible OS): proc_walk win32_stats
   INFO: Skipping (requires external dependency): bearssl tpm
   INFO: Using SIMD module simd_avx2
   INFO: Enabling use of external dependency boost
   INFO: Enabling use of external dependency bzip2
   INFO: Enabling use of external dependency commoncrypto
   INFO: Enabling use of external dependency lzma
   INFO: Enabling use of external dependency openssl
   INFO: Enabling use of external dependency sqlite3
   INFO: Enabling use of external dependency zlib
   INFO: Loading modules: adler32 aead aes aes_ni aes_ssse3 aont aria asn1 auto_rng base base32 base64 bcrypt bigint blake2 block blowfish boost bzip2 camellia cascade cast128 cast256 cbc cbc_mac ccm cecpq1 certstor_sql certstor_sqlite3 cfb chacha chacha20poly1305 chacha_avx2 chacha_rng chacha_simd32 checksum clmul clmul_ssse3 cmac codec_filt comb4p commoncrypto compression cpuid crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa dyn_load eax ec_group ecc_key ecdh ecdsa ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy fd_unix ffi filters fpe_fe1 gcm getentropy gmac gost_28147 gost_3410 gost_3411 hash hash_id hex hkdf hmac hmac_drbg hotp http_util idea idea_sse2 iso9796 kasumi kdf kdf1 kdf1_iso18033 kdf2 keccak keypair lion locking_allocator lzma mac mce mceies md4 md5 mdx_hash mem_pool mgf1 misty1 mode_pad modes mp newhope nist_keywrap noekeon noekeon_simd numbertheory ocb ofb openssl par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pgp_s2k pk_pad pkcs11 poly1305 poly_dbl prf_tls prf_x942 psk_db pubkey rc4 rdrand rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng rsa salsa20 scrypt seed serpent serpent_avx2 serpent_simd sessions_sql sessions_sqlite3 sha1 sha1_sse2 sha1_x86 sha2_32 sha2_32_bmi2 sha2_32_x86 sha2_64 sha3 shacal2 shacal2_simd shacal2_x86 shake shake_cipher simd simd_avx2 siphash siv skein sm2 sm3 sm4 socket sp800_108 sp800_56a sp800_56c sqlite3 srp6 stateful_rng stream streebog system_rng thread_utils threefish_512 threefish_512_avx2 tiger tls tls_cbc tss twofish utils uuid whirlpool x509 x919_mac xmss xtea xts zlib
   INFO: Defaulting to assuming little endian
   INFO: Using symlink to link files into build dir (use --link-method to change)
   INFO: Botan 2.9.0 (revision git:ebbc60c77ded99ddfd66dd8eff0c6d997cb4c4a4) (unreleased undated) build setup is complete

. . . . .
clang++ -fPIC -fvisibility=hidden -fstack-protector -m64 -pthread -stdlib=libc++ -maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4 -msse4.2 -Os -Ofast -I/opt/local/include -std=c++11 -D_REENTRANT -maes -mpclmul -msse2 -mssse3 -msse4 -msse4.2 -mrdseed -mrdrnd -mavx2 -mavx512f -std=gnu++17 -Os -Ofast -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual  -Ibuild/include -Ibuild/include/external -c src/lib/utils/socket/socket.cpp -o build/obj/lib/utils_socket.o
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
In file included from /opt/local/include/boost/asio/buffer.hpp:27:
In file included from /opt/local/include/boost/asio/detail/string_view.hpp:23:
/opt/local/libexec/llvm-7.0/include/c++/v1/experimental/string_view:11:2: error: "<experimental/string_view> has been removed. Use <string_view> instead."
#error "<experimental/string_view> has been removed. Use <string_view> instead."
 ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
In file included from /opt/local/include/boost/asio/buffer.hpp:27:
/opt/local/include/boost/asio/detail/string_view.hpp:32:12: error: no member named 'experimental' in namespace 'std'
using std::experimental::basic_string_view;
      ~~~~~^
/opt/local/include/boost/asio/detail/string_view.hpp:33:12: error: no member named 'experimental' in namespace 'std'
using std::experimental::string_view;
      ~~~~~^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
/opt/local/include/boost/asio/buffer.hpp:1489:5: error: no template named 'basic_string_view'; did you mean 'std::basic_string_view'?
    basic_string_view<Elem, Traits> data) BOOST_ASIO_NOEXCEPT
    ^~~~~~~~~~~~~~~~~
    std::basic_string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:194:28: note: 'std::basic_string_view' declared here
class _LIBCPP_TEMPLATE_VIS basic_string_view {
                           ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:23:
In file included from /opt/local/include/boost/asio/basic_datagram_socket.hpp:20:
In file included from /opt/local/include/boost/asio/basic_socket.hpp:40:
In file included from /opt/local/include/boost/asio/detail/reactive_socket_service.hpp:22:
/opt/local/include/boost/asio/buffer.hpp:1510:5: error: no template named 'basic_string_view'; did you mean 'std::basic_string_view'?
    basic_string_view<Elem, Traits> data,
    ^~~~~~~~~~~~~~~~~
    std::basic_string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:194:28: note: 'std::basic_string_view' declared here
class _LIBCPP_TEMPLATE_VIS basic_string_view {
                           ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
/opt/local/include/boost/asio/ip/address_v4.hpp:288:44: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address_v4 make_address_v4(string_view str);
                                           ^~~~~~~~~~~
                                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
/opt/local/include/boost/asio/ip/address_v4.hpp:295:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
In file included from /opt/local/include/boost/asio/ip/address_v4.hpp:328:
/opt/local/include/boost/asio/ip/impl/address_v4.ipp:193:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v4 make_address_v4(string_view str)
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:24:
In file included from /opt/local/include/boost/asio/ip/address_v4.hpp:328:
/opt/local/include/boost/asio/ip/impl/address_v4.ipp:198:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v4 make_address_v4(string_view str,
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
/opt/local/include/boost/asio/ip/address_v6.hpp:277:44: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address_v6 make_address_v6(string_view str);
                                           ^~~~~~~~~~~
                                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
/opt/local/include/boost/asio/ip/address_v6.hpp:284:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
In file included from /opt/local/include/boost/asio/ip/address_v6.hpp:335:
/opt/local/include/boost/asio/ip/impl/address_v6.ipp:309:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v6 make_address_v6(string_view str)
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:25:
In file included from /opt/local/include/boost/asio/ip/address_v6.hpp:335:
/opt/local/include/boost/asio/ip/impl/address_v6.ipp:314:28: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address_v6 make_address_v6(string_view str,
                           ^~~~~~~~~~~
                           std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
/opt/local/include/boost/asio/ip/address.hpp:218:38: error: unknown type name 'string_view'; did you mean 'std::string_view'?
BOOST_ASIO_DECL address make_address(string_view str);
                                     ^~~~~~~~~~~
                                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
/opt/local/include/boost/asio/ip/address.hpp:226:5: error: unknown type name 'string_view'; did you mean 'std::string_view'?
    string_view str, boost::system::error_code& ec);
    ^~~~~~~~~~~
    std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:259:
/opt/local/include/boost/asio/ip/impl/address.ipp:140:22: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address make_address(string_view str)
                     ^~~~~~~~~~~
                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:71:
In file included from /opt/local/include/boost/asio/ip/address.hpp:259:
/opt/local/include/boost/asio/ip/impl/address.ipp:145:22: error: unknown type name 'string_view'; did you mean 'std::string_view'?
address make_address(string_view str,
                     ^~~~~~~~~~~
                     std::string_view
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:80:
In file included from /opt/local/include/boost/asio/ip/basic_resolver.hpp:27:
In file included from /opt/local/include/boost/asio/ip/basic_resolver_iterator.hpp:27:
/opt/local/include/boost/asio/ip/basic_resolver_entry.hpp:54:7: error: no type named 'string_view' in namespace 'boost::asio'; did you mean 'std::string_view'?
      BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      std::string_view
/opt/local/include/boost/asio/detail/string_view.hpp:42:39: note: expanded from macro 'BOOST_ASIO_STRING_VIEW_PARAM'
# define BOOST_ASIO_STRING_VIEW_PARAM boost::asio::string_view
                                      ^~~~~~~~~~~~~
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
In file included from src/lib/utils/socket/socket.cpp:20:
In file included from /opt/local/include/boost/asio.hpp:80:
In file included from /opt/local/include/boost/asio/ip/basic_resolver.hpp:27:
In file included from /opt/local/include/boost/asio/ip/basic_resolver_iterator.hpp:27:
/opt/local/include/boost/asio/ip/basic_resolver_entry.hpp:54:42: error: no type named 'string_view' in namespace 'boost::asio'; did you mean 'std::string_view'?
      BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         std::string_view
/opt/local/include/boost/asio/detail/string_view.hpp:42:39: note: expanded from macro 'BOOST_ASIO_STRING_VIEW_PARAM'
# define BOOST_ASIO_STRING_VIEW_PARAM boost::asio::string_view
                                      ^~~~~~~~~~~~~
/opt/local/libexec/llvm-7.0/include/c++/v1/string_view:770:37: note: 'std::string_view' declared here
typedef basic_string_view<char>     string_view;
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [build/obj/lib/utils_socket.o] Error 1
$ 

Will update this issue, trying different compilers.

randombit commented 5 years ago

This seems to be an issue with boost.asio

mouse07410 commented 5 years ago

What are the options? Can I build Botan with Boost but disable boost::asio? Do I have to build without Boost at all? Or...?

randombit commented 5 years ago

Can I build Botan with Boost but disable boost::asio?

No, Boost is all or nothing.

Do I have to build without Boost at all?

Probably so. However, asio support is the main reason to enable Boost in the first place. The only other thing we use from Boost is filesystem library, and for Unix and Windows systems there are implementations using the native APIs when Boost is not available.

It looks like this was fixed a few weeks ago in asio https://github.com/chriskohlhoff/asio/commit/68df16d560c68944809bb2947360fe8035e9ae0a

mouse07410 commented 5 years ago

Thank you! I submitted the issue to Macports: https://trac.macports.org/ticket/57645#ticket

randombit commented 5 years ago

Closing as nothing actionable from our side here.

mouse07410 commented 5 years ago

Rebuilding/reinstalling Boost fixed this issue.