Some time ago
I wrote about my porting process of
Zori (
Alan‘s software for
Monte Carlo simulations using
parallel computing) to
FreeBSD. At the time, some ports (
mpich &
hdf5) were broken and needed an update…
Time passed and those ports were updated by their maintainers. Now they compile OK with the “normal” configure options. I could install lam7 and mpich for testing hdf5 parallel support. Here’s where things got stuck again…
I tweaked hdf5 port’s Makefile to enable parallel support and to use any of the MPI compilers:
# ex:ts=8
# New ports collection makefile for: HDF5
# Date created: Jul 7, 2002
# Whom: ijliao
#
# $FreeBSD: ports/science/hdf5/Makefile,v 1.33 2005/05/11 03:44:40 ijliao Exp $
#
PORTNAME= hdf5
PORTVERSION= 1.6.4
CATEGORIES= science archivers graphics
MASTER_SITES= ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/${PORTVERSION}/
MAINTAINER= koziol@ncsa.uiuc.edu
COMMENT= Hierarchical Data Format library (from NCSA)
USE_REINPLACE= yes
USE_LIBTOOL_VER=13
LIBTOOLFILES= configure c++/configure
CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --enable-cxx --enable-production --enable-threadsafe --disable-debug --with-pthread
ALL_TARGET= lib progs
INSTALLS_SHLIB= yes
OPTIONS= PARALLEL "Build with parallel support" Off
.include
.if defined(WITH_PARALLEL)
# Build with lam7
BUILD_DEPENDS+= mpicc:${PORTSDIR}/net/lam7
CC= /usr/local/bin/mpicc
# Build with mpich
#BUILD_DEPENDS+= ${LOCALBASE}/mpich/bin/mpicc:${PORTSDIR}/net/mpich
#CC= /usr/local/mpich/bin/mpicc
.endif
post-patch:
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS}|g ; s|[\$$]LDFLAGS -pthread|\$$LDFLAGS ${PTHREAD_LIBS}|g' ${WRKSRC}/config/freebsd
@${REINPLACE_CMD} -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS}|g ; s|[\$$]LDFLAGS -pthread|\$$LDFLAGS ${PTHREAD_LIBS}|g' ${WRKSRC}/c++/config/freebsd
@${REINPLACE_CMD} -e 's|-O3||g' ${WRKSRC}/config/gnu-flags
post-install:
.for i in gif2h5 h52gif h5debug h5diff h5dump h5import h5ls h5repart h5jam h5unjam
@${STRIP_CMD} ${PREFIX}/bin/${i}
.endfor
.include
For both MPI compilers the configure stage went perfect (parallel support enabled & MPI compiler detected). The problems arised at the make process.
hdf5 compilation brokes with any of the MPI compilers, but at different stages. Here are the last lines of the output using lam7 compiler:
./H5detect.c:1385: warning: cast discards qualifiers from pointer target type
./H5detect.c:1385: warning: cast discards qualifiers from pointer target type
./H5detect.c:1385: warning: comparing floating point with == or != is unsafe
./H5detect.c:1385: warning: padding struct to align 'x'
./H5detect.c: In function `detect_alignments':
./H5detect.c:1408: warning: padding struct to align 'x'
./H5detect.c:1409: warning: padding struct to align 'x'
./H5detect.c:1410: warning: padding struct to align 'x'
LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo -pthread | sed -e 's/-L/:/g' -e 's/ //g'`" ./H5detect > H5Tinit.c || (test $HDF5_Make_Ignore && echo "*** Error ignored") || (rm -f H5Tinit.c ; exit 1)
Segmentation fault (core dumped)
*** Error code 1
Stop in /usr/ports/science/hdf5/work/hdf5-1.6.4/src.
+ exit 1
*** Error code 1
Stop in /usr/ports/science/hdf5/work/hdf5-1.6.4.
*** Error code 1
Stop in /usr/ports/science/hdf5.
And with mpich compiler:
../../src/H5FDmpi.h:74: error: initializer expression list treated as compound expression
../../src/H5FDmpi.h:79: error: `MPI_Datatype' has not been declared
../../src/H5FDmpi.h:80: error: `MPI_Datatype' has not been declared
../../src/H5FDmpi.h:80: error: ISO C++ forbids declaration of `btype' with no type
../../src/H5FDmpi.h:80: error: ISO C++ forbids declaration of `ftype' with no type
../../src/H5FDmpi.h:86: error: `MPI_Comm' does not name a type
*** Error code 1
Stop in /usr/ports/science/hdf5/work/hdf5-1.6.4/c++/src.
+ exit 1
*** Error code 1
Stop in /usr/ports/science/hdf5/work/hdf5-1.6.4/c++.
+ exit 1
*** Error code 1
Stop in /usr/ports/science/hdf5/work/hdf5-1.6.4.
*** Error code 1
Stop in /usr/ports/science/hdf5.
Again, I had to e-mail hdf5‘s port maintainer and ask him for guidance. Zori porting will have to wait a bit more… 