Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How to run on Macintosh

2009-10-23
2013-05-28
  • Guyren G Howe
    Guyren G Howe
    2009-10-23

    If you download the Linux release and replace the contents of server/cyc/run/bin/run-cyc.sh with the below, it runs on at least Snow Leopard:

        #!/bin/bash
        #
        # $Id: run-cyc.sh 126951 2009-01-28 18:55:50Z tbrussea $
        # Assumes that java 1.5 or higher (1.6 or higher preferably) is in your path
       
        if ; then
          # we are inside the bin directory … moving one level up quietly
          cd ..
        else
          if ; then
             # this is the correct location, we are good
             :
          else
             echo "I do not think that CYC is installed here."
             exit -1
          fi
        fi
       
        if ; then
          CLASSPATH="lib/cyc.jar:lib/subl.jar:lib/junit.jar:resource:lib/ext:plugins"
        else
          CLASSPATH=
          PATH_ELEMENTS="lib/cyc.jar lib/subl.jar lib/junit.jar resource lib/ext plugins"
       
          for pathElement in ${PATH_ELEMENTS}; do
              canonicalElement=`readlink ${pathElement}`
              if test -z "${CLASSPATH}"; then
                 CLASSPATH=${canonicalElement}
              else
                 CLASSPATH=${CLASSPATH}:${canonicalElement}
              fi
          done
        fi
       
        echo CLASSPATH $CLASSPATH
       
        _JAVA_OPTIONS=
       
        # Add the following line to the JVM options to allow remote debugging
        # -agentlib:jdwp=transport=dt_socket,server=y,address=8888,suspend=n
       
       
        BIT_FLAG=
       
        if ; then
          java -d64 -Xmx5000m -version  > /dev/null 2>&1;
          if ; then
            echo "Running Solaris with 64 bit Java …."
            BIT_FLAG=-d64
            MIN_HEAP=5000m
            MAX_HEAP=8000m
            PERM_SIZE=256m
          else    # end 64-bit solaris
            echo "Running Solaris with 32 bit Java …"
            MIN_HEAP=1400m
            MAX_HEAP=1400m
            PERM_SIZE=128m
          fi
        else
          java -Xmx5000m -version > /dev/null 2>&1;
          if ; then
            echo "Running 64 bit Java …."
            MIN_HEAP=5000m
            MAX_HEAP=8000m
            PERM_SIZE=256m
          else
            echo "Running 32 bit Java …"
            MIN_HEAP=1400m
            MAX_HEAP=1400m
            PERM_SIZE=128m
          fi
        fi
       
        java $BIT_FLAG -server -Xms$MIN_HEAP -Xmx$MAX_HEAP -XX:MaxPermSize=$PERM_SIZE \
             -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:+UseFastAccessorMethods \
             -XX:-UseSpinning  -XX:PreBlockSpin=10  -XX:+UseParallelGC \
             -cp $CLASSPATH com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLMain \
             -f "(progn (load \"init/jrtl-release-init.lisp\")))" "$@"

     
  • Guyren G Howe
    Guyren G Howe
    2009-10-23

    That got munged. Need to at least replace " with double quotes. Can't see anywhere to post a file here, but I've contacted johndcyc about updating the release.

     
  • Guyren G Howe
    Guyren G Howe
    2009-10-23

    The new part is:

        if ; then
          CLASSPATH="lib/cyc.jar:lib/subl.jar:lib/junit.jar:resource:lib/ext:plugins"
        else

     
  • so, is this for real?  we can finally run on macintosh?  has anyone confirmed this?  does it work?  will somebody make an installer for this?

     
  • Guyren G Howe
    Guyren G Howe
    2010-06-05

    It's a Java app; all that's needed is the right launch script.

     
  • okay, so, like, "for n00bs", what are the step by step instructions?

     
  • Colm Kennedy
    Colm Kennedy
    2010-06-14

    i got Open Cyc running on osx snow leopard .  change the shell script to remove '/' to mark a continued line and put all that on the same line . run it in the 'server/cyc/run' directory .

     
  • I'm on snow leopard (10.6.4).
    The unique modification I've had to do is on opencyc-2.0/server/cyc/run/run-cyc.sh, where I've had to change:
        canonicalElement=`readlink -f ${pathElement}`
    into:
        canonicalElement=`stat -f "%N" ${pathElement}`
    … and that's all. (It seems there a problem with command readlink)

     
  • You can also install coreutils with brew which will give you the GNU version of readlink (greadlink).  Then you change the following in server/cyc/run/bin/run-cyc.sh

    if [ `uname -s` = "Darwin" ]; then
        READLINK="greadlink"
    else
        READLINK="readlink"
    fi
    CLASSPATH=
    PATH_ELEMENTS="lib/cyc.jar lib/subl.jar lib/junit.jar resource lib/ext plugins"
    for pathElement in ${PATH_ELEMENTS}; do
        canonicalElement=`${READLINK} -f ${pathElement}`