Skip to content

Fails to compile with clang as C compiler #636

Closed
@awvwgk

Description

@awvwgk

The compile options set are not limited to the Fortran compiler but also applied to the C compiler in CMake, leading to build failures when using clang as C compiler, because the options set are specific for GFortran.

[61/429] Building C object src/tests/hash_functions/CMakeFiles/libc_hash.dir/nmhash_scalar.c.o
FAILED: src/tests/hash_functions/CMakeFiles/libc_hash.dir/nmhash_scalar.c.o 
$BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang -Dlibc_hash_EXPORTS  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/fortran_stdlib-0.2.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -O3 -DNDEBUG -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fPIC -fimplicit-none -ffree-line-length-132 -fno-range-check -Wall -Wextra -Wimplicit-procedure -pedantic-errors -std=f2018 -MD -MT src/tests/hash_functions/CMakeFiles/libc_hash.dir/nmhash_scalar.c.o -MF src/tests/hash_functions/CMakeFiles/libc_hash.dir/nmhash_scalar.c.o.d -o src/tests/hash_functions/CMakeFiles/libc_hash.dir/nmhash_scalar.c.o -c $SRC_DIR/src/tests/hash_functions/nmhash_scalar.c
clang-12: warning: argument unused during compilation: '-fimplicit-none' [-Wunused-command-line-argument]
clang-12: warning: argument unused during compilation: '-ffree-line-length-132' [-Wunused-command-line-argument]
clang-12: warning: argument unused during compilation: '-fno-range-check' [-Wunused-command-line-argument]
warning: unknown warning option '-Wimplicit-procedure'; did you mean '-Wimplicit-int'? [-Wunknown-warning-option]
error: invalid value 'f2018' in '-std=f2018'
note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard
note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard
note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard
note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard
note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard
note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard
note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard
note: use 'c17', 'iso9899:2017', 'c18', or 'iso9899:2018' for 'ISO C 2017' standard
note: use 'gnu17' or 'gnu18' for 'ISO C 2017 with GNU extensions' standard
note: use 'c2x' for 'Working Draft for ISO C2x' standard
note: use 'gnu2x' for 'Working Draft for ISO C2x with GNU extensions' standard

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbuild: cmakeIssue with stdlib's CMake build filescompiler: gfortranSpecific to GCC Fortran compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions