-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildenv
More file actions
146 lines (134 loc) · 4.82 KB
/
Copy pathbuildenv
File metadata and controls
146 lines (134 loc) · 4.82 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# bump: libomp-version /LIBOMP_VERSION="(.*)"/ https://github.com/llvm/llvm-project.git|semver:*
LIBOMP_VERSION="21.1.8"
###
### Build control file for the libomp port
###
###
### Required Environment Variables
###
export ZOPEN_CLEAN="skip"
export ZOPEN_BUILD_LINE="STABLE"
export ZOPEN_STABLE_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBOMP_VERSION}/openmp-${LIBOMP_VERSION}.src.tar.xz"
export ZOPEN_STABLE_DEPS="cmake make check_python"
export ZOPEN_CONFIGURE="cmake"
export ZOPEN_CONFIGURE_OPTS="-B ../build --install-prefix \$ZOPEN_INSTALL_DIR/ -DCMAKE_INSTALL_PREFIX=\$ZOPEN_INSTALL_DIR/ -DLIBOMP_ENABLE_SHARED=OFF -DCMAKE_ASM_COMPILER=/bin/as -DCMAKE_ASM_FLAGS="" -DLIBOMP_ARCHER_SUPPORT=FALSE -DLIBOMP_OMPT_SUPPORT=FALSE" # -DCMAKE_C_COMPILER=clang64 -DCMAKE_CXX_COMPILER=clang++64"
export ZOPEN_COMP=OPENXL
export ZOPEN_MAKE="make"
export ZOPEN_MAKE_OPTS="-C ../build"
export ZOPEN_CHECK_OPTS="-C ../build check-openmp"
export ZOPEN_INSTALL_OPTS="-C ../build install"
#export ZOPEN_CONFIGURE_MINIMAL="yes"
#export ZOPEN_MAKE_MINIMAL="yes"
export ZOPEN_EXTRA_CFLAGS="-mzos-sys-include=/usr/include" ## C compiler flags to append to CFLAGS (defaults to '').
export ZOPEN_EXTRA_CPPFLAGS="-D__XPLAT=1 -D_POSIX_C_SOURCE=200809L" ## C,C++ pre-processor flags to append to CPPFLAGS (defaults to '')
export ZOPEN_EXTRA_CXXFLAGS="-mzos-sys-include=/usr/include" ## C++ compiler flags to append to CXXFLAGS (defaults to '')
export ZOPEN_EXTRA_LDFLAGS="-mzos-hlq-le=CEE -mzos-hlq-clang=CEE" ## C,C++ linker flags to append to LDFLAGS (defaults to '')
###
### Build settings (Port type: BUILD, Build system: GNU Make)
###
### Optional Settings for GNU Make build system (Autotools)
#export ZOPEN_EXTRA_CONFIGURE_OPTS="-DLIBOMP_ENABLE_SHARED=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++" # Add any additional configure options here
#export ZOPEN_EXTRA_CFLAGS="-mzos-target=zosv2r5 -D_POSIX_C_SOURCE=200809L"
#export ZOPEN_EXTRA_CPPFLAGS="-mzos-target=zosv2r5 -D__XPLAT=1 -D_POSIX_C_SOURCE=200809L -O0"
###
### Required user-supplied functions
###
zopen_check_results() {
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
# Add logic to extract the test results here:
echo "actualFailures:0"
echo "totalTests:1"
echo "expectedFailures:0"
echo "expectedTotalTests:1"
}
zopen_get_version() {
echo $LIBOMP_VERSION # Modify to echo the version of your tool/library
}
###
### Custom Build Logic (if applicable)
###
# For libraries, this hook exports variables for other ports to use.
zopen_append_to_env() {
cat <<END
if [ ! -z "\$ZOPEN_IN_ZOPEN_BUILD" ]; then
export ZOPEN_EXTRA_CFLAGS="\${ZOPEN_EXTRA_CFLAGS} -fopenmp -I\${PWD}/include"
export ZOPEN_EXTRA_CXXFLAGS="\${ZOPEN_EXTRA_CXXFLAGS} -fopemp -I\${PWD}/include"
export ZOPEN_EXTRA_LDFLAGS="\${ZOPEN_EXTRA_LDFLAGS} -L\${PWD}/lib"
export ZOPEN_EXTRA_LIBS="\${ZOPEN_EXTRA_LIBS} -llibomp"
fi
END
}
###
### Optional User-Supplied Hooks (uncomment to use)
zopen_post_extract(){
if [ ! -d "cmake" ]; then
curl -L -o cmake-${LIBOMP_VERSION}.src.tar.xz \
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBOMP_VERSION}/cmake-${LIBOMP_VERSION}.src.tar.xz"
mkdir cmake
tar -xf cmake-${LIBOMP_VERSION}.src.tar.xz -C cmake --strip-components=1
rm cmake-${LIBOMP_VERSION}.src.tar.xz
fi
}
###
#zopen_append_to_env() {
# ## This function runs as part of generation of the .env file. The output of the
# ## function is appended to .env.
#}
#
#zopen_append_to_setup(){
# ## This function runs as part of generation of the setup.sh file. The output of
# ## the function is appended to setup.sh.
#}
#
#zopen_append_to_validate_install(){
# ## This function runs as part of generation of the install_test.sh file. The
# ## output of the function is appended to install_test.sh script.
#}
#
#zopen_install_caveats(){
# ## This function is run post install. All stdout messages are captured and
# ## added to the metadata.json as installation caveats.
#}
#
zopen_init(){
if [ ! -d "venv" ]; then
python3 -m venv venv
./venv/bin/pip install --upgrade pip
./venv/bin/pip install lit
fi
. venv/bin/activate
}
#
#zopen_post_buildenv(){
# ## This function runs after the 'buildenv' is processed.
#}
#
#zopen_pre_build(){
# ## This function runs before the 'make' step of the build is run.
#}
#
#zopen_pre_check(){
# ## This function runs before the 'check' step of the build is run.
#}
#
#zopen_pre_configure(){
# ## This function runs before the 'configure' step of the build is run.
#}
#
#zopen_pre_install(){
# ## This function runs before the 'install' step of the build is run.
#}
#
#zopen_post_install(){
# ## This function runs after the 'install' step of the build is run.
#}
#
#zopen_pre_patch(){
# ## This function runs before the 'patch' step of the build is run.
#}
#
#zopen_pre_terminate(){
# ## This function runs before 'zopen build' terminates.
#}