Check-in [e8076eeeca]
Not logged in
Overview
Comment:LLVM download and compilation script bugfix
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e8076eeeca04978193eabb7e37536b4d5fc9274a
User & Date: martin_vahi on 2016-12-09 01:33:35
Other Links: manifest | tags
Context
2016-12-25 12:47
ParaSail_v_7_0_console_version initial entry check-in: 18752d1a53 user: martin_vahi tags: trunk
2016-12-09 01:33
LLVM download and compilation script bugfix check-in: e8076eeeca user: martin_vahi tags: trunk
2016-12-05 21:27
updated LLVM download script check-in: baf6891267 user: martin_vahi tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified work_in_progress/copy_of_the_LLVM/COMMENTS.txt from [69a94aa079] to [c77243294c].

1
2
3
4
5
6




7



The mmmv_LLVM_copy_t1 is not a fork of the LLVM. 
It is only a copy of the LLVM accompanied 
by a few custom scripts.













>
>
>
>

>
1
2
3
4
5
6
7
8
9
10
11
12


The mmmv_LLVM_copy_t1 is not a fork of the LLVM. 
It is only a copy of the LLVM accompanied 
by a few custom scripts.

The copy of the LLVM here requires the CMake
version to be at least 3.4.3 . The CMake might be
difficult to build due to the difficulty of
linking it with the OpenSSL library.


Modified work_in_progress/copy_of_the_LLVM/src/download_the_LLVM_t1.bash from [459731d3be] to [232341e379].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
237
238
239
240
241
242
243



244
245


246
247

248
249

250
251
252
253
254
255

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
func_mmmv_exit_if_not_on_path_t2() { # S_COMMAND_NAME
    local S_COMMAND_NAME=$1
    local S_LOCAL_VARIABLE="`which $S_COMMAND_NAME 2>/dev/null`"
    if [ "$S_LOCAL_VARIABLE" == "" ]; then
        echo ""
        echo "Command \"$S_COMMAND_NAME\" could not be found from the PATH. "
        echo "The execution of the Bash script is aborted."
        echo "GUID=='0833cc5d-3247-4209-8424-5153c050c0e7'"
        echo ""
        exit 1;
    fi
} # func_mmmv_exit_if_not_on_path_t2

func_mmmv_exit_if_not_on_path_t2 "git"
func_mmmv_exit_if_not_on_path_t2 "gcc"
................................................................................
    echo "    $S_FP_SCRIPTFILE_NAME"
    echo ""
    echo "The supported values are:"
    echo ""
    echo "    $S_FP_BASHSCRIPT_THAT_DOWNLOADS"
    echo "    $S_FP_BASHSCRIPT_THAT_COMPILES"
    echo ""
    echo "GUID=='a13e2b29-1be4-44f9-9324-5153c050c0e7'"
    echo ""
    #--------
    cd $S_FP_ORIG
    exit 1 # exiting with an error
fi


................................................................................

func_assert_last_cmd_exited_without_errors_t1() {  # S_GUID
    local S_GUID="$1"
    if [ "$?" != "0" ]; then
        echo ""
        echo "Something went wrong. The error code is: $?"
        echo "GUID==\"$S_GUID\""
        echo "GUID=='1c9f1e4d-516e-4163-b314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
} # func_assert_last_cmd_exited_without_errors_t1

................................................................................
    local S_FP="$1"
    local S_GUID="$2"
    #------------------------------
    if [ "$S_GUID" == "" ]; then
        echo ""
        echo "The code that calls this function is flawed."
        echo "This function requires 2 parameters: S_FP, S_GUID"
        echo "GUID=='ce41da25-38a4-469a-a314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
    #------------------------------
    if [ ! -e $S_FP ]; then
................................................................................
            echo ""
            echo "The path "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "points to a broken symbolic link."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='645ee34f-2fb6-4084-a214-5153c050c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        else
            echo ""
            echo "The folder "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "does not exist."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='64944e48-d225-4c46-b314-5153c050c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        fi
    fi
} # func_assert_folder_exists_t1
................................................................................

