{"id":1827,"date":"2022-07-01T18:17:32","date_gmt":"2022-07-01T09:17:32","guid":{"rendered":"https:\/\/mitsudo.net\/?p=1827"},"modified":"2025-01-03T18:24:35","modified_gmt":"2025-01-03T09:24:35","slug":"mac-homebrew-m1-mac","status":"publish","type":"post","link":"https:\/\/mitsudo.net\/en\/mac-homebrew-m1-mac\/","title":{"rendered":"Mac with Homebrew for Organic Chemists (Apple Silicon ver.)"},"content":{"rendered":"<h2>Let&#8217;s make an environment for chemistry on M1 Mac<\/h2>\n<p>A method is described to build a chemical environment on M1 Mac using Homebrew, a convenient package management system.<\/p>\n<p>For Intel Mac, see below:<\/p>\n<p><span style=\"font-size: 1.4rem;\">\r\n\t\t\t<div class=\"sitecard\">\r\n\t\t\t\t<div class=\"sitecard__subtitle\">\u95a2\u9023\u8a18\u4e8b<\/div>\r\n\t\t\t\t<div class=\"sitecard__contents\">\r\n\t\t\t\t\t<div class=\"heading heading-secondary\"><a href=\"https:\/\/mitsudo.net\/en\/mac-homebrew\/\" target=\"_blank\">Mac with Homebrew for Organic Chemists (for Intel Mac)<\/a><\/div>\r\n\t\t\t\t\t<p class=\"phrase phrase-tertiary\">Homebrew (A Package Manager for Mac)\r\nFor organic chemists, Homebrew is a very useful software, although it is not as es[\u2026]<\/p>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"eyecatch eyecatch-11\"><a class=\"eyecatch__link eyecatch__link-maskzoom\" href=\"https:\/\/mitsudo.net\/en\/mac-homebrew\/\" target=\"_blank\"><img decoding=\"async\" width=\"375\" height=\"232\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/mac-459196_1280-375x232.jpg\" class=\"attachment-icatch375 size-icatch375 wp-post-image\" alt=\"\" \/><\/a><\/div>\r\n\t\t\t<\/div><\/span><\/p>\n<h2>Homebrew (A Package Manager for Mac)<\/h2>\n<p><span>For organic chemists,\u00a0<\/span><strong>Homebrew<\/strong><span> is very useful software, although it is not as essential as\u00a0<\/span><strong>MS Office<\/strong><span>\u00a0or\u00a0<\/span><strong>ChemDraw<\/strong><span>.\u00a0<\/span><strong>Homebrew<\/strong><span>\u00a0is a package management system for Mac. Herein, I would like to explain how to build an environment on a Mac using Homebrew.<\/span><\/p>\n<ul>\n<li><strong>Homebrew<\/strong><br \/>\n<strong>Homebrew<\/strong><span>\u00a0is a package management system used from a terminal (software to type commands).\u00a0<\/span><span class=\"marker-halfPink\">You can easily install various UNIX-based software by<span>\u00a0<\/span><strong>Homebrew<\/strong><\/span><span>.<\/span><br \/>\n<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/1b98339dbb959f57f17ae2092bedbf97-300x197.png\" alt=\"\" width=\"300\" height=\"197\" class=\"alignnone wp-image-591 size-medium\" \/><\/li>\n<li><strong>iTerm2<\/strong><br \/>\n<strong>iTerm2<\/strong><span>\u00a0is a widely used terminal for Mac. It is more powerful than the standard terminal.\u00a0<\/span><strong>Homebrew<\/strong><span>\u00a0can be used from\u00a0<\/span><strong>iTerm2<\/strong><span>\u00a0(also from the standard terminal). It is useful to run Gaussian, python, etc. on a Mac and to connect to remote servers.<\/span><br \/>\n<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/ebd8530bc83a4c86731006d86c5c3532-300x106.png\" alt=\"\" width=\"300\" height=\"106\" class=\"alignnone wp-image-592 size-medium\" \/><\/li>\n<\/ul>\n<h2>Building an Environment with Homebrew<\/h2>\n<h3>Installation of Homebrew<\/h3>\n<p><strong>Homebrew<\/strong><span>\u00a0is installed from\u00a0<\/span><strong>Terminal<\/strong><span>\u00a0with commands.\u00a0<\/span><strong>Terminal<\/strong><span>\u00a0can be found in Launchpad.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2022\/03\/7aec63a53558eb4c6c4b7c783703602a.png\" alt=\"\" width=\"145\" height=\"148\" class=\"alignnone wp-image-1753 \" \/> \u00a0<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/cfb7f1192a2397f392a90493076962d3-150x150.png\" alt=\"\" width=\"150\" height=\"150\" class=\"alignnone wp-image-596 size-thumbnail\" \/><\/p>\n<p><span>Below is the\u00a0<\/span><strong>Terminal<\/strong><span>\u00a0screen. Type a command here to install\u00a0<\/span><strong>Homebrew<\/strong><span>.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2022\/03\/155b33242f048277a979ee6763bafc84.png\" alt=\"Terminal\" width=\"682\" height=\"483\" class=\"wp-image-1754 size-full\" \/><\/p>\n<p><span>First,\u00a0<\/span><span class=\"marker-halfPink\">before installing<span>\u00a0<\/span><strong>Homebrew<\/strong>,<span>\u00a0<\/span><strong>command line tools<\/strong><span>\u00a0<\/span>should be installed.<\/span><span>\u00a0Open\u00a0<\/span><strong>Terminal<\/strong><span>\u00a0and type the following command ($ is not included).\u00a0<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ xcode-select --install<\/code><\/pre>\n<\/div>\n<p><span>The command to install\u00a0<\/span><strong>Homebrew<\/strong><span>\u00a0changes occasionally, so check the Homebrew site (<\/span><a href=\"https:\/\/brew.sh\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/brew.sh\/<\/a><span>) and enter it in the terminal (as of July 1st, 2022, the following command is available. $ is not included). Enter your login password if required.<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ \/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/code><\/pre>\n<\/div>\n<p>The installation will take a while. After installation, you will be prompted to add the path to <strong>Homebrew<\/strong>. (On an Intel Mac, Homebrew is installed in <strong>\/usr\/local\/<\/strong>, but on an M1 Mac, it is installed in <strong>\/opt\/homebrew\/<\/strong>.)<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>echo 'eval \"$(\/opt\/homebrew\/bin\/brew shellenv)\"' &gt;&gt; \/Users\/<strong>&lt;User name&gt;<\/strong>\/.zprofile\r\neval \"$(\/opt\/homebrew\/bin\/brew shellenv)\"<\/code><\/pre>\n<\/div>\n<p>Once the path is specified, restart the <strong>Terminal<\/strong> once and execute the following command in the <strong>Terminal<\/strong>.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew doctor<\/code><\/pre>\n<\/div>\n<p>If you run it and there is no error, you have succeeded. It\u2019s a kind of strict check, so even if an error appears, it often works without any problem.<\/p>\n<h4 class=\"icon-pencil\">How to Use Homebrew<\/h4>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew update #update Homebrew\r\n$ brew upgrade #upgrade applications installed by Homebrew\r\n$ brew install hogehoge #command to install hogehoge<\/code><\/pre>\n<\/div>\n<p>It is better to run \u201c<strong>brew update<\/strong>\u201d and \u201c<strong>brew upgrade<\/strong>\u201d occasionally.<\/p>\n<h3>Installation of iTerm2<\/h3>\n<p>You can easily install iTerm2 by using the brew cask command.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask iterm2<\/code><\/pre>\n<\/div>\n<p>After the installation, commands are entered from <strong>iTerm2<\/strong>, not from <strong>Terminal<\/strong>.<\/p>\n<p><span>You can change the default color scheme of iTerm2 as you like. Change it from Color Presets in [Preferences]-[Profiles]-[Colors]. My setting is\u00a0<\/span><strong>Pastel<\/strong><span>\u00a0as you can see below.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/cf5edece10bd49e88a424b62812628c8.png\" alt=\"\" width=\"857\" height=\"614\" class=\"alignnone wp-image-613 size-full\" \/><\/p>\n<h3>Installation of gcc and etc.<\/h3>\n<p><span>Enter the following commands into\u00a0<\/span><strong>iTerm2<\/strong><span>\u00a0to install the gcc and other major programs.<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install vim coreutils wget gcc openssl<\/code><\/pre>\n<\/div>\n<h3>Setting for zsh<\/h3>\n<p>You can configure zsh by creating a <strong>.zshrc<\/strong> file in your home folder (<strong>\/Users\/&lt;username&gt;\/<\/strong>). Add the following to your <strong>.zshrc<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers language-bash\" data-lang=\"Zsh\"><code class=\" language-bash\" data-hcb-clip=\"7\"><span class=\"token comment\">#\u3000Aliases<\/span>\r\n<span class=\"token function\">alias<\/span> vi<span class=\"token operator\">=<\/span>vim<\/code><\/pre>\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code><\/code><\/pre>\n<\/div>\n<h3 id=\"outline_1__2_5\">Installation of Dropbox, Evernote, Google Chrome, Skitch by brew cask<\/h3>\n<p><span>With brew cask, you can easily install\u00a0<\/span><strong>Dropbox<\/strong><span>,\u00a0<\/span><strong>Evernote<\/strong><span>,\u00a0<\/span><strong>Google Chrome<\/strong><span>,\u00a0<\/span><strong>Skicth<\/strong><span>, etc. from the command line. You do not need to download each package at all.<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask dropbox evernote google-chrome skitch<\/code><\/pre>\n<\/div>\n<h3 id=\"outline_1__2_6\">Installation of VSCode by brew cask<\/h3>\n<p><span>You can also install VSCode, a cool text editor, with brew cask.<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask visual-studio-code<\/code><\/pre>\n<\/div>\n<h3>Installation of XQuartz<\/h3>\n<p><span>If\u00a0<\/span><strong>XQuartz<\/strong><span>\u00a0is not installed, some applications such as\u00a0<\/span><strong>Mercury<\/strong> and <strong>Platon<\/strong><span>\u00a0will not work. It is better to be installed on your Mac. You can easily install it with brew cask command.<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask xquartz<\/code><\/pre>\n<\/div>\n<h2 id=\"outline_1__3\">Installation of Other Software<\/h2>\n<p><span>The following software cannot be installed by\u00a0<\/span><strong>Homebrew<\/strong><span>, so you need to install them manually.<\/span><\/p>\n<ul>\n<li><strong>Microsoft Office<\/strong><\/li>\n<li><strong>ChemDraw<\/strong><\/li>\n<li><strong>Delta<\/strong><\/li>\n<li><strong>Mercury<br \/>\n<\/strong>Freeware for viewing cif files. You can download it from\u00a0<a href=\"https:\/\/www.ccdc.cam.ac.uk\/support-and-resources\/downloads\/\" target=\"_blank\" rel=\"noopener noreferrer\">The Cambridge Crystallographic Data Centre (CCDC)<\/a>.<\/li>\n<li><strong>Gaussian<\/strong> &amp; <strong>GaussView<\/strong><\/li>\n<li><strong>CYLView<\/strong><br \/>\n<span>Freeware for viewing and visualizing calculated chemical structures. You can download if from\u00a0<\/span><a href=\"https:\/\/www.cylview.org\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">cylview.org<\/a><span>.<\/span><\/li>\n<li><strong>Filezilla<\/strong><br \/>\nFilezilla, software for SFTP connection to remote servers, can be downloaded from the <a href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noopener\">Filezilla website<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s make an environment for chemistry on M1 Mac A method is described to build a chemical environment on M1 Mac using Homebrew, a convenient package management system. For Intel Mac, see below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":643,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/mitsudo.net\/?p=1752","footnotes":""},"categories":[26],"tags":[],"class_list":["post-1827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chem-with-mac","en-US"],"_links":{"self":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/1827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/comments?post=1827"}],"version-history":[{"count":5,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/1827\/revisions"}],"predecessor-version":[{"id":2354,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/1827\/revisions\/2354"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/media\/643"}],"wp:attachment":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/media?parent=1827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/categories?post=1827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/tags?post=1827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}