Installation Notes for Serpent on Mac OS X

Roger B. Dannenberg

There are two versions of serpent; one is a command line program and the other is a graphical interface program:
Serpent is currently released as an SVN repository and in three zip files (the "nnn" is the corresponding SVN version number):
The "win" and "mac" zip files contain compiled executables. The "src" zip file contains sources for all platforms. The SVN repository is described below in "Building From Sources."

Installing Compiled Programs

You should be able to simply download serpent64-mac-nnn.zip for your 64-bit Mac OS X machine, extract the executable and application bundle and run them without getting and compiling the sources, but you need to follow these instructions and run from the command line...

The executable and application bundle are serpent64 and wxserpent64.app.

Instructions:
  1. When you unzip the download, you will have a directory named serpent. Put this directory in your home directory. If it is on the desktop, move it to your home directory. (If you really want it on your desktop, that is OK, but you will have to adjust these instructions accordingly.)
  2. Your system must be able to find the executables. Move the executables to a personal directory of executables named ~/bin. The following commands can be used:
    mkdir ~/bin
    cd ~/serpent
    mv serpent64 wxserpent64.app ~/bin
  3. You also need a short script to execute wxserpent64 from within the application bundle, so create the file ~/bin/wxserpent64 with the following content; be sure to use your userid rather than "rbd":
  4. #!/bin/sh
    echo "running wxserpent64 with arguments $*"
    /Users/rbd/bin/wxserpent64.app/Contents/MacOS/wxserpent64 $*
  5. Make ~/bin/wxserpent64 executable as follows:
    chmod +x ~/bin/wxserpent64
  6. You then need to modify your ~/.profile to set your PATH and SERPENTPATH variables. Edit ~/.profile and append the following lines; be sure to use your userid rather than "rbd":
    export PATH=$PATH:/Users/rbd/bin
    export SERPENTPATH="/Users/rbd/serpent/lib:/Users/rbd/serpent/programs:/Users/rbd/serpent/wxslib"
  7. Close and reopen the terminal window to start a new shell.

Testing: Try these commands:

cd
serpent64
> print "hello world"
hello world
> exit()

  Try
wxserpent64 wxs_test.srp
to test wxserpent64 and see a variety of input controls. The screen will look something like this:
wxs_test.srp screen capture

Diagnosing Problems

If the installation does not behave as described above, the problem may be that your ~/.profile is not being loaded when you start a shell. You can check to see that SERPENTPATH is defined by typing (in a terminal window, of course):
echo $SERPENTPATH
If you do not see the long path string you created earlier, your export SERPENTPATH=... command is not being run in this shell. If you have a ~/.bash_profile file, it is probably taking priority over ~/.profile, and you should either move everything from .bash_profile to .profile and delete .bash_profile, or vice versa. You might want to add
echo "My .profile file has been loaded"
or something similar to your .profile and/or .bash_profile so that you can see what is being loaded when you start a terminal window.

Similarly, you should have your bin directory on your PATH. You can inspect the path with
echo $PATH

Building From Sources

If you want to build OS X versions from sources, get the "src" zip file. You can also get the very latest sources from SourceForge using SVN (subversion, a configuration management tool). The shell command to create a serpent directory (in the current directory) with the latest sources is:
svn checkout svn://svn.code.sf.net/p/serpent/code/trunk serpent
or, if you are a developer and plan to commit changes back to SourceForge,
svn checkout svn+ssh://rbd@svn.code.sf.net/p/serpent/code/trunk serpent
Important: If your serpent directory contains trunk, tags, and branches, check the code above and try again. For these instructions to work, all the repository files in trunk must be copied to the local working copy named serpent. E.g. you should have serpent/README.txt, serpent/32bit, and serpent/64bit. After you install liblo, you should have serpent/../liblo.

The source files can be built as follows:
Mac OS X (Ver. 10.9.5, gcc 4.2.1, wxWidgets 3.0.2, Xcode 6.2, CMake 3.5.2, MacOSX10.9.sdk)
#ifdef _LIBCPP_VERSION
// using libc++
#define HAVE_TYPE_TRAITS
// note: this was not the case when wxWidgets library was compiled!
#else
// using libstdc++
#define HAVE_TR1_TYPE_TRAITS
#endif
before the line
#if defined(HAVE_TYPE_TRAITS)
which is around line 25.