Showing posts with label f2py. Show all posts
Showing posts with label f2py. Show all posts

Tuesday, February 2, 2016

f2py gcc.exe: error: CreateProcess: No such file or directory

Again, for unclear reasons my f2py stopped working. Scripts that I could compile previously could not be compiled anymore. Without knowing why it stopped working, or why my proposed fix worked, I just wanted to let you know that I did to get f2py to work again on my windows x64 pc for python 2.7.


  • Upgrade to the latest Python version (for me 2.7.10 worked). Download and install:
  • Remove the old mingw version and download and install:
  • Open the system environment variables, remove old references to mingw, and add the '.../mingw/bin' path to your Path variable. For me that was "C:\Program Files\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin"
Optionally restart the pc or open a new DOS shell and run f2py. This worked for me.

Wednesday, February 6, 2013

F2PY on 64bit Windows (python2.7)

I am writing this post because after hours of frustration I want to share the solution that I found to get F2PY running on a 64 bit windows machine. Ok, here is how it worked out for me,...

If you have old python stuff on your computer, than entirely remove it and download and install components in the following order:

.) Python 2.7.3 Windows X86-64 Installer under http://www.python.org/getit/
.) numpy-unoptimized-1.6.2.win-amd64-py2.7.‌exe under http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

Then download and extract
.) mingw-w64 under http://sourceforge.net/projects/mingw-w64/
From the extracted directories copy mingw to your c:\mingw

After that, go to your environment variables (under System) and add
.) C:\Python27\Scripts
.) C:\mingw\bin 
to the PATH variable

Add also .py to the PATHEXT variable.


To use F2PY now write: 

f2py -c --fcompiler=gnu95 --compiler=mingw32 -m yourmodulename yourfortranfile

Important note:
I still got an error on my system saying:

"File "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\gnu.py", line 331, in get_libraries raise NotImplementedError("Only MS compiler supported with gfortran on win64") NotImplementedError: Only MS compiler supported with gfortran on win64"

I solved the problem absolutely randomly: 
I changed C:\Python27\Lib\site-packages\numpy\distutils\fcompiler\gnu.py line 331 to:

pass #raise NotImplementedError("Only MS compiler supported with gfortran on win64")

Basically I un commented the NotImplementedError and it worked fine!! GEZUZ!!

Monday, September 10, 2012

Patient-specific finite element simulation of radiofrequency ablation

Tetrahedral FE model for patient-specific simulation of radiofrequency ablation in the liver. The model geometry was generated based on patent-specific CT-image data. The image shows liver vasculature tumor, ablation probe, and surrounding bone structure.
Lets get this blog started with one of my favorite images of an python application (http://www.youtube.com/watch?v=jTXbjQ_6RWM) that I created to generate finite element (FE) models for simulation of radiofrequency ablation (RFA). The FE method is an established technique to solve the thermal-electrical differential equations for realistic RFA treatment simulation. Nevertheless, generation of patient-specific FE models is a labor intense task and requires use of multiple software tools. In order to overcome the challenges of modeling I generated a research tool as well as a workflow to generate patient-specific FE models for simulation of RF ablation efficiently. Common techniques of image processing and image meshing are combined with new approaches, such as interactive electrode placement, interfaces to commercial FE software programs including visualization of model results overlaid on imaging data. Such a tool may provide additional information for the treating physician for more effective pre-treatment planning of procedures. Via this tool, I was able to simulate RF ablation based on patient-specific geometry and visualize model results overlaid on CT imaging data. 
To create the application I used: