-
Notifications
You must be signed in to change notification settings - Fork 579
/
Copy pathbuild_tarballs.jl
101 lines (87 loc) · 2.96 KB
/
build_tarballs.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# In addition to coin-or-common.jl, we need to modify this file to trigger a
# rebuild.
#
# Last updated: 2024-07-24
include("../coin-or-common.jl")
# Collection of sources required to build Clp
sources = [
GitSource("https://github.com/coin-or/Clp.git", Clp_gitsha),
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/Clp*
# Remove misleading libtool files
rm -f ${prefix}/lib/*.la
update_configure_scripts
# old and custom autoconf
sed -i s/elf64ppc/elf64lppc/ configure
mkdir build
cd build/
export CPPFLAGS="${CPPFLAGS} -DNDEBUG -I${includedir} -I${includedir}/coin"
if [[ ${target} == *mingw* ]]; then
export LDFLAGS="-L${libdir}"
elif [[ ${target} == *linux* ]]; then
export LDFLAGS="-ldl -lrt"
fi
if [[ ${target} == *aarch64* ]] || [[ ${target} == *arm* ]]; then
export CPPFLAGS="${CPPFLAGS} -D__arm__"
fi
# BLAS and LAPACK
if [[ "${target}" == *mingw* ]]; then
LBT="-lblastrampoline-5"
else
LBT="-lblastrampoline"
fi
../configure \
--prefix=$prefix \
--build=${MACHTYPE} \
--host=${target} \
--with-pic \
--disable-pkg-config \
--disable-debug \
--disable-dependency-tracking \
--enable-shared \
lt_cv_deplibs_check_method=pass_all \
--with-blas \
--with-blas-lib="-L${libdir} ${LBT}" \
--with-lapack \
--with-lapack-lib="-L${libdir} ${LBT}" \
--with-coinutils-lib="-lCoinUtils" \
--with-osi-lib="-lCoinUtils -lOsi" \
--with-mumps-lib="-L${libdir} -ldmumps -lmpiseq" \
--with-mumps-incdir="${includedir}/libseq" \
--with-metis-lib="-L${libdir} -lmetis" \
--with-metis-incdir="${includedir}"
make -j${nproc}
make install
"""
# The products that we will ensure are always built
products = [
LibraryProduct("libClp", :libClp),
LibraryProduct("libOsiClp", :libOsiClp),
LibraryProduct("libClpSolver", :libClpSolver),
ExecutableProduct("clp", :clp),
]
# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="CoinUtils_jll", uuid="be027038-0da8-5614-b30d-e42594cb92df"), compat="=$(CoinUtils_version)"),
Dependency(PackageSpec(name="METIS_jll", uuid="d00139f3-1899-568f-a2f0-47f597d42d70"), compat="=$(METIS_version)"),
Dependency(PackageSpec(name="Osi_jll", uuid="7da25872-d9ce-5375-a4d3-7a845f58efdd"), compat="=$(Osi_version)"),
Dependency(PackageSpec(name="MUMPS_seq_jll", uuid="d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d"), compat="=$(MUMPS_seq_version_LBT)"),
Dependency(PackageSpec(name="libblastrampoline_jll", uuid="8e850b90-86db-534c-a0d3-1478176c7d93"), compat="5.4.0"),
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"))
]
# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(
ARGS,
"Clp",
Clp_version,
sources,
script,
platforms,
products,
dependencies;
preferred_gcc_version = gcc_version,
preferred_llvm_version = llvm_version,
julia_compat = "1.9",
)