Friday, January 24, 2014

How to install ctypes on mac

So when I was trying to install ctypes on mac I was getting this compile error:

clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from source/_ctypes.c:110:
build/temp.macosx-10.9-intel-2.7/libffi/include/ffi.h:161:3: error: unknown type name 'ffi_abi'
  ffi_abi abi;
build/temp.macosx-10.9-intel-2.7/libffi/include/ffi.h:183:3: error: unknown type name 'ffi_sarg'
  ffi_sarg  sint;
build/temp.macosx-10.9-intel-2.7/libffi/include/ffi.h:184:3: error: unknown type name 'ffi_arg'
  ffi_arg   uint;
build/temp.macosx-10.9-intel-2.7/libffi/include/ffi.h:267:4: error: unknown type name 'ffi_abi'
                        ffi_abi abi,
In file included from source/_ctypes.c:126:
source/ctypes.h:71:2: error: unknown type name 'ffi_closure'
        ffi_closure *pcl; /* the C callable */
source/_ctypes.c:162:21: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        parg->size = self->b_size;
                   ~ ~~~~~~^~~~~~
source/_ctypes.c:304:9: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
source/ctypes_dlfcn.h:19:24: note: expanded from macro 'ctypes_dlerror'
#define ctypes_dlerror dlerror
source/_ctypes.c:807:9: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        size = PyString_GET_SIZE(value);
             ~ ^~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:92:32: note: expanded from macro 'PyString_GET_SIZE'
#define PyString_GET_SIZE(op)  Py_SIZE(op)
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/object.h:116:56: note: expanded from macro 'Py_SIZE'
#define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
source/_ctypes.c:982:11: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        length = PyInt_AS_LONG(proto);
               ~ ^~~~~~~~~~~~~~~~~~~~

I fixed it by following the info on this thread:

Which says to go to line 167 in and comment out the




That fixed it so I could finish the install.

Wednesday, January 22, 2014

How to turn on spell check in the vi vim editor

I always forget to spell check in Latex coding projects when I am using vi or vim. You can enter this command while in a vim session:

:setlocal spell spelllang=en_us

Un-closable "Restore Windows" Message mac openOffice (FIX)

This was annoying and I waisted too long trying to figure this out so hopefully this helps someone.

So I was getting this OpenOffice pop-up box that I couldn't close and it was preventing me from using OpenOffice.

So I searched for this file:

find / -name "org.openoffice.script.savedState"

Then I did this:

rm -R "/Users/btaylor/Library/Saved Application State/org.openoffice.script.savedState"

Then I reopened OpenOffice and it was fixed (make sure it is closed completely before you begin)
This is the link that ended up helping me: