Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build libscsindirgpu.so against CUDA_full_jll #1289

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
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
36 changes: 12 additions & 24 deletions S/SCS/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = v"2.1.1"

# Collection of sources required to build SCSBuilder
sources = [
GitSource("https://github.com/cvxgrp/scs.git", "d2c1ae92b8c5c6d45406afd007d1ddad74635cfd")
GitSource("https://github.com/cvxgrp/scs.git", "e6ab81db115bb37502de0a9917041a0bc2ded313")
]

# Bash recipe for building across all platforms
Expand All @@ -21,30 +21,16 @@ else
blasldflags+=" -lopenblas"
fi

# Patch to reverse this WIN64 change: https://github.com/cvxgrp/scs/commit/9858d6b562f499de75493b85286276c19ad84c6f#diff-a9dbab3214616022c64ee2656440f544
# Looks like it is known that this change causes trouble witn mingw32 (but not for mingw64?):
# https://github.com/cvxgrp/scs/blob/e6ab81db115bb37502de0a9917041a0bc2ded313/.appveyor.yml#L13-L16
cd include
cp glbopts.h glbopts.h.orig
cat > file.patch <<'END'
--- glbopts.h.orig
+++ glbopts.h
@@ -97,7 +97,7 @@
#ifdef _WIN64
/* #include <stdint.h> */
/* typedef int64_t scs_int; */
-typedef long scs_int;
+typedef __int64 scs_int;
#else
typedef long scs_int;
#endif
END
patch -l glbopts.h.orig file.patch -o glbopts.h
cd ..

make BLASLDFLAGS="${blasldflags}" ${flags} out/libscsdir.${dlext}
make BLASLDFLAGS="${blasldflags}" ${flags} out/libscsindir.${dlext}

# Building CUDA dependent libs
make clean

flags="DLONG=0 USE_OPENMP=0"

CUDA_PATH=$prefix/cuda make BLASLDFLAGS="${blasldflags}" ${flags} out/libscsgpuindir.${dlext}

mkdir -p ${libdir}
cp out/libscs*.${dlext} ${libdir}
"""
Expand All @@ -56,12 +42,14 @@ platforms = supported_platforms()
# The products that we will ensure are always built
products = [
LibraryProduct("libscsindir", :libscsindir),
LibraryProduct("libscsdir", :libscsdir)
LibraryProduct("libscsdir", :libscsdir),
LibraryProduct("libscsgpuindir", :libscsgpuindir, dont_dlopen=true)
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("OpenBLAS_jll")
Dependency("OpenBLAS_jll"),
BuildDependency("CUDA_full_jll")
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down