Skip to content

Commit

Permalink
add builder for PROPACK
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed Jan 16, 2020
1 parent 6ffe4a2 commit 7bc520d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions P/PROPACK/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using BinaryBuilder

name = "PROPACK"
version = v"0.1"

sources = [
"https://github.com/optimizers/PROPACK/archive/v1.0.tar.gz" =>
"0d029a4c2cdcdb9b18a4fae77593a562f79406c3f79839ee948782b37974a10e",
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/PROPACK-*/
OPENBLAS="-lopenblas"
FFLAGS=(-xf77-cpp-input)
if [[ ${nbits} == 64 ]] && [[ ${target} != aarch64* ]]; then
OPENBLAS="-lopenblas64_"
FFLAGS+=(-fdefault-integer-8 -fno-align-commons)
for sym in caxpy cdotc cdotu ccopy cgemv clarnv clascl cscal csscal daxpy dbdsdc dbdsqr dcopy ddot dgemm dgemv dlamch dlapy2 dlarnv dlartg dlascl dnrm2 dznrm2 drot dscal lsame saxpy sbdsdc sbdsqr scnrm2 scopy sdot sgemm sgemv slamch slapy2 slarnv slartg slascl snrm2 srot sscal zaxpy zcopy zdotc zdotu zdscal zgemv zlarnv zlascl zscal
do
FFLAGS+=("-D${sym}=${sym}_64")
done
fi
make SLIB=${dlext} FFLAG=\"${FFLAGS[*]}\" BLAS=${OPENBLAS}
cp complex8/libcpropack.${dlext} complex16/libzpropack.${dlext} single/libspropack.${dlext} double/libdpropack.${dlext} ${libdir}/
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
# platforms = supported_platforms()
platforms = [
MacOS(:x86_64),
]

platforms = expand_gfortran_versions(platforms)

products = [
LibraryProduct("libcpropack", :libcpropack),
LibraryProduct("libzpropack", :libzpropack),
LibraryProduct("libspropack", :libspropack),
LibraryProduct("libdpropack", :libdpropack),
]

dependencies = [
"OpenBLAS_jll",
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)

0 comments on commit 7bc520d

Please sign in to comment.