Python calls C/fortran mixed dynamic link library--Previous

Source: Internet
Author: User
Tags python script

Content Description:

Using Python's ctypes and NumPy modules to invoke the finite element numerical calculation program of C/fortran mixed programming in a 32-bit or 64-bit Windows or gnu/linux system

Operating system and compilation environment:

32bit Win7 + mingw32 + gcc-4.8 + msys-1.0 + python2.7 + openblas-0.2.8

64bit Ubuntu 1404 + gcc-4.8 + python2.7 + openblas-0.2.8

Task decomposition:

1, packaging finite element numerical program, generate DLL or so format;

2. The Python script uses ctypes and numpy to define the input and output variables and invoke

Explanation:

A, why not f2py?

A: F2py project stagnation for many years, and F03, F08 standard Fortran and C programs can be seamlessly docking.

B, why use cTYPES?

A: cTYPES is a standard library that comes with Python, and Python itself is written in C.

C, why are there numpy?

Answer: NumPy's Ctypeslib module provides a simpler and more convenient way to call

?

?

Python calls C/fortran mixed dynamic link library--Previous

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.