Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 50dd99b

Browse files
committed
Staticly linked build
1 parent dbe9345 commit 50dd99b

File tree

3 files changed

+87
-6
lines changed

3 files changed

+87
-6
lines changed

build_tarballs.jl

100644100755
Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,58 @@ version = v"7.3.8"
99
sources = [
1010
"https://sourceforge.net/projects/sdpa/files/sdpa/sdpa_7.3.8.tar.gz" =>
1111
"c7541333da2f0bb2d18e90dbf758ac7cc099f3f7da3f256b284b0725f96d4117",
12-
12+
"./bundled"
1313
]
1414

1515
# Bash recipe for building across all platforms
1616
script = raw"""
1717
cd $WORKSPACE/srcdir
1818
cd sdpa-7.3.8/
19-
./configure --prefix=$prefix --host=$target --with-blas="-L${prefix}/lib -lopenblas" --with-lapack="-L${prefix}/lib -lopenblas"
19+
update_configure_scripts
20+
21+
for path in ${LD_LIBRARY_PATH//:/ }; do
22+
for file in $(ls $path/*.la); do
23+
echo "$file"
24+
baddir=$(sed -n "s|libdir=||p" $file)
25+
sed -i~ -e "s|$baddir|'$path'|g" $file
26+
done
27+
done
28+
if [ $target = "x86_64-apple-darwin14" ]; then
29+
# seems static linking requires apple's ar
30+
export AR=/opt/x86_64-apple-darwin14/bin/x86_64-apple-darwin14-ar
31+
fi
32+
33+
patch -p1 < $WORKSPACE/srcdir/patches/shared.diff
34+
mv configure.in configure.ac
35+
patch -p1 < $WORKSPACE/srcdir/patches/lt_init.diff
36+
autoreconf -i
37+
38+
39+
./configure --prefix=$prefix --host=${target} lt_cv_deplibs_check_method=pass_all \
40+
--with-blas="-L${prefix}/lib -lcoinblas -lgfortran -lcoinmumps -lcoinmetis" \
41+
--with-lapack="-L${prefix}/lib -lcoinlapack -lcoinmumps -lcoinmetis" \
42+
--with-mumps-libs="-L${prefix}/lib -lcoinmumps -lcoinmetis" --with-mumps-include="-I$prefix/include/coin/ThirdParty"
43+
2044
make
2145
make install
22-
2346
"""
2447

2548
# These are the platforms we will build for by default, unless further
2649
# platforms are passed in on the command line
2750
platforms = [
28-
Linux(:i686, :glibc)
51+
Linux(:i686, libc=:glibc),
52+
Linux(:x86_64, libc=:glibc),
53+
Linux(:aarch64, libc=:glibc),
54+
Linux(:armv7l, libc=:glibc, call_abi=:eabihf),
55+
MacOS(:x86_64),
56+
Windows(:i686),
57+
Windows(:x86_64)
2958
]
59+
platforms = expand_gcc_versions(platforms)
60+
# To fix gcc4 bug in Windows
61+
# platforms = setdiff(platforms, [Windows(:x86_64, compiler_abi=CompilerABI(:gcc4)), Windows(:i686, compiler_abi=CompilerABI(:gcc4))])
62+
push!(platforms, Windows(:i686,compiler_abi=CompilerABI(:gcc6)))
63+
push!(platforms, Windows(:x86_64,compiler_abi=CompilerABI(:gcc6)))
3064

3165
# The products that we will ensure are always built
3266
products(prefix) = [
@@ -35,9 +69,12 @@ products(prefix) = [
3569

3670
# Dependencies that must be installed before this package can be built
3771
dependencies = [
38-
"https://github.com/JuliaLinearAlgebra/OpenBLASBuilder/releases/download/v0.3.0-1/build_OpenBLAS.v0.3.0.jl"
72+
"https://github.com/juan-pablo-vielma/COINBLASBuilder/releases/download/v1.4.6-1-static/build_COINBLASBuilder.v1.4.6.jl",
73+
"https://github.com/juan-pablo-vielma/COINLapackBuilder/releases/download/v1.5.6-1-static/build_COINLapackBuilder.v1.5.6.jl",
74+
"https://github.com/juan-pablo-vielma/COINMetisBuilder/releases/download/v1.3.5-1-static/build_COINMetisBuilder.v1.3.5.jl",
75+
"https://github.com/juan-pablo-vielma/COINMumpsBuilder/releases/download/v1.6.0-1-static/build_COINMumpsBuilder.v1.6.0.jl"
76+
3977
]
4078

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

bundled/patches/lt_init.diff

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index b9a3b19..19ef6d8 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -9,6 +9,7 @@ AC_PROG_RANLIB
6+
AC_PROG_CC
7+
AC_PROG_CXX
8+
AC_PROG_FC
9+
+LT_INIT
10+
AC_FC_LIBRARY_LDFLAGS
11+
AC_FC_WRAPPERS
12+
AC_CANONICAL_HOST

bundled/patches/shared.diff

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/Makefile.am b/Makefile.am
2+
index afadcff..400b3cf 100644
3+
--- a/Makefile.am
4+
+++ b/Makefile.am
5+
@@ -20,20 +20,22 @@ sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \
6+
sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \
7+
sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h
8+
9+
-lib_LIBRARIES = libsdpa.a
10+
-libsdpa_a_SOURCES = sdpa_block.cpp sdpa_call.cpp sdpa_chordal.cpp \
11+
+lib_LTLIBRARIES = libsdpa.la
12+
+libsdpa_la_LDFLAGS = -shared -no-undefined -export-symbols-regex "(sdpa|SDPA)"
13+
+libsdpa_la_LIBADD = $(MUMPS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PTHREAD_LIBS) $(FCLIBS)
14+
+libsdpa_la_SOURCES = sdpa_block.cpp sdpa_call.cpp sdpa_chordal.cpp \
15+
sdpa_dataset.cpp sdpa_dpotrf.cpp sdpa_io.cpp sdpa_jordan.cpp \
16+
sdpa_linear.cpp sdpa_newton.cpp sdpa_parts.cpp sdpa_solve.cpp \
17+
sdpa_struct.cpp sdpa_tool.cpp \
18+
sdpa_algebra.h sdpa_block.h \
19+
sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \
20+
sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \
21+
-sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h
22+
-libsdpa_a_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE)
23+
+sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h
24+
+libsdpa_la_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE)
25+
26+
bin_PROGRAMS = sdpa
27+
sdpa_SOURCES = sdpa_exe.cpp
28+
-sdpa_LDADD = -L. -lsdpa $(MUMPS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PTHREAD_LIBS) $(FCLIBS)
29+
+sdpa_LDADD = libsdpa.la $(MUMPS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PTHREAD_LIBS) $(FCLIBS)
30+
sdpa_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE)
31+
32+
# each file of mumps is copied by 'nobase' option

0 commit comments

Comments
 (0)