Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Windows Release

  • Loading branch information...
commit abee016452980dec3f9f73672ea2b2770324b9d0 1 parent 8026a71
Keno Fischer authored
4 Makefile
View
@@ -60,7 +60,9 @@ install: release
cp -a $(BUILD)/lib/lib$${suffix}.* $(PREFIX)/$(JL_PRIVATE_LIBDIR) ; \
done
# Copy system image
+ifneq ($(OS), WINNT)
cp $(BUILD)/$(JL_PRIVATE_LIBDIR)/sys.ji $(PREFIX)/$(JL_PRIVATE_LIBDIR)
+endif
# Copy in all .jl sources as well
-cp -R -L $(BUILD)/share/julia $(PREFIX)/share/
ifeq ($(OS), WINNT)
@@ -72,7 +74,7 @@ ifeq ($(shell uname),MINGW32_NT-6.1)
endif
endif
-dist: cleanall
+dist:
rm -fr julia-*.tar.gz julia-$(JULIA_COMMIT)
# -$(MAKE) -C deps clean-openblas
$(MAKE) install OPENBLAS_DYNAMIC_ARCH=1
10 base/client.jl
View
@@ -249,13 +249,21 @@ const _jl_roottask_wi = WorkItem(_jl_roottask)
_jl_is_interactive = false
isinteractive() = (_jl_is_interactive::Bool)
-julia_pkgdir() = abs_path(get(ENV,"JULIA_PKGDIR",string(ENV["HOME"],"/.julia")))
+@unix_only julia_pkgdir() = abs_path(get(ENV,"JULIA_PKGDIR",string(ENV["HOME"],"/.julia")))
+@windows_only begin
+ const JULIA_USER_DATA_DIR = string(ENV["AppData"],"/julia")
+ julia_pkgdir() = abs_path(get(ENV,"JULIA_PKGDIR",string(JULIA_USER_DATA_DIR,"/packages")))
+end
function _start()
# set up standard streams
reinit_stdio()
librandom_init()
+ @windows_only if(!isdir(JULIA_USER_DATA_DIR))
+ mkdir(JULIA_USER_DATA_DIR)
+ end
+
# set CPU core count
global const CPU_CORES = ccall(:jl_cpu_cores, Int32, ())
7 base/fftw.jl
View
@@ -5,8 +5,15 @@ export bfft, bfftn, brfft, brfftn, fft, fft2, fft3, fftn,
## FFT: Implement fft by calling fftw.
+@unix_only begin
const libfftw = "libfftw3_threads"
const libfftwf = "libfftw3f_threads"
+end
+
+@windows_only begin
+const libfftw = "libfftw3"
+const libfftwf = "libfftw3f"
+end
## Direction of FFT
2  base/librandom.jl
View
@@ -192,7 +192,7 @@ end
@windows_only begin
function win32_SystemFunction036!(a::Array{Uint32})
- ccall((:SystemFunction036,:Advapi32),stdcall,Uint8,(Ptr{Void},Uint64),convert(Ptr{Void},a),8)
+ ccall((:SystemFunction036,:Advapi32),stdcall,Uint8,(Ptr{Void},Uint32),a,length(a)*sizeof(eltype(a)))
end
end
8 base/version.jl
View
@@ -135,7 +135,13 @@ end
## julia version info
-const VERSION = convert(VersionNumber,readchomp("$JULIA_HOME/../../VERSION"))
+if(isfile("$JULIA_HOME/../../VERSION"))
+ const VERSION = convert(VersionNumber,readchomp("$JULIA_HOME/../../VERSION"))
+elseif(isfile("$JULIA_HOME/../VERSION"))
+ const VERSION = convert(VersionNumber,readchomp("$JULIA_HOME/../VERSION"))
+else
+ const VERSION = convert(VersionNumber,"0.0.0")
+end
let
expected = ErrorException("error: don't copy this code, for breaking out of uv_run during boot-strapping only")
acceptable = ErrorException(expected.msg) # we would like to update the error msg for this later, but at
4 contrib/windows/prepare-julia-env.bat
View
@@ -11,7 +11,7 @@ set PATH=%~dp0bin;%~dp0usr\bin;%~dp0..\usr\bin;%~dp0..\..\usr\bin
set JULIA_EXE=julia-release-readline.exe
for %%A in (%JULIA_EXE%) do set JULIA_HOME=%%~dp$PATH:A
set JULIA=%JULIA_HOME%%JULIA_EXE%
-set PATH=%JULIA_HOME%..\lib\julia;%JULIA_HOME%..\lib;.;%SYS_PATH%;C:\MinGW\bin;C:\MinGW\lib;C:\Program Files\Git\bin;C:\Program Files (x86)\Git\bin;C:\Python27;C:\Python26
+set PATH=%JULIA_HOME%..\lib\julia;%JULIA_HOME%..\lib;.;%SYS_PATH%;%~dp0\Git\bin
set HOME=%JULIA_HOME%..\..
-if not exist %JULIA_HOME%..\lib\julia\sys.ji (echo "Preparing Julia for first launch. This may take a while" && cd %JULIA_HOME%..\lib\julia\base && %JULIA% -b sysimg.jl && popd && pushd %cd%)
+if not exist %JULIA_HOME%..\lib\julia\sys.ji (echo "Preparing Julia for first launch. This may take a while" && cd %JULIA_HOME%..\share\julia\base && %JULIA% -b sysimg.jl && popd && pushd %cd%)
9 deps/Makefile
View
@@ -334,7 +334,7 @@ $(PCRE_OBJ_TARGET): pcre-$(PCRE_VER)/config.status
$(INSTALL_NAME_CMD)libpcre.dylib $@
ifeq ($(OS),WINNT)
-rm $(USR)/lib/libpcre.dll
- mv $(USRBIN)/libpcre-1.dll $(USR)/lib/libpcre.dll
+ mv $(USRBIN)/libpcre.dll $(USR)/lib/libpcre.dll
endif
touch $@
@@ -595,6 +595,12 @@ arpack-ng_$(ARPACK_VER)/configure: arpack-ng_$(ARPACK_VER).tar.gz
tar zxf $<
touch $@
$(ARPACK_OBJ_TARGET): arpack-ng_$(ARPACK_VER)/configure $(OPENBLAS_OBJ_SOURCE) | $(USR)/$(JL_LIBDIR)
+ifeq ($(OS),WINNT)
+ cd arpack-ng_$(ARPACK_VER) && \
+ rm -f UTIL/second_NONE.f && \
+ $(FC) -shared $(ARPACK_OPTS) SRC/*.f UTIL/*.f $(LIBLAPACK) $(LIBBLAS) -o libarpack.$(SHLIB_EXT) && \
+ cp libarpack.$(SHLIB_EXT) $(USR)/lib/libarpack.$(SHLIB_EXT)
+else
cd arpack-ng_$(ARPACK_VER) && \
./configure --prefix=$(abspath $(USR)) --with-blas="$(LIBBLAS)" --with-lapack="$(LIBLAPACK)" --disable-mpi --enable-shared F77="$(FC)" MPIF77="$(FC)" CC="$(CC)" CXX="$(CXX)" && \
$(MAKE) install F77="$(FC)" MPIF77="$(FC)" && \
@@ -604,6 +610,7 @@ ifeq ($(OS), Linux)
$(USR)/bin/patchelf --set-rpath '$$ORIGIN' $$filename ;\
done
endif
+endif
touch $@
clean-arpack:
33 src/ccall.cpp
View
@@ -2,6 +2,7 @@
// --- library symbol lookup ---
+#ifndef __WIN32__
// map from "libX" to full soname "libX.so.ver"
static std::map<std::string, std::string> sonameMap;
static bool got_sonames = false;
@@ -46,6 +47,7 @@ extern "C" const char *jl_lookup_soname(char *pfx, size_t n)
}
return NULL;
}
+#endif
// map from user-specified lib names to handles
static std::map<std::string, void*> libMap;
@@ -68,11 +70,11 @@ static void *add_library_sym(char *name, char *lib)
if (lib != NULL && hnd != jl_dl_handle) {
void *exist = sys::DynamicLibrary::SearchForAddressOfSymbol(name);
if (exist != NULL && exist != sval &&
- // openlibm conflicts with libm, and lots of our libraries
- // (including LLVM) link to libm. fortunately AddSymbol() is
- // able to resolve these in favor of openlibm, but this could
- // be an issue in the future (TODO).
- strcmp(lib,"libopenlibm")) {
+ // openlibm conflicts with libm, and lots of our libraries
+ // (including LLVM) link to libm. fortunately AddSymbol() is
+ // able to resolve these in favor of openlibm, but this could
+ // be an issue in the future (TODO).
+ strcmp(lib,"libopenlibm")) {
ios_printf(ios_stderr, "Warning: Possible conflict in library symbol %s\n", name);
}
sys::DynamicLibrary::AddSymbol(name, sval);
@@ -289,26 +291,7 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
if (f_name != NULL) {
// just symbol, default to JuliaDLHandle
#ifdef __WIN32__
- fptr = jl_dlsym_e(jl_exe_handle, f_name);
- if(!fptr) {
- fptr = jl_dlsym_e(jl_dl_handle, f_name);
- if (!fptr) {
- fptr = jl_dlsym_e(jl_kernel32_handle, f_name);
- if (!fptr) {
- fptr = jl_dlsym_e(jl_ntdll_handle, f_name);
- if (!fptr) {
- fptr = jl_dlsym_e(jl_crtdll_handle, f_name);
- if (!fptr) {
- fptr = jl_dlsym(jl_winsock_handle, f_name);
- }
- }
- }
- }
- }
- else {
- // available in process symbol table
- fptr = NULL;
- }
+ fptr = jl_dlsym_win32(f_name);
#else
// will look in process symbol table
#endif
25 src/dlload.c
View
@@ -136,3 +136,28 @@ void *jl_dlsym(uv_lib_t *handle, char *symbol)
}
return ptr;
}
+
+#ifdef __WIN32__
+//Look for symbols in win32 libraries
+void *jl_dlsym_win32(char *f_name)
+{
+ void *fptr = jl_dlsym_e(jl_exe_handle, f_name);
+ if(!fptr) {
+ fptr = jl_dlsym_e(jl_dl_handle, f_name);
+ if (!fptr) {
+ fptr = jl_dlsym_e(jl_kernel32_handle, f_name);
+ if (!fptr) {
+ fptr = jl_dlsym_e(jl_ntdll_handle, f_name);
+ if (!fptr) {
+ fptr = jl_dlsym_e(jl_crtdll_handle, f_name);
+ if (!fptr) {
+ fptr = jl_dlsym(jl_winsock_handle, f_name);
+ }
+ }
+ }
+ }
+ }
+ return fptr;
+}
+
+#endif
4 src/init.c
View
@@ -130,7 +130,7 @@ void restore_signals() {
SetConsoleCtrlHandler(NULL,0); //turn on ctrl-c handler
}
void win_raise_sigint() {
- jl_raise(jl_interrupt_exception);
+ jl_throw(jl_interrupt_exception);
}
BOOL WINAPI sigint_handler(DWORD wsig) //This needs winapi types to guarantee __stdcall
{
@@ -345,7 +345,7 @@ void julia_init(char *imageFile)
uv_dlopen("Kernel32.dll",jl_kernel32_handle);
uv_dlopen("msvcrt.dll",jl_crtdll_handle);
uv_dlopen("Ws2_32.dll",jl_winsock_handle);
- jl_exe_handle = GetModuleHandleA(NULL);
+ _jl_exe_handle.handle = GetModuleHandleA(NULL);
#endif
jl_io_loop = uv_default_loop(); //this loop will internal events (spawining process etc.)
init_stdio();
1  src/julia.h
View
@@ -899,6 +899,7 @@ DLLEXPORT void *jl_dlsym_e(uv_lib_t *handle, char *symbol);
DLLEXPORT void *jl_dlsym(uv_lib_t *handle, char *symbol);
DLLEXPORT uv_lib_t *jl_wrap_raw_dl_handle(void *handle);
void *jl_dlsym_e(uv_lib_t *handle, char *symbol); //supress errors
+void *jl_dlsym_win32(char *name);
//event loop
DLLEXPORT void jl_runEventLoop();
8 ui/repl-readline.c
View
@@ -43,10 +43,16 @@ DLLEXPORT void jl_enable_color(void)
static void init_history(void) {
using_history();
+ if (disable_history) return;
+#ifndef __WIN32__
char *home = getenv("HOME");
if (!home) return;
- if (disable_history) return;
asprintf(&history_file, "%s/.julia_history", home);
+#else
+ char *home = getenv("AppData");
+ if (!home) return;
+ asprintf(&history_file, "%s/history", home);
+#endif
struct stat stat_info;
if (!stat(history_file, &stat_info)) {
read_history(history_file);
Please sign in to comment.
Something went wrong with that request. Please try again.