getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] Getfem python interface questions


From: LUK ShunTim
Subject: Re: [Getfem-users] Getfem python interface questions
Date: Sat, 22 Dec 2007 14:17:57 +0800
User-agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071008)

Julien Pommier wrote:
Hi ShunTim,

Well, you found a bug. I have commited a fix in the svn repository

http://svn.gna.org/viewcvs/getfem/trunk/getfem%2B%2B/interface/src/gf_mdbrick_set.cc?r2=2729&rev=2729&r1=2722&dir_pagestart=50

but of course, you can also cast the 1D array into a 2D array with one row, and
then the interface will be happy.

--
Julien

Hello Julien,

Thanks very much. It worked after the change.

BTW, I found that the python interface does not build if you don't have numarray in the usual place. (I had to compile my own numarray because the debian numarray package does seem to work with getfem.) I attached a patch to "setup.py.in" to allow configure to pick up the PYTHON_CPPFLAGS env variable so as to locate the custom installed python include directory. Feel free to do whatever you like with it. Just a hack to make things work for myself. :-)

Regards,
ST
--

--- setup.py.in.orig    2007-12-22 12:35:13.000000000 +0800
+++ setup.py.in 2007-12-22 13:49:08.000000000 +0800
@@ -6,6 +6,11 @@
 from distutils.core import setup, Extension
 import os
 
+### 20071222 - Strip leadin -I from @PYTHON_CPPFLAGS@
+include_python_cppflags = ["@PYTHON_CPPFLAGS@"]
+include_python_cppflags_dirs = [l[2:] for l in include_python_cppflags if 
l.startswith("-I")]
+###
+
 cclibopts = "../../../src/.libs/libgetfem.a".split()
 cclibopts += '@LIBS@'.split()
 
@@ -31,8 +36,17 @@
 #print "cclibopts=", cclibopts
 #print "libnames = ", libnames
 #print "libdirs = ", libdirs
+
+### 20071222 - Append include dir list from @PYTHON_CPPFLPAG@
+include_dirs_names = ['@address@hidden@']
+include_dirs_names = include_dirs_names + include_python_cppflags_dirs
+###
+
 getfemmod = Extension('_getfem',
-                      include_dirs = ['@address@hidden@'],
+                      ### 20071222 - Append include dir list from 
@PYTHON_CPPFLPAG@
+                      include_dirs = include_dirs_names,
+                      ###
+                      
                       libraries = libnames, 
#['getfemint','getfem','stdc++','m'],
                       library_dirs = libdirs, #['../src/.libs',
 #                                      '@GETFEM_STATICLIBS@'],

reply via email to

[Prev in Thread] Current Thread [Next in Thread]