#--------------------------------------------------------------------------

func_download(){
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR/vd_$S_TIMESTAMP"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #----
    mkdir -p $S_TMP_0_SRC
    func_assert_last_cmd_exited_without_errors_t1 "c6e1ae48-d29b-4f6b-9224-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "845fc914-66b3-4349-a414-5153c050c0e7"
    #----
    mkdir -p $S_TMP_0_INSTALLED
    func_assert_last_cmd_exited_without_errors_t1 "edf96c3b-6eba-42c1-8114-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \
        "1853a88d-62e8-4e63-8314-5153c050c0e7"
    #----
    cp $S_FP_BASHSCRIPT_THAT_DOWNLOADS  $S_TMP_0/$S_FN_BASHSCRIPT_THAT_COMPILES
    func_assert_last_cmd_exited_without_errors_t1 "3acbce56-ddd7-4ccd-9314-5153c050c0e7"
    #--------------------------------------------
    cd $S_TMP_0_SRC
        svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
        func_assert_last_cmd_exited_without_errors_t1 "cfd92d23-b56e-4459-9514-5153c050c0e7"
        sleep 1
        func_assert_folder_exists_t1 "$S_FP_LLVM" "f1cd60cf-5e63-4b63-a214-5153c050c0e7"
        cd $S_FP_LLVM
            #--------------------------------------------
            mkdir -p ./tools
            func_assert_last_cmd_exited_without_errors_t1 "53fbaea5-1780-4e17-9414-5153c050c0e7"
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools" \
                "31080158-0d7f-4e56-9314-5153c050c0e7"
            cd ./tools
                svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
                func_assert_last_cmd_exited_without_errors_t1 "e6b15c38-fc71-4a62-8414-5153c050c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools/clang/tools" \
                "163b3d5f-7bf7-4943-b114-5153c050c0e7"
            cd ./tools/clang/tools
                svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
                func_assert_last_cmd_exited_without_errors_t1 "31821e1a-d552-4a88-a404-5153c050c0e7"
            cd ../../..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "e6711c1d-6ae9-4a4d-9204-5153c050c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
                func_assert_last_cmd_exited_without_errors_t1 "edd9881f-a15a-4291-b204-5153c050c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "35819d60-2307-4618-9404-5153c050c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
                func_assert_last_cmd_exited_without_errors_t1 "1ff4f433-c779-4c47-8504-5153c050c0e7"
            cd ..
            #--------
            make update
            func_assert_last_cmd_exited_without_errors_t1 "15ab745f-e121-4723-8304-5153c050c0e7"
        #--------------------------------------------
        cd .. # $S_FP_LLVM
    cd .. # $S_TMP_0_SRC
} # func_download

#--------------------------------------------------------------------------

................................................................................
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_TMP_0_BUILD="$S_TMP_0/build_directory"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #--------------------------------------------



    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "59ae1311-2d19-4c0b-b304-5153c050c0e7"


    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \
        "ad817f1d-402d-45fb-b204-5153c050c0e7"

    func_assert_folder_exists_t1 "$S_FP_LLVM" \
        "1d79733e-12d0-48df-9204-5153c050c0e7"

    #--------------------------------------------
    mkdir -p $S_TMP_0_BUILD
    func_assert_last_cmd_exited_without_errors_t1 "b977d757-8608-4c69-b304-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_BUILD" \
        "16593551-8d81-4264-8304-5153c050c0e7"

    #--------------------------------------------
    cd $S_TMP_0_BUILD
        # http://llvm.org/docs/CMake.html
        #--------
        nice -n19 cmake $S_FP_LLVM  # the configure step
        func_assert_last_cmd_exited_without_errors_t1 "0607a148-b8bb-4713-9304-5153c050c0e7"
        nice -n19 cmake --build . --target install
        func_assert_last_cmd_exited_without_errors_t1 "80176334-6ac0-419f-b404-5153c050c0e7"
        nice -n19 cmake -DCMAKE_INSTALL_PREFIX=$S_TMP_0_INSTALLED -P cmake_install.cmake
        func_assert_last_cmd_exited_without_errors_t1 "24506794-da95-4439-8504-5153c050c0e7"
        #--------------------------------------------
    cd .. # $S_TMP_0_BUILD
} # func_compile



#--------------------------------------------------------------------------
................................................................................
    func_download
else
    if [ "$S_MODE" == "mode_compile" ]; then
        func_compile
    else
        echo ""
        echo "This script is flawed."
        echo "GUID=='61132b56-33cb-41ac-8314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
fi

#--------------------------------------------------------------------------
 
 








|







 







|







 







|







 







|







 







|












|







 







<



|


|

<
<
<
<
<
<

|



|

|



|


|


|




|


|




|


|




|


|



|







 







>
>
>
|
<
>
>
|
<
>

<
>


|


<
>





|

|

|







 







|











13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
161
162
163
164
165
166
167

168
169
170
171
172
173
174
175






176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
...
230
231
232
233
234
235
236
237
238
239
240

241
242
243

244
245

246
247
248
249
250
251

252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
func_mmmv_exit_if_not_on_path_t2() { # S_COMMAND_NAME
    local S_COMMAND_NAME=$1
    local S_LOCAL_VARIABLE="`which $S_COMMAND_NAME 2>/dev/null`"
    if [ "$S_LOCAL_VARIABLE" == "" ]; then
        echo ""
        echo "Command \"$S_COMMAND_NAME\" could not be found from the PATH. "
        echo "The execution of the Bash script is aborted."
        echo "GUID=='140b2347-fa79-4d12-a19d-30412090c0e7'"
        echo ""
        exit 1;
    fi
} # func_mmmv_exit_if_not_on_path_t2

func_mmmv_exit_if_not_on_path_t2 "git"
func_mmmv_exit_if_not_on_path_t2 "gcc"
................................................................................
    echo "    $S_FP_SCRIPTFILE_NAME"
    echo ""
    echo "The supported values are:"
    echo ""
    echo "    $S_FP_BASHSCRIPT_THAT_DOWNLOADS"
    echo "    $S_FP_BASHSCRIPT_THAT_COMPILES"
    echo ""
    echo "GUID=='516e2f6c-b19b-4226-a59d-30412090c0e7'"
    echo ""
    #--------
    cd $S_FP_ORIG
    exit 1 # exiting with an error
fi


................................................................................

func_assert_last_cmd_exited_without_errors_t1() {  # S_GUID
    local S_GUID="$1"
    if [ "$?" != "0" ]; then
        echo ""
        echo "Something went wrong. The error code is: $?"
        echo "GUID==\"$S_GUID\""
        echo "GUID=='edda0e25-216d-4e36-b39d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
} # func_assert_last_cmd_exited_without_errors_t1

................................................................................
    local S_FP="$1"
    local S_GUID="$2"
    #------------------------------
    if [ "$S_GUID" == "" ]; then
        echo ""
        echo "The code that calls this function is flawed."
        echo "This function requires 2 parameters: S_FP, S_GUID"
        echo "GUID=='c9337c50-721d-477b-939d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
    #------------------------------
    if [ ! -e $S_FP ]; then
................................................................................
            echo ""
            echo "The path "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "points to a broken symbolic link."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='5ecb8114-32e6-4010-839d-30412090c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        else
            echo ""
            echo "The folder "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "does not exist."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='f016ed28-3751-4453-828d-30412090c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        fi
    fi
} # func_assert_folder_exists_t1
................................................................................

#--------------------------------------------------------------------------

