Some time back, I began writing some OpenMPI wrappers for Lisp. I got everything that I needed working, but I hardly scratched the surface of what MPI-2 makes available.
Today, I have been working on getting his bindings up and running under Ubuntu Linux and Mac OS X.
So far, it has been a nightmare trying to get mpich2 compiled on either platform. It compiles famously if you just run
However, that doesn’t build shared libraries. Without shared libraries, the CFFI stub library happily links against the static library and happily imports zero of the symbols. After sifting through configure –help, I decided that I should add –enable-dynamiclibs. Doing so yells at me that I must also specify –enable-sharedlibs=type. So, I sifted through the help again and decided to try:
macosx% ./configure --prefix=/usr/local --enable-dynamiclibs --enable-sharedlibs=gcc-osx
Both compiles then bomb out saying MPIU_CALL_MPIDI_CH3 is undeclared. Yay.
Searching the web on the relevant errors, I discover that I do not need to enable dynamiclibs to get shared libraries. Wheee. Now, mpich2 is built on both architectures.
I added this target into cl-mpi/mpich2-stub/Makefile:
mpicc -dynamiclib -o libmpiskeleton.dylib -dylib mpiskeleton.o
and changed the bottom of cl-mpi/cl-mpi-configure.lisp to this:
(pushnew :mpich2 *features*) ; Use MPICH2
(defvar *mpi-header-file* "/usr/local/include/mpi.h")
;; For MPICH2, Need to load a special stub shared object, and not the MPICH s\
hared library directly
(defun load-mpi-foreign-libraries ()
After sorting out some svn merge problems in mpi-test.lisp, it appears as though it all works wonderfully on MacOSX. Most of it seems to work under Ubuntu for me, but I have to look into some error messages more closely.