summaryrefslogtreecommitdiff
path: root/lang/J/files/patch-make_build__libj.sh
blob: c35af47fb73abb3c1f3864505f89afe3d14ca9bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--- make/build_libj.sh.orig	2018-02-24 19:49:42 UTC
+++ make/build_libj.sh
@@ -1,7 +1,6 @@
 #!/usr/local/bin/bash
 # $1 is j32 or j64
-cd ~
-. jvars.sh
+. make/jvars.sh
 
 # gcc 5 vs 4 - killing off linux asm routines (overflow detection)
 # new fast code uses builtins not available in gcc 4
@@ -38,10 +37,10 @@ fi
 
 if [ "x$COMPILER" = x'gcc' ] ; then
 # gcc
-common="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
+common="$OPENMP -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
 else
 # clang 3.5 .. 5.0
-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+common="$OPENMP -Werror -fPIC -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
 fi
 darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
 
@@ -55,19 +54,19 @@ TARGET=libj.so
 COMPILE="$common -m32 -msse2 -mfpmath=sse -DC_NOMULTINTRINSIC "
 # slower, use 387 fpu and truncate extra precision
 # COMPILE="$common -m32 -ffloat-store "
-LINK=" -shared -Wl,-soname,libj.so -m32 -lm -ldl $LDOPENMP32 -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -m32 -lm $LDOPENMP32 -o libj.so "
 ;;
 
 linux_j64) # linux intel 64bit
 TARGET=libj.so
 COMPILE="$common "
-LINK=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
 ;;
 
 linux_j64avx) # linux intel 64bit avx
 TARGET=libj.so
 COMPILE="$common -mavx -DC_AVX=1 "
-LINK=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP -o libj.so "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
 OBJS_FMA=" blis/gemm_int-fma.o "
 ;;
 
@@ -102,6 +101,29 @@ LINK=" -dynamiclib -lm -ldl $LDOPENMP -m
 OBJS_FMA=" blis/gemm_int-fma.o "
 ;;
 
+freebsd_j32) # freebsd x86
+TARGET=libj.so
+# faster, but sse2 not available for 32-bit amd cpu
+# sse does not support mfpmath=sse in 32-bit gcc
+COMPILE="$common -m32 -msse2 -mfpmath=sse -DC_NOMULTINTRINSIC "
+# slower, use 387 fpu and truncate extra precision
+# COMPILE="$common -m32 -ffloat-store "
+LINK=" -shared -Wl,-soname,libj.so -m32 -lm $LDOPENMP32 -o libj.so "
+;;
+
+freebsd_j64) # freebsd intel 64bit
+TARGET=libj.so
+COMPILE="$common "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+;;
+
+freebsd_j64avx) # freebsd intel 64bit avx
+TARGET=libj.so
+COMPILE="$common -mavx -DC_AVX=1 "
+LINK=" -shared -Wl,-soname,libj.so -lm $LDOPENMP -o libj.so "
+OBJS_FMA=" blis/gemm_int-fma.o "
+;;
+
 *)
 echo no case for those parameters
 exit