Commit 6d86846c authored by camp's avatar camp

HDF5 build: I added thread safe option to the building of HDF5, if building VisIt in thread mode.

I added the "--enable-threadsafe --with-pthread" options.
I had to add a patch to the HDF5 1.8.7 library to have it build right with the "--enable-threadsafe" 
option. It will only apply the patch if VisIt is built in thread mode.
I found that HDF5 1.8.13 was the only version that built fine with the "--enable-threadsafe"
option, but there were problems building the silo library with that version.

Also removed the cf_darwin flag, it was always blank and it was used were we should have been
using cf_build_type in the info part of the build.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23898 18c085ea-50e0-402c-830e-de6fd14e8384
parent de41fd6b
......@@ -170,6 +170,36 @@ EOF
return 0;
}
function apply_hdf5_187_thread_patch
{
info "Patching thread hdf5"
patch -p0 << \EOF
diff -c src/H5private.h.orig src/H5private.h
*** src/H5private.h.orig 2014-07-28 10:46:54.821807839 -0700
--- src/H5private.h 2014-07-08 13:00:12.562002468 -0700
***************
*** 30,40 ****
/* include the pthread header */
#ifdef H5_HAVE_THREADSAFE
- #ifdef H5_HAVE_PTHREAD_H
#include <pthread.h>
- #else /* H5_HAVE_PTHREAD_H */
- #define H5_HAVE_WIN_THREADS
- #endif /* H5_HAVE_PTHREAD_H */
#endif /* H5_HAVE_THREADSAFE */
/*
--- 30,36 ----
EOF
if [[ $? != 0 ]] ; then
warn "HDF5 thread patch failed."
return 1
fi
return 0;
}
function apply_hdf5_patch
{
if [[ "${HDF5_VERSION}" == 1.8.7 ]] ; then
......@@ -177,6 +207,12 @@ function apply_hdf5_patch
if [[ $? != 0 ]]; then
return 1
fi
if [[ "$DO_THREAD_BUILD" == "yes" ]]; then
apply_hdf5_187_thread_patch
if [[ $? != 0 ]]; then
return 1
fi
fi
else
if [[ "${HDF5_VERSION}" == 1.8.8 ]] ; then
apply_hdf5_187_188_patch
......@@ -212,7 +248,6 @@ function build_hdf5
warn "Patch failed, but continuing."
fi
info "Configuring HDF5 . . ."
cf_darwin=""
if [[ "$OPSYS" == "Darwin" ]]; then
export DYLD_LIBRARY_PATH="$VISITDIR/szip/$SZIP_VERSION/$VISITARCH/lib":$DYLD_LIBRARY_PATH
else
......@@ -236,6 +271,11 @@ function build_hdf5
FORTRANARGS="FC=\"$FC_COMPILER\" F77=\"$FC_COMPILER\" FCFLAGS=\"$FCFLAGS\" FFLAGS=\"$FCFLAGS\" --enable-fortran"
fi
cf_build_thread=""
if [[ "$DO_THREAD_BUILD" == "yes" ]]; then
cf_build_thread="--enable-threadsafe --with-pthread"
fi
# In order to ensure $FORTRANARGS is expanded to build the arguments to
# configure, we wrap the invokation in 'sh -c "..."' syntax
info "Invoking command to configure HDF5"
......@@ -243,12 +283,12 @@ function build_hdf5
CFLAGS=\"$CFLAGS $C_OPT_FLAGS\" CXXFLAGS=\"$CXXFLAGS $CXX_OPT_FLAGS\" \
$FORTRANARGS \
--prefix=\"$VISITDIR/hdf5/$HDF5_VERSION/$VISITARCH\" \
${cf_szip} ${cf_darwin}"
${cf_szip} ${cf_build_type} ${cf_build_thread}"
sh -c "./configure CXX=\"$CXX_COMPILER\" CC=\"$C_COMPILER\" \
CFLAGS=\"$CFLAGS $C_OPT_FLAGS\" CXXFLAGS=\"$CXXFLAGS $CXX_OPT_FLAGS\" \
$FORTRANARGS \
--prefix=\"$VISITDIR/hdf5/$HDF5_VERSION/$VISITARCH\" \
${cf_szip} ${cf_build_type}"
${cf_szip} ${cf_build_type} ${cf_build_thread}"
if [[ $? != 0 ]] ; then
warn "HDF5 configure failed. Giving up"
return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment