From 0af7cea2201bb4c886969e5d6ccffa2ab9097484 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 6 Apr 2017 23:18:28 -0400 Subject: [PATCH] different approach to building and testing examples/embedding --- .travis.yml | 4 ++-- Makefile | 10 +++------- appveyor.yml | 5 +++-- contrib/julia-config.jl | 4 +++- contrib/windows/msys_build.sh | 1 + examples/Makefile | 4 ++-- test/embedding.jl | 3 ++- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab56b90b465295..b01c6f4f28b527 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,14 +121,14 @@ script: install -pm755 usr/lib/lib${name}*.dylib* /tmp/julia/lib/julia/; done; fi + - make $BUILDOPTS NO_GIT=1 prefix=/tmp/julia -C examples - cd .. && mv julia julia2 - /tmp/julia/bin/julia --precompiled=no -e 'true' && /tmp/julia/bin/julia-debug --precompiled=no -e 'true' - /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 runtests.jl $TESTSTORUN && - /tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg embedding + /tmp/julia/bin/julia --check-bounds=yes runtests.jl embedding - cd `dirname $TRAVIS_BUILD_DIR` && mv julia2 julia && rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log # uncomment the following if failures are suspected to be due to the out-of-memory killer diff --git a/Makefile b/Makefile index a7f94fb169abbd..846b252996923d 100644 --- a/Makefile +++ b/Makefile @@ -68,15 +68,12 @@ $(build_prefix)/.examples: $(wildcard $(JULIAHOME)/examples/*.jl) \ @echo Copying in usr/share/doc/julia/examples @-rm -fr $(build_docdir)/examples @mkdir -p $(build_docdir)/examples - @mkdir -p $(build_docdir)/examples/embedding @cp -R $(JULIAHOME)/examples/*.jl $(build_docdir)/examples/ + @cp -R $(JULIAHOME)/examples/Makefile $(build_docdir)/examples/ @cp -R $(JULIAHOME)/examples/clustermanager $(build_docdir)/examples/ - @cp -R $(JULIAHOME)/examples/embedding $(build_docdir)/examples/embedding + @cp -R $(JULIAHOME)/examples/embedding $(build_docdir)/examples @echo 1 > $@ -examples: julia-sysimg-$(JULIA_BUILD_MODE) - @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/examples $(JULIA_BUILD_MODE) - julia-symlink: julia-ui-$(JULIA_BUILD_MODE) ifneq ($(OS),WINNT) ifndef JULIA_VAGRANT_BUILD @@ -114,7 +111,7 @@ julia-sysimg-release : julia-inference julia-ui-release julia-sysimg-debug : julia-inference julia-ui-debug @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-debug$(CPUID_TAG).$(SHLIB_EXT) JULIA_BUILD_MODE=debug -julia-debug julia-release : julia-% : julia-ui-% julia-sysimg-% julia-symlink julia-libccalltest examples +julia-debug julia-release : julia-% : julia-ui-% julia-sysimg-% julia-symlink julia-libccalltest debug release : % : julia-% @@ -347,7 +344,6 @@ ifeq ($(OS),WINNT) -$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/ -$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/ -$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/ - -$(INSTALL_M) $(build_libexecdir)/*.exe $(DESTDIR)$(libexecdir)/ else -cp -a $(build_libexecdir) $(DESTDIR)$(prefix) diff --git a/appveyor.yml b/appveyor.yml index e8cec32f6c96bc..6e7459cfea70fb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,5 +55,6 @@ build_script: test_script: - usr\bin\julia -e "versioninfo()" - usr\bin\julia --precompiled=no -e "true" - - cd test && ..\usr\bin\julia --check-bounds=yes runtests.jl all && - ..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online download pkg embedding + - cd test && ..\usr\bin\julia runtests.jl embedding +# - cd test && ..\usr\bin\julia --check-bounds=yes runtests.jl all && +# ..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online download pkg embedding diff --git a/contrib/julia-config.jl b/contrib/julia-config.jl index 7a175bdf800781..889c6b075202f2 100755 --- a/contrib/julia-config.jl +++ b/contrib/julia-config.jl @@ -23,6 +23,8 @@ function libDir() end end +private_libDir() = joinpath(libDir(), "julia") + function includeDir() joinpath(match(r"(.*)(bin)",JULIA_HOME).captures[1],"include","julia") end @@ -59,7 +61,7 @@ function ldlibs() "julia" end if is_unix() - return replace("""-Wl,-rpath,$(libDir()) -l$libname""","\\","\\\\") + return replace("""-Wl,-rpath,$(libDir()) -Wl,-rpath,$(private_libDir()) -l$libname""","\\","\\\\") else return "-l$libname -lopenlibm" end diff --git a/contrib/windows/msys_build.sh b/contrib/windows/msys_build.sh index 715a1c858ad43a..beed73e887952e 100755 --- a/contrib/windows/msys_build.sh +++ b/contrib/windows/msys_build.sh @@ -206,3 +206,4 @@ cat Make.user make -j3 VERBOSE=1 make build-stats #make debug +make prefix=/c/projects/julia/usr VERBOSE=1 -C examples diff --git a/examples/Makefile b/examples/Makefile index 56e328bdd9c28e..80df7ed5b253a4 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -3,7 +3,7 @@ BUILDDIR := . JULIAHOME := $(abspath $(SRCDIR)/..) include $(JULIAHOME)/Make.inc -embedding_binary := $(abspath $(build_libexecdir)/embedding$(JULIA_LIBSUFFIX)$(EXE)) +embedding_binary := $(abspath $(libexecdir)/embedding$(JULIA_LIBSUFFIX)$(EXE)) release: embedding debug: embedding-debug @@ -13,7 +13,7 @@ embedding-debug: $(embedding_binary) $(embedding_binary): $(wildcard embedding/*) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/examples/embedding $(JULIA_BUILD_MODE) \ - JULIA="$(JULIA_EXECUTABLE)" BIN="$(build_libexecdir)" \ + JULIA="$(bindir)/julia$(JULIA_LIBSUFFIX)$(EXE)" BIN="$(libexecdir)" \ SPAWN="$(spawn)" CC="$(CC)" clean: diff --git a/test/embedding.jl b/test/embedding.jl index 2e78c45db10ca0..098641a06a8ce5 100644 --- a/test/embedding.jl +++ b/test/embedding.jl @@ -1,6 +1,7 @@ # test that the embedding example runs without error let - embedding_bin = joinpath(JULIA_HOME,"..","libexec","embedding") + exename = "embedding" * (is_windows() ? ".exe" : "") + embedding_bin = joinpath(JULIA_HOME,"..","libexec",exename) lines = readlines(pipeline(`$(embedding_bin)`, stderr=DevNull)) @test length(lines) == 5