Skip to content

Commit 48e10c5

Browse files
committed
Merge pull request FluidityProject#58 from FluidityProject/mac_friendly
Mac friendly configuration
2 parents 7973ef4 + 1362aaa commit 48e10c5

File tree

28 files changed

+301
-111
lines changed

28 files changed

+301
-111
lines changed

Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,5 @@ install-user-schemata:
571571
mkdir -p $(HOME)/.diamond/schemata/
572572
echo "Fluidity Markup Language" > $(HOME)/.diamond/schemata/flml
573573
echo "$(PWD)/schemas/fluidity_options.rng" >> $(HOME)/.diamond/schemata/flml
574+
575+
.PHONY: install

configure

Lines changed: 159 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ ac_includes_default="\
620620

621621
ac_subst_vars='LTLIBOBJS
622622
LIBOBJS
623+
SED
623624
HYPERLIGHT
624625
MEMORY_STATS
625626
MBA3D
@@ -3040,6 +3041,25 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
30403041

30413042

30423043

3044+
case $host_os in
3045+
darwin* )
3046+
LINUX=no
3047+
DARWIN=yes
3048+
FCFLAGS="-DDARWIN $FCFLAGS"
3049+
CXXFLAGS="-DDARWIN -fpermissive $CXXFLAGS"
3050+
CPPFLAGS="-DDARWIN $CPPFLAGS"
3051+
# Should really check for Mac OS vs. straight Darwin here, or at least test
3052+
# that the framework is valid
3053+
LIBS="$LIBS -framework Carbon";;
3054+
linux* )
3055+
LINUX=yes
3056+
DARWIN=no;;
3057+
* )
3058+
LINUX=no
3059+
DARWIN=no;;
3060+
esac
3061+
3062+
30433063
# Find compilers
30443064
{ $as_echo "$as_me:${as_lineno-$LINENO}: *** Fishing for legacy fortran compiler." >&5
30453065
$as_echo "$as_me: *** Fishing for legacy fortran compiler." >&6;}
@@ -10613,7 +10633,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1061310633
FCFLAGS="-fbounds-check -Wall -Wimplicit-interface -Wno-surprising ${FCFLAGS}"
1061410634
CFLAGS="-fbounds-check -Wall ${CFLAGS}"
1061510635
CXXFLAGS="-fbounds-check -Wall ${CXXFLAGS}"
10616-
LDFLAGS="-rdynamic ${LDFLAGS}"
10636+
if test "$DARWIN" = "no" ; then
10637+
LDFLAGS="-rdynamic ${LDFLAGS}"
10638+
fi
1061710639
elif test "$fcompiler" = "g95" ; then
1061810640
FFLAGS="-fbounds-check -ftrace=full ${FFLAGS}"
1061910641
FCFLAGS="-fbounds-check -ftrace=full ${FCFLAGS}"
@@ -15787,7 +15809,141 @@ fi
1578715809

1578815810
#*******************
1578915811

