Skip to content

Commit

Permalink
Merge pull request #2550 from stevengj/lib_path
Browse files Browse the repository at this point in the history
RFC: add .../share/julia/site/v0.1 to default LOAD_PATH
  • Loading branch information
stevengj committed Mar 20, 2013
2 parents 0303fa1 + 7a134ba commit 5961203
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
JULIAHOME = $(abspath .)
include $(JULIAHOME)/Make.inc

# TODO: Code bundled with Julia should be installed into a versioned directory,
# PREFIX/share/julia/VERSDIR, so that in the future one can have multiple
# major versions of Julia installed concurrently. Third-party code that
# is not controlled by Pkg should be installed into
# PREFIX/share/julia/site/VERSDIR (not PREFIX/share/julia/VERSDIR/site ...
# so that PREFIX/share/julia/VERSDIR can be overwritten without touching
# third-party code).
VERSDIR = v`cut -d. -f1-2 < VERSION`

all: default
default: release

Expand Down Expand Up @@ -55,7 +64,7 @@ JL_PRIVATE_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads \

PREFIX ?= julia-$(JULIA_COMMIT)
install: release
@for subdir in "bin" "libexec" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" "include/julia" ; do \
@for subdir in "bin" "libexec" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" "include/julia" "share/julia/site/"$(VERSDIR) ; do \
mkdir -p $(PREFIX)/$$subdir ; \
done
ifeq ($(OS), Darwin)
Expand Down
3 changes: 3 additions & 0 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,13 @@ is_interactive = false
isinteractive() = (is_interactive::Bool)

function init_load_path()
vers="v$(VERSION.major).$(VERSION.minor)"
global const LOAD_PATH = ByteString[
".", # TODO: should we really look here?
abspath(Pkg.dir()),
abspath(JULIA_HOME,"..","share","julia","extras"),
abspath(JULIA_HOME,"..","local","share","julia","site",vers),
abspath(JULIA_HOME,"..","share","julia","site",vers)
]
end

Expand Down

0 comments on commit 5961203

Please sign in to comment.