From e5ffc202f2dd540babc08303d6f12b448c121df4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 28 Mar 2009 14:17:24 -0500 Subject: [PATCH 1/3] fix blas ffi on linux64 --- basis/math/blas/ffi/ffi.factor | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basis/math/blas/ffi/ffi.factor b/basis/math/blas/ffi/ffi.factor index 48d43849c7..0603a91370 100644 --- a/basis/math/blas/ffi/ffi.factor +++ b/basis/math/blas/ffi/ffi.factor @@ -7,6 +7,10 @@ IN: math.blas.ffi { [ os macosx? ] [ "libblas.dylib" intel-unix-abi add-fortran-library ] } { [ os windows? cpu x86.32? and ] [ "blas.dll" f2c-abi add-fortran-library ] } { [ os windows? cpu x86.64? and ] [ "blas.dll" gfortran-abi add-fortran-library ] } + { + [ os [ freebsd? ] [ linux? cpu x86.32? and ] bi or ] + [ "libblas.so" gfortran-abi add-fortran-library ] + } { [ os [ freebsd? ] [ linux? ] bi or ] [ "libblas.so" gfortran-abi add-fortran-library ] } [ "libblas.so" f2c-abi add-fortran-library ] } cond From 5460a5375e3923423d7de6efb90826a4a52137f4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 28 Mar 2009 14:41:48 -0500 Subject: [PATCH 2/3] change makefile to use .so instead of .a on unix --- Makefile | 4 ++-- basis/compiler/tests/alien.factor | 2 +- vm/Config.macosx | 1 + vm/Config.unix | 2 +- vm/Config.windows | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a652edbcea..5e63017218 100644 --- a/Makefile +++ b/Makefile @@ -162,11 +162,11 @@ factor-console: $(DLL_OBJS) $(EXE_OBJS) $(CFLAGS) $(CFLAGS_CONSOLE) -o factor$(EXE_SUFFIX)$(CONSOLE_EXTENSION) $(EXE_OBJS) factor-ffi-test: vm/ffi_test.o - $(CC) $(LIBPATH) $(CFLAGS) $(FFI_TEST_CFLAGS) $(SHARED_FLAG) -o libfactor-ffi-test$(DLL_EXTENSION) $(TEST_OBJS) + $(CC) $(LIBPATH) $(CFLAGS) $(FFI_TEST_CFLAGS) $(SHARED_FLAG) -o libfactor-ffi-test$(SHARED_DLL_EXTENSION) $(TEST_OBJS) clean: rm -f vm/*.o - rm -f factor*.dll libfactor.{a,so,dylib} + rm -f factor*.dll libfactor.{a,so,dylib} libfactor-ffi-test.{a,so,dylib} vm/resources.o: $(WINDRES) vm/factor.rs vm/resources.o diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index 5b3bed6554..4d7882ad08 100755 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -13,7 +13,7 @@ IN: compiler.tests { { [ os winnt? ] [ "libfactor-ffi-test.dll" ] } { [ os macosx? ] [ "libfactor-ffi-test.dylib" ] } - { [ os unix? ] [ "libfactor-ffi-test.a" ] } + { [ os unix? ] [ "libfactor-ffi-test.so" ] } } cond append-path ; "f-cdecl" libfactor-ffi-tests-path "cdecl" add-library diff --git a/vm/Config.macosx b/vm/Config.macosx index 6655d548b7..98d14cfdf4 100644 --- a/vm/Config.macosx +++ b/vm/Config.macosx @@ -4,6 +4,7 @@ CFLAGS += -fPIC PLAF_DLL_OBJS += vm/os-macosx.o vm/mach_signal.o DLL_EXTENSION = .dylib +SHARED_DLL_EXTENSION = .dylib SHARED_FLAG = -dynamiclib diff --git a/vm/Config.unix b/vm/Config.unix index 8f2f140247..339c3c3ffb 100644 --- a/vm/Config.unix +++ b/vm/Config.unix @@ -5,7 +5,7 @@ endif EXE_SUFFIX = DLL_PREFIX = lib DLL_EXTENSION = .a -# DLL_EXTENSION = .so +SHARED_DLL_EXTENSION = .so SHARED_FLAG = -shared PLAF_DLL_OBJS = vm/os-unix.o diff --git a/vm/Config.windows b/vm/Config.windows index 75452a9bb4..cdb72f4e24 100644 --- a/vm/Config.windows +++ b/vm/Config.windows @@ -5,5 +5,6 @@ SHARED_FLAG = -shared EXE_EXTENSION=.exe CONSOLE_EXTENSION=.com DLL_EXTENSION=.dll +SHARED_DLL_EXTENSION=.dll LINKER = $(CC) -shared -mno-cygwin -o LINK_WITH_ENGINE = -l$(DLL_PREFIX)factor$(DLL_SUFFIX) From df4d652c0a86971222dfc5b58e68f445cecfcf5c Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 28 Mar 2009 15:02:28 -0500 Subject: [PATCH 3/3] less stack shuffling --- basis/roman/roman.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/roman/roman.factor b/basis/roman/roman.factor index 66fb3b302a..92202da8ca 100644 --- a/basis/roman/roman.factor +++ b/basis/roman/roman.factor @@ -51,7 +51,7 @@ PRIVATE> > swap ] [ out>> ] bi + [ infer in>> ] [ ] [ infer out>> ] tri '[ [ roman> ] _ napply @ [ >roman ] _ napply ] ; PRIVATE>