Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active October 3, 2022 15:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zulhfreelancer/26daf8c04569d1cd98841ef8a4e8d948 to your computer and use it in GitHub Desktop.
Save zulhfreelancer/26daf8c04569d1cd98841ef8a4e8d948 to your computer and use it in GitHub Desktop.
How to install Solidity 0.4.x on Mac using Homebrew?
# Step 1 - Remove previous solc
$ brew uninstall solidity
Uninstalling /usr/local/Cellar/solidity/0.5.4... (6 files, 7MB)
# Step 2 - Make sure it's gone
$ which solc
solc not found
# Step 3 - Add the formula
$ brew install https://raw.githubusercontent.com/ethereum/homebrew-ethereum/master/solidity@4.rb
Updating Homebrew... # <----------------------- This process could take awhile
######################################################################## 100.0%
==> Installing dependencies for solidity@4: cmake, boost@1.60, openssl and sqlite
==> Installing solidity@4 dependency: cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.14.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring cmake-3.14.0.sierra.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> Summary
🍺 /usr/local/Cellar/cmake/3.14.0: 5,680 files, 54MB
==> Installing solidity@4 dependency: boost@1.60
==> Downloading https://homebrew.bintray.com/bottles/boost@1.60-1.60.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring boost@1.60-1.60.0.sierra.bottle.tar.gz
==> Caveats
boost@1.60 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
For compilers to find boost@1.60 you may need to set:
export LDFLAGS="-L/usr/local/opt/boost@1.60/lib"
export CPPFLAGS="-I/usr/local/opt/boost@1.60/include"
==> Summary
🍺 /usr/local/Cellar/boost@1.60/1.60.0: 11,140 files, 411.4MB
==> Installing solidity@4 dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2r.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2r.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2r: 1,795 files, 12.4MB
==> Installing solidity@4 dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.27.2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.27.2.sierra.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/sqlite/3.27.2: 11 files, 3.7MB
==> Installing solidity@4
==> Downloading https://github.com/ethereum/solidity/releases/download/v0.4.25/solidity_0.4.25.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/40892817/f5685400-b797-11e8-9630-d0694d11b507?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=
######################################################################## 100.0%
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/solidity@4/0.4.25 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FR
==> make install
🍺 /usr/local/Cellar/solidity@4/0.4.25: 6 files, 5.5MB, built in 7 minutes 23 seconds
==> Caveats
==> cmake
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/cmake
==> boost@1.60
boost@1.60 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
For compilers to find boost@1.60 you may need to set:
export LDFLAGS="-L/usr/local/opt/boost@1.60/lib"
export CPPFLAGS="-I/usr/local/opt/boost@1.60/include"
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
# Step 4 - Make sure it's now installed
$ which solc
/usr/local/bin/solc
# Step 5 - Check the newly installed version
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.25+commit.59dbf8f1.Darwin.appleclang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment