def build_code(source_code, options=[], skip=[], only=[], suffix=None,
module_name=None):
"""
Compile and import Fortran code using f2py.
"""
if suffix is None:
suffix = '.f'
fd, tmp_fn = tempfile.mkstemp(suffix=suffix)
os.write(fd, asbytes(source_code))
os.close(fd)
try:
return build_module([tmp_fn], options=options, skip=skip, only=only,
module_name=module_name)
finally:
os.unlink(tmp_fn)
#
# Check if compilers are available at all...
#
评论列表
文章目录