15790-
ac_config_files="$ac_config_files Makefile debug/Makefile bathymetry/Makefile ocean_forcing/Makefile ocean_forcing/tests/Makefile sediments/Makefile hyperlight/Makefile femtools/Makefile femtools/tests/Makefile forward_interfaces/Makefile horizontal_adaptivity/Makefile horizontal_adaptivity/tests/Makefile preprocessor/Makefile error_measures/Makefile error_measures/tests/Makefile parameterisation/Makefile parameterisation/tests/Makefile fldecomp/Makefile assemble/Makefile assemble/tests/Makefile diagnostics/Makefile main/Makefile tools/Makefile tools/version-info python/setup.py climatology/Makefile libmba2d/Makefile libmba3d/Makefile libjudy/Makefile libjudy/src/Makefile libjudy/src/JudyCommon/Makefile libjudy/src/Judy1/Makefile libjudy/src/JudyL/Makefile libjudy/src/JudySL/Makefile libjudy/src/JudyHS/Makefile libwm/Makefile libvtkfortran/Makefile reduced_modelling/Makefile"
15812+
15813+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
15814+
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
15815+
if ${ac_cv_path_SED+:} false; then :
15816+
$as_echo_n "(cached) " >&6
15817+
else
15818+
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
15819+
for ac_i in 1 2 3 4 5 6 7; do
15820+
ac_script="$ac_script$as_nl$ac_script"
15821+
done
15822+
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
15823+
{ ac_script=; unset ac_script;}
15824+
if test -z "$SED"; then
15825+
ac_path_SED_found=false
15826+
# Loop through the user's path and test for each of PROGNAME-LIST
15827+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15828+
for as_dir in $PATH
15829+
do
15830+
IFS=$as_save_IFS
15831+
test -z "$as_dir" && as_dir=.
15832+
for ac_prog in sed gsed; do
15833+
for ac_exec_ext in '' $ac_executable_extensions; do
15834+
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
15835+
as_fn_executable_p "$ac_path_SED" || continue
15836+
# Check for GNU ac_path_SED and select it if it is found.
15837+
# Check for GNU $ac_path_SED
15838+
case `"$ac_path_SED" --version 2>&1` in
15839+
*GNU*)
15840+
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
15841+
*)
15842+
ac_count=0
15843+
$as_echo_n 0123456789 >"conftest.in"
15844+
while :
15845+
do
15846+
cat "conftest.in" "conftest.in" >"conftest.tmp"
15847+
mv "conftest.tmp" "conftest.in"
15848+
cp "conftest.in" "conftest.nl"
15849+
$as_echo '' >> "conftest.nl"
15850+
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
15851+
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
15852+
as_fn_arith $ac_count + 1 && ac_count=$as_val
15853+
if test $ac_count -gt ${ac_path_SED_max-0}; then
15854+
# Best one so far, save it but keep looking for a better one
15855+
ac_cv_path_SED="$ac_path_SED"
15856+
ac_path_SED_max=$ac_count
15857+
fi
15858+
# 10*(2^10) chars as input seems more than enough
15859+
test $ac_count -gt 10 && break
15860+
done
15861+
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
15862+
esac
15863+
15864+
$ac_path_SED_found && break 3
15865+
done
15866+
done
15867+
done
15868+
IFS=$as_save_IFS
15869+
if test -z "$ac_cv_path_SED"; then
15870+
as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
15871+
fi
15872+
else
15873+
ac_cv_path_SED=$SED
15874+
fi
15875+
15876+
fi
15877+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
15878+
$as_echo "$ac_cv_path_SED" >&6; }
15879+
SED="$ac_cv_path_SED"
15880+
rm -f conftest.sed
15881+
15882+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
15883+
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
15884+
if ${ac_cv_path_GREP+:} false; then :
15885+
$as_echo_n "(cached) " >&6
15886+
else
15887+
if test -z "$GREP"; then
15888+
ac_path_GREP_found=false
15889+
# Loop through the user's path and test for each of PROGNAME-LIST
15890+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15891+
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
15892+
do
15893+
IFS=$as_save_IFS
15894+
test -z "$as_dir" && as_dir=.
15895+
for ac_prog in grep ggrep; do
15896+
for ac_exec_ext in '' $ac_executable_extensions; do
15897+
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
15898+
as_fn_executable_p "$ac_path_GREP" || continue
15899+
# Check for GNU ac_path_GREP and select it if it is found.
15900+
# Check for GNU $ac_path_GREP
15901+
case `"$ac_path_GREP" --version 2>&1` in
15902+
*GNU*)
15903+
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
15904+
*)
15905+
ac_count=0
15906+
$as_echo_n 0123456789 >"conftest.in"
15907+
while :
15908+
do
15909+
cat "conftest.in" "conftest.in" >"conftest.tmp"
15910+
mv "conftest.tmp" "conftest.in"
15911+
cp "conftest.in" "conftest.nl"
15912+
$as_echo 'GREP' >> "conftest.nl"
15913+
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
15914+
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
15915+
as_fn_arith $ac_count + 1 && ac_count=$as_val
15916+
if test $ac_count -gt ${ac_path_GREP_max-0}; then
15917+
# Best one so far, save it but keep looking for a better one
15918+
ac_cv_path_GREP="$ac_path_GREP"
15919+
ac_path_GREP_max=$ac_count
15920+
fi
15921+
# 10*(2^10) chars as input seems more than enough
15922+
test $ac_count -gt 10 && break
15923+
done
15924+
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
15925+
esac
15926+
15927+
$ac_path_GREP_found && break 3
15928+
done
15929+
done
15930+
done
15931+
IFS=$as_save_IFS
15932+
if test -z "$ac_cv_path_GREP"; then
15933+
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
15934+
fi
15935+
else
15936+
ac_cv_path_GREP=$GREP
15937+
fi
15938+
15939+
fi
15940+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
15941+
$as_echo "$ac_cv_path_GREP" >&6; }
15942+
GREP="$ac_cv_path_GREP"
15943+
15944+
15945+
15946+
ac_config_files="$ac_config_files Makefile debug/Makefile bathymetry/Makefile ocean_forcing/Makefile ocean_forcing/tests/Makefile sediments/Makefile hyperlight/Makefile femtools/Makefile femtools/tests/Makefile forward_interfaces/Makefile horizontal_adaptivity/Makefile horizontal_adaptivity/tests/Makefile preprocessor/Makefile error_measures/Makefile error_measures/tests/Makefile parameterisation/Makefile parameterisation/tests/Makefile fldecomp/Makefile assemble/Makefile assemble/tests/Makefile diagnostics/Makefile main/Makefile tools/Makefile tools/version-info python/setup.py climatology/Makefile libmba2d/Makefile libmba3d/Makefile libjudy/Makefile libjudy/src/Makefile libjudy/src/JudyCommon/Makefile libjudy/src/Judy1/Makefile libjudy/src/JudyL/Makefile libjudy/src/JudySL/Makefile libjudy/src/JudyHS/Makefile libwm/Makefile libvtkfortran/Makefile reduced_modelling/Makefile tests/tools.mk"
1579115947

1579215948
cat >confcache <<\_ACEOF
1579315949
# This file is a shell script that caches the results of configure
@@ -16518,6 +16674,7 @@ do
1651816674
"libwm/Makefile") CONFIG_FILES="$CONFIG_FILES libwm/Makefile" ;;
1651916675
"libvtkfortran/Makefile") CONFIG_FILES="$CONFIG_FILES libvtkfortran/Makefile" ;;
1652016676
"reduced_modelling/Makefile") CONFIG_FILES="$CONFIG_FILES reduced_modelling/Makefile" ;;
16677+
"tests/tools.mk") CONFIG_FILES="$CONFIG_FILES tests/tools.mk" ;;
1652116678

1652216679
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
1652316680
esac

configure.in

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,25 @@ FLFEMDEM="femdem"
8080
# Check system type
8181
AC_CANONICAL_HOST
8282

83+
case $host_os in
84+
darwin* )
85+
LINUX=no
86+
DARWIN=yes
87+
FCFLAGS="-DDARWIN $FCFLAGS"
88+
CXXFLAGS="-DDARWIN -fpermissive $CXXFLAGS"
89+
CPPFLAGS="-DDARWIN $CPPFLAGS"
90+
# Should really check for Mac OS vs. straight Darwin here, or at least test
91+
# that the framework is valid
92+
LIBS="$LIBS -framework Carbon";;
93+
linux* )
94+
LINUX=yes
95+
DARWIN=no;;
96+
* )
97+
LINUX=no
98+
DARWIN=no;;
99+
esac
100+
101+
83102
# Find compilers
84103
AC_MSG_NOTICE([*** Fishing for legacy fortran compiler.])
85104
AC_PROG_F77(ifort ifc efc sunf95 gfortran pgf95 pathf95 g95 f90,,f90,$PATH)
@@ -577,7 +596,9 @@ EOF
577596
FCFLAGS="-fbounds-check -Wall -Wimplicit-interface -Wno-surprising ${FCFLAGS}"
578597
CFLAGS="-fbounds-check -Wall ${CFLAGS}"
579598
CXXFLAGS="-fbounds-check -Wall ${CXXFLAGS}"
580-
LDFLAGS="-rdynamic ${LDFLAGS}"
599+
if test "$DARWIN" = "no" ; then
600+
LDFLAGS="-rdynamic ${LDFLAGS}"
601+
fi
581602
elif test "$fcompiler" = "g95" ; then
582603
FFLAGS="-fbounds-check -ftrace=full ${FFLAGS}"
583604
FCFLAGS="-fbounds-check -ftrace=full ${FCFLAGS}"
@@ -1667,6 +1688,10 @@ fi
16671688

16681689
#*******************
16691690

1691+
1692+
AC_PROG_SED
1693+
AC_PROG_GREP
1694+
16701695
AC_OUTPUT(Makefile
16711696
debug/Makefile
16721697
bathymetry/Makefile
@@ -1698,4 +1723,5 @@ AC_OUTPUT(Makefile
16981723
libjudy/src/JudyHS/Makefile
16991724
libwm/Makefile
17001725
libvtkfortran/Makefile
1701-
reduced_modelling/Makefile)
1726+
reduced_modelling/Makefile
1727+
tests/tools.mk)

libjudy/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ install:
1212
distclean: clean
1313
rm -fr config.h libtool make.log stamp-h1 src/obj src/Judy1/Judy1TablesGen src/JudyL/JudyLTablesGen
1414

15+
.PHONY: install
16+

libwm/Makefile.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ TESTLIBS = $(shell echo @LIBS@ | sed 's@./lib/lib\([a-z]*\)\.a@-l\1@g')
5252
# These are all the objects that are supposed to go into the makefile
5353
OBJS = Wm4Command.o Wm4FoundationPCH.o \
5454
Wm4Math.o Wm4Memory.o \
55-
Wm4System.o Wm4Vector2.o Wm4Vector3.o
55+
Wm4System.o Wm4Vector2.o Wm4Vector3.o \
56+
Wm4Intersector.o Wm4Intersector1.o \
57+
Wm4IntrQuad2Quad2.o \
58+
Wm4IntrTetrahedron3Tetrahedron3.o \
59+
Wm4IntrTriangle2Triangle2.o
5660

5761
.SUFFIXES: .f90 .F90 .c .o .a
5862

libwm/Wm4Intersector.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,8 @@ class Intersector<double,Vector2d>;
106106

107107
template WM4_FOUNDATION_ITEM
108108
class Intersector<double,Vector3d>;
109+
110+
template WM4_FOUNDATION_ITEM
111+
class Intersector<long double,Vector3<long double> >;
109112
//----------------------------------------------------------------------------
110113
}

libwm/Wm4Intersector.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,5 @@ typedef Intersector<double, Vector3<double> > Intersector3d;
8383

8484
}
8585

86-
#include "Wm4Intersector.cpp"
8786

8887
#endif

libwm/Wm4Intersector1.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,4 @@ typedef Intersector1<double> Intersector1d;
7171

7272
}
7373

74-
#include "Wm4Intersector1.cpp"
75-
7674
#endif

libwm/Wm4IntrQuad2Quad2.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,4 @@ typedef IntrQuad2Quad2<double> IntrQuad2Quad2d;
6161

6262
}
6363

64-
#include "Wm4IntrQuad2Quad2.cpp"
65-
6664
#endif

libwm/Wm4IntrTetrahedron3Tetrahedron3.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,4 @@ typedef IntrTetrahedron3Tetrahedron3<double> IntrTetrahedron3Tetrahedron3d;
5858

5959
}
6060

61-
#include "Wm4IntrTetrahedron3Tetrahedron3.cpp"
62-
6361
#endif

libwm/Wm4IntrTriangle2Triangle2.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,4 @@ typedef IntrTriangle2Triangle2<long double> IntrTriangle2Triangle2ld;
106106

107107
}
108108

109-
#include "Wm4IntrTriangle2Triangle2.cpp"
110-
111109
#endif

tests/add_src_directly_1d_2grp_hom_zerobc_eig_fv/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ SHELL = sh
22