func_download(){
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR/vd_$S_TIMESTAMP"
    local S_TMP_0_SRC="$S_TMP_0/src"

    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #----
    mkdir -p $S_TMP_0_SRC
    func_assert_last_cmd_exited_without_errors_t1 "1dc4b133-0238-4e65-b59d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "51f124df-d555-4384-8b9d-30412090c0e7"
    #----






    cp $S_FP_BASHSCRIPT_THAT_DOWNLOADS  $S_TMP_0/$S_FN_BASHSCRIPT_THAT_COMPILES
    func_assert_last_cmd_exited_without_errors_t1 "bd3fb339-c26c-42c3-949d-30412090c0e7"
    #--------------------------------------------
    cd $S_TMP_0_SRC
        svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
        func_assert_last_cmd_exited_without_errors_t1 "ed5a5451-9957-4aca-939d-30412090c0e7"
        sleep 1
        func_assert_folder_exists_t1 "$S_FP_LLVM" "6abac121-dcf8-4aa9-b48d-30412090c0e7"
        cd $S_FP_LLVM
            #--------------------------------------------
            mkdir -p ./tools
            func_assert_last_cmd_exited_without_errors_t1 "7381e4c2-9141-45ca-8d8d-30412090c0e7"
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools" \
                "c28efe3c-a535-455f-aa8d-30412090c0e7"
            cd ./tools
                svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
                func_assert_last_cmd_exited_without_errors_t1 "3c64aab2-2d4c-41cb-9e8d-30412090c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools/clang/tools" \
                "65fbae30-6672-44d6-a28d-30412090c0e7"
            cd ./tools/clang/tools
                svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
                func_assert_last_cmd_exited_without_errors_t1 "e41d0e18-ba2f-448e-838d-30412090c0e7"
            cd ../../..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "942cfc14-e1ac-404e-a48d-30412090c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
                func_assert_last_cmd_exited_without_errors_t1 "5ee9e137-9169-45b6-928d-30412090c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "28b3d5fc-1a93-404a-858d-30412090c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
                func_assert_last_cmd_exited_without_errors_t1 "73c4e926-3bba-4d7c-838d-30412090c0e7"
            cd ..
            #--------
            make update
            func_assert_last_cmd_exited_without_errors_t1 "422d1e68-042c-48e9-8a8d-30412090c0e7"
        #--------------------------------------------
        cd .. # $S_FP_LLVM
    cd .. # $S_TMP_0_SRC
} # func_download

#--------------------------------------------------------------------------

................................................................................
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_TMP_0_BUILD="$S_TMP_0/build_directory"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #--------------------------------------------
    mkdir -p $S_TMP_0_INSTALLED
    func_assert_last_cmd_exited_without_errors_t1 "30249d49-b5bc-4e03-928d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \

        "e8a1df2d-f31b-4014-b38d-30412090c0e7"
    #----
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \

        "2692f061-f0b4-41b2-827d-30412090c0e7"
    func_assert_folder_exists_t1 "$S_FP_LLVM" \

        "38740e6b-5668-4f11-9c7d-30412090c0e7"
    #--------------------------------------------
    mkdir -p $S_TMP_0_BUILD
    func_assert_last_cmd_exited_without_errors_t1 "a5842233-fcf9-4cd6-817d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_BUILD" \

        "3e961585-b4aa-405d-b17d-30412090c0e7"
    #--------------------------------------------
    cd $S_TMP_0_BUILD
        # http://llvm.org/docs/CMake.html
        #--------
        nice -n19 cmake $S_FP_LLVM  # the configure step
        func_assert_last_cmd_exited_without_errors_t1 "2002c583-ea5e-449b-b37d-30412090c0e7"
        nice -n19 cmake --build . --target install
        func_assert_last_cmd_exited_without_errors_t1 "f8a72349-c917-4936-947d-30412090c0e7"
        nice -n19 cmake -DCMAKE_INSTALL_PREFIX=$S_TMP_0_INSTALLED -P cmake_install.cmake
        func_assert_last_cmd_exited_without_errors_t1 "5ba5354c-51e4-4f50-917d-30412090c0e7"
        #--------------------------------------------
    cd .. # $S_TMP_0_BUILD
} # func_compile



#--------------------------------------------------------------------------
................................................................................
    func_download
else
    if [ "$S_MODE" == "mode_compile" ]; then
        func_compile
    else
        echo ""
        echo "This script is flawed."
        echo "GUID=='d720c15e-12dc-458a-848d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
