1
+ #! /bin/bash
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ # #####
14
+
15
+ if [[ ! -f $SDK_DIR /bin/java ]]; then
16
+ echo " Java not found"
17
+ exit -1
18
+ fi
19
+
20
+ echo " Using this Java SDK"
21
+ $SDK_DIR /bin/java -version
22
+
23
+ # HOME_DIR is the root of bumblebench
24
+ cd ../../
25
+ HOME_DIR=` pwd`
26
+
27
+ echo Using $HOME_DIR as bumblebench home directory.
28
+
29
+ rm -f ./* .o
30
+ rm -f ./* .so
31
+
32
+
33
+ CPP_DIR=" $HOME_DIR /net/adoptopenjdk/bumblebench/jni/c++/"
34
+ export INC_PATH=" -I$HOME_DIR -I$CPP_DIR -I$SDK_DIR /include/zos -I$SDK_DIR /include/ "
35
+
36
+ #
37
+ # Generate header files for our JNI Java class
38
+ #
39
+ $SDK_DIR /bin/javah net.adoptopenjdk.bumblebench.jni.CallOverheadTestcases
40
+
41
+
42
+ #
43
+ # Compile the C++ libraries
44
+ # Step 1. ascii->ebcdic conversion
45
+ #
46
+ #
47
+ cd $CPP_DIR
48
+
49
+ rm -f ./* .so
50
+ rm -f ./* .o
51
+ rm -f ./* .asmlist
52
+
53
+ CPP_FILES=` find . | grep ' \.cpp' | tr ' \n' ' ' `
54
+
55
+ if [[ ! -f " EBCDIC_DONE" ]]; then
56
+ iconv -fISO8859-1 -tIBM-1047 CallOverheadTestcases.cpp > CallOverheadTestcases.cpp-ebc
57
+ iconv -fISO8859-1 -tIBM-1047 Portal.h > Portal.h-ebc
58
+ rm -f Portal.h CallOverheadTestcases.cpp
59
+ mv Portal.h-ebc Portal.h
60
+ mv CallOverheadTestcases.cpp-ebc CallOverheadTestcases.cpp
61
+ touch EBCDIC_DONE
62
+ fi
63
+
64
+ mv $HOME_DIR /* .h $CPP_DIR /
65
+
66
+ #
67
+ # Compile the C++ libraries
68
+ # Step 2. compile
69
+ #
70
+ #
71
+ # make a Std non-xplink JNI benchmark DLL
72
+ #
73
+ #
74
+ # NOTE: xlc can't handle files with the same name. Hence, the **JavaObject.cpp file names.
75
+ #
76
+ echo " Making 32-bit standard non-xplink JNI benchmark DLL"
77
+ export CXXFLAGS=" -qlist=no-xplink.asmlist -Dnullptr=NULL -Wc,convlit(ISO8859-1) -Wc,NOANSIALIAS -q32 -Wc,noxplink -O -qlanglvl=extended0x -Wc,DLL,EXPORTALL -Wa,DLL -Wc,ARCH(7) -Wc,TUNE(10) "
78
+ xlC $CXXFLAGS -o libstdlinkjnibench.so $INC_PATH $CPP_FILES
79
+
80
+
81
+ echo " Making 32-bit xplink JNI benchmark DLL"
82
+ export CXXFLAGS=" -qlist=xplink32.asmlist -Dnullptr=NULL -Wc,convlit(ISO8859-1) -Wc,NOANSIALIAS -q32 -Wc,xplink -O -qlanglvl=extended0x -Wc,DLL,EXPORTALL -Wa,DLL -Wc,ARCH(7) -Wc,TUNE(10) "
83
+ xlC $CXXFLAGS -o libxplinkjnibench31.so $INC_PATH $CPP_FILES
84
+
85
+
86
+ echo " Making 64-bit xplink JNI benchmark DLL"
87
+ rm -f ./* .o
88
+ export CXXFLAGS=" -qlist=xplink64.asmlist -Dnullptr=NULL -Wc,convlit(ISO8859-1) -Wc,NOANSIALIAS -Wc,xplink -Wc,lp64 -O -qlanglvl=extended0x -Wc,DLL,EXPORTALL -Wa,DLL -Wc,ARCH(7) -Wc,TUNE(10) "
89
+ xlC $CXXFLAGS -o libxplinkjnibench64.so $INC_PATH $CPP_FILES
90
+
91
+
92
+
93
+ #
94
+ #
95
+ # Move all DLL to bumblebench home directory
96
+ #
97
+ mv $CPP_DIR /* .so $HOME_DIR /
98
+ cd $HOME_DIR
0 commit comments