Skip to content

Commit

Permalink
Run embedding test on appveyor and travis
Browse files Browse the repository at this point in the history
always use libexec for embedding executable
  • Loading branch information
ihnorton authored and JeffBezanson committed Apr 13, 2017
1 parent 1f05ba9 commit 87601aa
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,15 @@ 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
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg 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
Expand Down
1 change: 1 addition & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(libdir))
build_private_libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(build_bindir) $(build_private_libdir))
private_libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(private_libdir))
datarootdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(datarootdir))
libexecdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(libexecdir))
docdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(docdir))
sysconfdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(sysconfdir))
includedir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(includedir))
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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-%

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ 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
..\usr\bin\julia --check-bounds=yes runtests.jl libgit2-online download pkg embedding
1 change: 1 addition & 0 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ endif
@echo "const DATAROOTDIR = \"$(datarootdir_rel)\"" >> $@
@echo "const DOCDIR = \"$(docdir_rel)\"" >> $@
@echo "const LIBDIR = \"$(libdir_rel)\"" >> $@
@echo "const LIBEXECDIR = \"$(libexecdir_rel)\"" >> $@
@echo "const INCLUDEDIR = \"$(includedir_rel)\"" >> $@

@# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl,
Expand Down
12 changes: 10 additions & 2 deletions contrib/julia-config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +51,13 @@ function initDir()
end

function ldflags()
replace("""-L$(libDir())""","\\","\\\\")
fl = replace("""-L$(libDir())""","\\","\\\\")
if is_windows()
fl = fl * " -Wl,--stack,8388608"
elseif is_linux()
fl = fl * " -Wl,--export-dynamic"
end
return fl
end

function ldlibs()
Expand All @@ -59,7 +67,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
Expand Down
1 change: 1 addition & 0 deletions contrib/windows/msys_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,4 @@ cat Make.user
make -j3 VERBOSE=1
make build-stats
#make debug
make VERBOSE=1 -C examples
7 changes: 5 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
BUILDDIR := .
JULIAHOME := $(abspath $(SRCDIR)/..)
prefix := $(JULIAHOME)/usr
include $(JULIAHOME)/Make.inc

embedding_binary := $(abspath $(build_libexecdir)/embedding$(JULIA_LIBSUFFIX)$(EXE))
outdir := $(libexecdir)

embedding_binary := $(abspath $(outdir)/embedding$(JULIA_LIBSUFFIX)$(EXE))

release: embedding
debug: embedding-debug
Expand All @@ -13,7 +16,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="$(outdir)" \
SPAWN="$(spawn)" CC="$(CC)"

clean:
Expand Down
8 changes: 6 additions & 2 deletions test/embedding.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# test that the embedding example runs without error
let
embedding_bin = joinpath(JULIA_HOME,"..","libexec","embedding")
if is_windows()
embedding_bin = joinpath(JULIA_HOME,Base.LIBEXECDIR,"embedding.exe")
else
embedding_bin = joinpath(JULIA_HOME,Base.LIBEXECDIR,"embedding")
end
lines = readlines(pipeline(`$(embedding_bin)`,
stderr=DevNull))
@test length(lines) == 5
@test length(lines) == 6
@test parse(Float64, lines[1]) sqrt(2)
end

0 comments on commit 87601aa

Please sign in to comment.