fi

#--------------------------------------------------------------------------
 
 

Modified work_in_progress/copy_of_the_LLVM/src/vd_2016_12_03/compile_the_downloaded_LLVM_t1.bash from [459731d3be] to [232341e379].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
237
238
239
240
241
242
243



244
245


246
247

248
249

250
251
252
253
254
255

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
func_mmmv_exit_if_not_on_path_t2() { # S_COMMAND_NAME
    local S_COMMAND_NAME=$1
    local S_LOCAL_VARIABLE="`which $S_COMMAND_NAME 2>/dev/null`"
    if [ "$S_LOCAL_VARIABLE" == "" ]; then
        echo ""
        echo "Command \"$S_COMMAND_NAME\" could not be found from the PATH. "
        echo "The execution of the Bash script is aborted."
        echo "GUID=='0833cc5d-3247-4209-8424-5153c050c0e7'"
        echo ""
        exit 1;
    fi
} # func_mmmv_exit_if_not_on_path_t2

func_mmmv_exit_if_not_on_path_t2 "git"
func_mmmv_exit_if_not_on_path_t2 "gcc"
................................................................................
    echo "    $S_FP_SCRIPTFILE_NAME"
    echo ""
    echo "The supported values are:"
    echo ""
    echo "    $S_FP_BASHSCRIPT_THAT_DOWNLOADS"
    echo "    $S_FP_BASHSCRIPT_THAT_COMPILES"
    echo ""
    echo "GUID=='a13e2b29-1be4-44f9-9324-5153c050c0e7'"
    echo ""
    #--------
    cd $S_FP_ORIG
    exit 1 # exiting with an error
fi


................................................................................

func_assert_last_cmd_exited_without_errors_t1() {  # S_GUID
    local S_GUID="$1"
    if [ "$?" != "0" ]; then
        echo ""
        echo "Something went wrong. The error code is: $?"
        echo "GUID==\"$S_GUID\""
        echo "GUID=='1c9f1e4d-516e-4163-b314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
} # func_assert_last_cmd_exited_without_errors_t1

................................................................................
    local S_FP="$1"
    local S_GUID="$2"
    #------------------------------
    if [ "$S_GUID" == "" ]; then
        echo ""
        echo "The code that calls this function is flawed."
        echo "This function requires 2 parameters: S_FP, S_GUID"
        echo "GUID=='ce41da25-38a4-469a-a314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
    #------------------------------
    if [ ! -e $S_FP ]; then
................................................................................
            echo ""
            echo "The path "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "points to a broken symbolic link."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='645ee34f-2fb6-4084-a214-5153c050c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        else
            echo ""
            echo "The folder "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "does not exist."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='64944e48-d225-4c46-b314-5153c050c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        fi
    fi
} # func_assert_folder_exists_t1
................................................................................

#--------------------------------------------------------------------------

