Skip to content

Commit

Permalink
Hooked library parser into build script
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Jun 18, 2019
1 parent 12018d4 commit cc47273
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ end
cd(joinpath(wdir, "Singular_build"))
withenv("CPP_FLAGS"=>"-I$vdir/include", "LD_LIBRARY_PATH"=>"$vdir/lib:$nemodir/lib") do
if !debug_build
run(`$srcs/configure --prefix=$vdir --disable-static --enable-p-procs-static --disable-p-procs-dynamic --disable-gfanlib --enable-shared --with-gmp=$nemovdir --with-flint=$nemovdir --with-ntl=$vdir --without-python --with-readline=no`)
run(`$srcs/configure --with-libparse --prefix=$vdir --disable-static --enable-p-procs-static --disable-p-procs-dynamic --disable-gfanlib --enable-shared --with-gmp=$nemovdir --with-flint=$nemovdir --with-ntl=$vdir --without-python --with-readline=no`)
else
run(`$srcs/configure --prefix=$vdir --disable-static --enable-p-procs-static --disable-p-procs-dynamic --disable-gfanlib --enable-shared --with-gmp=$nemovdir --with-flint=$nemovdir --with-ntl=$vdir --without-python --with-readline=no --with-debug --enable-debug --disable-optimizationflags`)
run(`$srcs/configure --with-libparse --prefix=$vdir --disable-static --enable-p-procs-static --disable-p-procs-dynamic --disable-gfanlib --enable-shared --with-gmp=$nemovdir --with-flint=$nemovdir --with-ntl=$vdir --without-python --with-readline=no --with-debug --enable-debug --disable-optimizationflags`)
end
withenv("LDFLAGS"=>LDFLAGS) do
run(`make -j4`)
Expand Down Expand Up @@ -130,3 +130,5 @@ print("Running cmake")
run(`make VERBOSE=1`)
run(`make install`)

include("parselibs.jl")

5 changes: 3 additions & 2 deletions deps/parselibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ function execute(cmd::Cmd)
end

parsepath = abspath(joinpath(@__DIR__,"..","etc","parse_libs.sh"))
libparsepath = abspath(joinpath(@__DIR__,"..","local","bin","libparse"))

library_dir = ""

if haskey(ENV,"SINGULAR_LIBRARY_DIR")
library_dir = ENV["SINGULAR_LIBRARY_DIR"]
else
library_dir = abspath(joinpath(@__DIR__,"Singular_build","Singular","LIB"))
library_dir = abspath(joinpath(@__DIR__,"..","local","share","singular","LIB"))
end

filenames = filter(x -> endswith(x,".lib"),readdir(library_dir))
Expand All @@ -32,7 +33,7 @@ open(output_filename,"w") do outputfile
libraryfunctiondictionary = Dict(""")
for i in filenames
full_path = joinpath(library_dir,i)
libs = execute(`$parsepath $full_path`)
libs = execute(`$parsepath $libparsepath $full_path`)
println(outputfile,"""
:$(i[1:end-4]) => [
$(libs.stdout)],
Expand Down
2 changes: 1 addition & 1 deletion etc/parse_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## create json for all files

/home/sebastian/Software/Singular-git/Singular/libparse -f $1 | awk -F " " '{print "[\"" $1 "\",\"" $3 "\"]\,"}' | tail -n+4
$1 -f $2 | awk -F " " '{print "[\"" $1 "\",\"" $3 "\"]\,"}' | tail -n+4

0 comments on commit cc47273

Please sign in to comment.