CMake build from pip - #16
Conversation
|
I've uploaded the successful build to I've run |
|
So this looks like a nice improvement, it simplifies a few areas so I'm keen to merge it to develop and get a few testers to feed back. |
|
The version is now managed in import parametric_plasma_source as pps
print(pps.__version__)This needs to be updated at a minimum before new packages are published to Perhaps I can create a |
I can confirm this installs and works during transport. Also the pps.version helps |
shimwell
left a comment
There was a problem hiding this comment.
Thanks for adding that version info to the code on conduct. For anyone reading this, Dan an I have chatted offline about this PR
|
Latest updates should resolve build issues reported under #17. |
Needs work to get versions to automatically update.
Ensure pybind11 and cmake are installed prior to build Include CMakeLists.txt in package Manually set version
We're just packaging the source after all.
a62071d to
3cfd906
Compare
New name for Source abstract base class. Make sample method (and methods that it calls) const. Set library path and parameters as strings and pass into CustomSourceWrapper. Set external source via CustomSourceWrapper. Remove pugixml as a dependency.
Also provide a function to call it via Python.
Check that we can sample from a source via OpenMC.
|
Latest commits introduce tests for the OpenMC integration, which make use of the |
Checks that the build works outside of pip. Runs some simple regression tests on the C++ library. Checks that the library built with cmake can be imported in OpenMC.
|
Latest version includes tests for the cmake-only build, using the header-only version of |
|
Lots going on in this PR, tests pass and it looks like it is ready to merge if you are both happy @makeclean and @DanShort12 . Just wondering if #19 needs merging first? |
|
As this is just going into develop and not main, I keen to merge it and let users try the pypi test install that will generated by merging to develop. This should provide some useful user feedback prior without harming the main branch. I can merge this tomorrow midday if there are no objections |
|
Sounds good to me. @makeclean requested a few tweaks to add tests when building outside of PyPI, which I believe I've addressed. |
This PR addresses #13 by implementing the following changes:
cmaketo be configured appropriately for building the package when a user runspip install.CMakeLists.txt, the packaging is simplified by moving the source files into asrcdirectory and creating aCMakeLists.txtwithin the package. This allows the package to be built either locally by envokingcmake, locally by runningpip install .orpython setup.py install, or by remotely sourcing the package viapip install parametric-plasma-source.cmakeoutside ofgitrepo. The original build method relied on submodules to get dependencies. We now usefind_packageif we're outside of the repo, which allowssetuptoolsto build the package in a temp directory.buildpackage and apyproject.tomlfile to ensure the necessary dependencies are in place before we start the build. This in turn lets us installcmakeandpybind11as Python packages and use them in our package build to ensure they exist on the user's system.Closes #13