Skip to content

Commit 3b1369a

Browse files
reorganisation of file locations
1 parent 77e292e commit 3b1369a

File tree

9 files changed

+102
-42
lines changed

9 files changed

+102
-42
lines changed

LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Float128 is licensed under the MIT License:
2+
3+
Copyright (c) 2016: Harald Hofstätter
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23+

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
julia 0.4-

deps/src/Makefile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
all: shared_lib
2+
3+
ifeq (exists, $(shell [ -e Make.user ] && echo exists ))
4+
include Make.user
5+
endif
6+
7+
8+
#location of mpfr.h:
9+
INCMPFR = $(HOME)/LibDownloads/mpfr-3.1.3/src
10+
11+
#location of mparam.h:
12+
INCMPARAM = $(HOME)/LibDownloads/mpfr-3.1.3/src/x86_64/core2
13+
14+
#location of gmp.h:
15+
INCGMP = $(HOME)/LibDownloads/gmp-6.1.0/
16+
17+
#path to shared quadmath library:
18+
LIBQUADMATH = /usr/lib/x86_64-linux-gnu/libquadmath.so.0
19+
20+
#path to shared mpfr library used by Julia:
21+
LIBMPFR = /usr/lib/x86_64-linux-gnu/libmpfr.so.4
22+
23+
24+
OBJS = float128.o get_float128.o set_float128.o
25+
#LIBS += -lquadmath -L/usr/lib/x86_64-linux-gnu -lmpfr -lgmp -lm
26+
#LIBS += -lquadmath -lm
27+
28+
# Figure out OS and architecture
29+
OS = $(shell uname)
30+
ifeq ($(OS), MINGW32_NT-6.1)
31+
OS=WINNT
32+
endif
33+
34+
# file extensions
35+
ifeq ($(OS), WINNT)
36+
SHLIB_EXT = dll
37+
else ifeq ($(OS), Darwin)
38+
SHLIB_EXT = dylib
39+
else
40+
SHLIB_EXT = so
41+
endif
42+
43+
44+
shared_lib: libfloat128.$(SHLIB_EXT)
45+
46+
%.c.o: %.c %.h
47+
$(CC) $< -fPIC -c -o $@ $(INC) $(CFLAGS) $(FLAGS)
48+
49+
float128.o: float128.c float128.h
50+
gcc -O3 -g -fPIC -c -o float128.o float128.c
51+
52+
set_float128.o: set_float128.c float128.h
53+
gcc -O3 -fpic -c -o set_float128.o \
54+
-I$(INCGMP) -I$(INCMPFR) -I$(INCMPARAM) \
55+
set_float128.c
56+
57+
get_float128.o: get_float128.c float128.h
58+
gcc -O3 -fpic -c -o get_float128.o \
59+
-I$(INCGMP) -I$(INCMPFR) -I$(INCMPARAM) \
60+
get_float128.c
61+
62+
63+
libfloat128.$(SHLIB_EXT): $(OBJS)
64+
$(CC) $(OBJS) -rdynamic -shared -o $@ $(LDFLAGS) $(LIBS)
65+
66+
clean:
67+
rm -f *.o *.$(SHLIB_EXT)
File renamed without changes.

float128.h renamed to deps/src/float128.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdint.h>
22
#include <quadmath.h>
33

4+
#if 1
45
typedef union
56
{
67
__float128 value;
@@ -28,3 +29,11 @@ typedef union
2829

2930
#define F(x) (x.value)
3031

32+
#else
33+
34+
typedef __float128 myfloat128;
35+
typedef __complex128 mycomplex128;
36+
37+
#define F(x) (x)
38+
39+
#endif
File renamed without changes.
File renamed without changes.

float128.jl renamed to src/float128.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module float128
22

3-
export Float128, Complex256
3+
export Complex256
44

55
import
66
Base: +, -, (*), /, <, <=, ==, >, >=, ^, convert, promote_rule,
@@ -18,7 +18,7 @@ import
1818

1919
import Base.GMP: ClongMax, CulongMax, CdoubleMax
2020

21-
bitstype 128 Float128 <: AbstractFloat
21+
#bitstype 128 Float128 <: AbstractFloat # this is in base/boot.jl
2222
#Note: with "<: AbstracFloat" multiplication of two Float128 numbers
2323
#mysteriously doesn't work!
2424

0 commit comments

Comments
 (0)