Sunday, October 21, 2018

Re: NEW: math/mlpack (and dependency math/armadillo)

On Sun, Oct 21 2018, Steven Mestdagh <steven@openbsd.org> wrote:
> Jeremie Courreges-Anglas [2018-10-21, 17:25:19]:

[...]

>> Regarding libgfortran,
>>
>> > - the library definitely requires linking with the gfortran library
>> > because some of lapack blas want symbols in there
>>
>> Yeah I see. IIUC blas, apack and arpack don't register the dep on
>> libgfortran because of a build system quirk (linking is done with with
>> cc instead of gfortran). A simple diff like below would register the
>> dep on libgfortran, and remove the need for patch-CMakeLists_txt.
>>
>> cc'ing steven@ (maintainer)
>>
>> Thoughts, ok?
>>
>>
>> Index: blas/Makefile
>> ===================================================================
>> RCS file: /cvs/ports/math/blas/Makefile,v
>> retrieving revision 1.27
>> diff -u -p -r1.27 Makefile
>> --- blas/Makefile 13 Nov 2017 06:56:38 -0000 1.27
>> +++ blas/Makefile 21 Oct 2018 14:31:16 -0000
>> @@ -4,6 +4,7 @@ COMMENT= Basic Linear Algebra Subprogram
>>
>> VERSION= 3.7.1
>> DISTNAME= blas-${VERSION}
>> +REVISION= 0
>>
>> SHARED_LIBS= blas 2.1
>>
>> Index: blas/files/Makefile
>> ===================================================================
>> RCS file: /cvs/ports/math/blas/files/Makefile,v
>> retrieving revision 1.3
>> diff -u -p -r1.3 Makefile
>> --- blas/files/Makefile 13 Nov 2017 06:56:38 -0000 1.3
>> +++ blas/files/Makefile 21 Oct 2018 14:31:16 -0000
>> @@ -25,6 +25,7 @@ SRCS = caxpy.f ccopy.f cdotc.f cdotu.
>> zhpmv.f zhpr.f zhpr2.f zrotg.f zscal.f zswap.f zsymm.f \
>> zsyr2k.f zsyrk.f ztbmv.f ztbsv.f ztpmv.f ztpsv.f ztrmm.f \
>> ztrmv.f ztrsm.f ztrsv.f xerbla_array.f
>> +LDADD = -lgfortran
>>
>> printsrc:
>> @echo ${SRCS}
>
> How about just linking with gfortran by passing CC to make?
> (blas diff below, but similar for the other ports)
> I didn't check if dependent ports are happy with that in terms of
> WANTLIB etc.

Looks like a better approach, and seems to work for blas at least.
make port-lib-depends-check says:

blas-3.7.1p0(math/blas):
Missing: m.10 (/usr/local/lib/libblas.so.2.1) (system lib)
WANTLIB += m

so blas itself would need a WANTLIB update. ENOTIME to cook another
diff right now, feel free to beat me to it.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/math/blas/Makefile,v
> retrieving revision 1.27
> diff -u -p -u -r1.27 Makefile
> --- Makefile 13 Nov 2017 06:56:38 -0000 1.27
> +++ Makefile 21 Oct 2018 21:40:59 -0000
> @@ -4,6 +4,7 @@ COMMENT= Basic Linear Algebra Subprogram
>
> VERSION= 3.7.1
> DISTNAME= blas-${VERSION}
> +REVISION= 0
>
> SHARED_LIBS= blas 2.1
>
> @@ -30,7 +31,8 @@ BUILD_DEPENDS= ${MODFORTRAN_BUILD_DEPEND
> MAKE_FILE= ${FILESDIR}/Makefile
> MAKE_ENV= SHLIB_MAJOR=${LIBblas_VERSION:R} \
> SHLIB_MINOR=${LIBblas_VERSION:E} \
> - FC="${MODFORTRAN_COMPILER} -cpp"
> + FC="${MODFORTRAN_COMPILER} -cpp" \
> + CC=${MODFORTRAN_COMPILER}
> FAKE_FLAGS= LIBDIR=${LOCALBASE}/lib DEBUGLIBS=no
> USE_GROFF= Yes
>
>

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

No comments:

Post a Comment