func_download(){
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR/vd_$S_TIMESTAMP"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #----
    mkdir -p $S_TMP_0_SRC
    func_assert_last_cmd_exited_without_errors_t1 "c6e1ae48-d29b-4f6b-9224-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "845fc914-66b3-4349-a414-5153c050c0e7"
    #----
    mkdir -p $S_TMP_0_INSTALLED
    func_assert_last_cmd_exited_without_errors_t1 "edf96c3b-6eba-42c1-8114-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \
        "1853a88d-62e8-4e63-8314-5153c050c0e7"
    #----
    cp $S_FP_BASHSCRIPT_THAT_DOWNLOADS  $S_TMP_0/$S_FN_BASHSCRIPT_THAT_COMPILES
    func_assert_last_cmd_exited_without_errors_t1 "3acbce56-ddd7-4ccd-9314-5153c050c0e7"
    #--------------------------------------------
    cd $S_TMP_0_SRC
        svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
        func_assert_last_cmd_exited_without_errors_t1 "cfd92d23-b56e-4459-9514-5153c050c0e7"
        sleep 1
        func_assert_folder_exists_t1 "$S_FP_LLVM" "f1cd60cf-5e63-4b63-a214-5153c050c0e7"
        cd $S_FP_LLVM
            #--------------------------------------------
            mkdir -p ./tools
            func_assert_last_cmd_exited_without_errors_t1 "53fbaea5-1780-4e17-9414-5153c050c0e7"
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools" \
                "31080158-0d7f-4e56-9314-5153c050c0e7"
            cd ./tools
                svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
                func_assert_last_cmd_exited_without_errors_t1 "e6b15c38-fc71-4a62-8414-5153c050c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools/clang/tools" \
                "163b3d5f-7bf7-4943-b114-5153c050c0e7"
            cd ./tools/clang/tools
                svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
                func_assert_last_cmd_exited_without_errors_t1 "31821e1a-d552-4a88-a404-5153c050c0e7"
            cd ../../..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "e6711c1d-6ae9-4a4d-9204-5153c050c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
                func_assert_last_cmd_exited_without_errors_t1 "edd9881f-a15a-4291-b204-5153c050c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "35819d60-2307-4618-9404-5153c050c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
                func_assert_last_cmd_exited_without_errors_t1 "1ff4f433-c779-4c47-8504-5153c050c0e7"
            cd ..
            #--------
            make update
            func_assert_last_cmd_exited_without_errors_t1 "15ab745f-e121-4723-8304-5153c050c0e7"
        #--------------------------------------------
        cd .. # $S_FP_LLVM
    cd .. # $S_TMP_0_SRC
} # func_download

#--------------------------------------------------------------------------

................................................................................
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_TMP_0_BUILD="$S_TMP_0/build_directory"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #--------------------------------------------



    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "59ae1311-2d19-4c0b-b304-5153c050c0e7"


    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \
        "ad817f1d-402d-45fb-b204-5153c050c0e7"

    func_assert_folder_exists_t1 "$S_FP_LLVM" \
        "1d79733e-12d0-48df-9204-5153c050c0e7"

    #--------------------------------------------
    mkdir -p $S_TMP_0_BUILD
    func_assert_last_cmd_exited_without_errors_t1 "b977d757-8608-4c69-b304-5153c050c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_BUILD" \
        "16593551-8d81-4264-8304-5153c050c0e7"

    #--------------------------------------------
    cd $S_TMP_0_BUILD
        # http://llvm.org/docs/CMake.html
        #--------
        nice -n19 cmake $S_FP_LLVM  # the configure step
        func_assert_last_cmd_exited_without_errors_t1 "0607a148-b8bb-4713-9304-5153c050c0e7"
        nice -n19 cmake --build . --target install
        func_assert_last_cmd_exited_without_errors_t1 "80176334-6ac0-419f-b404-5153c050c0e7"
        nice -n19 cmake -DCMAKE_INSTALL_PREFIX=$S_TMP_0_INSTALLED -P cmake_install.cmake
        func_assert_last_cmd_exited_without_errors_t1 "24506794-da95-4439-8504-5153c050c0e7"
        #--------------------------------------------
    cd .. # $S_TMP_0_BUILD
} # func_compile



#--------------------------------------------------------------------------
................................................................................
    func_download
else
    if [ "$S_MODE" == "mode_compile" ]; then
        func_compile
    else
        echo ""
        echo "This script is flawed."
        echo "GUID=='61132b56-33cb-41ac-8314-5153c050c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
fi

#--------------------------------------------------------------------------
 
 








|







 







|







 







|







 







|







 







|












|







 







<



|


|

<
<
<
<
<
<

|



|

|



|


|


|




|


|




|


|




|


|



|







 







>
>
>
|
<
>
>
|
<
>

<
>


|


<
>





|

|

|







 







|











13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
161
162
163
164
165
166
167

168
169
170
171
172
173
174
175






176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
...
230
231
232
233
234
235
236
237
238
239
240

241
242
243

244
245

246
247
248
249
250
251

