Skip to content

Commit

Permalink
different approach to building and testing examples/embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 7, 2017
1 parent 131e8fb commit 0af7cea
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 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 Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion 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 Down Expand Up @@ -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
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 prefix=/c/projects/julia/usr VERBOSE=1 -C examples
4 changes: 2 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion test/embedding.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0af7cea

Please sign in to comment.