I am trying to install solc v0.4.25 through brew on a Mac. Please note that I was able to install its latest version solc v.0.5.0 using brew install solidity; but I am unable to install its previous version using:
brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/9599ce8371d9de039988f89ed577460e58a0f56a/solidity.rb
Please note that I have done sudo mv /opt/local ~/macports. Is there any alternative way to install solc v0.4.25, which is a previous version.
[Q] How could I overcome this error?
$ brew unlink solidity
$ brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/9599ce8371d9de039988f89ed577460e58a0f56a/solidity.rb
######################################################################## 100.0%
Warning: solidity 0.5.0 is available and more recent than version 0.4.24.
==> Downloading https://github.com/ethereum/solidity/releases/download/v0.4.24/solidity_0.4.24.tar.gz
Already downloaded: /Users/alper/Library/Caches/Homebrew/downloads/901e9d034f6a2c114bcf56b7d1d3c73cc05b1890a43928baf3706ebddc1ca66f--solidity_0.4.24.tar.gz
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/l
==> make install
Last 15 lines from /Users/alper/Library/Logs/Homebrew/solidity/02.make:
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:792:5: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
basic_string(size_type __n, _CharT __c, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:796:5: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:793:5: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos, size_type __n,
^
2 errors generated.
make[2]: *** [libevmasm/CMakeFiles/evmasm.dir/Assembly.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [libevmasm/CMakeFiles/evmasm.dir/all] Error 2
make: *** [all] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You have MacPorts or Fink installed:
/sw/bin/fink, /opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
@avatar-lavventura There seems to be an issue with homebrew (version of stdlibc++ / XCode commandline tools) during compilation for this particular version: https://github.com/ethereum/homebrew-ethereum/issues/191. So far we couldn't reproduce this and are lacking resources to properly support older versions in homebrew. Could you try to build 0.4.25 from source? That seems to be a workaround for this issue. Also, have you checked if one of those: https://github.com/ethereum/homebrew-ethereum#troubleshooting works?
@bit-shift: When I try to install from the source code I am getting following error:
$ mkdir build
$ cd build
$ cmake ..
$ make
Scanning dependencies of target solidity_BuildInfo.h
CMake Error at cmake/scripts/buildinfo.cmake:52 (message):
Unable to determine commit hash. Either compile from within git repository
or supply a file called commit_hash.txt
make[2]: *** [CMakeFiles/solidity_BuildInfo.h] Error 1
make[1]: *** [CMakeFiles/solidity_BuildInfo.h.dir/all] Error 2
make: *** [all] Error 2
Then I have tried to build it from solidity's git clone:
$ git clone https://github.com/ethereum/solidity.git
$ cd solidity
$ git pull origin v0.4.24
$ mkdir build && cd build
$ cmake ..
$ make
[ 0%] Built target solidity_BuildInfo.h
[ 4%] Built target jsoncpp-project
[ 9%] Built target devcore
[ 9%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/Assembly.cpp.o
/Users/alper/solidity/libevmasm/Assembly.cpp:267:74: error: no matching conversion for functional-style cast from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >')
createJsonValue("PUSH [tag]", i.location().start, i.location().end, string(i.data())));
^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:760:40: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::allocator_type' (aka 'const std::__1::allocator<char>') for 1st argument
_LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:767:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const std::__1::basic_string<char>' for 1st argument
basic_string(const basic_string& __str);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:772:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::basic_string<char>' for 1st argument
basic_string(basic_string&& __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:782:31: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const char *' for 1st argument
_LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:804:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__self_view' (aka 'basic_string_view<char, std::__1::char_traits<char> >') for 1st argument
basic_string(__self_view __sv);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:815:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'initializer_list<char>' for 1st argument
basic_string(initializer_list<_CharT> __il);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:800:9: note: candidate constructor template not viable: requires at least 3 arguments, but 1 was provided
basic_string(const _Tp& __t, size_type __pos, size_type __n,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:809:9: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
basic_string(_InputIterator __first, _InputIterator __last);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:812:9: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:757:31: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
_LIBCPP_INLINE_VISIBILITY basic_string()
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:768:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const basic_string& __str, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:780:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(basic_string&& __str, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:784:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const _CharT* __s, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:786:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const _CharT* __s, size_type __n);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:790:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(size_type __n, _CharT __c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:806:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(__self_view __sv, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:817:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:788:5: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:792:5: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
basic_string(size_type __n, _CharT __c, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:796:5: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:793:5: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos, size_type __n,
^
/Users/alper/solidity/libevmasm/Assembly.cpp:293:66: error: no matching conversion for functional-style cast from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >')
createJsonValue("tag", i.location().start, i.location().end, string(i.data())));
^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:760:40: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::allocator_type' (aka 'const std::__1::allocator<char>') for 1st argument
_LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:767:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const std::__1::basic_string<char>' for 1st argument
basic_string(const basic_string& __str);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:772:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::basic_string<char>' for 1st argument
basic_string(basic_string&& __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:782:31: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'const char *' for 1st argument
_LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:804:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__self_view' (aka 'basic_string_view<char, std::__1::char_traits<char> >') for 1st argument
basic_string(__self_view __sv);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:815:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number<boost::multiprecision::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >') to 'initializer_list<char>' for 1st argument
basic_string(initializer_list<_CharT> __il);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:800:9: note: candidate constructor template not viable: requires at least 3 arguments, but 1 was provided
basic_string(const _Tp& __t, size_type __pos, size_type __n,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:809:9: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
basic_string(_InputIterator __first, _InputIterator __last);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:812:9: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:757:31: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
_LIBCPP_INLINE_VISIBILITY basic_string()
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:768:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const basic_string& __str, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:780:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(basic_string&& __str, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:784:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const _CharT* __s, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:786:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(const _CharT* __s, size_type __n);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:790:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(size_type __n, _CharT __c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:806:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(__self_view __sv, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:817:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:788:5: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:792:5: note: candidate constructor not viable: requires 3 arguments, but 1 was provided
basic_string(size_type __n, _CharT __c, const _Allocator& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:796:5: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:793:5: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
basic_string(const basic_string& __str, size_type __pos, size_type __n,
^
2 errors generated.
make[2]: *** [libevmasm/CMakeFiles/evmasm.dir/Assembly.cpp.o] Error 1
make[1]: *** [libevmasm/CMakeFiles/evmasm.dir/all] Error 2
make: *** [all] Error 2
MacOS Mojave 10.14.1
Homebrew 1.8.4
xcode-select version 2354
same error.
/Users/jolestar/opensource/github.com/ethereum/solidity/libevmasm/Assembly.cpp:267:74: error: no matching conversion for functional-style cast from 'const dev::u256' (aka 'const number
createJsonValue("PUSH [tag]", i.location().start, i.location().end, string(i.data())));
^~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:760:40: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number
_LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:767:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number
basic_string(const basic_string& __str);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:772:5: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number
basic_string(basic_string&& __str)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:782:31: note: candidate constructor not viable: no known conversion from 'const dev::u256' (aka 'const number
_LIBCPP_INLINE_VISIBILITY basic_string(const _CharT __s);
@jolestar @avatar-lavventura Thank you a lot for reporting this again. We are currently evaluating a solution to this. Please feel free to join the discussion (https://github.com/ethereum/solidity/issues/5452) :)
https://github.com/ethereum/solidity/issues/5449#issuecomment-440019747
https://github.com/ethereum/solidity/issues/5449#issuecomment-442378730
the reason of the error above: boost-v1.68 is not supported.
see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230392
a solution for this is switch the boost version to another, like this:
brew switch brew switch boost 1.67.0_1
We are only supporting current versions on homebrew, so I'm closing this.
You can compile using either a different version of boost or from the solidity branch release-0.4.
Boost 1.67 does not compile either with the following error: "boost: "cxx11" is not a recognized standard". Here is a workaround by @redjade:
brew install https://gist.githubusercontent.com/redjade/44e43f2d728ac5d02ea8d9ed4a9c4040/raw/02795d2d2fa007c40861d4a28222c5c71b314a42/boost.rb
Once installed, solidity 0.4 will also install.
I wrote a tutorial post here to show how to install 0.4.25 using Homebrew:
https://medium.com/@zulhhandyplast/how-to-install-solidity-0-4-x-on-mac-using-homebrew-8dfadb244f5d
=> Is it possible to install 0.4.24 or maybe later version as well ? @zulhfreelancer
@avatar-lavventura I don't think so. Why you specifically need 0.4.24 though?
I am required to user 0.4.24 for using populus. Please see: https://github.com/ethereum/populus/issues/450#issuecomment-411283048 @zulhfreelancer
Most helpful comment
https://github.com/ethereum/solidity/issues/5449#issuecomment-440019747
https://github.com/ethereum/solidity/issues/5449#issuecomment-442378730
the reason of the error above: boost-v1.68 is not supported.
see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230392
a solution for this is switch the boost version to another, like this:
brew switch brew switch boost 1.67.0_1