Help. Trying to build Quadpack2 with fpm

My system:
Fedora Linux 40
FPM: installed using snap. The executable is ‘fortran-fpm’
$>fortran-fpm --version
Version: 0.10.1, alpha
Program: fpm(1)
Description: A Fortran package manager and build system
Home Page: GitHub - fortran-lang/fpm: Fortran Package Manager (fpm)
License: MIT
OS Type: Linux

Just downloaded the zip pack of Quadpack2 from the GitHub repo:

Unzipped in directory quadpack-master. Entered the directory and, as per instructions:
$>fortran-fpm build --profile release

Got the following error message:

  • mkdir -p build/dependencies
    quadpack_double.F90 compiling…
    [ 0%] Compiling…:failed command gfortran -c ././src/quadpack_double.F90 -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -I././src -J build/gfortran_E4DE965427EE3A32 -Ibuild/gfortran_E4DE965427EE3A32 -o build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o>build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o.log 2>&1
    run:Invalid command line
    STOP 1

What I am doing wrong? This is the first time I’m using fpm to build a project.

Before running the fpm command is gfortran in your path? What does

  gfortran --version

produce? Add the --verbose option to the fpm(1) command and (hopefully) you will see an error message that unravels what went wrong if the compiler is installed.

Indeed it’s in the path:
$>gfortran --version
GNU Fortran (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$>fortran-fpm build --profile release --verbose

  • mkdir -p build/dependencies
    BUILD_NAME: build/gfortran
    COMPILER: gfortran
    C COMPILER: gcc
    CXX COMPILER: g++
    COMPILER OPTIONS: -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single
    C COMPILER OPTIONS:
    CXX COMPILER OPTIONS:
    LINKER OPTIONS:
    INCLUDE DIRECTORIES: [././src]
  • mkdir -p build/gfortran_D36B36D36CC46814
  • mkdir -p build/gfortran_E4DE965427EE3A32
    [ 0%] quadpack_double.F90
  • mkdir -p build/gfortran_E4DE965427EE3A32/quadpack/
  • gfortran -c ././src/quadpack_double.F90 -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -I././src -J build/gfortran_E4DE965427EE3A32 -Ibuild/gfortran_E4DE965427EE3A32 -o build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o

:failed command gfortran -c ././src/quadpack_double.F90 -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -I././src -J build/gfortran_E4DE965427EE3A32 -Ibuild/gfortran_E4DE965427EE3A32 -o build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o>build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o.log 2>&1
run:Invalid command line
STOP 1

After the build/* directories are created, running the full command
$> gfortran -c ././src/quadpack_double.F90 -O3 -funroll-loops -Wimplicit-interface -f
PIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -I././src -J bui
ld/gfortran_E4DE965427EE3A32 -Ibuild/gfortran_E4DE965427EE3A32 -o build/gfortran_E4DE965427EE3A32/quadpack/
src_quadpack_double.F90.o>build/gfortran_E4DE965427EE3A32/quadpack/src_quadpack_double.F90.o.log 2>&1

from the terminal seems to work. The object
src_quadpack_double.F90.o
is created.
The command seems to fail when issued during the execution of fpm.

You appear to be in some MSWindows environment, but it is not clear which variant (powershell, DOS shell, …). Without any other indications it seems the status returned to Fortran from calling the command is not zero. Did you build fpm(1) or pull down a binary? I am not sure how you tell the exit status of the command when you enter it outside of fpm but one question is whether the exit status is zero or not. Another is how you installed fpm(1) and what version it is. Using “fpm --version” shows the version. Sometimes an executable on Windows does not run in the same kind of environment as the shell it is launched with so the last line that shows the OS type fpm(1) thinks it is running in is important as well as the version number. A small test program calling EXECUTE_COMMAND_LINE(3f). You might want to start with building the standalone single-file fpm.F90 and trying that executable

I’m guessing something like that is the cause of the problem. I did not build fpm. I installed it via snap. That’s why the executable has the name “fortran-fpm”.
I guess I’ll have to remove the snap installation and build fpm locally.

Solved.
I indeed had to remove the snap install of fpm.
Then I used conda to install fpm, as instructed here:
https://fpm.fortran-lang.org/install/index.html#install
and managed to compile the quadpack2 source and create the modules and (static) library.
I also ran the tests with:
fpm test --profile release
again, the sources compiled and the tests ran. I got a bunch of numbers (with no explanation) for the single, double and extended precisions, so I guess the tests were successful.

Just one last question. If I want to compile the library using the OneAPI (ifx) compiler, where do I change in the config files?

You can add the --compiler ifx option to the fpm command. For more details, see the fpm --help command.