Skip to content

fpm project with C source; Intel compilers on Windows #486

@ghost

Description

I was trying to build an fpm project with Intel compilers on Windows and was running into issue.

C:\Temp\test>fpm run --compiler ifort
 + mkdir build\dependencies
GNU ar (GNU Binutils) 2.36.1
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
 + mkdir build\ifort_FA91F1929995A164\test
 + ifort -c test\check.f90 /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl /traceback /Qcoarray:single /module:build\ifort_FA91F1929995A164\test /Ibuild\ifort_FA91F1929995A164\test  -o build\ifort_FA91F1929995A164\test\test_check.f90.o
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

 + icc -c .\.\src\csource.c -o build\ifort_FA91F1929995A164\test\src_csource.c.o
'icc' is not recognized as an internal or external command, operable program or batch file.
 Command failed
ERROR STOP

C source is src/csource.c

int func(void) { return 0;}

I would add an special case

case(id_intel_classic_windows)
    c_compiler = 'icl'

to https://github.com/fortran-lang/fpm/blob/master/src/fpm_compiler.f90#L341 and create a PR. But it wouldn't solve it, because icl syntax for 'compile-only, do not link', is icl /c file.c /Fofile.obj and that requires a change in https://github.com/fortran-lang/fpm/blob/master/src/fpm_backend.f90#L243. My understanding is that I should not add compiler specific flags to fpm_backend.f90.

[1] icl syntax: https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-setup/using-the-command-line/using-compiler-options.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions