fortran-lang / stdlib

Fortran Standard Library
https://stdlib.fortran-lang.org
MIT License
1.08k stars 166 forks source link

Distribute library and module files? #640

Open Beliavsky opened 2 years ago

Beliavsky commented 2 years ago

To write a program that links to stdlib using gfortran on Windows, I only need libstdlib.a and .mod and .smod files, which take up less than 7 MB. I assume this is true for other platforms too. I suggest that binary distributions of stdlib on common platforms be made available that don't require the user to compile anything.

awvwgk commented 2 years ago

Binary distributions are available via conda-forge for Linux and MacOS. I also published a tutorial for packaging stdlib for Windows in https://fortran-lang.discourse.group/t/packaging-for-msys2/2005.

ivan-pi commented 2 years ago

The quickstart-fortran installer from @LKedward offers an extra utility to setup stdlib. I think that might be the easiest way on Windows. Perhaps making stdlib a default component of the installer would lower the barrier even further.

LKedward commented 2 years ago

Yep, that was my intention - to make it really easy to install on 'plain' Windows. (I'd probably say this is easier than downloading binaries and installing them manually to the right locations.)

Perhaps making stdlib a default component of the installer would lower the barrier even further.

Yes good point, but the reason I've set it up as a script currently is to make it easy to always get the latest version of stdlib without having to reinstall quickstart-fortran. You do still have to compile it, but the script takes care of everything for you, including installing, and it doesn't take that long to run. (After installing you can link stdlib with just -lstdlib or link = "stdlib" in fpm.)

ivan-pi commented 2 years ago

Understood. Given the young status of stdlib I agree that is the best solution.

Is their a place to let Windows users know about quickstart-fortran in the stdlib-repo, perhaps in a discussion (Show and Tell)?

LKedward commented 2 years ago

We could perhaps add it to the how-to install guide here.

I'm hoping to move quickstart-fortran to under fortran-lang on Github and perhaps also link to it from fortran-lang.org

kjelljorner commented 2 years ago

@awvwgk I'm a bit confused about how to use conda-forge-installed stdlib with fpm?

awvwgk commented 2 years ago

I'm a bit confused about how to use conda-forge-installed stdlib with fpm?

The conda-forge distribution is not targeted at fpm, but for CMake/meson/... based projects, As a source code package manager fpm will therefore use build-on-demand for accessing stdlib rather than discovering binary distributions.

For improving this I recommend to join on the discussions at the fpm repository, especially those for creating custom / local registries, which might provide a way to serve binary distributions with fpm.