Menu

#66 Need a way to pass option -C ... to iconc to set c compiler

open
None
5
2023-10-04
2021-11-16
No

I am using
iconc -C "gcc -O3 -march=native" prog.icn
for gcc-10 builds, with good results on a ryzen CPU.
(-O2 is terribly slow on gcc-10)
(-O3 was broken on older gcc)
unicon -C
does not let me do that AFAICT
how should this work?

FYI: with -O3 in CFLAGS, cobench hits 85M coswitches/s on a ryzen CPU

Discussion

  • Charles Evans

    Charles Evans - 2021-11-16

    ( optional, for recent gcc only, -march is not portable, -mtune=native should be )
    Makedefs:
    CFLAGS += -flto -O3 -march=native
    LDFLAGS += -flto -fuse-linker-plugin
    RANLIB = gcc-ranlib

    (iconc is not using CFLAGS or LDFLAGS, so)
    export iconcflags=" -flto -O3 -march=native -fuse-linker-plugin"
    iconc -C "gcc $iconcflags" cobench.icn

     
  • Charles Evans

    Charles Evans - 2021-11-17

    NOTE: -flto is causing iconc to spam warnings, #pragma ... ignored # is ignored.
    possibly related to:
    GCC Bugzilla – Bug 53431 C++ preprocessor ignores #pragma GCC diagnostic
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

     
    • Charles Evans

      Charles Evans - 2023-10-04

      fixed in gcc-13

       
  • Charles Evans

    Charles Evans - 2023-09-23

    bash workaround for unicon -C only:
    export ICONC=' iconc -p "'''$iconcflags"'"'
    unicon -C file -v9
    ^# cc now has the flags

     

Log in to post a comment.

MongoDB Logo MongoDB