# setup.py

**URL:** <https://discourse.obspy.org/t/setup-py/233>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [November 7, 2013, 12:19pm UTC](https://discourse.obspy.org/t/setup-py/233 "2013-11-07T12:19:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Danecek1](https://discourse.obspy.org/user_avatar/discourse.obspy.org/peter_danecek1/32/1123_2.png) [@Peter\_Danecek1](https://discourse.obspy.org/u/Peter_Danecek1)\
**Post date:** [November 7, 2013, 12:19pm UTC](https://discourse.obspy.org/t/setup-py/233/1 "2013-11-07T12:19:09Z")

</div>

Hi all,  
I would like to use the new style `setup.py` file (master) with the release 0.8.4. I tried it something like one year back with some older version from f2py branch (not remembering the details). Now I am wondering if the current version from master would be compatible with the 0.8.4 release. I guess, there might be issues new features added (plugins) in master not available in 0.8.4.

Has anybody tried this? Or is there some new style setup.py version somewhere available in the repo, which would be compatible which with 0.8.4?

Thanks for any info!  
~petr

---

<div class="post-metadata">

**Author:** ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)\
**Post date:** [November 7, 2013, 1:17pm UTC](https://discourse.obspy.org/t/setup-py/233/2 "2013-11-07T13:17:52Z")

</div>

Hi again,

I guess it is possible with some effort. The relevant pull request:

> <https://github.com/obspy/obspy/pull/431>
>
> I moved obspy.taup from ctypes to f2py. This should get rid of quite a lot of co…mpilation problems related to obspy.taup.
> 
> In the course of the transition I also converted the existing setup.py to numpy.distutils. This results a sizable reduction of the amount of source code and the complexity of the setup.py as almost all hacks mainly related to Fortran are no longer necessary. Furthermore the custom extension class has been removed from the setup.py script.
> 
> It is currently tested only on Linux so some more changes might be necessary to successfully run it on Windows and OSX.
> 
> One small issue remains: One temporary file needs to be created in the course of the setup. This is necessary to be able to have architecture specific library filenames. The natural place to put the temporary file would be the \`build/\` subdirectory. This works fine as long as it is installed from source. Installing it via \`pypi\` or other means, results in a different build directory. I could not find a reliable way to get the path of the build directory within the setup.py. As a consequence, currently a \`build/\` folder is created in the current working directory.

You could try to only use those commits on top of the releases branch and see what happens.

Is there any particular reason you want to do that? 0.8.4 installs mostly fine and otherwise you could just install the latest master I guess.

Cheers!

Lion

---

<div class="post-metadata">

**Author:** ![Peter\_Danecek1](https://discourse.obspy.org/user_avatar/discourse.obspy.org/peter_danecek1/32/1123_2.png) [@Peter\_Danecek1](https://discourse.obspy.org/u/Peter_Danecek1)\
**Post date:** [November 7, 2013, 4:22pm UTC](https://discourse.obspy.org/t/setup-py/233/3 "2013-11-07T16:22:36Z")

</div>

> Hi again,
> 
> I guess it is possible with some effort. The relevant pull request:  
> [Using numpy.distutils for the setup.py + f2py for obspy.taup by krischer · Pull Request #431 · obspy/obspy · GitHub](https://github.com/obspy/obspy/pull/431)

> You could try to only use those commits on top of the releases branch and see what happens.

Okay, will try around a bit.

> Is there any particular reason you want to do that? 0.8.4 installs mostly fine and otherwise you could just install the latest master I guess.

This is to fix a problem with Macports version of 0.8.4. The problem with libgfortran.

Ideally, I would just use gfortran for the link step as well, gfortran knows where to find its libgfortran. But I do not find a way to patch this in the "traditional" setup.py. Linking manually against the "correct" libgfortran it is not very difficult, but in the Portsfile it becomes ugly, as I need to care about as set of possible gcc versions and it should not hardcode anything. So it is not a trivial hack.

My hope is that the new style setup.py would do all correctly out of the box.

~petr
