Permalink
Browse files

launch-julia-webserver now works in the packaged julia created

with `make dist`.

Close #595
  • Loading branch information...
1 parent efc157e commit 78f701bdbbed2c9eb9ddaecd1d26e857467558e4 @ViralBShah ViralBShah committed May 29, 2012
View
@@ -34,19 +34,14 @@ usr/lib/julia/sys.ji: VERSION usr/lib/julia/sys0.ji base/*.jl
DESTDIR = julia-$(JULIA_COMMIT)
install: release
- mkdir -p $(DESTDIR)/{sbin,bin,etc,lib/julia/webserver,lib/julia/website}
+ mkdir -p $(DESTDIR)/{sbin,bin,etc,lib/julia}
cp usr/bin/*julia* $(DESTDIR)/bin
- cp usr/lib/julia/sys.ji $(DESTDIR)/lib/julia
+ cp -r usr/lib/julia/* $(DESTDIR)/lib/julia
cp usr/lib/lib{Rmath,amd,amos,arpack,cholmod,colamd,fdm,fftw3,fftw3f,fftw3_threads,fftw3f_threads,glpk,glpk_wrapper,gmp,gmp_wrapper,grisu,history,julia-release,openblas,pcre,random,readline,suitesparse_wrapper,umfpack}.$(SHLIB_EXT) $(DESTDIR)/lib
- cp -r base extras $(DESTDIR)/lib/julia
# Web-REPL stuff
cp usr/lib/mod* $(DESTDIR)/lib
cp usr/sbin/* $(DESTDIR)/sbin
cp usr/etc/* $(DESTDIR)/etc
- cp ui/webserver/*.jl $(DESTDIR)/lib/julia/webserver
- cp ui/website/*.* $(DESTDIR)/lib/julia/website
- cp -r ui/website/assets $(DESTDIR)/lib/julia/website
- cp -r ui/website/images $(DESTDIR)/lib/julia/website
dist: release
rm -fr dist julia-*.tar.gz julia-$(JULIA_COMMIT)
@@ -68,6 +63,7 @@ clean:
@rm -f *~ *# *.tar.gz
@rm -fr usr/lib/julia
@$(MAKE) -sC base clean
+ @$(MAKE) -sC extras clean
@$(MAKE) -sC src clean
@$(MAKE) -sC ui clean
@$(MAKE) -sC ui/webserver clean
View
@@ -1,4 +1,4 @@
-server.document-root = "./ui/website"
+server.document-root = "../lib/julia/website"
server.port = 2000
View
@@ -1,6 +1,8 @@
JULIAHOME = $(abspath ..)
include $(JULIAHOME)/Make.inc
+all: glpk_h.jl julia_message_types_h.jl
+
GLPK_VER = 4.43
GLPK_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+
@@ -13,3 +15,9 @@ endif
glpk_h.jl:
$(QUIET_PERL) cpp -dM $(GLPK_PREFIX)/include/glpk.h | perl -nle '/^\s*#define\s+(GLP\w*)\s*\(?($(GLPK_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@
+
+julia_message_types_h.jl:
+ $(QUIET_PERL) cpp -Dnotdefined ../ui/webserver/message_types.h > $@
+
+clean:
+ rm -f glpk_h.jl julia_message_types_h.jl
File renamed without changes.
@@ -16,7 +16,7 @@
# [message_type::number, arg0::string, arg1::string, ...]
# import the message types
-load("./ui/webserver/message_types.h")
+load("julia_message_types_h.jl")
###########################################
# set up the socket connection
@@ -91,7 +91,7 @@ end
###########################################
# load the special functions available to the web repl
-load("./ui/webserver/julia_web.jl")
+load("julia_web.jl")
###########################################
# input event handler
View
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-test -x ./usr/sbin/lighttpd || { echo "Install lighttpd with \"make -C deps install-lighttpd\" " && exit 0; }
-
-echo "Connect to http://localhost:2000/ for the web REPL."
-./usr/sbin/lighttpd -D -f ./usr/etc/lighttpd.conf &
-./usr/bin/julia-release-webserver -p 2001
View
@@ -20,20 +20,21 @@ WEBSERVER_SRCS = webserver.cpp server.cpp jsoncpp.cpp
%.do: %.c
$(QUIET_CC)$(CC) $(CFLAGS) $(DEBUGFLAGS) -c $< -o $@
-julia-release julia-debug: %: %-webserver
+julia-release julia-debug: %: $(USRBIN)/%-webserver $(USRBIN)/launch-julia-webserver
release debug:
$(MAKE) julia-$@
-julia-release-webserver: $(USRBIN)/julia-release-webserver
-julia-debug-webserver: $(USRBIN)/julia-debug-webserver
-
$(USRBIN)/julia-release-webserver: $(WEBSERVER_SRCS)
$(QUIET_LINK) $(CXX) $(CXXFLAGS) -o $@ $(SHIPFLAGS) $(WEBSERVER_SRCS) $(LIBS)
$(USRBIN)/julia-debug-webserver: $(WEBSERVER_SRCS)
$(QUIET_LINK) $(CXX) $(CXXFLAGS) -o $@ $(DEBUGFLAGS) $(WEBSERVER_SRCS) $(LIBS)
+$(USRBIN)/launch-julia-webserver: launch-julia-webserver
+ cp launch-julia-webserver $@
+ cp -r ../website $(USR)/lib/julia
+
clean:
rm -f *.o *.do
rm -f $(USRBIN)/julia-*-webserver
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+test -x ../sbin/lighttpd || { echo "Install lighttpd with \"make -C deps install-lighttpd\" " && exit 0; }
+
+echo "Connect to http://localhost:2000/ for the web REPL."
+../sbin/lighttpd -D -f ../etc/lighttpd.conf -m ../lib &
+./julia-release-webserver -p 2001
@@ -678,11 +678,11 @@ string get_session(string user_name, string session_name) {
opts.stdout_stream = session_data->julia_out;
opts.stderr_stream = session_data->julia_err;
#if 0
- char *argv[5] = {"gdbserver","localhost:2222","./usr/bin/julia-debug-readline", "ui/webserver/julia_web_base.jl", NULL};
+ char *argv[5] = {"gdbserver","localhost:2222","./julia-debug-readline", "julia_web_base.jl", NULL};
#else
- char arg0[]="./usr/bin/julia-release-readline";
- char arg1[]="--no-history";
- char arg2[]="./ui/webserver/julia_web_base.jl";
+ char arg0[]="./julia-release-readline";
+ char arg1[]="--no-history";
+ char arg2[]="../lib/julia/extras/julia_web_base.jl";
char *argv[4]={arg0,arg1,arg2,NULL};
#endif
opts.exit_cb=&process_exited;

0 comments on commit 78f701b

Please sign in to comment.