Skip to content

Commit

Permalink
Move JL_LIBDIR and JL_PRIVATE_LIBDIR definitions higher in the file, …
Browse files Browse the repository at this point in the history
…as they are supposedly being used before being defined

Move sys.ji to JL_PRIVATE_LIBDIR to fix not being able to `make clean && make` properly
Don't remove JL_LIBDIR so that we don't have to re-test a bunch of external dependencies' libraries
  • Loading branch information
staticfloat committed Nov 21, 2012
1 parent 04306d0 commit 039a9d3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
32 changes: 16 additions & 16 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ USRINC = $(USR)/include
LLVMROOT = $(USR)
BUILD = $(USR)

# List of "private" libraries, e.g. ones that get installed to lib/julia
JL_PRIVATE_LIBS = Rmath openlibm julia-release suitesparse_wrapper tk_wrapper gmp_wrapper glpk_wrapper random
JL_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads fftw3f_threads glpk gmp grisu history $(OPENBLASNAME) pcre readline spqr umfpack z

# Directories where said libraries get installed to
JL_PRIVATE_LIBDIR = lib/julia
JL_LIBDIR = lib

# If we're on debian, default to arch-dependent library dirs
ifeq ($(USE_DEBIAN), 1)
MULTIARCH = $(shell gcc -print-multiarch)
JL_PRIVATE_LIBDIR = lib/$(MULTIARCH)/julia
JL_LIBDIR = lib/$(MULTIARCH)/
endif

OS = $(shell uname)
ARCH = $(shell uname -m)

Expand Down Expand Up @@ -78,7 +93,7 @@ endif
endif

# if not absolute, then relative to JULIA_HOME
JCFLAGS += '-DJL_SYSTEM_IMAGE_PATH="../share/julia/sys.ji"'
JCFLAGS += '-DJL_SYSTEM_IMAGE_PATH="../$(JL_PRIVATE_LIBDIR)/sys.ji"'

# OPENBLAS build options
OPENBLAS_DYNAMIC_ARCH=0
Expand Down Expand Up @@ -266,21 +281,6 @@ LIBBLASNAME = libsatlas
LIBLAPACKNAME = $(LIBBLASNAME)
endif

# List of "private" libraries, e.g. ones that get installed to lib/julia
JL_PRIVATE_LIBS = Rmath openlibm julia-release suitesparse_wrapper tk_wrapper gmp_wrapper glpk_wrapper random
JL_LIBS = amd arpack cholmod colamd fftw3 fftw3f fftw3_threads fftw3f_threads glpk gmp grisu history $(OPENBLASNAME) pcre readline spqr umfpack z

# Directories where said libraries get installed to
JL_PRIVATE_LIBDIR = lib/julia
JL_LIBDIR = lib

# If we're on debian, default to arch-dependent library dirs
ifeq ($(USE_DEBIAN), 1)
MULTIARCH = $(shell gcc -print-multiarch)
JL_PRIVATE_LIBDIR = lib/$(MULTIARCH)/julia
JL_LIBDIR = lib/$(MULTIARCH)/
endif

# Make tricks

define dir_target
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ endif

debug release: | $(DIRS) $(BUILD)/share/julia/extras $(BUILD)/share/julia/base $(BUILD)/share/julia/test $(BUILD)/share/julia/doc $(BUILD)/share/julia/examples
@$(MAKEs) julia-$@
@$(MAKEs) JULIA_EXECUTABLE=$(JULIA_EXECUTABLE_$@) $(BUILD)/share/julia/sys.ji
@export JL_PRIVATE_LIBDIR=$(JL_PRIVATE_LIBDIR) && \
$(MAKEs) JULIA_EXECUTABLE=$(JULIA_EXECUTABLE_$@) $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji

julia-debug julia-release:
@$(MAKEs) -C deps
Expand All @@ -30,9 +31,9 @@ $(BUILD)/share/julia/helpdb.jl: doc/helpdb.jl | $(BUILD)/share/julia
@cp $< $@

# use sys.ji if it exists, otherwise run two stages
$(BUILD)/share/julia/sys.ji: VERSION base/*.jl $(BUILD)/share/julia/helpdb.jl
$(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji: VERSION base/*.jl $(BUILD)/share/julia/helpdb.jl
$(QUIET_JULIA) cd base && \
(test -f $(BUILD)/share/julia/sys.ji || $(JULIA_EXECUTABLE) -bf sysimg.jl) && $(JULIA_EXECUTABLE) -f sysimg.jl || echo "Note: this error is usually fixed by running 'make clean'."
(test -f $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji || $(JULIA_EXECUTABLE) -bf sysimg.jl) && $(JULIA_EXECUTABLE) -f sysimg.jl || echo "Note: this error is usually fixed by running 'make clean'."

ifeq ($(OS), WINNT)
OPENBLASNAME=openblas-r0.1.1
Expand Down Expand Up @@ -95,11 +96,11 @@ clean: | $(CLEAN_TARGETS)
done \
done
@rm -f *~ *# *.tar.gz
@rm -fr $(BUILD)/$(JL_LIBDIR)
@rm -fr $(BUILD)/$(JL_PRIVATE_LIBDIR)

cleanall: clean
@$(MAKE) -C src clean-flisp clean-support
@rm -fr $(BUILD)/$(JL_LIBDIR)
# @$(MAKE) -C deps clean-uv

.PHONY: default debug release julia-debug julia-release \
Expand Down
3 changes: 2 additions & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ end # module Base

using Base

JL_PRIVATE_LIBDIR = getenv("JL_PRIVATE_LIBDIR")
# create system image file
ccall(:jl_save_system_image, Void, (Ptr{Uint8},Ptr{Uint8}),
"$JULIA_HOME/../share/julia/sys.ji", "start_image.jl")
"$JULIA_HOME/../$JL_PRIVATE_LIBDIR/sys.ji", "start_image.jl")

0 comments on commit 039a9d3

Please sign in to comment.