252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
func_mmmv_exit_if_not_on_path_t2() { # S_COMMAND_NAME
    local S_COMMAND_NAME=$1
    local S_LOCAL_VARIABLE="`which $S_COMMAND_NAME 2>/dev/null`"
    if [ "$S_LOCAL_VARIABLE" == "" ]; then
        echo ""
        echo "Command \"$S_COMMAND_NAME\" could not be found from the PATH. "
        echo "The execution of the Bash script is aborted."
        echo "GUID=='140b2347-fa79-4d12-a19d-30412090c0e7'"
        echo ""
        exit 1;
    fi
} # func_mmmv_exit_if_not_on_path_t2

func_mmmv_exit_if_not_on_path_t2 "git"
func_mmmv_exit_if_not_on_path_t2 "gcc"
................................................................................
    echo "    $S_FP_SCRIPTFILE_NAME"
    echo ""
    echo "The supported values are:"
    echo ""
    echo "    $S_FP_BASHSCRIPT_THAT_DOWNLOADS"
    echo "    $S_FP_BASHSCRIPT_THAT_COMPILES"
    echo ""
    echo "GUID=='516e2f6c-b19b-4226-a59d-30412090c0e7'"
    echo ""
    #--------
    cd $S_FP_ORIG
    exit 1 # exiting with an error
fi


................................................................................

func_assert_last_cmd_exited_without_errors_t1() {  # S_GUID
    local S_GUID="$1"
    if [ "$?" != "0" ]; then
        echo ""
        echo "Something went wrong. The error code is: $?"
        echo "GUID==\"$S_GUID\""
        echo "GUID=='edda0e25-216d-4e36-b39d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
} # func_assert_last_cmd_exited_without_errors_t1

................................................................................
    local S_FP="$1"
    local S_GUID="$2"
    #------------------------------
    if [ "$S_GUID" == "" ]; then
        echo ""
        echo "The code that calls this function is flawed."
        echo "This function requires 2 parameters: S_FP, S_GUID"
        echo "GUID=='c9337c50-721d-477b-939d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
    #------------------------------
    if [ ! -e $S_FP ]; then
................................................................................
            echo ""
            echo "The path "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "points to a broken symbolic link."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='5ecb8114-32e6-4010-839d-30412090c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        else
            echo ""
            echo "The folder "
            echo ""
            echo "    $S_FP "
            echo ""
            echo "does not exist."
            echo "GUID==\"$S_GUID\""
            echo "GUID=='f016ed28-3751-4453-828d-30412090c0e7'"
            echo ""
            #--------
            cd $S_FP_ORIG
            exit 1 # exiting with an error
        fi
    fi
} # func_assert_folder_exists_t1
................................................................................

#--------------------------------------------------------------------------

func_download(){
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR/vd_$S_TIMESTAMP"
    local S_TMP_0_SRC="$S_TMP_0/src"

    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #----
    mkdir -p $S_TMP_0_SRC
    func_assert_last_cmd_exited_without_errors_t1 "1dc4b133-0238-4e65-b59d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \
        "51f124df-d555-4384-8b9d-30412090c0e7"
    #----






    cp $S_FP_BASHSCRIPT_THAT_DOWNLOADS  $S_TMP_0/$S_FN_BASHSCRIPT_THAT_COMPILES
    func_assert_last_cmd_exited_without_errors_t1 "bd3fb339-c26c-42c3-949d-30412090c0e7"
    #--------------------------------------------
    cd $S_TMP_0_SRC
        svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
        func_assert_last_cmd_exited_without_errors_t1 "ed5a5451-9957-4aca-939d-30412090c0e7"
        sleep 1
        func_assert_folder_exists_t1 "$S_FP_LLVM" "6abac121-dcf8-4aa9-b48d-30412090c0e7"
        cd $S_FP_LLVM
            #--------------------------------------------
            mkdir -p ./tools
            func_assert_last_cmd_exited_without_errors_t1 "7381e4c2-9141-45ca-8d8d-30412090c0e7"
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools" \
                "c28efe3c-a535-455f-aa8d-30412090c0e7"
            cd ./tools
                svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
                func_assert_last_cmd_exited_without_errors_t1 "3c64aab2-2d4c-41cb-9e8d-30412090c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/tools/clang/tools" \
                "65fbae30-6672-44d6-a28d-30412090c0e7"
            cd ./tools/clang/tools
                svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
                func_assert_last_cmd_exited_without_errors_t1 "e41d0e18-ba2f-448e-838d-30412090c0e7"
            cd ../../..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "942cfc14-e1ac-404e-a48d-30412090c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
                func_assert_last_cmd_exited_without_errors_t1 "5ee9e137-9169-45b6-928d-30412090c0e7"
            cd ..
            #--------
            sleep 1
            func_assert_folder_exists_t1 "$S_FP_LLVM/projects" \
                "28b3d5fc-1a93-404a-858d-30412090c0e7"
            cd ./projects
                svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
                func_assert_last_cmd_exited_without_errors_t1 "73c4e926-3bba-4d7c-838d-30412090c0e7"
            cd ..
            #--------
            make update
            func_assert_last_cmd_exited_without_errors_t1 "422d1e68-042c-48e9-8a8d-30412090c0e7"
        #--------------------------------------------
        cd .. # $S_FP_LLVM
    cd .. # $S_TMP_0_SRC
} # func_download

