-
Notifications
You must be signed in to change notification settings - Fork 173
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
packaging ecosystem experiment #44
Comments
@gronki thanks for taking part of our repositories by providing feedback and suggestions and ideas. Regarding the core of this issue, isn't this a duplicate of j3-fortran/fortran_proposals#55? If so, let's close it and move the discussion there? For the record, I think we need both a standard library, and a packaging ecosystem (like Python, Julia or Matlab has). These are orthogonal efforts. |
I wanted to make it a separate thread but I might as well continue in the other one. Whatever you decide. :) |
We can keep discussing here. Building upon what has been discussed at j3-fortran/fortran_proposals#55, what exactly is your proposal? Build a new source distribution? How will it differ from Spack? Build a new binary distribution? How will it differ from Conda? Or to contribute Fortran packages to either Spack or Conda together with any possible fixes for Spack/Conda to make them work better with Fortran? Or something like Pip or Cargo or the Julia package manager, which seem to be a mix of source and binary packages? The issue is that most Fortran codes depend on non-Fortran packages such as Lapack, FFTW and others, and so we have to package those also. |
Great idea, thanks Dominik. I agree with Ondrej it's an orthogonal effort to this (stdlib), but I do see it fitting as a separate project in fortran-lang, alongside stdlib. It's good to discuss it here. Stdlib wouldn't compete with packages provided by the package manager, it would be one of them. See how many packages there are just on GitHub: https://github.com/fortran-lang/stdlib/wiki/List-of-popular-open-source-Fortran-projects. From the surface, it does seem like Spack is the best candidate for this, though I haven't used it so I can't say from experience. From description of what it does, it seems most appropriate to me. |
Great! Each proposal issue is exactly there so that we can all say we want this in stdlib or we don't want this. This is such a young project (8 days I believe) that I didn't catch a breath to open some proposals for what I'd like to see in stdlib (but I will soon :)). Please join us! We need to hear from everybody what should stdlib look and act like, made by community, for the community. We don't have the answers yet and we're learning along the way. |
As I mentioned in j3-fortran/fortran_proposals#55, unfortunately Spack does not run on Windows, which is a deal breaker. However, Spack shows what it takes to make a successful source distribution --- it's not easy at all. However, Spack, Conda and similar solutions are general solutions that work for any language. I feel that there is still a need for a language specific solution (Pip, Cargo, Julia Pkg, ...). This is something that we have a chance of implementing. Here are some ideas:
We need to brainstorm all the details here. Let's take FFTW as an example. Our "tool" can have a package for FFTW, described as TOML. In the TOML description, we would list how to install the package using all backends that our "tool" supports, that is, it would look like this: [install]
conda="fftw"
apt-get="libfftw3-dev"
spack="fftw"
yum="..."
apk="..." and our "tool" would know how to use all these backends to install the package. On each platform the user would select a preferable backend, and our "tool" would know how to either install, or check that Summary of the idea: our "tool" can be a source distribution for pure Fortran packages, and it would piggy back on other general package managers for non-pure Fortran dependencies. Finally what about most of the codes at https://github.com/fortran-lang/stdlib/wiki/List-of-popular-open-source-Fortran-projects that have both non-pure Fortran dependencies and are themselves a non-pure Fortran package? I don't have an answer right now. Part of the answer is that those codes are typically end applications. If one has a complex Python based application (such as https://www.sagemath.org/), that will be hard to package as a pip package also. So end applications will have their own complicated build system and distribution. They could still use our "tool" to install and manage most of their dependencies, and our "tool" should make that easy. |
Windows is unfortunate, but Windows users can still install packages the "old way". To use the package manager, it is possible install one of the few popular linux distros using Windows Subsystem for Linux. We should make sure that the package system works with that. Actually my idea was exactly what @certik described: in the first and foremost step, it should be a tool allowing to manage dependencies. In the second step, it can be used to distribute small apps (in general, apps that can be easily encapsulated and packaged). The biggest packages will certainly be a challenge and at this point it's hard to predict all the issues that will come up. I would certainly prefer not reinventing the wheel and using one of the existing solutions. Writing our own tool would be possible but we will certainly make so many mistakes that others have already made I am not sure if we have human resources for this. Also, as I understand, If we decide to write our own tool, IMO the tool should be absolutely minimal in my opinion and only handle things that cannot be done in a different way. So generating Makefiles, package information etc should be the responsibility of the developer. Again, all about human resources and maintenance. I'm currently torn between the two (spack/conda vs own tool), let's wait for more voices. :) |
Re Windows: I am afraid the Windows Subsystem for Linux is not an acceptable solution --- some people cannot use it, and those will be left out. I think the right solution is to build and install natively. It's actually not that hard, and cmake has great support on Windows. One issue with Conda, being a binary package manager, is that it uses gfortran. So if you want to build with Intel Fortran, you are out of luck and you can't reuse any dependencies from Conda build with gfortran. Spack fixes this issue by allowing you to choose a compiler for all the dependencies. But it doesn't work on Windows. I personally just use Conda, as at least it works everywhere, even if with just one compiler. |
There is also the use case (not discussed above if I understand well) of having the packages already available. On HPC systems, packages are often available by loading the compiler environment or by using the module system. In that case, the "tool" should make sure that the libraries are found and compiled. Also, regarding build systems, I wrote on my experience with git and CMake here: http://pdebuyl.be/blog/2018/fortran-cmake-git.html I think it is relevant for packaging in the sense that it should cover all pure Fortran packages, as well as Fortran/C packages. |
I would like to move this forward. I think we have a sufficient community around stdlib now that we can pull this off. Here are my current ideas:
Who would have time to help me brainstorm some of these ideas in more detail and help me with coding and then especially testing? Here is some FAQ:
|
Here are some relevant blog posts about package management in Rust vs C++: https://blog.pierre.marijon.fr/why-i-stopped-c/ http://cliffle.com/blog/m4vga-in-rust/ I only used Rust as a user so far, not a developer, to compile some end applications. And the experience was very smooth. I think we can create something similar for Fortran. |
I'm in. I agree that Cargo is most like what we're looking for. Additional levels of complexity that we'll have over Cargo:
Should fpm (Fortran Package Manager) expect libraries to fit it, or should fpm adapt to different structures and build rules of projects? I think the latter -- more difficult to implement but it would allow us to have a larger ecosystem. Another consideration: should fpm require packages to maintain a "registry" file (yaml, toml or whatever we choose) or would the complete build rules be maintained solely on fpm end? Let's set some specs for the MVP. I suggest:
|
Here is what @milancurcic and I agreed on so far:
|
Ok, I've started playing with Rust, or to be specific, with Cargo, which is their build manager. Here is how to get an overview what it does: https://doc.rust-lang.org/cargo/guide/index.html and in particular, Cargo assumes this layout: https://doc.rust-lang.org/cargo/guide/project-layout.html and here are more details about it: https://doc.rust-lang.org/cargo/reference/manifest.html#the-project-layout And I suggest we do something very similar (if not exactly the same) for Fortran. Cargo pretty much figures out which files to build and which binaries and libraries and tests and examples all automatically, even for large projects. So I need more time to learn Cargo and get experience using it and also Rust itself, so that I can see how this can be adopted for Fortran. So I need some project to learn this, so I was thinking I'll implement a prototype for
So Python is out, because it's hard to create a single binary and to make it start and work quickly, as well as to distribute all the dependencies and ensure they work. I was going to use C++. But if the Rust prototype goes well, Rust would also work I think --- the advantage over C++ is that Rust has all the nice (easy to install!) packages to handle TOML, downloads, filesystem, etc. |
Requests: CMake generator selectionallow for different CMake generators that consumer of fpm packages can specify. E.g. Visual Studio, Ninja, GNU Make. With CMake >= 3.15, the end-user can set environment variable CMAKE_GENERATOR. Maybe CMake Generator could be an fpm command line option. allow non-CMake backendsSome major projects have switched away from autotools/make to meson/ninja. I think it would be good that even if CMake is the primary fpm choice, we don't make fpm so intertwined with CMake that fpm can't build non-CMake projects. This could be done a couple different ways, maybe even via CMake ExternalProject calling Meson. |
@scivision Yes, good and important point, Ondrej and I discussed this briefly. Eventually, CMake would be one of possible backends, and each could have their own backends (or.... generators? Confusing name IMO). The challenge, of course, would be to design fpm with the possibilities in mind. |
@certik +1 for Rust. Another potential candidate could be Go, which I hear is simple to learn and program and has great networking and system facilities built-in. I'll be happy to learn and participate in this project regardless of the implementation language. |
In addition to requirements for fpm that @certik listed, I think it's important to also consider further design and implementation requirements:
|
Yes, I need to look at Go more --- I used it a few times and I wasn't impressed with their dependency management. But as an implementation language for @scivision yes, it should be able to work any backend as you described. However, I want to point out, that just like Cargo works, So for already existing projects, they would have two options:
I am still figuring out how Cargo handles non-Rust parts, but it seems you are responsible for building them yourself (using any build system you want), and probably you specify how to link them in. |
@milancurcic here is a very minimal prototype: https://gitlab.com/certik/fpm. Can you try it out (see README) and let me know what you think? Let's discuss it and brainstorm some more. Overall, I must say I really like the Rust ecosystem, the package manager (Cargo) etc. There are libraries for anything that we would need. I would like exactly the same for Fortran. Regarding the Rust language itself, I think for what we need we don't seem to require any advanced features (such as the borrow checker) and so it's actually not difficult to learn. And the Rust compiler provides excellent error messages. |
Great! I'll play with it and let you know. |
@milancurcic once you have a look at it, I mainly need your feedback on:
If the answer is yes, then I suggest we create a new repository
|
I played with it. So far so good. I've also built a few Rust projects in the past so this experience was similar. A bit strange was that the test examples were included with the package manager, but I understand that this is a minimal proof of concept.
Yes! It will be a steep climb but I don't see why it wouldn't work from a technical point of view. Building a rich ecosystem is a different story but we need to start somewhere. Please go ahead and create fortran-lang/fpm. Let's discuss your specific questions/issues there. I have some ideas. |
Thanks for the review, I'll start a new repository.
Where would you include the tests if not in the repository? Testing will be essential to ensure fpm works in all cases.
…On Mon, Jan 13, 2020, at 7:40 PM, Milan Curcic wrote:
I played with it. So far so good. I've also built a few Rust projects
in the past so this experience was similar. A bit strange was that the
test examples were included with the package manager, but I understand
that this is a minimal proof of concept.
> can we make this work in general?
Yes! It will be a steep climb but I don't see why it wouldn't work from
a technical point of view. Building a rich ecosystem is a different
story but we need to start somewhere. Please go ahead and create
fortran-lang/fpm.
Let's discuss your specific questions/issues there. I have some ideas.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#44?email_source=notifications&email_token=AAAFAWAFBYCR2YH7VI565IDQ5UQZ7A5CNFSM4J6XR34KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI3B7IA#issuecomment-573972384>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAFAWBKL7QCRIZP62F7AYLQ5UQZ7ANCNFSM4J6XR34A>.
|
Here is the repository: https://github.com/fortran-lang/fpm. I moved from GitLab-CI to GitHub CI, for now only Linux and macOS is tested. Tests pass. Let's open issues in that repository and continue the discussion. |
Closing this in favor of fpm. :) |
Sorry if this post is irrelevant to this repo. I am posting here because I understand people here are mostly package maintainers, so I think it's the right recipients for this post. I can move away to not mess this place if this project takes off.
I just saw this repo for the first time and my first fear was "it is not going to work". Standard library in C, Python, IDL or other languages I had experience with would hold the most essential functions possible. Here half of the proposals or more are extremely particular features. The do not fit in stdlib. These proposals are awesome but more suitable for packaging ecosystem (that we discussed in the other repo) than an stdlib.
I am so happy that there is this movement because since I started using fortran I've felt frustration and I thought nobody shared it. Then I realized some people have the same issues and then founders of fortran-lang project have made the amazing effort to organize these chaotic movement into streamed and targeted action. Since it's Christmas time I wanted to express my thankfulness for this from the bottom of my heart.
I wanted to ask if anyone is willing to participate in a following experimental project.
How about we try to take a dozen of packages (each of us created or maintains at least one) and attempt to make an experimental packaging ecosystem that will hold all of them. So we use currently existing and mature tools (make, gcc, gfortran) just to make it work on one platform (I think it should be linux/unix because it's the easiest and free). If that takes off and we reach the critical mass, we might expand to cover all needs (Windows, other compilers).
I am willing to put my effort (as I have a bit of free time now), however I have had no experience with packaging other than pypi and rpm (which is mostly binary packages). I know some people have mentioned they worked with some of source based packaging systems that could work for Fortran.
In this issue, instead of discussing whether it's a good idea or not, I would like to collect suggestions and advice of tools and solutions that would make it possible in the fastest time.
We need:
Again, despite my personal feels, I do not want to argue which of the solutions (stdlib vs packaging ecosystem) is superior. I just want to make a demostration working product in a short time.
The text was updated successfully, but these errors were encountered: