aboutsummarylogtreecommitdiffstats
path: root/rice.sh.in
blob: b1923807deccb485b89fa10f10a2ab8c7b065417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/bash
#
#   rice.sh - Compile with extreme and unsafe optimization
#

[[ -n "$LIBMAKEPKG_BUILDENV_RICE_SH" ]] && return
LIBMAKEPKG_BUILDENV_RICE_SH=1

LIBRARY=${LIBRARY:-'@libmakepkgdir@'}

source "$LIBRARY/util/option.sh"

build_options+=('rice' 'rice-clang')
buildenv_functions+=('buildenv_rice')

buildenv_rice() {
    if check_buildoption "rice" "y" || check_buildoption "rice-clang" "y"; then
        riceflags=" -Ofast -fdata-sections -ffloat-store -fgcse-las -fgcse-sm -fmodulo-sched -fmodulo-sched-allow-regmoves -funsafe-math-optimizations -fno-threadsafe-statics -fomit-frame-pointer -fopenmp -fPIC -fshort-wchar -fvariable-expansion-in-unroller -Wno-sizeof-pointer-memaccess -pthread" #
        check_buildoption "rice" "y" && \
            riceflags+=" -fbranch-target-load-optimize2 -fcx-fortran-rules -fipa-pta -fno-enforce-eh-specs -fnothrow-opt -fno-var-tracking-assignments -freg-struct-return -freschedule-modulo-scheduled-loops -fsched-pressure -fsched-spec-load -fsched-spec-load-dangerous -fsched-stalled-insns=0 -fsched2-use-superblocks -fselective-scheduling -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftree-lrs -maccumulate-outgoing-args" # -fmerge-all-constants

        riceldflags=" -lpthread -lgomp" # -shared
        CFLAGS+="$riceflags"
        CXXFLAGS+="$riceflags"
        LDFLAGS+="$riceldflags"
    fi
}