From b4f432f3d8cdd8cfe54bff39f7642b345dab4c47 Mon Sep 17 00:00:00 2001 From: thofma Date: Wed, 12 Apr 2017 15:41:49 +0200 Subject: [PATCH] Tweak build.jl (#158) Update build.jl --- deps/build.jl | 81 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index 2c58c5e7dd..80877e9f5b 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -5,9 +5,16 @@ wdir = Pkg.dir("Nemo", "deps") vdir = Pkg.dir("Nemo", "local") if !ispath(Pkg.dir("Nemo", "local")) + + mkdir(Pkg.dir("Nemo", "local")) + + if !ispath(Pkg.dir("Nemo", "local", "lib")) + mkdir(Pkg.dir("Nemo", "local", "lib")) + end +else + println("Deleting old $vdir") + rm(vdir, force=true, recursive=true) mkdir(Pkg.dir("Nemo", "local")) -end -if !ispath(Pkg.dir("Nemo", "local", "lib")) mkdir(Pkg.dir("Nemo", "local", "lib")) end @@ -26,6 +33,8 @@ end #install libpthreads +print("Downloading libpthread ... ") + if is_windows() if Int == Int32 download_dll("http://nemocas.org/binaries/w32-libwinpthread-1.dll", joinpath(vdir, "lib", "libwinpthread-1.dll")) @@ -34,6 +43,8 @@ if is_windows() end end +println("DONE") + cd(wdir) # install M4 @@ -42,6 +53,7 @@ if !is_windows() try run(`m4 --version`) catch + print("Building m4 ... ") download("http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.bz2", joinpath(wdir, "m4-1.4.17.tar.bz2")) run(`tar -xvf m4-1.4.17.tar.bz2`) run(`rm m4-1.4.17.tar.bz2`) @@ -49,6 +61,7 @@ if !is_windows() run(`./configure --prefix=$vdir`) run(`make`) run(`make install`) + print("DONE") end end @@ -58,12 +71,14 @@ cd(wdir) if !is_windows() if !ispath(Pkg.dir("Nemo", "local", "yasm-1.3.0")) + print("Building yasm ... ") download("http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz", "yasm-1.3.0.tar.gz") run(`tar -xvf yasm-1.3.0.tar.gz`) run(`rm yasm-1.3.0.tar.gz`) cd(joinpath("$wdir","yasm-1.3.0")) run(`./configure`) run(`make`) + println("DONE") end end @@ -72,16 +87,21 @@ cd(wdir) # install GMP/MPIR if !ispath(Pkg.dir("Nemo", "local", "mpir-3.0.0")) + print("Downloading MPIR sources ... ") download("http://mpir.org/mpir-3.0.0.tar.bz2", joinpath(wdir, "mpir-3.0.0.tar.bz2")) + println("DONE") end if is_windows() + print("Downloading MPIR ... ") if Int == Int32 download_dll("http://nemocas.org/binaries/w32-libgmp-16.dll", joinpath(vdir, "lib", "libgmp-16.dll")) else download_dll("http://nemocas.org/binaries/w64-libgmp-16.dll", joinpath(vdir, "lib", "libgmp-16.dll")) end + println("DONE") else + print("Building MPIR ... ") run(`tar -xvf mpir-3.0.0.tar.bz2`) run(`rm mpir-3.0.0.tar.bz2`) cd("$wdir/mpir-3.0.0") @@ -95,6 +115,7 @@ else run(`make install`) cd(wdir) run(`rm -rf bin`) + println("DONE") end cd(wdir) @@ -102,16 +123,21 @@ cd(wdir) # install MPFR if !ispath(Pkg.dir("Nemo", "local", "mpfr-3.1.5")) + print("Downloading MPFR sources ... ") download("http://www.mpfr.org/mpfr-current/mpfr-3.1.5.tar.bz2", joinpath(wdir, "mpfr-3.1.5.tar.bz2")) + println("DONE") end if is_windows() + print("Downloading MPFR ... ") if Int == Int32 download_dll("http://nemocas.org/binaries/w32-libmpfr-4.dll", joinpath(vdir, "lib", "libmpfr-4.dll")) else download_dll("http://nemocas.org/binaries/w64-libmpfr-4.dll", joinpath(vdir, "lib", "libmpfr-4.dll")) end + println("DONE") else + print("Building MPFR ... ") run(`tar -xvf mpfr-3.1.5.tar.bz2`) run(`rm mpfr-3.1.5.tar.bz2`) cd("$wdir/mpfr-3.1.5") @@ -121,6 +147,7 @@ else run(`make install`) end cd(wdir) + println("DONE") end cd(wdir) @@ -128,17 +155,21 @@ cd(wdir) # install ANTIC if !is_windows() + print("Cloning antic ... ") try run(`git clone https://github.com/wbhart/antic.git`) cd(joinpath("$wdir", "antic")) run(`git checkout 119d15d686436d94f39fd3badf5eea4acf94ab72`) cd(wdir) catch - cd(joinpath("$wdir", "antic")) - run(`git pull`) - run(`git checkout 119d15d686436d94f39fd3badf5eea4acf94ab72`) - cd(wdir) + if ispath(joinpath("$wdir", "antic")) + cd(joinpath("$wdir", "antic")) + run(`git pull`) + run(`git checkout 119d15d686436d94f39fd3badf5eea4acf94ab72`) + cd(wdir) + end end + println("DONE") end cd(wdir) @@ -146,19 +177,24 @@ cd(wdir) # install FLINT if !is_windows() try + print("Cloning flint2 ... ") run(`git clone https://github.com/wbhart/flint2.git`) cd(joinpath("$wdir", "flint2")) - run(`git checkout f81d8805b9fb79fcd2a6a9eef61c525e58ef425b`) + run(`git checkout 768d1aaa54516ddb351a06683e532ead54d47470`) cd(wdir) catch - cd(joinpath("$wdir", "flint2")) - run(`git pull`) - run(`git checkout f81d8805b9fb79fcd2a6a9eef61c525e58ef425b`) - cd(wdir) + if ispath(joinpath("$wdir", "flint2")) + cd(joinpath("$wdir", "flint2")) + run(`git pull`) + run(`git checkout 768d1aaa54516ddb351a06683e532ead54d47470`) + cd(wdir) + end end + println("DONE") end if is_windows() + print("Downloading flint ... ") if Int == Int32 download_dll("http://nemocas.org/binaries/w32-libflint.dll", joinpath(vdir, "lib", "libflint.dll")) else @@ -169,13 +205,16 @@ if is_windows() catch cp(joinpath(vdir, "lib", "libflint.dll"), joinpath(vdir, "lib", "libflint-13.dll"), remove_destination=true) end + println("DONE") else + print("Building flint ... ") cd(joinpath("$wdir", "flint2")) withenv("LD_LIBRARY_PATH"=>"$vdir/lib", "LDFLAGS"=>LDFLAGS) do run(`./configure --prefix=$vdir --extensions="$wdir/antic" --disable-static --enable-shared --with-mpir=$vdir --with-mpfr=$vdir`) run(`make -j4`) run(`make install`) end + println("DONE") end cd(wdir) @@ -183,32 +222,40 @@ cd(wdir) # INSTALL ARB if !is_windows() + print("Cloning arb ... ") try run(`git clone https://github.com/fredrik-johansson/arb.git`) cd(joinpath("$wdir", "arb")) - run(`git checkout b30933ace9762d1de6ffd56fb579230604267330`) + run(`git checkout 99c1696b48de74959ccb6bd88187e8b15262ff4d`) cd(wdir) catch - cd(joinpath("$wdir", "arb")) - run(`git pull`) - run(`git checkout b30933ace9762d1de6ffd56fb579230604267330`) - cd(wdir) - end + if ispath(joinpath("$wdir", "arb")) + cd(joinpath("$wdir", "arb")) + run(`git pull`) + run(`git checkout 99c1696b48de74959ccb6bd88187e8b15262ff4d`) + cd(wdir) + end + end + println("DONE") end if is_windows() + print("Downloading arb ... ") if Int == Int32 download_dll("http://nemocas.org/binaries/w32-libarb.dll", joinpath(vdir, "lib", "libarb.dll")) else download_dll("http://nemocas.org/binaries/w64-libarb.dll", joinpath(vdir, "lib", "libarb.dll")) end + println("DONE") else + print("Building arb ... ") cd(joinpath("$wdir", "arb")) withenv("LD_LIBRARY_PATH"=>"$vdir/lib", "LDFLAGS"=>LDFLAGS) do run(`./configure --prefix=$vdir --disable-static --enable-shared --with-mpir=$vdir --with-mpfr=$vdir --with-flint=$vdir`) run(`make -j4`) run(`make install`) end + println("DONE") end cd(wdir)