~nizamov-shawkat/python-meep/devel

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Nizamov Shawkat
  • Date: 2009-11-10 09:52:59 UTC
  • Revision ID: nizamov.shawkat@gmail.com-20091110095259-721br1mtx42jye2u
merging, step by step 

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
import sys,getopt
10
10
 
11
11
#User can specify an include directory with -I : this will be passed to SWIG. If no such parameter is specified, then -I/usr/include will be passed to SWIG
12
 
optlist, a = getopt.getopt(sys.argv[2:], 'I:',['all'])
13
 
 
14
 
includeDir = "/usr/include"
 
12
optlist, a = getopt.getopt(sys.argv[2:], 'I:L:',['all'])
 
13
 
 
14
 
 
15
libDir = "/usr/lib"
15
16
removeArg = -1
 
17
removeArg2 = -1
16
18
 
17
19
for opt in optlist:
18
20
    if (opt[0]=="-I"):
19
 
        includeDir = opt[1]
20
 
        c = 0
21
 
        for arg in sys.argv:
22
 
            if (arg[0:2]=="-I"):
23
 
                removeArg = c+2  # +2 because we omitted the 1st and 2nd argument in the beginning!
24
 
                break
 
21
    includeDir = opt[1]
 
22
    c = 0
 
23
    for arg in sys.argv:
 
24
        if (arg[0:2]=="-I"):
 
25
            removeArg = c+2  # +2 because we omitted the 1st and 2nd argument in the beginning!
 
26
    if (opt[0]=="-L"):
 
27
        libDir = opt[1]
 
28
        c = 0
 
29
    for arg in sys.argv:
 
30
            if (arg[0:2]=="-L"):
 
31
                removeArg2 = c+2  # +2 because we omitted the 1st and 2nd argument in the beginning!
25
32
 
26
33
if (removeArg >= 0):
27
 
        dummy = sys.argv.pop(removeArg)
28
 
                
 
34
    dummy = sys.argv.pop(removeArg)
 
35
if (removeArg2 >= 0):
 
36
    dummy = sys.argv.pop(removeArg2)
 
37
            
29
38
print "Directory for SWIG -I option : " , includeDir
30
 
 
31
 
#file_util.copy_file("python_meep_config-nonmpi.py","python_meep_config.py")
32
 
 
 
39
print "Directory for -L option : " , libDir
 
40
 
 
41
# file_util.copy_file("python_meep_config-nonmpi.py","python_meep_config.py")
 
42
# no need for such granularization
 
43
 
33
44
meep_swig = Extension ('_meep', ['meep.i'], 
34
45
        swig_opts=['-c++','-w503','-I'+includeDir],
35
 
        libraries = ['meep'])
 
46
        libraries = ['meep'],
 
47
        library_dirs=[libDir],
 
48
)
 
49
 
36
50
 
37
51
setup (name = 'python-meep',
38
 
       version = '0.6',
39
 
       author      = "Nizamov Shawkat (original author), Emmanuel Lambert (co-author from 08-2009 onwards)",
 
52
       version = '0.7',
 
53
       author      = "Nizamov Shawkat and Emmanuel Lambert",
40
54
       author_email = "http://launchpad.net/~python-meep/+contactuser",
41
55
       url = 'http://launchpad.net/~python-meep',
42
 
       description = """Python wrapper module for MEEP""",
 
56
       description = """Python wrapper module for MEEP FDTD""",
43
57
       ext_modules = [meep_swig],
44
58
       data_files=[(sysconfig.get_python_lib(1,0,""),['custom.hpp'])],
45
59
       py_modules = ["meep"],