Skip to content

Commit

Permalink
Early ARM compilation support; platform = Yocto linux, poky release
Browse files Browse the repository at this point in the history
  • Loading branch information
waTeim committed Feb 9, 2016
1 parent 06c9012 commit 5117457
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
build
node_modules
*.swp
*~
31 changes: 23 additions & 8 deletions binding.gyp
Expand Up @@ -8,7 +8,14 @@
{
"conditions":
[
[ "OS=='linux'", { "gcc":"<!(python tools/nj_config.py <(OS) gcc_version)" }, { "gcc":"" } ]
[ "OS=='linux'",
{
"gcc":"<!(python tools/nj_config.py <(OS) gcc_version)"
},
{
"gcc":""
}
]
],
"juliaBase":"<!(python tools/nj_config.py <(OS) base)"
},
Expand All @@ -33,6 +40,9 @@
"juliaInclude":"<(juliaBase)/include/julia"
}
],
[ "OS == 'linux'",
{ "gcc_target":"<!(python tools/nj_config.py <(OS) gcc_target)" }
],
[ "OS=='win'",
{
"juliaLib":"<(juliaBase)/bin",
Expand Down Expand Up @@ -85,10 +95,6 @@
"src/util.cpp"
],
"cflags!": [ "-fno-exceptions" ],
"cflags":
[
"-std=<(std)", "-Wno-strict-aliasing"
],
"defines":
[
'<(OS)',
Expand All @@ -112,12 +118,13 @@
],
"conditions":
[
[ "OS == 'win'",
[ "gcc_target == 'arm-poky-linux-gnueabi'",
{
"libraries":
[
"-llibjulia",
"-llibopenlibm"
"-lgfortran",
"-lopenblas",
"-ljulia"
]
},
{
Expand All @@ -131,6 +138,14 @@
},
"conditions":
[
[ "gcc_target == 'arm-poky-linux-gnueabi'",
{
"cflags": [ "-std=<(std)", "-Wno-strict-aliasing", "-march=armv7-a" ]
},
{
"cflags": [ "-std=<(std)", "-Wno-strict-aliasing" ]
}
],
[ "OS == 'mac'",
{
"xcode_settings":
Expand Down
4 changes: 2 additions & 2 deletions lib/nj.jl
Expand Up @@ -95,8 +95,8 @@ function topExpr(mod::Module,paths::Array{ASCIIString,1})
end

include(mod::Module,path,args::Vector) = include(mod,path,UTF8String[args...])
@vLT "0.5.0-dev+2400" readAllFromFile(filename) = readall(filename)
@vGE "0.5.0-dev+2400" readAllFromFile(filename) = readstring(filename)
@vLT "0.5.0-dev+2300" readAllFromFile(filename) = readall(filename)
@vGE "0.5.0-dev+2300" readAllFromFile(filename) = readstring(filename)

function scriptify(mod::Module,filename::ASCIIString)
ast = parse("function _(args...)\n" * readAllFromFile(filename) * "end");
Expand Down
15 changes: 13 additions & 2 deletions tools/nj_config.py
Expand Up @@ -85,10 +85,19 @@ def get_gcc_version():
which_gcc = which("gcc")
if len(which_gcc) > 0:
output = subprocess.Popen([which_gcc,"--version"],stdout=subprocess.PIPE).communicate()[0]
line1 = output.split("\n")[0]
version = re.sub(r"^gcc.*\) ([0-9]*\.[0-9]*)\.([0-9]*)$","\g<1>",line1)
line = output.split("\n")[0]
version = re.sub(r"^gcc.*\) ([0-9]*\.[0-9]*)\.([0-9]*)$","\g<1>",line)
return version

def get_gcc_target():
version = ""
which_gcc = which("gcc")
if len(which_gcc) > 0:
output = subprocess.Popen([which_gcc,"-v"],stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()[1]
line = output.split("\n")[3]
target = line.split()[1]
return target

if sys.argv[2] == "version": print node_version()
elif sys.argv[2] == "base":
path = find_julia_base(sys.argv[1])
Expand All @@ -99,3 +108,5 @@ def get_gcc_version():
print get_julia_lib_define_variable(sys.argv[1])
elif sys.argv[2] == "gcc_version":
print get_gcc_version()
elif sys.argv[2] == "gcc_target":
print get_gcc_target()

0 comments on commit 5117457

Please sign in to comment.