summaryrefslogtreecommitdiff
path: root/cad/tochnog/files/patch-makefile
blob: 421f11264e382f3f8f911f53748640aebb7c3a5e (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--- makefile.orig	2014-01-05 15:35:37.000000000 +0100
+++ makefile	2014-03-09 22:07:32.000000000 +0100
@@ -5,7 +5,8 @@
 #***********  fortran 2 c *******************
 # Set F2C (for unix -lf2c and for MS windows if using Visual C++ to f2c.lib)
 
-F2C= -lf2c 
+F2C= -lf2c -L%%LOCALBASE%%/lib
+F2C_INCLUDE= -I%%LOCALBASE%%/include
 #  ***********  hypoplasticity ****************
 # For hypoplasticity:
 #    install f2c on your computer (also see F2C above)
@@ -30,11 +31,11 @@
 SYS_FILE=sysother
 BCPP=-P
 VCPP=
-COMPILER_C=bcc32
-COMPILER_CPP=bcc32
-COMPILER_FLAGS= -c -O2 -w-
+COMPILER_C=$(CC)
+COMPILER_CPP=$(CXX)
+COMPILER_FLAGS=$(CFLAGS) -c
 OBJ=obj
-LINK_FLAGS_BEFORE= -l$(F2C)
+LINK_FLAGS_BEFORE= -l$(F2C) -L%%LOCALBASE%%/lib
 LINK_FLAGS_AFTER=
 
 #  ***********  SUPERLU library *******************
@@ -49,6 +50,9 @@
 #      SUPERLU_INCLUDE=-I/Users/fdolorenzo/Downloads/petsc-3.4.2/arch-darwin-c-debug/include
 #      3. For SuperLU_MT be sure to compile a multi threaded version
 #      of Tochnog (sparc_parallel, alpha_parallel, linux, etc.
+SUPERLU=%%LOCALBASE%%
+SUPERLU_LIB=$(SUPERLU)/lib/lib%%SUPERLU%%.a %%BLAS_LIBS%%
+SUPERLU_INCLUDE=-I$(SUPERLU)/include/%%SUPERLU%%
 
 #  ***********  PetSc library *******************
 # Do NOT link together with the SUPERLU library
@@ -80,7 +84,7 @@
 ALL_LIB=  $(LAPACK_LIB)  $(BLAS_LIB) $(F2C) -lm $(PETSC_LIB) $(SUPERLU_LIB)
 
 #  ***********  default platform  *******************
-default: darwin-intel
+default: freebsd_old
 
 # single and multi-processor windows; borland c++ compiler
 # set SYS_FILE above to syswin32 for multi-processor
@@ -130,17 +134,22 @@
 	"LINK_FLAGS_AFTER=-g -v -dynamic -undefined dynamic_lookup  $(ALL_LIB) $(PROFILE) -dynamic -lpthread -o tochnog"
 
 # single processor linux; gnu gcc compiler
-linux_old: 
-	make tochnog \
+freebsd_old:
+	${MAKE} tochnog \
 	"SYS_FILE=sysother" \
 	"OBJ=o" \
-	"BCPP=" \
-	"VCPP=" \
-	"COMPILER_C=gcc" \
-	"COMPILER_CPP=g++-4.2" \
-	"COMPILER_FLAGS= -ansi -c -O2 -Wall $(PROFILE) $(ALL_INCLUDE)" \
+	"COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} $(ALL_INCLUDE)" \
 	"LINK_FLAGS_BEFORE=" \
-	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) -static -lm -o tochnog"
+	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -pthread -lm -o tochnog"
+
+# Multithreaded FreeBSD
+freebsd_parallel:
+	${MAKE} tochnog \
+	"SYS_FILE=sysposix" \
+	"OBJ=o" \
+	"COMPILER_FLAGS= -c ${CFLAGS} ${CPPFLAGS} -D_REENTRANT $(ALL_INCLUDE)" \
+	"LINK_FLAGS_BEFORE=" \
+	"LINK_FLAGS_AFTER= $(PROFILE) $(ALL_LIB) ${LDFLAGS} -lpthread -lm -o tochnog"
 
 # multi processor linux; gnu gcc compiler
 linux: 
@@ -289,7 +298,7 @@
 	renumber.$(OBJ) repeat.$(OBJ) restart.$(OBJ) \
 	slide.$(OBJ) \
 	so.$(OBJ) so_bicg.$(OBJ) \
-	   split.$(OBJ) \
+	so_suplu.$(OBJ) split.$(OBJ) \
 	spring.$(OBJ) stress.$(OBJ) \
 	$(SYS_FILE).$(OBJ) tendon.$(OBJ) time.$(OBJ) tn.$(OBJ) \
 	top.$(OBJ) truss.$(OBJ) \
@@ -401,7 +410,7 @@
 	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hyperela.$(SRC_CPP)
 
 $(HYPO_OBJ): $(HYPO_SRC)
-	$(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC)
+	$(COMPILER_C) $(COMPILER_FLAGS) $(HYPO_SRC) $(F2C_INCLUDE)
 
 hypoplas.$(OBJ): hypoplas.$(SRC_CPP) tochnog.h
 	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)hypoplas.$(SRC_CPP)
@@ -565,6 +574,9 @@
 #so_petsc.$(OBJ): so_petsc.$(SRC_C) tochnog.h
 #	$(COMPILER_C) $(COMPILER_FLAGS) so_petsc.$(SRC_C)
 
+so_suplu.$(OBJ): so_suplu.$(SRC_C) tochnog.h
+	$(COMPILER_C) $(COMPILER_FLAGS) so_suplu.$(SRC_C)
+
 split.$(OBJ): split.$(SRC_CPP) tochnog.h
 	$(COMPILER_CPP) $(COMPILER_FLAGS) $(BCPP) $(VCPP)split.$(SRC_CPP)