gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / openfoam-4.1-cleanup.patch
1 # This patch removes all need for the ThirdParty files of OpenFOAM.
2
3 # Derived from EasyBuild patch by Ward Poelmans <wpoely86@gmail.com>.
4 # Modified for GNU Guix by Paul Garlick <pgarlick@tourbillion-technology.com>.
5
6 diff -ur OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulation/setSet/Allwmake OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/setSet/Allwmake
7 --- OpenFOAM-4.x-version-4.1.org/applications/utilities/mesh/manipulation/setSet/Allwmake
8 +++ OpenFOAM-4.x-version-4.1/applications/utilities/mesh/manipulation/setSet/Allwmake
9 @@ -9,7 +9,7 @@
10 #
11 # use readline if available
12 #
13 -if [ -f /usr/include/readline/readline.h ]
14 +if true
15 then
16 echo "Found <readline/readline.h> -- enabling readline support."
17 export COMP_FLAGS="-DHAS_READLINE"
18 diff -ur OpenFOAM-4.x-version-4.1.org/etc/bashrc OpenFOAM-4.x-version-4.1/etc/bashrc
19 --- OpenFOAM-4.x-version-4.1.org/etc/bashrc
20 +++ OpenFOAM-4.x-version-4.1/etc/bashrc
21 @@ -43,8 +43,10 @@
22 # Please set to the appropriate path if the default is not correct.
23 #
24 [ $BASH_SOURCE ] && \
25 -export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
26 +export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
27 export FOAM_INST_DIR=$HOME/$WM_PROJECT
28 +# For GNU Guix: set initially for build then re-set at runtime
29 +#
30 # export FOAM_INST_DIR=~$WM_PROJECT
31 # export FOAM_INST_DIR=/opt/$WM_PROJECT
32 # export FOAM_INST_DIR=/usr/local/$WM_PROJECT
33 diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL OpenFOAM-4.x-version-4.1/etc/config.sh/CGAL
34 --- OpenFOAM-4.x-version-4.1.org/etc/config.sh/CGAL
35 +++ OpenFOAM-4.x-version-4.1/etc/config.sh/CGAL
36 @@ -36,37 +36,7 @@
37 #
38 #------------------------------------------------------------------------------
39
40 -boost_version=boost-system
41 -cgal_version=cgal-system
42 -#cgal_version=CGAL-4.8
43 -
44 -if [ -z "$SOURCE_CGAL_VERSIONS_ONLY" ]
45 -then
46 -
47 - common_path=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
48 -
49 - export BOOST_ARCH_PATH=$common_path/$boost_version
50 - export CGAL_ARCH_PATH=$common_path/$cgal_version
51 -
52 - if [ "$FOAM_VERBOSE" -a "$PS1" ]
53 - then
54 - echo "Using CGAL and boost" 1>&2
55 - echo " $cgal_version at $CGAL_ARCH_PATH" 1>&2
56 - echo " $boost_version at $BOOST_ARCH_PATH" 1>&2
57 - fi
58 -
59 - if [ -d "$CGAL_ARCH_PATH" -a "$cgal_version" != "cgal-system" ]
60 - then
61 - _foamAddLib $CGAL_ARCH_PATH/lib
62 - fi
63 -
64 - if [ -d "$BOOST_ARCH_PATH" -a "$boost_version" != "boost-system" ]
65 - then
66 - _foamAddLib $BOOST_ARCH_PATH/lib
67 - fi
68 -
69 - unset boost_version cgal_version common_path
70 -
71 -fi
72 +export CGAL_ARCH_PATH=$CGAL_ROOT
73 +export BOOST_ARCH_PATH=$BOOST_ROOT
74
75 #------------------------------------------------------------------------------
76 diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools OpenFOAM-4.x-version-4.1/etc/config.sh/gperftools
77 --- OpenFOAM-4.x-version-4.1.org/etc/config.sh/gperftools
78 +++ OpenFOAM-4.x-version-4.1/etc/config.sh/gperftools
79 @@ -29,13 +29,5 @@
80 #
81 #------------------------------------------------------------------------------
82
83 -version=svn
84 -gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
85 -
86 -GPERFTOOLS_VERSION=gperftools-$version
87 -GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
88 -
89 -export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH
90 -export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH
91
92 #------------------------------------------------------------------------------
93 diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis OpenFOAM-4.x-version-4.1/etc/config.sh/metis
94 --- OpenFOAM-4.x-version-4.1.org/etc/config.sh/metis
95 +++ OpenFOAM-4.x-version-4.1/etc/config.sh/metis
96 @@ -34,7 +34,7 @@
97 #
98 #------------------------------------------------------------------------------
99
100 -export METIS_VERSION=metis-5.1.0
101 -export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
102 +export METIS_VERSION=metis-$METISVERSION
103 +export METIS_ARCH_PATH=$METIS_ROOT
104
105 #------------------------------------------------------------------------------
106 diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch OpenFOAM-4.x-version-4.1/etc/config.sh/scotch
107 --- OpenFOAM-4.x-version-4.1.org/etc/config.sh/scotch
108 +++ OpenFOAM-4.x-version-4.1/etc/config.sh/scotch
109 @@ -37,7 +37,7 @@
110 #
111 #------------------------------------------------------------------------------
112
113 -export SCOTCH_VERSION=scotch_6.0.3
114 -export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
115 +export SCOTCH_VERSION=scotch_$SCOTCHVERSION
116 +export SCOTCH_ARCH_PATH=$SCOTCH_ROOT
117
118 #------------------------------------------------------------------------------
119 diff -ur OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings OpenFOAM-4.x-version-4.1/etc/config.sh/settings
120 --- OpenFOAM-4.x-version-4.1.org/etc/config.sh/settings
121 +++ OpenFOAM-4.x-version-4.1/etc/config.sh/settings
122 @@ -279,6 +279,9 @@
123 ;;
124 system)
125 # Use system compiler
126 + # Use system GMP and MPFR packages
127 + export GMP_ARCH_PATH=$GMP_ROOT
128 + export MPFR_ARCH_PATH=$MPFR_ROOT
129 ;;
130 *)
131 echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2
132 diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDecomp/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDecomp/Make/options
133 --- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/ptscotchDecomp/Make/options
134 +++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/ptscotchDecomp/Make/options
135 @@ -5,8 +5,7 @@
136 $(PFLAGS) $(PINC) \
137 -I$(SCOTCH_ROOT)/include \
138 -I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
139 - -I/usr/include/scotch \
140 -I../decompositionMethods/lnInclude
141
142 LIB_LIBS = \
143 - -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) -lptscotch -lptscotcherrexit -lscotch ${LINK_FLAGS} -lrt
144 + -L$(SCOTCH_ROOT)/lib -L$(MPI_ARCH_PATH)/lib -lptscotch -lptscotcherrexit -lscotch ${LINK_FLAGS} -lrt
145 diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecomp/Make/options OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp/Make/options
146 --- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/scotchDecomp/Make/options
147 +++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/scotchDecomp/Make/options
148 @@ -9,8 +9,7 @@
149 $(PFLAGS) $(PINC) \
150 -I$(SCOTCH_ROOT)/include \
151 -I$(SCOTCH_ARCH_PATH)/include \
152 - -I/usr/include/scotch \
153 -I../decompositionMethods/lnInclude
154
155 LIB_LIBS = \
156 - -L$(SCOTCH_ROOT)/lib -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
157 + -L$(SCOTCH_ROOT)/lib -lscotch -lscotcherrexit -lrt
158 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general OpenFOAM-4.x-version-4.1/wmake/makefiles/general
159 --- OpenFOAM-4.x-version-4.1.org/wmake/makefiles/general
160 +++ OpenFOAM-4.x-version-4.1/wmake/makefiles/general
161 @@ -33,7 +33,6 @@
162 # The Makefile uses a POSIX shell
163 #------------------------------------------------------------------------------
164
165 -SHELL = /bin/sh
166
167
168 #------------------------------------------------------------------------------
169 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmake OpenFOAM-4.x-version-4.1/wmake/wmake
170 --- OpenFOAM-4.x-version-4.1.org/wmake/wmake
171 +++ OpenFOAM-4.x-version-4.1/wmake/wmake
172 @@ -163,7 +163,7 @@
173 then
174 if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
175 then
176 - lockDir=$HOME/.$WM_PROJECT/.wmake
177 + lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake
178
179 if [ -d $lockDir ]
180 then
181 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler OpenFOAM-4.x-version-4.1/wmake/wmakeScheduler
182 --- OpenFOAM-4.x-version-4.1.org/wmake/wmakeScheduler
183 +++ OpenFOAM-4.x-version-4.1/wmake/wmakeScheduler
184 @@ -53,7 +53,7 @@
185 # csh sets HOST, bash sets HOSTNAME
186 : ${HOST:=$HOSTNAME}
187
188 -lockDir=$HOME/.$WM_PROJECT/.wmake
189 +lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake
190
191 # Fallback - 1 core on current host
192 : ${WM_HOSTS:=$HOST:1}
193 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime OpenFOAM-4.x-version-4.1/wmake/wmakeSchedulerUptime
194 --- OpenFOAM-4.x-version-4.1.org/wmake/wmakeSchedulerUptime
195 +++ OpenFOAM-4.x-version-4.1/wmake/wmakeSchedulerUptime
196 @@ -53,7 +53,7 @@
197 # csh sets HOST, bash sets HOSTNAME
198 : ${HOST:=$HOSTNAME}
199
200 -lockDir=$HOME/.$WM_PROJECT/.wmake
201 +lockDir=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)/.$WM_PROJECT/.wmake
202 # Fallback - 1 core on current host
203 : ${WM_HOSTS:=$HOST:1}
204
205 diff -ur OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp/metisDecomp.C OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/metisDecomp.C
206 --- OpenFOAM-4.x-version-4.1.org/src/parallel/decompose/metisDecomp/metisDecomp.C
207 +++ OpenFOAM-4.x-version-4.1/src/parallel/decompose/metisDecomp/metisDecomp.C
208 @@ -67,7 +67,7 @@
209
210 // Processor weights initialised with no size, only used if specified in
211 // a file
212 - Field<scalar> processorWeights;
213 + Field<floatScalar> processorWeights;
214
215 // Cell weights (so on the vertices of the dual)
216 List<label> cellWeights;
217 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/rules/General/CGAL OpenFOAM-4.x-version-4.1/wmake/rules/General/CGAL
218 --- OpenFOAM-4.x-version-4.1.org/wmake/rules/General/CGAL
219 +++ OpenFOAM-4.x-version-4.1/wmake/rules/General/CGAL
220 @@ -6,9 +6,10 @@
221 -I/usr/include
222
223 CGAL_LIBS = \
224 - -L$(MPFR_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
225 - -L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
226 + -L$(MPFR_ARCH_PATH)/lib \
227 + -L$(GMP_ARCH_PATH)/lib \
228 -L$(BOOST_ARCH_PATH)/lib \
229 -L$(CGAL_ARCH_PATH)/lib \
230 -lCGAL \
231 + -lgmp \
232 -lmpfr
233 diff -ur OpenFOAM-4.x-version-4.1.org/wmake/rules/linux64Gcc/c++ OpenFOAM-4.x-version-4.1/wmake/rules/linux64Gcc/c++
234 --- OpenFOAM-4.x-version-4.1.org/wmake/rules/linux64Gcc/c++
235 +++ OpenFOAM-4.x-version-4.1/wmake/rules/linux64Gcc/c++
236 @@ -20,5 +20,5 @@
237
238 LINK_LIBS = $(c++DBUG)
239
240 -LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
241 -LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed
242 +LINKLIBSO = $(CC) $(c++FLAGS) $(LDFLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
243 +LINKEXE = $(CC) $(c++FLAGS) $(LDFLAGS) -Xlinker --add-needed -Xlinker --no-as-needed