Commit 97ecf48a authored by Cory Quammen's avatar Cory Quammen
Browse files

mili: add Mili 15.1 project

This project downloads the Mili 15.1 library source code, extracts it,
applies a few patches needed to the configuration and source code, and
builds it. The build is a little unusual in that the Makefile
generated by the configure step is within a subdirectory. Hence, the
build and install steps are added by separate calls to
superbuild_project_add_step. Furthermore, the install command is
broken in the project's Makefile, so we install libraries and headers
manually instead.
parent a380648a
......@@ -98,6 +98,7 @@ function (superbuild_find_projects var)
fortran
genericio
libxml2
mili
mxml
scipy)
......
superbuild_add_project(mili
CAN_USE_SYSTEM
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
BUILD_COMMAND
""
INSTALL_COMMAND
""
)
set(_build_subdir <SOURCE_DIR>/MILI-build)
# Split out building of code into a separate step because the working
# directory is different from the configure step.
superbuild_project_add_step("custom-build"
COMMAND
make opt fortran=false
COMMENT
"Building mili"
DEPENDEES
configure
WORKING_DIRECTORY
${_build_subdir}
)
# Mili's make install command is broken. Just grab what we need.
superbuild_project_add_step("custom-install"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${_build_subdir}/lib_opt/libeprtf.a
${_build_subdir}/lib_opt/libmili.a
${_build_subdir}/lib_opt/libtaurus.a
<INSTALL_DIR>/lib
COMMAND ${CMAKE_COMMAND} -E make_directory
<INSTALL_DIR>/include/mili
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${_build_subdir}/include/eprtf.h
${_build_subdir}/include/gahl.h
${_build_subdir}/include/list.h
${_build_subdir}/include/mili.h
${_build_subdir}/include/mili_endian.h
${_build_subdir}/include/mili_enum.h
${_build_subdir}/include/mili_fparam.h
${_build_subdir}/include/mili_internal.h
${_build_subdir}/include/misc.h
${_build_subdir}/include/mr.h
${_build_subdir}/include/partition.h
${_build_subdir}/include/sarray.h
${_build_subdir}/include/taurus_db.h
<INSTALL_DIR>/include/mili
COMMENT
"Installing mili"
DEPENDEES
build
)
if (UNIX)
superbuild_apply_patch(mili unix-patch1 "Mili Unix patch 1")
if (APPLE)
# Patches derived from VisIt build
# https://portal.nersc.gov/project/visit/releases/3.0.0/build_visit3_0_0
superbuild_apply_patch(mili darwin-patch1 "Mili Darwin patch 1")
superbuild_apply_patch(mili darwin-patch2 "Mili Darwin patch 2")
superbuild_apply_patch(mili darwin-patch3 "Mili Darwin patch 3")
endif()
superbuild_add_extra_cmake_args(
-DMili_INCLUDE_DIR:PATH=<INSTALL_DIR>/include/mili
-DMili_LIBRARY:PATH=<INSTALL_DIR>/lib/libmili.a
)
endif()
From e2562d32e496b31acf4f4f099997af094e0e56ba Mon Sep 17 00:00:00 2001
From: Cory Quammen <cory.quammen@kitware.com>
Date: Mon, 10 Jun 2019 00:08:55 -0400
Subject: [PATCH] Darwin patch 1
---
src/mesh_u.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesh_u.c b/src/mesh_u.c
index a7e71d7..b743697 100755
--- a/src/mesh_u.c
+++ b/src/mesh_u.c
@@ -38,7 +38,7 @@
#include <string.h>
#ifndef _MSC_VER
-#include <values.h>
+#include <limits.h>
#include <sys/time.h>
#endif
#include <time.h>
--
2.10.1
From 0a84aedbaff5c0ac5a32b09e5ea1170667ffa472 Mon Sep 17 00:00:00 2001
From: Cory Quammen <cory.quammen@kitware.com>
Date: Mon, 10 Jun 2019 00:10:37 -0400
Subject: [PATCH] Darwin patch 2
---
Makefile.Library | 5 -----
1 file changed, 5 deletions(-)
diff --git a/Makefile.Library b/Makefile.Library
index fc5e230..7be7b74 100755
--- a/Makefile.Library
+++ b/Makefile.Library
@@ -386,8 +386,3 @@ install-chmod:
done
uninstall:
-
-ifneq ($(OS_NAME),Linux)
-include $(OBJS:.o=.d)
-endif
-
--
2.10.1
From d87540f07efd2f3ad6740f1e83731e151bc668be Mon Sep 17 00:00:00 2001
From: Cory Quammen <cory.quammen@kitware.com>
Date: Mon, 10 Jun 2019 00:11:26 -0400
Subject: [PATCH] Darwin patch 3
---
src/mili_internal.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/mili_internal.h b/src/mili_internal.h
index 0fca996..8182410 100755
--- a/src/mili_internal.h
+++ b/src/mili_internal.h
@@ -555,9 +555,9 @@ typedef struct _mili_family
* Library-private file family management routines and data.
*/
-int host_index;
-int internal_sizes[QTY_PD_ENTRY_TYPES + 1];
-int mili_verbose;
+extern int host_index;
+extern int internal_sizes[QTY_PD_ENTRY_TYPES + 1];
+extern int mili_verbose;
Return_value validate_fam_id( Famid fam_id );
Return_value parse_control_string( char *ctl_str, Mili_family *fam,
Bool_type *p_create );
@@ -625,7 +625,7 @@ void delete_dir( Mili_family *fam );
Return_value load_directories( Mili_family *fam );
/* param.c - parameter management routines. */
-char *dtype_names[QTY_PD_ENTRY_TYPES + 1];
+extern char *dtype_names[QTY_PD_ENTRY_TYPES + 1];
Return_value read_scalar( Mili_family *fam, Param_ref *p_pr, void *p_value );
Return_value mili_read_string( Mili_family *fam, Param_ref *p_pr,
char *p_value );
@@ -668,7 +668,7 @@ void get_mili_version( char *mili_version_ptr );
/* dep.c - routines for handling architecture dependencies. */
Return_value set_default_io_routines( Mili_family *fam );
Return_value set_state_data_io_routines( Mili_family *fam );
-void (*write_funcs[QTY_PD_ENTRY_TYPES + 1])();
+extern void (*write_funcs[QTY_PD_ENTRY_TYPES + 1])();
/* svar.c - routines for managing state variables. */
Bool_type valid_svar_data( Aggregate_type atype, char *name,
@@ -761,7 +761,7 @@ Return_value mc_get_class_info_by_index(Mili_family* in, int *mesh_id,
void mili_delete_mo_class_data( void *p_data );
/* wrap_c.c - C-half of FORTRAN-to-C wrappers. */
-int fortran_api;
+extern int fortran_api;
/* write_db.c */
Return_value
write_state_data( int state_num, Mili_analysis *out_db );
--
2.10.1
--- mili/configure 2015-09-11 06:32:00.000000000 -0700
+++ mili/configure_minus_fortran 2016-06-22 09:34:12.000000000 -0700
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 1.26.4.1 .
+# From configure.ac Revision: 1.26.4.2 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for Mili V15_01.
#
@@ -721,16 +721,13 @@
EGREP
GREP
CPP
+OBJEXT
+EXEEXT
ac_ct_CC
CPPFLAGS
+LDFLAGS
CFLAGS
CC
-OBJEXT
-EXEEXT
-ac_ct_F77
-LDFLAGS
-FFLAGS
-F77
HOSTNAME
HOSTDIR
HDF_DEBUG_ENABLE
@@ -830,12 +827,10 @@
ac_precious_vars='build_alias
host_alias
target_alias
-F77
-FFLAGS
-LDFLAGS
-LIBS
CC
CFLAGS
+LDFLAGS
+LIBS
CPPFLAGS
CPP'
@@ -1484,13 +1479,11 @@
--with-usrbuild=PATH Use given PATH for BUILD DIRECTORY
Some influential environment variables:
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
+ CC C compiler command
+ CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CC C compiler command
- CFLAGS C compiler flags
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
@@ -2096,20 +2089,20 @@
# Variable Initialization
cat >>confdefs.h <<\_ACEOF
-#define PACKAGE_DATE "2015/09/11"
+#define PACKAGE_DATE "2015/09/18"
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define PACKAGE_TIME "06:00:00"
+#define PACKAGE_TIME "09:00:00"
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define PACKAGE_DATETIME "2015/09/11 06:00:00"
+#define PACKAGE_DATETIME "2015/09/18 09:00:00"
_ACEOF
-PACKAGE_DATETIME="2015/09/11 06:00:00"
+PACKAGE_DATETIME="2015/09/18 09:00:00"
#############################################################################
@@ -2441,22 +2434,24 @@
# select compiler
#AC_PROG_FC
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+#AC_PROG_F77([ifort xlf gfortran])
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
- for ac_prog in ifort xlf gfortran
+ for ac_prog in icc xlc gcc
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -2465,7 +2460,7 @@
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -2475,32 +2470,32 @@
fi
fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { $as_echo "$as_me:$LINENO: result: $F77" >&5
-$as_echo "$F77" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
- test -n "$F77" && break
+ test -n "$CC" && break
done
fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in ifort xlf gfortran
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in icc xlc gcc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
$as_echo_n "(cached) " >&6
else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -2509,7 +2504,7 @@
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
+ ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -2519,21 +2514,21 @@
fi
fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-$as_echo "$ac_ct_F77" >&6; }
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
- test -n "$ac_ct_F77" && break
+ test -n "$ac_ct_CC" && break
done
- if test "x$ac_ct_F77" = x; then
- F77=""
+ if test "x$ac_ct_CC" = x; then
+ CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
@@ -2541,13 +2536,21 @@
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
- F77=$ac_ct_F77
+ CC=$ac_ct_CC
fi
fi
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+
# Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
{ (ac_try="$ac_compiler --version >&5"
@@ -2583,20 +2586,29 @@
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-rm -f a.out
cat >conftest.$ac_ext <<_ACEOF
- program main
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- end
+int
+main ()
+{
+
+ ;
+ return 0;
+}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:$LINENO: checking for Fortran 77 compiler default output file name" >&5
-$as_echo_n "checking for Fortran 77 compiler default output file name... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
@@ -2667,9 +2679,9 @@
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: Fortran 77 compiler cannot create executables
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
-$as_echo "$as_me: error: Fortran 77 compiler cannot create executables
+$as_echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; }; }
fi
@@ -2678,8 +2690,8 @@
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether the Fortran 77 compiler works" >&5
-$as_echo_n "checking whether the Fortran 77 compiler works... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
@@ -2701,10 +2713,10 @@
else
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot run Fortran 77 compiled programs.
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run Fortran 77 compiled programs.
+$as_echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }; }
@@ -2772,9 +2784,19 @@
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
- program main
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
- end
+ ;
+ return 0;
+}
_ACEOF
rm -f conftest.o conftest.obj
if { (ac_try="$ac_compile"
@@ -2815,280 +2837,6 @@
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-$as_echo_n "checking whether $F77 accepts -g... " >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_f77_g=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_prog_f77_g=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-$as_echo "$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=