Skip to content

Commit

Permalink
travis (wip): set -j4 on travis to prevent from out-of-memory
Browse files Browse the repository at this point in the history
  • Loading branch information
iblislin committed Sep 6, 2017
1 parent 35d1ec2 commit 0d274db
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ else
info("Did not find a CUDA installation, using CPU-only version of MXNet.")
end

function get_cpucore()
if haskey(ENV, "TRAVIS") # on travis-ci
4
else
min(Sys.CPU_CORES, 8)
end
end

using BinDeps
@BinDeps.setup
if !libmxnet_detected
Expand Down Expand Up @@ -170,9 +178,9 @@ if !libmxnet_detected
ChangeDirectory(_mxdir)
`cp ../../cblas.h include/cblas.h`
if USE_JULIA_BLAS
`make -j$(min(Sys.CPU_CORES,8)) USE_BLAS=$blas_name $MSHADOW_LDFLAGS`
`make -j$(get_cpucore()) USE_BLAS=$blas_name $MSHADOW_LDFLAGS`
else
`make -j$(min(Sys.CPU_CORES,8))`
`make -j$(get_cpucore())`
end
end
FileRule(joinpath(_libdir, "libmxnet.so"), @build_steps begin
Expand Down

0 comments on commit 0d274db

Please sign in to comment.