-
Notifications
You must be signed in to change notification settings - Fork 1
/
setupIntel.py
35 lines (27 loc) · 860 Bytes
/
setupIntel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy as np
from os import system
# compile the fortran modules without linking
fortran_mod_comp = '$FC gfunc.f90 -c -o gfunc.o -O3 -fPIC'
print(fortran_mod_comp)
system(fortran_mod_comp)
shared_obj_comp = '$FC pygfunc.f90 -c -o pygfunc.o -O3 -fPIC'
print(shared_obj_comp)
system(shared_obj_comp)
mes_extensions = Extension(
name="pygfunc",
sources=["pygfunc.pyx"],
#extra_compile_args=['-fPIC', '-O3'],
extra_link_args=['gfunc.o', 'pygfunc.o'],
library_dirs=["."],
libraries = [], # need to include gfortran as a library
include_dirs=[".",np.get_include()]
)
setup(
name="pygfunc",
version="0.1",
ext_modules=cythonize([mes_extensions])
)