Skip to content

Commit

Permalink
[masa]: python SWIG tenatively appears to be enabled in masa. Current…
Browse files Browse the repository at this point in the history
…ly, build will fail if it is not available. #2932
  • Loading branch information
nicholasmalaya committed Jul 9, 2013
1 parent 8fd2c2c commit ef2876b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ AM_SANITY_CHECK
# swig
AM_PATH_PYTHON(2.3)
AC_PROG_SWIG(1.3.21)
SWIG_ENABLE_CXX
#SWIG_ENABLE_CXX
SWIG_ENABLE_C
SWIG_PYTHON

#---------------------------------------------
Expand Down
17 changes: 17 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ libmasa_la_SOURCES = $(cc_sources) $(h_sources)
libfmasa_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE)
libfmasa_la_SOURCES = masa.f90

#-----------------------
# MASA (SWIG) Python interface -- optional!
#-----------------------

BUILT_SOURCES += $(srcdir)/masa_wrap.c
SWIG_SOURCES=masa.i

pkgpython_PYTHON = masa.py
pkgpyexec_LTLIBRARIES = _your_extension.la
_your_extension_la_SOURCES = $(srcdir)/masa_wrap.c $(SWIG_SOURCES)
_your_extension_la_CFLAGS = $(SWIG_PYTHON_CFLAGS) -I$(top_srcdir)/src
_your_extension_la_LDFLAGS = -module
_your_extension_la_LIBADD = ../src/libmasa.la

$(srcdir)/masa_wrap.c : $(SWIG_SOURCES)
$(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -o $@ $<

#-----------------------
# Standalone binaries
#-----------------------
Expand Down
18 changes: 18 additions & 0 deletions src/masa.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SWIG declarations for building MASA module
// Notice the C and not the C++ API is wrapped
// See SWIG documentation at http://www.swig.org/

%module masa

// Verbatim #includes passed into C compilation
%{
#define SWIG_FILE_WITH_INIT
%}

%include "masa.h"


//
// nick and rhys
// 7/2/13
//

0 comments on commit ef2876b

Please sign in to comment.