Skip to content

Commit

Permalink
improved Mac install permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssandrews committed Feb 27, 2024
1 parent dbe75c1 commit fda0da1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Mac/README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This README file is for the Smoldyn distribution for Mac OS X.

This distribution contains pre-compiled Smoldyn software for running on standard Macs. It assumes that you have an Intel Mac running OS 10.6 or higher, that your system is configured in a typical way, and that you want the default Smoldyn installation.
This distribution contains pre-compiled Smoldyn software for running on standard Macs. It assumes that you have an M1 or Intel Mac running OS 10.9 or higher, that your system is configured in a typical way, and that you want the default Smoldyn installation.

To install Smoldyn, open your "Terminal" application, which is in your Applications/Utilities directory. Change directories to this download directory (probably type "cd Desktop/smoldyn-2.xx-mac", or something similar). Then type "sudo ./install.sh", and enter your computer password when prompted. If you get a warning about Python bindings not being installed, that's okay; just install pip at some point and re-run the install script. If you are asked whether you want the installer to update your environment PATH variable, you should generally say yes (enter 'y'). This will add the directory /usr/local/bin to the list of places where your computer will look for executable files, which means that it will find Smoldyn correctly. Next, test Smoldyn by typing "smoldyn examples/S1_intro/bounce3.txt". If it runs, congratulations, you have a successful Smoldyn installation! If not, see below.
To install Smoldyn, open your "Terminal" application, which is in your Applications/Utilities directory. Change directories to this download directory (probably type "cd Desktop/smoldyn-2.xx-mac", or something similar). Then type "./install.sh" and enter your computer password when prompted. If you get a warning about Python bindings not being installed, that's okay; just install pip at some point and re-run the install script. If you are asked whether you want the installer to update your environment PATH variable, you should generally say yes (enter 'y'). This will add the directory /usr/local/bin to the list of places where your computer will look for executable files, which means that it will find Smoldyn correctly. Next, test Smoldyn by typing "smoldyn examples/S1_intro/bounce3.txt". If it runs, congratulations, you have a successful Smoldyn installation! If not, see below.

Particularly useful files in the download directory:
SmoldynQuickGuide.pdf - a 2 page Smoldyn quick reference guide, in documentation directory
Expand Down
34 changes: 17 additions & 17 deletions Mac/install.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/bin/bash

echo "Installing Smoldyn"
mkdir -p /usr/local/bin
cp bin/smoldyn /usr/local/bin
chmod +x /usr/local/bin/smoldyn
cp -r bin/BioNetGen /usr/local/bin
chmod +x /usr/local/bin/BioNetGen/BNG2.pl
chmod +x /usr/local/bin/BioNetGen/Perl2
sudo mkdir -p /usr/local/bin
sudo cp bin/smoldyn /usr/local/bin
sudo chmod +x /usr/local/bin/smoldyn
sudo cp -r bin/BioNetGen /usr/local/bin
sudo chmod +x /usr/local/bin/BioNetGen/BNG2.pl
sudo chmod +x /usr/local/bin/BioNetGen/Perl2

echo "Installing SmolCrowd"
cp bin/SmolCrowd /usr/local/bin
chmod +x /usr/local/bin/SmolCrowd
sudo cp bin/SmolCrowd /usr/local/bin
sudo chmod +x /usr/local/bin/SmolCrowd

echo "Installing wrl2smol"
cp bin/wrl2smol /usr/local/bin
chmod +x /usr/local/bin/wrl2smol
sudo cp bin/wrl2smol /usr/local/bin
sudo chmod +x /usr/local/bin/wrl2smol

echo "Installing Libsmoldyn"
mkdir -p /usr/local/include
mkdir -p /usr/local/lib
cp include/libsmoldyn.h /usr/local/include
cp include/smoldyn.h /usr/local/include
cp include/smoldynconfigure.h /usr/local/include
cp lib/libsmoldyn_static.a /usr/local/lib
cp lib/libsmoldyn_shared.dylib /usr/local/lib
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib
sudo cp include/libsmoldyn.h /usr/local/include
sudo cp include/smoldyn.h /usr/local/include
sudo cp include/smoldynconfigure.h /usr/local/include
sudo cp lib/libsmoldyn_static.a /usr/local/lib
sudo cp lib/libsmoldyn_shared.dylib /usr/local/lib

echo "Installing Python bindings"
if command -v pip &> /dev/null; then
Expand Down
18 changes: 9 additions & 9 deletions Mac/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

echo "Uninstalling Smoldyn"
rm /usr/local/bin/smoldyn
rm -r /usr/local/bin/BioNetGen
sudo rm /usr/local/bin/smoldyn
sudo rm -r /usr/local/bin/BioNetGen

echo "Uninstalling SmolCrowd"
rm /usr/local/bin/SmolCrowd
sudo rm /usr/local/bin/SmolCrowd

echo "Uninstalling wrl2smol"
rm /usr/local/bin/wrl2smol
sudo rm /usr/local/bin/wrl2smol

echo "Uninstalling Libsmoldyn"
rm /usr/local/include/libsmoldyn.h
rm /usr/local/include/smoldyn.h
rm /usr/local/include/smoldynconfigure.h
rm /usr/local/lib/libsmoldyn_static.a
rm /usr/local/lib/libsmoldyn_shared.dylib
sudo rm /usr/local/include/libsmoldyn.h
sudo rm /usr/local/include/smoldyn.h
sudo rm /usr/local/include/smoldynconfigure.h
sudo rm /usr/local/lib/libsmoldyn_static.a
sudo rm /usr/local/lib/libsmoldyn_shared.dylib

echo "Uninstalling Python bindings"
if command -v pip &> /dev/null; then
Expand Down
Binary file modified docs/Smoldyn/SmoldynCodeDoc.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/Smoldyn/SmoldynCodeDoc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7067,6 +7067,8 @@ \subsection*{Modifications for version 2.73 (released 2/27/24)}
\item Added \ttt{PYTHON\_VERSION} as an option to the build, with new code in the master CMakeLists.txt file. Using this fixes the problem of building for one Python version and running a different one.
\item Fixed bug in cmdsetreactionratemolcount. It wasn't loading the species name correctly, leading to a non-functional command. I'm not sure why it wasn't caught earlier, but it wasn't.

\subsection*{Modifications for version 2.74 (not released yet)}
\item Changed Mac install and uninstall scripts so that individual commands use sudo, but the whole script does not. This is important because sudo should not be used with pip.

\end{itemize}

Expand Down

0 comments on commit fda0da1

Please sign in to comment.