Easy to make ufuncs from scalar Fortran function?
![](https://secure.gravatar.com/avatar/725a50eff7b51f36402b946bf786393e.jpg?s=120&d=mm&r=g)
Hello, Can anyone tell me if it is very difficult to make a numpy ufunc given a scalar function written in Fortran? I have read part of http://docs.scipy.org/doc/numpy/user/c-info.beyond-basics.html on creating ufuncs, is there anything else I should read? John
![](https://secure.gravatar.com/avatar/d38e806c24e18f78db6475c7f02ff7a0.jpg?s=120&d=mm&r=g)
John Salvatier skrev:
Can anyone tell me if it is very difficult to make a numpy ufunc given a scalar function written in Fortran? I have read part of http://docs.scipy.org/doc/numpy/user/c-info.beyond-basics.html on creating ufuncs, is there anything else I should read?
I have never created ufuncs, but as the docs you point to seem very c-oriented, I just wanted to make sure you know that calling fortran from c is not too complicated (at least with gnu compilers). If I would try, I would first wrap the fortran code in c, and then look at how to create ufuncs from c-code, but I have no idea how to do the second part. A page that seems rather informative and that was suggested by a google search on mixing c and fortran is <http://www.cae.tntech.edu/help/programming/mixed_languages>. I hope it helps a bit, although it does not answer your question. / johan
participants (2)
-
Johan Grönqvist
-
John Salvatier