simphony / simphony-openfoam

The implementation of the SimPhoNy OpenFOAM -wrappers.
GNU General Public License v2.0
2 stars 0 forks source link

binary extension package must be separated from the pure python one. #100

Open stefanoborini opened 7 years ago

stefanoborini commented 7 years ago

The build system currently is out of best practices. The reason is that the setup.py delegates to a install_foam_interface.sh that does compilation and installation of an unrelated package, including installing on the user's home directory.

To accommodate edm packaging this has to change.

  1. extension module and libraries must be in a separate repo and package, and packaged as a separate egg.
  2. simphony-openfoam becomes a purely python entity, with the binary extension as a dependency

Without this change, porting to EDM is pretty much impossible.

dpinte commented 7 years ago

@stefanoborini if you move the python install[1] call out of the sh script, you should be able to common.local_repo_to_edm_egg(".", name=xxx, version=xxx, build=xxx) on the openfoam-interface/internal-interface/wrapper directory and get an egg out of it.

[1] https://github.com/simphony/simphony-openfoam/blob/master/install_foam_interface.sh#L37

stefanoborini commented 7 years ago

@dpinte Not really, the setup.py install actually creates the extension. Also, I work under the assumption that one repo = one egg. I would have to generate two eggs here.

stefanoborini commented 7 years ago

Additionally, all those commands end up installing the .so files under my home directory. They should really be part of the resulting egg, but then openfoam needs to find them.

dpinte commented 7 years ago

@stefanoborini

stefanoborini commented 7 years ago

@dpinte

  1. yes, that is possible. Just not very elegant.
  2. there's a "version 2" of that module here https://github.com/simphony/buildrecipes-common/blob/master/buildcommons/__init__.py#L84 that builds from a local repo.
  3. I think it's wmake, but I would have to investigate further. In any case, I expect it will need some combing for the rpath.

That said, putting everything inside one egg feels like a hack. They are two separate modules. They are installed as separate modules, and they just live in the same repo. It would eventually make a bit more sense that at least the python extension is part of the current main setup.py, not of the other setup.py.

dpinte commented 7 years ago

@stefanoborini I am not suggesting to put everything into the same egg. I think we need to keep two eggs separated. Having to rebuild the openfoam extension when you make changes to the pure python code, would not make sense.

For the rpath, let's see what happens when packaged. I suspect it will work as expected.

dpinte commented 7 years ago

@stefanoborini now that #101 is merged, do we need to keep this open?

stefanoborini commented 7 years ago

@dpinte I still think it's kind of wrong to have that setup. #101 is a workaround.