-
Notifications
You must be signed in to change notification settings - Fork 117
Improve cmake build #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cmake build #210
Conversation
f9ac54f
to
3255e9a
Compare
There is one unclear usage in this project. Why is there a separate shared and static target? How about using |
Signed-off-by: Cristian Le <cristian.le@mpsd.mog.de> Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
3255e9a
to
396bafb
Compare
Thanks @LecrisUT.
From cmake documentation, "If no type is given explicitly the type is STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is ON." Simply, I didn't know that. Can we build both? This change may affect to conda-forge build. Ping @jochym. |
How about running cmake twice with |
Yes, I think it is the solution. I will have a look into the detail of your PR. |
I think the build error now is of |
How can |
Anything that is Note Also I am working on a fix for the fedora repo (https://copr.fedorainfracloud.org/coprs/lecris/spglib/) |
c0dd433
to
4e7600b
Compare
Ok, I have the python api able to build and run, but there might be a few issues:
Otherwise let's try again the CI if things work |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
4e7600b
to
1095da4
Compare
Ok, I've updated |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
1095da4
to
084b45f
Compare
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Btw, I should clarify what's going on with this. I was able to replicate the failures of the CI that is reported there using the commands.
I was previously testing with I was considering the design (feel free to stop me and nudge me in a more sensible direction) so that you run cmake once and have the pip get the libraries from a pre-configured installation. I was thinking about this because of package managers would have |
|
I agree, it is difficult to find the information. About the parameters of Currently I don't yet understand what you really want to do. Could you give me some more information what you want to design? In the case of phonopy (https://github.com/phonopy/phonopy/blob/develop/setup.py), |
Ok, so let me clarify the scope of this PR since it evolved a bit:
There might be 2 ways to make the build work like this:
I would lean towards the second one because it would enable the user to use whichever setup it is currently installed on (e.g. if they used |
Can your configuration work for macOS and Windows? |
That's a good point, and I don't have a workspace to test those. If the CI had those, that would be great. For the cmake part, it should be perfectly ok, just the python one might need to specify for each os (e.g. |
Having CI for windows and macOS is great. Writing workflow takes time for me and needs some skill, so I hesitated to invest my time for it unless having strong motivation. |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Ok, I think I've fixed the build. I have tested with
|
- Bundle C++ library with python api - Remove editable mode from CI (does not include libraries otherwise) - Try to load C++ library and if fail use bundled version Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
I have switched this now to Can you check if I included the dependencies correctly, and if it would still work for PyPi distribution? |
@LecrisUT, thanks for your effort. How about not using cmake for python spglib? |
We probably need to add
|
Conda-force package of spglib is made in the other system, https://github.com/conda-forge/spglib-feedstock. Wheel package for pip install is build by another github workflow, https://github.com/spglib/spglib/blob/develop/.github/workflows/pypi-wheel-builds.yml using pypa/cibuildwheel. we have to take care of these, too, and they are not a very easy task. So though not very beautiful not to use cmake for building python package, in total, required effort for maintenance may be smaller. OpenMP support can be removed. |
Writing CI is always annoying and packaging is even more. My concern is if pypa/cibuildwheel which is used for spglib wheel build works properly or not. This can be tested using https://test.pypi.org/. Currently this is automatically triggered by pushing to rc branch of spglib repository. We can try if it is our direction. |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
I'm afraid that we would be kicking the can down the road. If we add/remove source code files, link to external libraries, etc., we would have to duplicate the build logic across these, if even realistically plausible. Although for the python api specifically, if we make sure that the api header is independent of build system, these should be compatible with any compiled environment (if possible we should check how it behaves when compiled with different compilers though). The latest one should fix all issues on this repo side and the I will check the conda forge you suggested and make an equivalent PR there: conda-forge/spglib-feedstock#82 |
I see. Is there any documentation update needed, for example, test and fortran make? |
I think I've documented most of it, but I found a few spaces I forgot |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Ok, I've done my best with the documentation. It should cover all aspects except ruby and documentation building that I did not touch. Let me know if any parts of it are unclear |
Codecov ReportBase: 85.34% // Head: 64.34% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #210 +/- ##
============================================
- Coverage 85.34% 64.34% -21.01%
============================================
Files 18 18
Lines 1358 1321 -37
============================================
- Hits 1159 850 -309
- Misses 199 471 +272
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Merged. Thanks @LecrisUT. I will try to make editable install possible. |
About that. It's technically possible, but not the scope of editable install. Afaiu, editable installs are for development allowing for live editing of the python code in place in the source folder. Its focus is on the pyrhon code so the dev would have to make sure the other environment is working properly like appropriate But if we want to make that part seamless too, just need to make sure Note that |
@LecrisUT, yes, I know you are correct. But I expect editable install working until alternative appears. |
This PR has evolved a bit over the implementation. Changes here are:
symspg
andspglib_f08
project
CMakeLists.txt
WITH_Fortran
,WITH_Python
andWITH_TESTS
Closes #208