freebsd-ports/math/mumps/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

145 lines
4.7 KiB
Makefile

PORTNAME= mumps
DISTVERSION= 5.1.2-aster7
PORTREVISION= 3
CATEGORIES= math
PKGNAMESUFFIX= -edf
MAINTAINER= thierry@FreeBSD.org
COMMENT= MUltifrontal Massively Parallel sparse direct Solver for Code_Aster
WWW= https://graal.ens-lyon.fr/MUMPS/
LICENSE= CeCILL_C
LICENSE_NAME= CeCILL-C
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LIB_DEPENDS= libmetis.so:math/metis
USES= blaslapack fortran
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:R}
FORTRANLIBS= -lgfortran
GCCLIBDIR= ${LDFLAGS}
USE_LDCONFIG= yes
VEM= ${PORTVERSION:R:R:R}
MUMPSVERSION= ${PORTVERSION:R}
LIBS= cmumps dmumps mumps_common pord smumps zmumps
PLIST_SUB= VE=${VEM} MUMPSVERSION=${MUMPSVERSION}
OPTIONS_DEFINE= DOCS EXAMPLES MPICH
MPICH_USES= mpi:mpich
MPICH_LIB_DEPENDS_OFF= libscotch.so:cad/scotch
MPICH_LIB_DEPENDS= libparmetis.so:math/parmetis \
libptscotch.so:cad/scotch \
libscalapack.so:math/scalapack
MPICH_PLIST_SUB= WITH_LIBSEQ="@comment "
MPICH_PLIST_SUB_OFF= WITH_LIBSEQ=""
MPICH_LIBS_OFF= mpiseq
MAKE_JOBS_UNSAFE=yes
.include <bsd.port.pre.mk>
.include "${.CURDIR}/../../french/aster/bsd.aster.mk"
.if ${GCC_DEFAULT} >= 10
# workaround for Type mismatch in argument 's' at (1); passed INTEGER(4) to LOGICAL(4)
FCFLAGS+= -fallow-argument-mismatch
.endif
.ifdef WITH_MPICH
PKGNAMESUFFIX+= -mpich
.endif
.if ${FORTRAN_DEFAULT} == gfortran && ${GCC_DEFAULT} >= 10
FCFLAGS+= -fallow-argument-mismatch
.endif
post-patch-MPICH-on:
${INSTALL_DATA} ${WRKSRC}/Make.inc/Makefile.FREEBSD10.PAR \
${WRKSRC}/Makefile.inc
post-patch-MPICH-off:
${INSTALL_DATA} ${WRKSRC}/Make.inc/Makefile.FREEBSD10.SEQ \
${WRKSRC}/Makefile.inc
pre-configure:
${DIRNAME} `${FC} -print-libgcc-file-name` > ${WRKSRC}/LIBDIR
.for MF in Makefile Makefile.inc PORD/lib/Makefile libseq/Makefile src/Makefile
${REINPLACE_CMD} -e 's+@CC@+${CC}+g ; s+@FC@+${FC}+g ; \
s+/usr/local+${LOCALBASE}+; \
s+@CFLAGS@+${CFLAGS} -fPIC+g; \
s+@FCFLAGS@+${FCFLAGS} -fPIC+g; \
s+@SOVER@+${VEM}+g; \
s+@GCCLIBDIR@+${GCCLIBDIR}+g; \
s+@FORTRANLIBS@+${FORTRANLIBS}+g; \
s+@BLAS_LIBS@+${BLASLIB}+ ; \
s+@LAPACK_LIBS@+${LAPACKLIB}+ ; \
s+@LOCALBASE@+${LOCALBASE}+g;' \
${WRKSRC}/${MF}
.endfor
pre-configure-MPICH-on:
${REINPLACE_CMD} -e '/lptscotch/s|#LSCOTCH|LSCOTCH|' \
-e 's|^LMETIS|##LMETIS|;s|^#LMETIS|LMETIS|' ${WRKSRC}/Makefile.inc
pre-configure-MPICH-off:
${REINPLACE_CMD} -e '/lscotch/s|#LSCOTCH|LSCOTCH|' ${WRKSRC}/Makefile.inc
do-install:
${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/lib/lib*.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${WRKSRC}/lib/lib*.so.${VEM} ${STAGEDIR}${PREFIX}/lib
.for lib in ${LIBS}
(cd ${STAGEDIR}${PREFIX}/lib && \
${LN} -sf lib${lib}.so.${VEM} ${STAGEDIR}${PREFIX}/lib/lib${lib}.so)
.endfor
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/userguide_${MUMPSVERSION}.pdf ${STAGEDIR}${DOCSDIR}
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
.for ex in Makefile README *.c *.F input_simpletest_*
${INSTALL_DATA} ${WRKSRC}/examples/${ex} ${STAGEDIR}${EXAMPLESDIR}
.endfor
.for ex in c_example *simpletest
${INSTALL_PROGRAM} ${WRKSRC}/examples/${ex} ${STAGEDIR}${EXAMPLESDIR}
.endfor
do-install-MPICH-off:
${MKDIR} ${STAGEDIR}${PREFIX}/include/mumps_seq
${INSTALL_DATA} ${WRKSRC}/libseq/mpi.h ${STAGEDIR}${PREFIX}/include/mumps_seq/mpi.h
${INSTALL_DATA} ${WRKSRC}/libseq/libmpiseq.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${WRKSRC}/libseq/libmpiseq*.so.${VEM} ${STAGEDIR}${PREFIX}/lib
.for lib in ${LIBS}
. for ext in a so so.${VEM}
(cd ${STAGEDIR}${PREFIX}/lib && \
${LN} -sf lib${lib}.${ext} ${STAGEDIR}${PREFIX}/lib/lib${lib}_seq.${ext})
. endfor
.endfor
test: install
.if defined (WITH_MPICH) && defined(MAINTAINER_MODE)
. if !exists(${HOME}/.mpd.conf)
@${ECHO_CMD} "MPD_SECRETWORD=change_on_install" > ${HOME}/.mpd.conf
${CHMOD} go-r ${HOME}/.mpd.conf
@${ECHO_MSG} "${HOME}/.mpd.conf has been generated - please change the secret word!"
. endif
(cd ${WRKSRC}/examples && \
${LOCALBASE}/bin/mpirun -np 2 ./ssimpletest < input_simpletest_real ; \
${LOCALBASE}/bin/mpirun -np 2 ./dsimpletest < input_simpletest_real ; \
${LOCALBASE}/bin/mpirun -np 2 ./csimpletest < input_simpletest_cmplx ; \
${LOCALBASE}/bin/mpirun -np 2 ./zsimpletest < input_simpletest_cmplx ; \
${ECHO_MSG} "The solution should be (1,2,3,4,5)" ; \
${LOCALBASE}/bin/mpirun -np 3 ./c_example ; \
${ECHO_MSG} "The solution should be (1,2)")
.else
(cd ${WRKSRC}/examples && \
./ssimpletest < input_simpletest_real ; \
./dsimpletest < input_simpletest_real ; \
./csimpletest < input_simpletest_cmplx ; \
./zsimpletest < input_simpletest_cmplx ; \
${ECHO_MSG} "The solution should be (1,2,3,4,5)" ; \
./c_example ; \
${ECHO_MSG} "The solution should be (1,2)")
.endif
.include <bsd.port.post.mk>