Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from staticfloat/sf/julia_compat
Browse files Browse the repository at this point in the history
Julia compatibility
  • Loading branch information
staticfloat authored May 25, 2018
2 parents d708249 + 451f352 commit 7806376
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ env:
# Our build takes too long for one job, so split targets across multiple jobs
matrix:
- TARGET=x86_64-linux-gnu
- TARGET=i686-linux-gnu
- TARGET=aarch64-linux-gnu
- TARGET=arm-linux-gnueabihf
- TARGET=powerpc64le-linux-gnu
- TARGET=x86_64-apple-darwin14
- TARGET=x86_64-w64-mingw32
- TARGET=i686-w64-mingw32

# Windows times out, even with sharding. Since we have to upload one, might as well upload
# them all, so to avoid wasting CI time, we just disable most of these, leaving only
# enough to make sure we aren't breaking something obvious when we push.

# - TARGET=i686-linux-gnu
# - TARGET=arm-linux-gnueabihf
# - TARGET=powerpc64le-linux-gnu
# - TARGET=x86_64-w64-mingw32
# - TARGET=i686-w64-mingw32
sudo: required

jobs:
Expand Down
47 changes: 34 additions & 13 deletions build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ flags="${flags} OBJCONV=objconv"
if [[ ${nbits} == 64 ]]; then
# If we're building for a 64-bit platform, engage ILP64
flags="${flags} INTERFACE64=1 SYMBOLSUFFIX=64_ LIBPREFIX=libopenblas64_"
LIBPREFIX=libopenblas64_
flags="${flags} INTERFACE64=1 SYMBOLSUFFIX=64_"
else
LIBPREFIX=libopenblas
fi
flags="${flags} LIBPREFIX=${LIBPREFIX}"
# Set BINARY=32 on 32-bit platforms
if [[ ${nbits} == 32 ]]; then
Expand Down Expand Up @@ -52,31 +56,48 @@ elif [[ ${target} == powerpc64le-* ]]; then
fi
# Enter the fun zone
cd ${WORKSPACE}/srcdir/OpenBLAS-0.3.0/
cd ${WORKSPACE}/srcdir/OpenBLAS-*/
# Build the library
make ${flags} -j${nproc}
# Install the library
make ${flags} PREFIX=$prefix install
# Force the library to be named the same as in Julia-land.
# Move things around, fix symlinks, and update install names/SONAMEs.
ls -la ${prefix}/lib
for f in ${prefix}/lib/libopenblas*p-r0*; do
name=${LIBPREFIX}.0.${f#*.}
# Move this file to a julia-compatible name
mv -v ${f} ${prefix}/lib/${name}
# If there were links that are now broken, fix 'em up
for l in $(find ${prefix}/lib -xtype l); do
if [[ $(basename $(readlink ${l})) == $(basename ${f}) ]]; then
ln -vsf ${name} ${l}
fi
done
# If this file was a .so or .dylib, set its SONAME/install name
if [[ ${f} == *.so.* ]] || [[ ${f} == *.dylib ]]; then
if [[ ${target} == *linux* ]] || [[ ${target} == *freebsd* ]]; then
patchelf --set-soname ${name} ${prefix}/lib/${name}
elif [[ ${target} == *apple* ]]; then
install_name_tool -id ${name} ${prefix}/lib/${name}
fi
fi
done
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line.
platforms = [
Windows(:i686),
Windows(:x86_64),
Linux(:i686, :glibc),
Linux(:x86_64, :glibc),
Linux(:aarch64, :glibc),
Linux(:armv7l, :glibc),
Linux(:powerpc64le, :glibc),
MacOS()
]
platforms = supported_platforms()

# The products that we will ensure are always built
products(prefix) = [
LibraryProduct(prefix, ["libopenblasp-r0", "libopenblas64_p-r0"], :libopenblas)
LibraryProduct(prefix, ["libopenblas", "libopenblas64_"], :libopenblas)
]

# Dependencies that must be installed before this package can be built
Expand Down

0 comments on commit 7806376

Please sign in to comment.