Skip to content

Commit

Permalink
Merge pull request #26 from mariux64/Add-julia-0.6.4
Browse files Browse the repository at this point in the history
Julia: Add version 0.6.4
  • Loading branch information
donald authored Sep 12, 2018
2 parents 1711ebb + 76d8d43 commit 02cea30
Showing 1 changed file with 207 additions and 0 deletions.
207 changes: 207 additions & 0 deletions julia-0.6.4-0.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
#! /bin/bash

PKG=julia
VERSION=0.6.4
BUILD=0

PREFIX=/pkg/$PKG-$VERSION-$BUILD
#PREFIX=/dev/shm/$PKG-$VERSION-$BUILD

set -xe
umask 022

BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home

exec </dev/null

mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
EOF
. $PREFIX/profile

export MAKEFLAGS="-j $(nproc)"

BUILDDIR=$PREFIX/build

mkdir -p $BUILDDIR
cd $BUILDDIR

test -e julia-${VERSION}-full.tar.gz || wget https://github.com/JuliaLang/julia/releases/download/v${VERSION}/julia-${VERSION}-full.tar.gz
test -d julia || tar xvf julia-${VERSION}-full.tar.gz
cd julia

patch -p1 <<'EOF'
From 44d590277454035841803083f57af1b861192595 Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Fri, 30 Jun 2017 11:41:41 +0200
Subject: [PATCH 1/2] Allow OpenBLAS NUM_THREADS to be overwritten
When building OpenBLAS we have some default for its NUM_THREADS build
option. Allow this default to be overwritten by a new
OPENBLAS_NUM_THREADS make variable.
---
deps/blas.mk | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/deps/blas.mk b/deps/blas.mk
index 55216c8..b9bf8ed 100644
--- a/deps/blas.mk
+++ b/deps/blas.mk
@@ -14,17 +14,18 @@ OPENBLAS_BUILD_OPTS += GEMM_MULTITHREADING_THRESHOLD=50
ifneq ($(ARCH),x86_64)
# Assume we can't address much memory to spawn many threads
# It is also unlikely that 32-bit architectures have too many cores
-OPENBLAS_BUILD_OPTS += NUM_THREADS=8
+OPENBLAS_NUM_THREADS:=8
else ifeq ($(OS),WINNT)
# Windows seems unable to handle very many
-OPENBLAS_BUILD_OPTS += NUM_THREADS=16
+OPENBLAS_NUM_THREADS:=16
else ifeq ($(OS),Darwin)
# This should suffice for the largest macs
-OPENBLAS_BUILD_OPTS += NUM_THREADS=16
+OPENBLAS_NUM_THREADS:=16
else
# On linux, try to provision for the largest possible machine currently
-OPENBLAS_BUILD_OPTS += NUM_THREADS=16
+OPENBLAS_NUM_THREADS:=16
endif
+OPENBLAS_BUILD_OPTS += NUM_THREADS=$(OPENBLAS_NUM_THREADS)
else
OPENBLAS_BUILD_OPTS += USE_THREAD=0
endif
--
2.4.1
From 93dd6a3b0e45708b902e5b7ad459d554ce45b7ab Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Fri, 30 Jun 2017 14:41:53 +0200
Subject: [PATCH 2/2] Start up OpenBLAS with 1 thread per default.
---
base/initdefs.jl | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/base/initdefs.jl b/base/initdefs.jl
index 20437a4..4f8f6e6 100644
--- a/base/initdefs.jl
+++ b/base/initdefs.jl
@@ -62,9 +62,8 @@ function early_init()
# make sure OpenBLAS does not set CPU affinity (#1070, #9639)
ENV["OPENBLAS_MAIN_FREE"] = get(ENV, "OPENBLAS_MAIN_FREE",
get(ENV, "GOTOBLAS_MAIN_FREE", "1"))
- if Sys.CPU_CORES > 8 && !("OPENBLAS_NUM_THREADS" in keys(ENV)) && !("OMP_NUM_THREADS" in keys(ENV))
- # Prevent openblas from starting too many threads, unless/until specifically requested
- ENV["OPENBLAS_NUM_THREADS"] = 8
+ if !("OPENBLAS_NUM_THREADS" in keys(ENV)) && !("OMP_NUM_THREADS" in keys(ENV))
+ Base.LinAlg.BLAS.set_num_threads(1)
end
end
--
2.4.1
From 36e4a82ba8714bd76828d56bde4431758af552fc Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Fri, 30 Jun 2017 15:44:42 +0200
Subject: [PATCH 3/3] Remove html docs
The building of html docs pull something not versioned from the internet
and made the build sudddenly fail.
Building HTML documentation.
INFO: Initializing package repository /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
INFO: Updating METADATA...
INFO: Computing changes...
INFO: Cloning cache of Compat from https://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of DocStringExtensions from https://github.com/JuliaDocs/DocStringExtensions.jl.git
INFO: Cloning cache of Documenter from https://github.com/JuliaDocs/Documenter.jl.git
INFO: Installing Compat v0.25.2
INFO: Installing DocStringExtensions v0.3.3
INFO: Installing Documenter v0.11.1
INFO: No packages to install, update or remove
Documenter: setting up build directory.
Documenter: expanding markdown templates.
Documenter: building cross-references.
Documenter: running document checks.
!! Skipped doctesting.
> checking footnote links.
Documenter: populating indices.
Documenter: rendering document.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/arrow.svg'.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/documenter.js'.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/search.js'.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/highlightjs/highlight.js'.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/highlightjs/default.css'.
!! Overwriting '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/assets/documenter.css'.
fatal: Not a git repository (or any parent up to mount point /dev/shm)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
ERROR: LoadError: failed process: Process(`git rev-parse --show-toplevel`, ProcessExited(128)) [128]
Stacktrace:
[1] pipeline_error(::Base.Process) at ./process.jl:682
[2] read(::Cmd, ::Base.DevNullStream) at ./process.jl:629
[3] readstring at ./process.jl:634 [inlined] (repeats 2 times)
[4] readchomp at ./io.jl:491 [inlined]
[5] (::Documenter.Utilities.##2#3)() at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Utilities/Utilities.jl:423
[6] cd(::Documenter.Utilities.##2#3, ::String) at ./file.jl:70
[7] url(::String, ::String) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Utilities/Utilities.jl:422
[8] render_article(::Documenter.Writers.HTMLWriter.HTMLContext, ::Documenter.Documents.NavNode) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Writers/HTMLWriter.jl:403
[9] render_page(::Documenter.Writers.HTMLWriter.HTMLContext, ::Documenter.Documents.NavNode) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Writers/HTMLWriter.jl:170
[10] render(::Documenter.Documents.Document) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Writers/HTMLWriter.jl:118
[11] dispatch(::Type{Documenter.Writers.FormatSelector}, ::Symbol, ::Documenter.Documents.Document) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Selectors.jl:164
[12] render(::Documenter.Documents.Document) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Writers/Writers.jl:66
[13] runner(::Type{Documenter.Builder.RenderDocument}, ::Documenter.Documents.Document) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Builder.jl:205
[14] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Selectors.jl:164
[15] cd(::Documenter.##2#3{Documenter.Documents.Document}, ::String) at ./file.jl:70
[16] #makedocs#1(::Bool, ::Array{Any,1}, ::Function) at /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/deps/v0.6/Documenter/src/Documenter.jl:198
[17] (::Documenter.#kw##makedocs)(::Array{Any,1}, ::Documenter.#makedocs) at ./<missing>:0
[18] include_from_node1(::String) at ./loading.jl:569
[19] include(::String) at ./sysimg.jl:14
[20] process_options(::Base.JLOptions) at ./client.jl:305
[21] _start() at ./client.jl:371
while loading /dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/make.jl, in expression starting on line 118
Makefile:33: recipe for target 'html' failed
make[2]: *** [html] Error 1
make[2]: Leaving directory '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc'
Makefile:119: recipe for target 'docs' failed
make[1]: *** [docs] Error 2
make[1]: Leaving directory '/dev/shm/bee-root/julia/julia-0.6.0-0/source'
Makefile:59: recipe for target '/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/index.html' failed
make: *** [/dev/shm/bee-root/julia/julia-0.6.0-0/source/doc/_build/html/en/index.html] Error 2
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9dfbf52..e0f3f0f 100644
--- a/Makefile
+++ b/Makefile
@@ -332,7 +332,7 @@ define stringreplace
$(build_depsbindir)/stringreplace $$(strings -t x - $1 | grep '$2' | awk '{print $$1;}') '$3' 255 "$(call cygpath_w,$1)"
endef
-install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html
+install: $(build_depsbindir)/stringreplace
@$(MAKE) $(QUIET_MAKE) all
@for subdir in $(bindir) $(datarootdir)/julia/site/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir); do \
mkdir -p $(DESTDIR)$$subdir; \
--
2.4.1
EOF

make -j $(nproc) prefix="${PREFIX}" MARCH=x86-64 OPENBLAS_NUM_THREADS=80
make install prefix="${PREFIX}" MARCH=x86-64

patchelf --remove-rpath ${PREFIX}/lib/julia/libpcre2-posix.so.1.0.1

for i in `ls ${PREFIX}/bin`; do
ln -sv ${PREFIX}/bin/$i{,-$VERSION}
done

exit

0 comments on commit 02cea30

Please sign in to comment.