Is there / will there be a way to build the pure Fortran + curl fpm itself without needing to install Haskell first? Would this be doable at least via a Makefile or is there generated source for fpm itself?
(I would like to start using fpm across my Fortran projects as it seems Fortran submodules are/will be soon supported. I couldn't use fpm until Fortran submodules are supported.)
Yes, that is planned:
https://github.com/fortran-lang/fpm/issues/123
On Sat, Nov 7, 2020, at 4:36 PM, Michael Hirsch wrote:
Is there / will there be a way to build the pure Fortran + curl fpm
itself without needing to install Haskell first? Would this be doable
at least via a Makefile or is there generated source for fpm itself?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fortran-lang/fpm/issues/231, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAFAWBJTPDSMRWAPKVGJNTSOXKXTANCNFSM4TN6GDMA.
Bootstrapping fpm once with the Haskell version is currently required, but the Fortran fpm implementation should be able to bootstrap itself afterwards. We are working towards a first release and a way to provide binaries as a rolling release (https://github.com/fortran-lang/fpm/issues/218).
Yes, if you are ok with using an fpm binary as a starting point, then fpm will be able built itself eventually. The issue #123 is for bootstrapping from source from scratch.
If I understand correctly the end goal is to have the capability to build fpm from scratch with a Fortran compiler + CMake (among other methods). This would be great.
Yes, correct.
On Sun, Nov 8, 2020, at 12:13 PM, Michael Hirsch wrote:
If I understand correctly the end goal is to have the capability to
build fpm from scratch with a Fortran compiler + CMake (among other
methods). This would be great.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fortran-lang/fpm/issues/231#issuecomment-723652869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFAWB7CE2L4HKKTPR3OP3SO3UT3ANCNFSM4TN6GDMA.
Well, since the Fortran version does not have any C dependencies at this point it will actually build as a single Fortran file.
Long story short I wanted a version of #229 on a machine that just had a Fortran compiler and that I could build with the
debugger so I used an old "make" trick:
```bash#!/bin/bash
cd $(basename $0)
cat >gfortran <<\EOF
(
exec 2>&1
/usr/bin/gfortran "$@" 2>&1
) >/dev/null
NAME=$(echo $|xargs -n 1|grep '.f90$')
echo ============================================================
echo COMMAND "$@"
echo NAME $NAME
case "$NAME" in
'');;
test/);;
*)
echo cat $NAME >> catthem
;;
esac
EOF
echo '#!/bin/bash' >catthem
export PATH=pwd:$PATH
chmod u+xr gfortran
rm -rfv build
fpm build
mkdir -p _scratch
bash catthem >_scratch/ffpm.f90
(
cd _scratch
gfortran ffpm.f90 -o ../ffpm
)
rm gfortran
rm catthem
mv _scratch/ffpm.f90 .
rm -rf _scratch
exit
``
If you run that with the bootstrapfpmit makes a file calledffpm.f90that compiles just fine with a simplegfortran` compile.'.
It lets you try other compilers anduse a debugger on the code and other nice things for now. Would not commit to that being a long-term solution but it has been pretty handy lately. Maybe we could place the file out there as a simple way for some people to test the Alpha version without having to commit to much effort. Compile one file. Try it.
i changed the use statements to all use the module that defines toml_table as the quickest way to get rid of that Intel compiler message and updated M_CLI2 to use standard-conforming use of : and * in that one line. Wondering if anyone can try the single-file bootstrap version with anything other than gfortran 8.3.1-5 on a Red Hat 8.2
system. Particularly interested in gfortran 10 and non-gfortran compiles.
wget http://www.urbanjost.altervista.org/REMOVE/ffpm.f90
and just compile the single file and if it builds the theory is it should be able to bootstrap a pull of the fpm/fpm Fortran directory without having to install anything on a machine except gfortran and git.
@urbanjost I did a bit of testing with all my available compiler toolchains on three different machines (Manjaro, RedHat, OpenSuse).
GCC works nicely for me, tested 7.5, 8.4, 9.2, 10.1 and 10.2 so far. Intel is the same, compiles with 18.0, 19.0 and 19.1, but the resulting binary might be non-functional.
PGI doesn't work since toml-f cannot be compiled due to a bug in 20.7 and 20.9 of the NVHPC compilers (see https://github.com/toml-f/toml-f/issues/25). Also M_CLI2 triggers some PGI bugs, see https://github.com/urbanjost/M_CLI2/issues/2.
NAG fails on a logical formatter in M_CLI2 (see https://github.com/urbanjost/M_CLI2/issues/1), but toml-f seems to be fine.
I took a try at this. To make fpm build purely from CMake, I would need to add FetchContent (CMake feature) to retrieve and build toml-f and M_CLI2. The goal of this is to partially address #123 by making fpm build from nothing more than CMake and Fortran compiler, without needing bootstrap fpm. Would this be useful?
@scivision I'm sometimes building fpm with meson myself. So I'm certainly not against adding another build system (cmake/meson/...) to this repository as it makes some tasks way easier.
From #123 I suspect that a fpm dist --cmake command was intended for this purpose to generate a source distribution with additional CMake files. Until we are actually able to do this, another build system might be a suitable choice as well.
FetchContent seems to be the easiest way to get the dependencies with CMake, I'm using something similar right now for toml-f.
Most helpful comment
Well, since the Fortran version does not have any C dependencies at this point it will actually build as a single Fortran file.
Long story short I wanted a version of #229 on a machine that just had a Fortran compiler and that I could build with the
debugger so I used an old "make" trick:
```bash#!/bin/bash
cd $(basename $0)
cat >gfortran <<\EOF
!/bin/bash
(
exec 2>&1
/usr/bin/gfortran "$@" 2>&1
) >/dev/null
NAME=$(echo $|xargs -n 1|grep '.f90$')
echo ============================================================
echo COMMAND "$@"
echo NAME $NAME
case "$NAME" in
'');;
test/);;
*)
echo cat $NAME >> catthem
;;
esac
EOF
echo '#!/bin/bash' >catthem
export PATH=
pwd:$PATHchmod u+xr gfortran
rm -rfv build
fpm build
mkdir -p _scratch
bash catthem >_scratch/ffpm.f90
(
cd _scratch
gfortran ffpm.f90 -o ../ffpm
)
rm gfortran
rm catthem
mv _scratch/ffpm.f90 .
rm -rf _scratch
exit
``
If you run that with the bootstrapfpmit makes a file calledffpm.f90that compiles just fine with a simplegfortran` compile.'.It lets you try other compilers anduse a debugger on the code and other nice things for now. Would not commit to that being a long-term solution but it has been pretty handy lately. Maybe we could place the file out there as a simple way for some people to test the Alpha version without having to commit to much effort. Compile one file. Try it.