#--------------------------------------------------------------------------

................................................................................
    #--------------------------------------------
    local S_TMP_0="$S_FP_DIR"
    local S_TMP_0_SRC="$S_TMP_0/src"
    local S_TMP_0_INSTALLED="$S_TMP_0/installed"
    local S_TMP_0_BUILD="$S_TMP_0/build_directory"
    local S_FP_LLVM="$S_TMP_0_SRC/llvm"
    #--------------------------------------------
    mkdir -p $S_TMP_0_INSTALLED
    func_assert_last_cmd_exited_without_errors_t1 "30249d49-b5bc-4e03-928d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_INSTALLED" \

        "e8a1df2d-f31b-4014-b38d-30412090c0e7"
    #----
    func_assert_folder_exists_t1 "$S_TMP_0_SRC" \

        "2692f061-f0b4-41b2-827d-30412090c0e7"
    func_assert_folder_exists_t1 "$S_FP_LLVM" \

        "38740e6b-5668-4f11-9c7d-30412090c0e7"
    #--------------------------------------------
    mkdir -p $S_TMP_0_BUILD
    func_assert_last_cmd_exited_without_errors_t1 "a5842233-fcf9-4cd6-817d-30412090c0e7"
    sleep 1
    func_assert_folder_exists_t1 "$S_TMP_0_BUILD" \

        "3e961585-b4aa-405d-b17d-30412090c0e7"
    #--------------------------------------------
    cd $S_TMP_0_BUILD
        # http://llvm.org/docs/CMake.html
        #--------
        nice -n19 cmake $S_FP_LLVM  # the configure step
        func_assert_last_cmd_exited_without_errors_t1 "2002c583-ea5e-449b-b37d-30412090c0e7"
        nice -n19 cmake --build . --target install
        func_assert_last_cmd_exited_without_errors_t1 "f8a72349-c917-4936-947d-30412090c0e7"
        nice -n19 cmake -DCMAKE_INSTALL_PREFIX=$S_TMP_0_INSTALLED -P cmake_install.cmake
        func_assert_last_cmd_exited_without_errors_t1 "5ba5354c-51e4-4f50-917d-30412090c0e7"
        #--------------------------------------------
    cd .. # $S_TMP_0_BUILD
} # func_compile



#--------------------------------------------------------------------------
................................................................................
    func_download
else
    if [ "$S_MODE" == "mode_compile" ]; then
        func_compile
    else
        echo ""
        echo "This script is flawed."
        echo "GUID=='d720c15e-12dc-458a-848d-30412090c0e7'"
        echo ""
        #--------
        cd $S_FP_ORIG
        exit 1 # exiting with an error
    fi
fi

#--------------------------------------------------------------------------