Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ notifications:
- http://julia.mit.edu:8000/travis-hook
before_install:
- make check-whitespace
- JULIA_SYSIMG_BUILD_FLAGS="--output-ji ../usr/lib/julia/sys.ji"
- if [ `uname` = "Linux" ]; then
contrib/travis_fastfail.sh || exit 1;
mkdir -p $HOME/bin;
Expand Down Expand Up @@ -86,15 +85,20 @@ before_install:
export LDFLAGS="-L$(brew --prefix openblas-julia)/lib -L$(brew --prefix suite-sparse-julia)/lib";
export DYLD_FALLBACK_LIBRARY_PATH="/usr/local/lib:/lib:/usr/lib:$(brew --prefix openblas-julia)/lib:$(brew --prefix suite-sparse-julia)/lib:$(brew --prefix arpack-julia)/lib";
make $BUILDOPTS -C contrib -f repackage_system_suitesparse4.make;
JULIA_SYSIMG_BUILD_FLAGS="$JULIA_SYSIMG_BUILD_FLAGS --compile=all";
COMPILE_MODE="--compile=min";
COMPILE_MODE="--compile=min --sysimage=/tmp/julia/lib/julia/sys-all.dylib";
TESTSTORUN="core ccall mmap llvmcall threads"; fi # TODO: turn this back to "all" once it's fast enough to not time out
- git clone -q git://git.kitenet.net/moreutils
script:
- make -C moreutils mispipe
- make $BUILDOPTS -C base version_git.jl.phony
- moreutils/mispipe "make $BUILDOPTS NO_GIT=1 -C deps" bar > deps.log || cat deps.log
- make $BUILDOPTS NO_GIT=1 JULIA_SYSIMG_BUILD_FLAGS="$JULIA_SYSIMG_BUILD_FLAGS" prefix=/tmp/julia install | moreutils/ts -s "%.s"
- make $BUILDOPTS NO_GIT=1 release | moreutils/ts -s "%.s"
- make $BUILDOPTS NO_GIT=1 debug | moreutils/ts -s "%.s"
- if [ `uname` = "Darwin" ]; then
make $BUILDOPTS NO_GIT=1 julia-sysimg-all-release | moreutils/ts -s "%.s";
make $BUILDOPTS NO_GIT=1 julia-sysimg-all-debug | moreutils/ts -s "%.s";
fi
- make $BUILDOPTS NO_GIT=1 prefix=/tmp/julia install | moreutils/ts -s "%.s" # due to limited memory, link julia-sysimg-debug in a separate step
- make $BUILDOPTS NO_GIT=1 build-stats
- du -sk /tmp/julia/*
- if [ `uname` = "Darwin" ]; then
Expand All @@ -103,8 +107,6 @@ script:
done;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep this as discussed in the rebased-out commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Even if slightly redundant I don't see much benefit in removing this test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't actually want to be installing sys.ji (which is a build intermediate). otoh, this command is now being run as part of bootstrapping, so it should be redundant to run it again as part of the tests

this test, added by e92fc78, was obsoleted by f0712f0 which removed the code path that this was supposed to test (4776757#commitcomment-9240188)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point that we probably don't want it in the average install. So we can change this test to run in the build tree. This functionality is still valuable for anyone who wants to run from a custom image but does not have a linker available, so we should continue testing it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionality is still valuable for anyone....

sadly true. this PR is actually starting to test some ideas i have for fixing that. there's no solid reason we can't emit a better incremental build. that's probably a prereq for #5155 anyhow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also no reason we couldn't try to build and ship lld. It might not be fully functional yet in ld-mode on Windows, but link.exe mode should mostly work now AIUI.

fi
- cd .. && mv julia julia2
- cp /tmp/julia/lib/julia/sys.ji local.ji && /tmp/julia/bin/julia -J local.ji -e 'true' &&
/tmp/julia/bin/julia-debug -J local.ji -e 'true' && rm local.ji
- /tmp/julia/bin/julia -e 'versioninfo()'
- export JULIA_CPU_CORES=2 && export JULIA_TEST_MAXRSS_MB=600 && cd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes $COMPILE_MODE runtests.jl $TESTSTORUN &&
Expand Down
52 changes: 35 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,23 @@ julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.in
julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/ui julia-$*

julia-inference : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/inference.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
julia-sysimg : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
julia-sysimg-all : julia-sysimg
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-all.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)

julia-sysimg-release : julia-inference julia-ui-release
julia-sysimg-release : julia-sysimg julia-ui-release
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.$(SHLIB_EXT) JULIA_BUILD_MODE=release

julia-sysimg-debug : julia-inference julia-ui-debug
julia-sysimg-all-release : julia-sysimg-all julia-ui-release
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-all.$(SHLIB_EXT) JULIA_BUILD_MODE=release
julia-sysimg-debug : julia-sysimg julia-ui-debug
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) JULIA_BUILD_MODE=debug
julia-sysimg-all-debug : julia-sysimg-all julia-ui-debug
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-all-debug.$(SHLIB_EXT) JULIA_BUILD_MODE=debug

julia-debug julia-release : julia-% : julia-ui-% julia-sysimg-% julia-symlink julia-libccalltest

debug release : % : julia-%
julia-all-debug julia-all-release : julia-all-% : julia-ui-% julia-sysimg-all-% julia-symlink julia-libccalltest
debug release all-debug all-release : % : julia-%

julia-genstdlib: julia-sysimg-$(JULIA_BUILD_MODE)
@$(call PRINT_JULIA, $(JULIA_EXECUTABLE) $(call cygpath_w, $(JULIAHOME)/doc/genstdlib.jl))
Expand Down Expand Up @@ -212,21 +217,33 @@ BASE_SRCS := $(shell find $(JULIAHOME)/base -name \*.jl)

$(build_private_libdir)/inference.ji: $(CORE_SRCS) | $(build_private_libdir)
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
$(call spawn,$(JULIA_EXECUTABLE)) -C $(JULIA_CPU_TARGET) --output-ji $(call cygpath_w,$@) -f \
$(call spawn,$(JULIA_EXECUTABLE)) -O0 -C $(JULIA_CPU_TARGET) --output-ji $(call cygpath_w,$@) -f \
coreimg.jl)

$(build_private_libdir)/sys.ji: $(build_private_libdir)/inference.ji $(JULIAHOME)/VERSION $(BASE_SRCS)
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
$(call spawn,$(JULIA_EXECUTABLE)) -O0 -C $(JULIA_CPU_TARGET) --output-ji $(call cygpath_w,$@) $(JULIA_SYSIMG_BUILD_FLAGS) -f \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the performance consequences of building this with -O0 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it builds faster

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only affects native code, and this step doesn't save native code so it shouldn't matter AFAICT.

-J $(call cygpath_w,$<) sysimg.jl $(RELBUILDROOT) \
|| { echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***' && false; } )

$(build_private_libdir)/sys-all.ji: $(build_private_libdir)/sys.ji
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
$(call spawn,$(JULIA_EXECUTABLE)) -O0 -C $(JULIA_CPU_TARGET) --output-ji $(call cygpath_w,$@) --compile=all -f \
-J $(call cygpath_w,$<) -e nothing)

RELBUILDROOT := $(shell $(JULIAHOME)/contrib/relative_path.sh "$(JULIAHOME)/base" "$(BUILDROOT)/base/")
COMMA:=,
define sysimg_builder
$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/inference.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS)
$$(build_private_libdir)/sys$1$2.bc $$(build_private_libdir)/sys$1$2.o: $$(build_private_libdir)/sys$1$2.% : $$(build_private_libdir)/sys$1.ji
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
$$(call spawn,$3) $2 -C $$(JULIA_CPU_TARGET) --output-o $$(call cygpath_w,$$@) $$(JULIA_SYSIMG_BUILD_FLAGS) -f \
-J $$(call cygpath_w,$$<) sysimg.jl $$(RELBUILDROOT) \
|| { echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***' && false; } )
.SECONDARY: $(build_private_libdir)/sys$1.o
$$(call spawn,$4) $3 -C $$(JULIA_CPU_TARGET) --output-$$* $$(call cygpath_w,$$@) $$(JULIA_SYSIMG_BUILD_FLAGS) -f \
-J $$(call cygpath_w,$$<) -e nothing)
.SECONDARY: $(build_private_libdir)/sys$1$2.o $(build_private_libdir)/sys$1$2.bc
endef
$(eval $(call sysimg_builder,,-O3,$(JULIA_EXECUTABLE_release)))
$(eval $(call sysimg_builder,-debug,-O0,$(JULIA_EXECUTABLE_debug)))
$(eval $(call sysimg_builder,,,-O3,$(JULIA_EXECUTABLE_release)))
$(eval $(call sysimg_builder,,-debug,-O0,$(JULIA_EXECUTABLE_debug)))
$(eval $(call sysimg_builder,-all,,--compile=all -O3,$(JULIA_EXECUTABLE_release)))
$(eval $(call sysimg_builder,-all,-debug,--compile=all -O0,$(JULIA_EXECUTABLE_debug)))

$(build_bindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(build_bindir)
@$(call PRINT_CC, $(HOSTCC) -o $(build_bindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c)
Expand Down Expand Up @@ -365,7 +382,8 @@ endif
endif
$(INSTALL_F) $(addprefix $(JULIAHOME)/,src/julia.h src/julia_threads.h src/julia_version.h src/support/*.h) $(DESTDIR)$(includedir)/julia
# Copy system image
-$(INSTALL_F) $(build_private_libdir)/sys.ji $(DESTDIR)$(private_libdir)
-$(INSTALL_M) $(build_private_libdir)/sys-all.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
-$(INSTALL_M) $(build_private_libdir)/sys-all-debug.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when and why would we ever build and install this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm hoping we can transition to making these the default. they can also be useful building blocks for making a static compiler

$(INSTALL_M) $(build_private_libdir)/sys.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
$(INSTALL_M) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
# Copy in system image build script
Expand Down Expand Up @@ -640,7 +658,7 @@ LLVM_SIZE := $(build_bindir)/llvm-size$(EXE)
endif
build-stats:
@echo $(JULCOLOR)' ==> ./julia binary sizes'$(ENDCOLOR)
$(call spawn,$(LLVM_SIZE) -A $(build_private_libdir)/sys.$(SHLIB_EXT) $(build_shlibdir)/libjulia.$(SHLIB_EXT) $(build_bindir)/julia$(EXE))
$(call spawn,$(LLVM_SIZE) -A $(build_private_libdir)/sys*.$(SHLIB_EXT) $(build_shlibdir)/libjulia.$(SHLIB_EXT) $(build_bindir)/julia$(EXE))
@echo $(JULCOLOR)' ==> ./julia launch speedtest'$(ENDCOLOR)
@time $(call spawn,$(build_bindir)/julia$(EXE) -e '')
@time $(call spawn,$(build_bindir)/julia$(EXE) -e '')
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ build_script:

test_script:
- usr\bin\julia -e "versioninfo()"
- copy usr\lib\julia\sys.ji local.ji && usr\bin\julia -J local.ji -e "true" && del local.ji
- cd test && ..\usr\bin\julia runtests.jl all && ..\usr\bin\julia runtests.jl libgit2-online pkg
1 change: 0 additions & 1 deletion contrib/windows/msys_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ for lib in SUITESPARSE ARPACK BLAS LAPACK FFTW \
done
echo 'override LIBLAPACK = $(LIBBLAS)' >> Make.user
echo 'override LIBLAPACKNAME = $(LIBBLASNAME)' >> Make.user
echo 'JULIA_SYSIMG_BUILD_FLAGS=--output-ji ../usr/lib/julia/sys.ji' >> Make.user

# Remaining dependencies:
# libuv since its static lib is no longer included in the binaries
Expand Down