Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,22 @@ endif

ifeq ($(OS), Linux)
SHLIB_EXT = so
OSLIBS += -ldl -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND)
endif

ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND)
endif

ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
OSLIBS += -Wl,-w -framework ApplicationServices
OSLIBS += -ldl -Wl,-w -framework ApplicationServices
#CFLAGS += -fno-optimize-sibling-calls -fno-inline-functions
endif

# Libraries to link
LIBS = $(shell $(LLVM_CONFIG) --libfiles) $(JULIAHOME)/src/flisp/libflisp.a $(JULIAHOME)/src/support/libsupport.a -L$(EXTROOT)/lib -lutil -ldl -lm $(OSLIBS) -lpthread $(shell $(LLVM_CONFIG) --ldflags)
LIBS = $(shell $(LLVM_CONFIG) --libfiles) $(JULIAHOME)/src/flisp/libflisp.a $(JULIAHOME)/src/support/libsupport.a -L$(EXTROOT)/lib -lutil -lm $(OSLIBS) -lpthread $(shell $(LLVM_CONFIG) --ldflags)

# Colors for make

Expand Down
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This is the GitHub repository of Julia source code, including instructions for c

- **GNU/Linux:** x86/64 (64-bit); x86 (32-bit).
- **Darwin/OS X:** x86/64 (64-bit); x86 (32-bit).
- **FreeBSD:** x86/64 (64-bit); x86 (32-bit).

<a name="Source-Download-Compilation"/>
## Source Download & Compilation
Expand Down Expand Up @@ -74,6 +75,50 @@ On OS X, you may need to install `gfortran`. Either download and install [gfortr
brew install gfortran
ln -s /usr/local/bin/gfortran-4.2 /usr/local/bin/gfortran

On FreeBSD the prerequisites can be installed from ports like this:

cd /usr/ports/devel/gmake
make install

cd /usr/ports/ftp/curl
make install

cd /usr/ports/devel/libunwind
make install

cd /usr/ports/lang/gcc45
make install
ln -s /usr/local/bin/gfortran45 /usr/local/bin/gfortran

Other versions of gcc are also available but gfortran45 is the one use by all the ports that depend on fortran currently.

**Use the gmake command on FreeBSD instead of make**

On FreeBSD two of the unit tests of flisp fail at the moment. Until this is fixed you can comment them out:

diff --git a/src/flisp/unittest.lsp b/src/flisp/unittest.lsp
index 9ebd491..3b0df0e 100644
--- a/src/flisp/unittest.lsp
+++ b/src/flisp/unittest.lsp
@@ -77,7 +77,7 @@
(assert (equal? (string 'sym #byte(65) #wchar(945) "blah") "symA\u03B1blah"))

; NaNs
-(assert (equal? +nan.0 +nan.0))
+;;;(assert (equal? +nan.0 +nan.0))
(assert (not (= +nan.0 +nan.0)))
(assert (not (= +nan.0 -nan.0)))
(assert (equal? (< +nan.0 3) (> 3 +nan.0)))
@@ -92,7 +92,7 @@

; -0.0 etc.
(assert (not (equal? 0.0 0)))
-(assert (equal? 0.0 0.0))
+;;;(assert (equal? 0.0 0.0))
(assert (not (equal? -0.0 0.0)))
(assert (not (equal? -0.0 0)))
(assert (not (eqv? 0.0 0)))

<a name="Required-Build-Tools-External-Libraries"/>
## Required Build Tools & External Libraries

Expand All @@ -82,7 +127,7 @@ Buliding Julia requires that the following software be installed:
- **[GNU make]** — building dependencies.
- **[gcc, g++, gfortran][gcc]** — compiling and linking C, C++ and Fortran code.
- **[perl]** — preprocessing of header files of libraries.
- **[wget]** or **[curl]** — to automatically download external libraries (Linux defaults to `wget`, OS X to `curl`).
- **[wget]** or **[curl]** — to automatically download external libraries (Linux defaults to `wget`, OS X and FreeBSD to `curl`).

With the exception of `gfortran`, these are standard on most Linux systems and on any OS X system with `Xcode` and Apple's Developer Tools installed.
Julia uses the following external libraries, which are automatically downloaded and compiled from source (or in a few cases, included in the Julia source repository) the first time you run `make`:
Expand Down
9 changes: 9 additions & 0 deletions external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ ifeq ($(OS), Linux)
LIBS += unwind
endif

ifeq ($(OS), FreeBSD)
LIBS += unwind
endif

ifeq ($(USE_SYSTEM_READLINE), 0)
LIBS += readline
endif
Expand All @@ -46,6 +50,11 @@ WGET = curl -kLO
WGET_DASH_O = curl -kLo
endif

ifeq ($(OS), FreeBSD)
WGET = curl -kLO
WGET_DASH_O = curl -kLo
endif

default: install
compile: $(addprefix compile-, $(LIBS))
install: $(addprefix install-, $(LIBS))
Expand Down
2 changes: 1 addition & 1 deletion src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <assert.h>
#include <sys/stat.h>

#if defined(__linux)
#if defined(__linux) || defined(__FreeBSD__)
#include <unistd.h>
#include <dlfcn.h>
#define GET_FUNCTION_FROM_MODULE dlsym
Expand Down
4 changes: 2 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdarg.h>
#include <setjmp.h>
#include <assert.h>
#if defined(__linux) || defined(__APPLE__)
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/resource.h>
Expand All @@ -32,7 +32,7 @@ size_t jl_page_size;
static void jl_find_stack_bottom(void)
{
size_t stack_size;
#if defined(__linux) || defined(__APPLE__)
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__)
struct rlimit rl;
getrlimit(RLIMIT_STACK, &rl);
stack_size = rl.rlim_cur;
Expand Down
15 changes: 15 additions & 0 deletions src/support/dirpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ char *get_exename(char *buf, size_t size)

return buf;
}
#elif defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/sysctl.h>

char *get_exename(char *buf, size_t size)
{
int mib[4];
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PATHNAME;
mib[3] = -1;
sysctl(mib, 4, buf, &size, NULL, 0);

return buf;
}
#elif defined(WIN32)
char *get_exename(char *buf, size_t size)
{
Expand Down
2 changes: 2 additions & 0 deletions src/support/utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include <malloc.h>
#define snprintf _snprintf
#else
#ifndef __FreeBSD__
#include <alloca.h>
#endif /* __FreeBSD__ */
#endif
#include <assert.h>

Expand Down
4 changes: 4 additions & 0 deletions ui/webserver/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <netdb.h>
#endif

#ifdef __FreeBSD__
#include <netinet/in.h>
#endif

namespace network
{
// error class for exception handling
Expand Down