Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Q/qdldl/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "qdldl"
version = v"0.1.5"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://github.com/osqp/qdldl/archive/refs/tags/v$(version).tar.gz", "2868b0e61b7424174e9adef3cb87478329f8ab2075211ef28fe477f29e0e5c99")
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
cd qdldl-0.1.5/
mkdir build_double
cd build_double/
cmake -DCMAKE_INSTALL_PREFIX=$prefix/double -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DDFLOAT=0 ..
cmake --build . -j8
make install
cd ..
mkdir build_single
cd build_single/
cmake -DCMAKE_INSTALL_PREFIX=$prefix/single -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DDFLOAT=1 ..
cmake --build . -j8
make install
"""

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

# The products that we will ensure are always built
products = [
LibraryProduct("libqdldl", :libqdldl64, "double/lib"),
LibraryProduct("libqdldl", :libqdldl32, "single/lib")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it isn't a good idea to have two libraries with same soname in the same process. It's hugely problematic: #3801

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imciner2 you seem to be familiar with this library. Is there a way to build the two distinct variants next to each other with different sonames by default? This is what FFTW does, which makes it possible for different variants to coexist, but having same soname only causes problems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bummer. I'll see if I can get the authors to provide an option to add a suffix to the library name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The short answer is no, there is no way to build the two variants next to each other right now, and I don't think any other consumer of QDLDL has ever wanted to provide both a float32 and float64 variant, they usually have just used float64 if they provide a library (or at least no one has reached out to us about it). Is there a real need to provide float32 in the C library when there is QDLDL.jl that can handle any type under AbstractFloat since it is a pure Julia implementation?

]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
]

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