# on windows:
# set VS90COMNTOOLS=%VS100COMNTOOLS%
# python setup.py build_ext --compiler=msvc

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import glob
from distutils.ccompiler import new_compiler

sources = glob.glob('../source/*.cpp')
sources.append('terran.pyx')

if new_compiler().compiler_type == 'msvc':
    compile_args = ['/openmp']
else:
    compile_args = ['-fopenmp']

ext_modules = [Extension('terran',
                        include_dirs = ['../include'],
                        language = 'c++',
                        sources = sources,
                        define_macros = [('TERRAN_BUILDING_SHARED_LIBRARY', '1')],
                        extra_compile_args=compile_args,
                        )]
                        
setup(
    name = 'TERRAN',
    cmdclass = {'build_ext': build_ext},
    ext_modules = ext_modules
)
@@ -404,16 +404,37 @@
 penmp'%5D%0A
+    link_args = %5B''%5D%0A
 else:%0A  
@@ -463,16 +463,47 @@
 penmp'%5D%0A
+    link_args = %5B'-lgomp'%5D%0A    
 %0Aext_mod
@@ -795,17 +795,19 @@
 ile_args
-=
+ = 
 compile_
@@ -812,16 +812,69 @@
 e_args,%0A
+                        extra_link_args = link_args,%0A
         

fix missing lgomp