-
Notifications
You must be signed in to change notification settings - Fork 254
/
build.jl
24 lines (21 loc) · 830 Bytes
/
build.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sources = ["im2col.cpp", "pooling.cpp"]
compiler = get(ENV, "CXX", "g++")
flags = ["-fPIC", "-Wall", "-O3", "-shared"]
libname = "libmochaext.so"
openmp = "-fopenmp"
@static is_apple() ? begin
if !haskey(ENV, "MOCHA_FORCE_OMP")
println("OpenMP is currently not officially supported by OS X Clang compiler yet.")
println("(see http://clang-omp.github.io/ to install OpenMP clang extension, or")
println("install gcc.")
println("")
println("Disabling OpenMP. To force enable OpenMP, set MOCHA_FORCE_OMP environment")
println("variable and set the CXX environment variable to the appropriate value")
println("to invoke GCC's g++ frontend, such as g++-5")
println("")
openmp = ""
end
end : nothing
cmd = `$compiler $flags $openmp -o $libname $sources`
println("Running $cmd")
run(cmd)