/
profile.x86_64
127 lines (115 loc) · 5.1 KB
/
profile.x86_64
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
me=${BASH_SOURCE[0]//\//_}; me=${me//./_}; if [[ ${SOURCED[${me}]} == "yes" ]]; then return; else declare -A SOURCED; SOURCED[${me}]=yes; fi # Only load once
# Add /usr/bin, the avx2/avx512 bin paths and 3rd-party bin path to PATH as needed
# Then cleanup symlink paths
case ":${PATH:-}:" in
*:/usr/bin:*) ;;
*) PATH="/usr/bin${PATH:+:$PATH}" ;;
esac
if grep -q "flags.*:.* avx512bw" /proc/cpuinfo; then
case ":${PATH:-}:" in
*:/usr/bin/haswell/avx512_1:*) ;;
*) PATH="/usr/bin/haswell/avx512_1:/usr/bin/haswell:$PATH" ;;
esac
elif grep -q "flags.*:.* fma .* avx2" /proc/cpuinfo; then
case ":${PATH:-}:" in
*:/usr/bin/haswell:*) ;;
*) PATH="/usr/bin/haswell:$PATH" ;;
esac
fi
case ":${PATH:-}:" in
*:/usr/local/bin:*) ;;
*) PATH="/usr/local/bin:$PATH" ;;
esac
case ":${PATH:-}:" in
*:/opt/3rd-party/bin:*) ;;
*) PATH="$PATH:/opt/3rd-party/bin" ;;
esac
# Remove from beginning/end/middle of PATH
PATH="${PATH/#\/bin:}"
PATH="${PATH/%:\/bin}"
PATH="${PATH/:\/bin:/:}"
PATH="${PATH/#\/sbin:}"
PATH="${PATH/%:\/sbin}"
PATH="${PATH/:\/sbin:/:}"
PATH="${PATH/#\/usr\/sbin:}"
PATH="${PATH/%:\/usr\/sbin}"
PATH="${PATH/:\/usr\/sbin:/:}"
if [[ -x "/bin/vi" ]]; then
EDITOR="/usr/bin/vi" # needed for packages like cron
else
EDITOR="/usr/bin/nano" # needed for packages like cron
fi
test -z "$TERM" && TERM="xterm" # Basic terminal capab. For screen etc.
# Ensure the interactive terminal has rows and columns
if [ -n "$PS1" ] && tty > /dev/null; then # Only for interactive shells
tty_rows=$(stty size | cut -d' ' -f1)
tty_columns=$(stty size | cut -d' ' -f2)
if [ $((${tty_rows} + 0)) -le 0 -o $((${tty_columns} + 0)) -le 0 ]; then
[ -x /usr/bin/setterm ] && setterm --resize
# fail safe if size still not set
tty_rows=$(stty size | cut -d' ' -f1)
tty_columns=$(stty size | cut -d' ' -f2)
if [ $((${tty_rows} + 0)) -le 0 -o $((${tty_columns} + 0)) -le 0 ]; then
stty rows 24 columns 80
fi
fi
unset tty_rows tty_columns
fi
if [ ! -e /etc/localtime ]; then
TZ="UTC" # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html
# for an explanation of how to set this to your local timezone.
export TZ
fi
if [ -z "$PS1" ]; then
# works for bash and ash (no other shells known to be in use here)
PS1='\u@\h:\w\$ '
fi
CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now -Wl,-z,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mrelax-cmpxchg-loop -ffunction-sections "
FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now -Wl,-z,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,--enable-new-dtags -ffunction-sections"
FCFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now -Wl,-z,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,-sort-common -Wl,--enable-new-dtags "
CXXFLAGS="$CFLAGS -fvisibility-inlines-hidden -Wl,--enable-new-dtags -std=gnu++17"
export AR=gcc-ar
export RANLIB=gcc-ranlib
export NM=gcc-nm
export LA_VERSION="OpenBLAS"
export LA_LIBS=/usr/lib64/libopenblas.so.0
export LA_INCLUDE=/usr/include
export LA_PATH=/usr/lib64/
export MPI_CC=/usr/bin/mpicc
export MPI_LIBS=/usr/lib64/libmpi.so
export MPI_INCLUDE=/usr/include/
export MPI_PATH=/usr/lib64/
export MPI_VERSION=3.2
export THEANO_FLAGS='floatX=float32,openmp=true,gcc.cxxflags="-ftree-vectorize -mavx"'
export CC=gcc
export CXX=g++
export PYTHONIOENCODING=utf-8:surrogateescape
export GTK_IM_MODULE="ibus"
export JAVA_INCLUDE_PATH=/usr/lib/jvm/java-1.19.0/include
export QTWEBENGINE_DISABLE_SANDBOX=1
export LD_ORDERING_SCRIPT_MAP=/usr/share/clear/optimized-link-scripts/clear_ordering_map.ld
if [ -d /usr/share/defaults/etc/profile.d ]; then
for i in /usr/share/defaults/etc/profile.d/* ; do
. $i
done
unset i
fi
XDG_CONFIG_DIRS=/usr/share/xdg:/etc/xdg
XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share":/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/cache
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/* ; do
. $i
done
unset i
fi
if [ -e /etc/profile ]; then
. /etc/profile
fi
for langfile in /usr/share/defaults/etc/locale.conf /etc/locale.conf "$HOME/.i18n" ; do
[ -f $langfile ] && . $langfile
done
export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
export PATH PS1 EDITOR TERM CFLAGS CXXFLAGS FCFLAGS FFLAGS XDG_CONFIG_DIRS XDG_DATA_DIRS
umask 022