Skip to content

Commit dd95b74

Browse files
iblislinhaohuw
authored andcommitted
Julia: add windows-cpu build (apache#13937)
- Julia v0.7 - Julia v1.0
1 parent fd15dc7 commit dd95b74

File tree

13 files changed

+184
-77
lines changed

13 files changed

+184
-77
lines changed

ci/docker/runtime_functions.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -922,29 +922,21 @@ unittest_ubuntu_cpu_julia() {
922922
export PATH="$1/bin:$PATH"
923923
export MXNET_HOME='/work/mxnet'
924924
export JULIA_DEPOT_PATH='/work/julia-depot'
925-
export DEVDIR="$JULIA_DEPOT_PATH/dev"
926925

927926
julia -e 'using InteractiveUtils; versioninfo()'
928927

929-
# install package
930-
mkdir -p $DEVDIR
931-
ln -sf ${MXNET_HOME}/julia ${DEVDIR}/MXNet
932-
933-
# register MXNet.jl and dependencies
934-
julia -e 'using Pkg; Pkg.develop("MXNet")'
935-
936928
# FIXME
937929
export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libjemalloc.so'
938930
export LD_LIBRARY_PATH=/work/mxnet/lib:$LD_LIBRARY_PATH
939931

940932
# use the prebuilt binary from $MXNET_HOME/lib
941-
julia -e 'using Pkg; Pkg.build("MXNet")'
933+
julia --project=./julia -e 'using Pkg; Pkg.build("MXNet")'
942934

943935
# run the script `julia/test/runtests.jl`
944-
julia -e 'using Pkg; Pkg.test("MXNet")'
936+
julia --project=./julia -e 'using Pkg; Pkg.test("MXNet")'
945937

946938
# See https://github.com/dmlc/MXNet.jl/pull/303#issuecomment-341171774
947-
julia -e 'using MXNet; mx._sig_checker()'
939+
julia --project=./julia -e 'using MXNet; mx._sig_checker()'
948940
}
949941

950942
unittest_ubuntu_cpu_julia07() {
@@ -1280,10 +1272,8 @@ deploy_jl_docs() {
12801272
export PATH="/work/julia10/bin:$PATH"
12811273
export MXNET_HOME='/work/mxnet'
12821274
export JULIA_DEPOT_PATH='/work/julia-depot'
1283-
export DEVDIR="$JULIA_DEPOT_PATH/dev"
12841275

12851276
julia -e 'using InteractiveUtils; versioninfo()'
1286-
mkdir -p $DEVDIR
12871277

12881278
# FIXME
12891279
export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libjemalloc.so'

ci/jenkins/Jenkins_steps.groovy

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,34 @@ def test_windows_python3_cpu() {
12101210
}]
12111211
}
12121212

1213+
def test_windows_julia07_cpu() {
1214+
return ['Julia 0.7: CPU Win': {
1215+
node(NODE_WINDOWS_CPU) {
1216+
ws('workspace/ut-julia07-cpu') {
1217+
timeout(time: max_time, unit: 'MINUTES') {
1218+
utils.init_git_win()
1219+
unstash 'windows_package_cpu'
1220+
powershell 'ci/windows/test_jl07_cpu.ps1'
1221+
}
1222+
}
1223+
}
1224+
}]
1225+
}
1226+
1227+
def test_windows_julia10_cpu() {
1228+
return ['Julia 1.0: CPU Win': {
1229+
node(NODE_WINDOWS_CPU) {
1230+
ws('workspace/ut-julia10-cpu') {
1231+
timeout(time: max_time, unit: 'MINUTES') {
1232+
utils.init_git_win()
1233+
unstash 'windows_package_cpu'
1234+
powershell 'ci/windows/test_jl10_cpu.ps1'
1235+
}
1236+
}
1237+
}
1238+
}]
1239+
}
1240+
12131241
def test_qemu_armv7_cpu() {
12141242
return ['ARMv7 QEMU': {
12151243
node(NODE_LINUX_CPU) {

ci/jenkins/Jenkinsfile_windows_cpu

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ utils.main_wrapper(
3535
core_logic: {
3636
utils.parallel_stage('Build', [
3737
custom_steps.compile_windows_cpu()
38-
])
38+
])
3939

4040
utils.parallel_stage('Tests', [
4141
custom_steps.test_windows_python2_cpu(),
42-
custom_steps.test_windows_python3_cpu()
43-
])
42+
custom_steps.test_windows_python3_cpu(),
43+
custom_steps.test_windows_julia07_cpu(),
44+
custom_steps.test_windows_julia10_cpu()
45+
])
4446
}
4547
,
4648
failure_handler: {

ci/windows/test_jl07_cpu.ps1

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
7z x -y windows_package.7z
19+
20+
# set default output encoding to utf8
21+
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
22+
23+
$env:MXNET_HOME = [System.IO.Path]::GetFullPath('.\windows_package')
24+
$env:JULIA_URL = "https://julialang-s3.julialang.org/bin/winnt/x64/0.7/julia-0.7.0-win64.exe"
25+
$env:JULIA_DEPOT_PATH = [System.IO.Path]::GetFullPath('.\julia-depot')
26+
27+
$JULIA_DIR = [System.IO.Path]::GetFullPath('.\julia07')
28+
$JULIA = "$JULIA_DIR\bin\julia"
29+
30+
# Download most recent Julia Windows binary
31+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
32+
(New-Object System.Net.WebClient).DownloadFile($env:JULIA_URL, "julia-binary.exe")
33+
if (! $?) { Throw ("Error on downloading Julia Windows binary") }
34+
35+
# Run installer silently, output to C:\julia07\julia
36+
Start-Process -Wait "julia-binary.exe" -ArgumentList "/S /D=$JULIA_DIR"
37+
if (! $?) { Throw ("Error on installing Julia") }
38+
39+
& $JULIA -e "using InteractiveUtils; versioninfo()"
40+
41+
dir
42+
43+
$src='
44+
using Pkg
45+
Pkg.activate(".\\julia")
46+
Pkg.build()
47+
Pkg.test()
48+
'
49+
50+
$src > .\ci-build.jl
51+
52+
# Redirect all stderr output to stdout,
53+
# since Julia loggers output stuffs to stderr.
54+
# Then, stderr triggers powershell NativeCommandError.
55+
& $JULIA .\ci-build.jl 2>&1 | %{ "$_" }
56+
if ($LastExitCode -eq 1) { Throw ("Error") }

ci/windows/test_jl10_cpu.ps1

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
7z x -y windows_package.7z
19+
20+
# set default output encoding to utf8
21+
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
22+
23+
$env:MXNET_HOME = [System.IO.Path]::GetFullPath('.\windows_package')
24+
$env:JULIA_URL = "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0.3-win64.exe"
25+
$env:JULIA_DEPOT_PATH = [System.IO.Path]::GetFullPath('.\julia-depot')
26+
27+
$JULIA_DIR = [System.IO.Path]::GetFullPath('.\julia10')
28+
$JULIA = "$JULIA_DIR\bin\julia"
29+
30+
# Download most recent Julia Windows binary
31+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
32+
(New-Object System.Net.WebClient).DownloadFile($env:JULIA_URL, "julia-binary.exe")
33+
if (! $?) { Throw ("Error on downloading Julia Windows binary") }
34+
35+
# Run installer silently, output to C:\julia10\julia
36+
Start-Process -Wait "julia-binary.exe" -ArgumentList "/S /D=$JULIA_DIR"
37+
if (! $?) { Throw ("Error on installing Julia") }
38+
39+
& $JULIA -e "using InteractiveUtils; versioninfo()"
40+
41+
dir
42+
43+
$src='
44+
using Pkg
45+
Pkg.activate(".\\julia")
46+
Pkg.build()
47+
Pkg.test()
48+
'
49+
50+
$src > .\ci-build.jl
51+
52+
# Redirect all stderr output to stdout,
53+
# since Julia loggers output stuffs to stderr.
54+
# Then, stderr triggers powershell NativeCommandError.
55+
& $JULIA .\ci-build.jl 2>&1 | %{ "$_" }
56+
if ($LastExitCode -eq 1) { Throw ("Error") }

julia/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ deps/src
88
deps/usr
99
deps/deps.jl
1010
.vscode
11+
/Manifest.toml

julia/Project.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name = "MXNet"
2+
uuid = "a7949054-b901-59c6-b8e3-7238c29bf7f0"
3+
authors = ["Chiyuan Zhang <pluskid@gmail.com>", "Valentin Churavy <vchuravy@mit.edu>", "Iblis Lin <iblis@hs.ntnu.edu.tw>"]
4+
version = "1.5.0"
5+
6+
[deps]
7+
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
8+
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
9+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
10+
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
11+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12+
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
13+
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
14+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
15+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
16+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
17+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
18+
19+
[compat]
20+
julia = "≥0.7"
21+
22+
[extras]
23+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24+
25+
[targets]
26+
test = ["Test"]

julia/REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.6
1+
julia 0.7
22
Formatting
33
BinDeps
44
JSON

julia/appveyor.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

julia/deps/build.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if HAS_CUDA
8686
if HAS_CUDNN
8787
@info("Found a CuDNN installation.")
8888
end
89-
@info("CUDA_HOME -> $(get(ENV, "CUDA_HOME", nothing))")
89+
@info("CUDA_HOME -> $(get(ENV, "CUDA_HOME", "nothing"))")
9090
else
9191
@info("Did not find a CUDA installation, using CPU-only version of MXNet.")
9292
end

0 commit comments

Comments
 (0)