We just released version 0.6.0 of the Fortran package manager (fpm).
This release introduces a better visualization for the build output, the compiler output is only shown on error to keep the standard output clean for successful builds. Furthermore, fpm can now detect unused modules and avoids compiling modules that are not needed for an application, which improves the compilation speed with large dependencies like stdlib. Fpm can now also compile projects with a C main, i.e. it is now also a C package manager. A new command was added to remove build artifacts via the clean command, no need to manually delete the build directory anymore.
When creating a new project with fpm the author information are now taken from the git configuration to avoid using placeholders in the manifest. Also the new command for backfilling will work now when inside an existing fpm directory with fpm new . --backfill.
Plenty more improvements and bugfixes went into this release, thanks to eleven contributors sending patches for this release. Checkout the release notes:
I was curious, is there a way to specify the minimum version of fpm needed to build a project? I suspect this would be useful to detect if your fpm.toml can be used for with your from version.
Currently there is not. It could be useful to have a version constraint on fpm, this also means fpm must track at which point a new feature in the package manifest is introduced in some way. Otherwise we end up with a situation like in CMake, where you can add a minimum required version, but unless you actually build with the minimum version there is no way to know whether it actually works as expected (which is to be honest more harmful than not having such an option).
I have asked my sysadmins to update the fpm installation on our HPC cluster from 0.2.0 to 0.6.0 but they are facing some issues.
Their first choice was to use spack but they get an error āError: Package āfpmā not foundā. Iām not familiar with spack, is there a specific repository they should use?
Second attempt was use the bootstrapping install script from the GitHub repository, which I had successfully done for 0.5.0 on my local install. But that option is now giving an error āno commits present in branch āmasterāā. Same error with āfpm updateā from version 0.5.0. Iām thinking this might be due to the change in naming the default branch in git? If thatās the case is there any fix other than updating git? Or any suggestions on how to go forward?
Make sure ~/bin is on your PATH and if it isnāt add it by doing export PATH=~/bin:$PATH in your .bashrc or equivalent shell config file. Maybe Iām the unlucky one, but asking HPC sysadmins to do something has never led to any good in my life
I havenāt tried the prebuilt binaries, will check thanks. I guess theyāll need an install mechanism to automate the modules builds in the system. Not an expert in that domain really.
hi @lkedward. I am not sure, I cloned a fresh copy of the repository and launched the install script from there. At first sight it seems that same script you linked.
mkdir _scratch # make a scratch directory to use for the build
cd _scratch
wget https://raw.githubusercontent.com/urbanjost/index/main/bootstrap/fpm.F90
gfortran -o fpm fpm.F90
printenv PATH # show your PATH variable and pick a directory in your path to move the executable to
cp fpm ~/.local/bin # for example; or make and ~/bin as described as above
assume āprintenv SHELLā is bash (or fish, sh, ā¦) and that you have a recent version of gfortran.
That builds it from a single source file. If that does not work, what does
uname -a
gfortran --version
display; should build with ifort at a minimum as well.
PS:
I like to add the option ā-staticā to the compile, personally.
So Iāve double checked and I am actually using the the latest script. To add some details here is what Iām doing for the bootstraping:
git clone git@github.com:fortran-lang/fpm.git
cd fpm
./install.sh
And this is the output I get
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 892k 100 892k 0 0 1579k 0 --:--:-- --:--:-- --:--:-- 1579k
fpm.F90:3405:0:
path=adjustl(path//' ')
Warning: ā__builtin_memsetā: specified size 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
/tmp/ccfF6cY1.o: In function `__fpm_filesystem_MOD_get_temp_filename':
_tmp/fpm/build/bootstrap/fpm.F90:10050: warning: the use of `tempnam' is dangerous, better use `mkstemp'
fatal: your current branch 'master' does not have any commits yet
<ERROR>Error while retrieving commit information
STOP 1
thanks, I agree that this is a good method for the ~/.local/bin installation.
More in general, here Iām looking for a mechanism that allows easy software updates without the need of having to know how to compile fortran code or think about compiler flags. That is just because the use case is on a cluster managed through users submitting tickets and the admins might not know any fortran and might have very different levels of experience with building fortran applications.
Ideally spack would be the best in our case because I believe thatās the package manager generally used for most of the system modules. Bootstrapping already requires more experienced admins to get involved and makes the update slower (and team mates less likely to request it choosing the least resistance path and just going for a local install that then does not allow sharing tools within the teams).
FWIW we have only managed to build a system module for fpm from the pre-built binaries but not to solve that error or use spack.
The updated user experience looks very good and to people used to spend time building with Makefiles for small projects seeing this for the first time looked like magic.
Thanks for the extra info, it looks like the bootstrapping script is working, but fpm is then failing to fetch itās own dependencies. This may be a bug with fpm and older versions of Git perhaps?
With your fpm system module, are you able to compile fpm projects that have dependencies?
I thought so too at first, but Iāve managed to run the bootstrapping script successfully on an ubuntu docker environment with an even older version of git.
Yes I am able to add stdlib as a dependency and build the project with the module based on the compiled binaries.
And now I just tested again the bootstrapping is now working, but my version of git has not changed. Assuming nothing has changed in the dependencies themselves I can only imagine that there was something broken with my system (git installation?) which has been fixed in the meanwhile.
Being curious about fpm I went to fpm Ā· GitHub Topics Ā· GitHub and clicked on fortran-lang/fpm ā fmp ā README ā download which got me to Fpm version 0.6.0 but then what was I supposed to do? Nothing I could see there seemed to be helping newbies like me download it.