33
SIM = add_src_directly_1d_2grp_hom_zerobc_eig_fv
44

5+
include ../tools.mk
6+
57
# options for 1d mesh interval script for different mesh resolutions
68
LEFT_X = 0.0
79
RIGHT_X = 44.5
@@ -16,7 +18,13 @@ input: clean
1618
interval --dx=$(MESH_SIZE_A) $(LEFT_X) $(RIGHT_X) $(SIM)_A
1719
interval --dx=$(MESH_SIZE_B) $(LEFT_X) $(RIGHT_X) $(SIM)_B
1820
interval --dx=$(MESH_SIZE_C) $(LEFT_X) $(RIGHT_X) $(SIM)_C
19-
interval --dx=$(MESH_SIZE_D) $(LEFT_X) $(RIGHT_X) $(SIM)_D
21+
interval --dx=$(MESH_SIZE_D) $(LEFT_X) $(RIGHT_X) $(SIM)_D
22+
cp $(SIM)_A.flml $(SIM)_B.flml
23+
cp $(SIM)_A.flml $(SIM)_C.flml
24+
cp $(SIM)_A.flml $(SIM)_D.flml
25+
$(SED) -i 's/_A/_B/' $(SIM)_B.flml
26+
$(SED) -i 's/_A/_C/' $(SIM)_C.flml
27+
$(SED) -i 's/_A/_D/' $(SIM)_D.flml
2028

2129
clean:
2230
rm -f $(SIM)*.ele
@@ -39,3 +47,4 @@ clean:
3947
rm -f first_timestep_adapted_mesh*
4048
rm -f $(SIM)*.eig_iteration_convergence
4149
rm -f $(SIM)*checkpoint*
50+
rm -f $(SIM)_{BCD}.flml

tests/add_src_directly_1d_2grp_hom_zerobc_eig_fv/add_src_directly_1d_2grp_hom_zerobc_eig_fv.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,9 @@
88
<problem_definition length="short" nprocs="1">
99
<command_line>
1010
../../bin/fluidity add_src_directly_1d_2grp_hom_zerobc_eig_fv_A.flml
11-
12-
cp add_src_directly_1d_2grp_hom_zerobc_eig_fv_A.flml add_src_directly_1d_2grp_hom_zerobc_eig_fv_B.flml
13-
sed -i 's/_A/_B/' add_src_directly_1d_2grp_hom_zerobc_eig_fv_B.flml
14-
1511
../../bin/fluidity add_src_directly_1d_2grp_hom_zerobc_eig_fv_B.flml
16-
17-
rm -f add_src_directly_1d_2grp_hom_zerobc_eig_fv_B.flml
18-
19-
cp add_src_directly_1d_2grp_hom_zerobc_eig_fv_A.flml add_src_directly_1d_2grp_hom_zerobc_eig_fv_C.flml
20-
sed -i 's/_A/_C/' add_src_directly_1d_2grp_hom_zerobc_eig_fv_C.flml
21-
2212
../../bin/fluidity add_src_directly_1d_2grp_hom_zerobc_eig_fv_C.flml
23-
24-
rm -f add_src_directly_1d_2grp_hom_zerobc_eig_fv_C.flml
25-
26-
cp add_src_directly_1d_2grp_hom_zerobc_eig_fv_A.flml add_src_directly_1d_2grp_hom_zerobc_eig_fv_D.flml
27-
sed -i 's/_A/_D/' add_src_directly_1d_2grp_hom_zerobc_eig_fv_D.flml
28-
2913
../../bin/fluidity add_src_directly_1d_2grp_hom_zerobc_eig_fv_D.flml
30-
31-
rm -f add_src_directly_1d_2grp_hom_zerobc_eig_fv_D.flml
3214
</command_line>
3315
<!-- Two field diffusion eigenvalue problem with one material, two groups no upscatter with all zero BC using a 1d geometry compared to PANTHER reference solution for the Eigenvalue and also the fine mesh linear fv solution for different mesh resolutions. This tests adding the src directly to the rhs. -->
3416
</problem_definition>

0 commit comments

Comments
 (0)