Skip to content

Commit 3911247

Browse files
committed
merge wip
2 parents 13df0f6 + 6384b36 commit 3911247

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+13403
-362
lines changed

.github/julia/build_tarballs.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
3535
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
3636
-DHIPO=ON \
3737
-DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}" \
38-
-DMETIS_ROOT=${prefix} \
3938
..
4039
4140
if [[ "${target}" == *-linux-* ]]; then

.github/julia/generate_binaries.jl

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Version
2+
haskey(ENV, "HIGHS_RELEASE") || error("The environment variable HIGHS_RELEASE is not defined.")
3+
version = VersionNumber(ENV["HIGHS_RELEASE"])
4+
version2 = ENV["HIGHS_RELEASE"]
5+
package = "HIGHS"
6+
7+
platforms = [
8+
("aarch64-apple-darwin", "lib", "dylib"),
9+
("aarch64-linux-gnu-cxx11", "lib", "so" ),
10+
("aarch64-linux-musl-cxx11", "lib", "so" ),
11+
("aarch64-unknown-freebsd", "lib", "so" ),
12+
("armv6l-linux-gnueabihf-cxx11", "lib", "so" ),
13+
("armv6l-linux-musleabihf-cxx11", "lib", "so" ),
14+
("armv7l-linux-gnueabihf-cxx11", "lib", "so" ),
15+
("armv7l-linux-musleabihf-cxx11", "lib", "so" ),
16+
("i686-linux-gnu-cxx11", "lib", "so" ),
17+
("i686-linux-musl-cxx11", "lib", "so" ),
18+
("i686-w64-mingw32", "bin", "dll" ),
19+
("x86_64-apple-darwin", "lib", "dylib"),
20+
("x86_64-linux-gnu-cxx11", "lib", "so" ),
21+
("x86_64-linux-musl-cxx11", "lib", "so" ),
22+
("x86_64-unknown-freebsd", "lib", "so" ),
23+
("x86_64-w64-mingw32", "bin", "dll" )
24+
]
25+
26+
for (platform, libdir, ext) in platforms
27+
28+
tarball_name = "$package.v$version.$platform.tar.gz"
29+
30+
if isfile("products/$(tarball_name)")
31+
# Unzip the tarball generated by BinaryBuilder.jl
32+
isdir("products/$platform") && rm("products/$platform", recursive=true)
33+
mkdir("products/$platform")
34+
run(`tar -xzf products/$(tarball_name) -C products/$platform`)
35+
36+
if isfile("products/$platform/deps.tar.gz")
37+
# Unzip the tarball of the dependencies
38+
run(`tar -xzf products/$platform/deps.tar.gz -C products/$platform`)
39+
40+
# Copy the license of each dependency
41+
for folder in readdir("products/$platform/deps/licenses")
42+
cp("products/$platform/deps/licenses/$folder", "products/$platform/share/licenses/$folder")
43+
end
44+
rm("products/$platform/deps/licenses", recursive=true)
45+
46+
# Copy the shared library of each dependency
47+
for file in readdir("products/$platform/deps")
48+
cp("products/$platform/deps/$file", "products/$platform/$libdir/$file")
49+
end
50+
51+
# Remove the folder used to unzip the tarball of the dependencies
52+
rm("products/$platform/deps", recursive=true)
53+
rm("products/$platform/deps.tar.gz", recursive=true)
54+
55+
# Create the archives *_binaries
56+
isfile("$(package)_binaries.$version2.$platform.tar.gz") && rm("$(package)_binaries.$version2.$platform.tar.gz")
57+
isfile("$(package)_binaries.$version2.$platform.zip") && rm("$(package)_binaries.$version2.$platform.zip")
58+
cd("products/$platform")
59+
60+
# Create a folder with the version number of the package
61+
mkdir("$(package)_binaries.$version2")
62+
for folder in ("include", "share", "modules", "lib", "bin")
63+
cp(folder, "$(package)_binaries.$version2/$folder")
64+
end
65+
66+
cd("$(package)_binaries.$version2")
67+
if ext == "dll"
68+
run(`zip -r --symlinks ../../../$(package)_binaries.$version2.$platform.zip include share modules lib bin`)
69+
else
70+
run(`tar -czf ../../../$(package)_binaries.$version2.$platform.tar.gz include share modules lib bin`)
71+
end
72+
cd("../../..")
73+
74+
# Remove the folder used to unzip the tarball generated by BinaryBuilder.jl
75+
rm("products/$platform", recursive=true)
76+
else
77+
@warn("The tarball deps.tar.gz is missing in $(tarball_name)!")
78+
end
79+
else
80+
@warn("The tarball for the platform $platform was not generated!")
81+
end
82+
end

.github/workflows/release.yml

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v2023.11.15
8+
9+
jobs:
10+
build-linux-x64:
11+
name: HiGHS -- Linux (x86_64) -- Release ${{ github.ref_name }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout HiGHS
15+
uses: actions/checkout@v4
16+
17+
- name: Install Julia
18+
uses: julia-actions/setup-julia@v2
19+
with:
20+
version: "1.7"
21+
arch: x64
22+
23+
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, HIGHS_RELEASE, HIGHS_COMMIT
24+
shell: bash
25+
run: |
26+
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
27+
echo "HIGHS_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
28+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
29+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
30+
31+
- name: Cross-compilation of HiGHS -- x86_64-linux-gnu-cxx11
32+
run: |
33+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
34+
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-linux-gnu-cxx11 --verbose
35+
36+
- name: Archive artifact
37+
run: julia --color=yes .github/julia/generate_binaries.jl
38+
39+
- name: Upload artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: HiGHS_binaries.${{ github.ref_name }}.x86_64-linux-gnu-cxx11.tar.gz
43+
path: ./HiGHS_binaries.${{ github.ref_name }}.x86_64-linux-gnu-cxx11.tar.gz
44+
45+
build-linux-aarch64:
46+
name: HiGHS -- Linux (aarch64) -- Release ${{ github.ref_name }}
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout HiGHS
50+
uses: actions/checkout@v4
51+
52+
- name: Install Julia
53+
uses: julia-actions/setup-julia@v2
54+
with:
55+
version: "1.7"
56+
arch: x64
57+
58+
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, UNO_RELEASE, UNO_COMMIT
59+
shell: bash
60+
run: |
61+
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
62+
echo "HIGHS_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
63+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
64+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
65+
66+
- name: Cross-compilation of HiGHS -- aarch64-linux-gnu-cxx11
67+
run: |
68+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
69+
julia --color=yes .github/julia/build_tarballs_release.jl aarch64-linux-gnu-cxx11 --verbose
70+
71+
- name: Archive artifact
72+
run: julia --color=yes .github/julia/generate_binaries.jl
73+
74+
- name: Upload artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: Uno_binaries.${{ github.ref_name }}.aarch64-linux-gnu-cxx11.tar.gz
78+
path: ./Uno_binaries.${{ github.ref_name }}.aarch64-linux-gnu-cxx11.tar.gz
79+
80+
build-windows-x64:
81+
name: HiGHS -- Windows (x86_64) -- Release ${{ github.ref_name }}
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout Uno
85+
uses: actions/checkout@v4
86+
87+
- name: Install Julia
88+
uses: julia-actions/setup-julia@v2
89+
with:
90+
version: "1.7"
91+
arch: x64
92+
93+
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, UNO_RELEASE, UNO_COMMIT
94+
shell: bash
95+
run: |
96+
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
97+
echo "HIGHS_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
98+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
99+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
100+
101+
- name: Cross-compilation of HiGHS -- x86_64-w64-mingw32-cxx11
102+
run: |
103+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
104+
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-w64-mingw32-cxx11 --verbose
105+
- name: Archive artifact
106+
run: julia --color=yes .github/julia/generate_binaries.jl
107+
108+
- name: Upload artifact
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-cxx11.zip
112+
path: ./Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-cxx11.zip
113+
114+
build-mac-x64:
115+
name: HiGHS -- macOS (x86_64) -- Release ${{ github.ref_name }}
116+
runs-on: ubuntu-latest
117+
steps:
118+
- name: Checkout Uno
119+
uses: actions/checkout@v4
120+
121+
- name: Install Julia
122+
uses: julia-actions/setup-julia@v2
123+
with:
124+
version: "1.7"
125+
arch: x64
126+
127+
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, UNO_RELEASE, UNO_COMMIT
128+
shell: bash
129+
run: |
130+
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
131+
echo "HIGHS_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
132+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
133+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
134+
135+
- name: Cross-compilation of HiGHS -- x86_64-apple-darwin-cxx11
136+
run: |
137+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
138+
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-apple-darwin-cxx11 --verbose
139+
140+
- name: Archive artifact
141+
run: julia --color=yes .github/julia/generate_binaries.jl
142+
143+
- name: Upload artifact
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-cxx11.tar.gz
147+
path: ./Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-cxx11.tar.gz
148+
149+
build-mac-aarch64:
150+
name: HiGHS -- macOS (aarch64) -- Release ${{ github.ref_name }}
151+
runs-on: ubuntu-latest
152+
steps:
153+
- name: Checkout Uno
154+
uses: actions/checkout@v4
155+
156+
- name: Install Julia
157+
uses: julia-actions/setup-julia@v2
158+
with:
159+
version: "1.7"
160+
arch: x64
161+
162+
- name: Set the environment variables BINARYBUILDER_AUTOMATIC_APPLE, UNO_RELEASE, UNO_COMMIT
163+
shell: bash
164+
run: |
165+
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
166+
echo "HIGHS_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
167+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
168+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
169+
170+
- name: Cross-compilation of HiGHS -- aarch64-apple-darwin-cxx11
171+
run: |
172+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
173+
julia --color=yes .github/julia/build_tarballs_release.jl aarch64-apple-darwin-cxx11 --verbose
174+
175+
- name: Archive artifact
176+
run: julia --color=yes .github/julia/generate_binaries.jl
177+
178+
- name: Upload artifact
179+
uses: actions/upload-artifact@v4
180+
with:
181+
name: Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-cxx11.tar.gz
182+
path: ./Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-cxx11.tar.gz
183+
184+
release:
185+
name: Create Release and Upload Binaries
186+
needs: [build-windows-x64, build-linux-x64, build-linux-aarch64, build-mac-x64, build-mac-aarch64]
187+
runs-on: ubuntu-latest
188+
steps:
189+
- name: Checkout Uno
190+
uses: actions/checkout@v4
191+
192+
- name: Download artifacts
193+
uses: actions/download-artifact@v4
194+
with:
195+
path: .
196+
197+
- name: Create GitHub Release
198+
run: |
199+
gh release create ${{ github.ref_name }} \
200+
--title "${{ github.ref_name }}" \
201+
--notes "" \
202+
--verify-tag
203+
env:
204+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
205+
206+
- name: Upload Linux (x86_64) artifact
207+
run: |
208+
gh release upload ${{ github.ref_name }} \
209+
Uno_binaries.${{ github.ref_name }}.x86_64-linux-gnu-cxx11.tar.gz/Uno_binaries.${{ github.ref_name }}.x86_64-linux-gnu-cxx11.tar.gz#Uno.${{ github.ref_name }}.linux.x86_64.tar.gz
210+
env:
211+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
212+
213+
- name: Upload Linux (aarch64) artifact
214+
run: |
215+
gh release upload ${{ github.ref_name }} \
216+
Uno_binaries.${{ github.ref_name }}.aarch64-linux-gnu-cxx11.tar.gz/Uno_binaries.${{ github.ref_name }}.aarch64-linux-gnu-cxx11.tar.gz#Uno.${{ github.ref_name }}.linux.aarch64.tar.gz
217+
env:
218+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219+
220+
- name: Upload Mac (x86_64) artifact
221+
run: |
222+
gh release upload ${{ github.ref_name }} \
223+
Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-cxx11.tar.gz/Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-cxx11.tar.gz#Uno.${{ github.ref_name }}.mac.x86_64.tar.gz
224+
env:
225+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226+
227+
- name: Upload Mac (aarch64) artifact
228+
run: |
229+
gh release upload ${{ github.ref_name }} \
230+
Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-cxx11.tar.gz/Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-cxx11.tar.gz#Uno.${{ github.ref_name }}.mac.aarch64.tar.gz
231+
env:
232+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
233+
234+
- name: Upload Windows (x86_64) artifact
235+
run: |
236+
gh release upload ${{ github.ref_name }} \
237+
Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-cxx11.zip/Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-cxx11.zip#Uno.${{ github.ref_name }}.windows.x86_64.zip
238+
env:
239+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ endif()
148148

149149
option(HIPO "Build HIPO" OFF)
150150
message(STATUS "Build HIPO: ${HIPO}")
151+
option(BUILD_OPENBLAS "Build OpenBLAS" OFF)
152+
message(STATUS "Build OpenBLAS: ${BUILD_OPENBLAS}")
151153
if (HIPO AND CSHARP)
152154
message(ERROR "HIPO is only available in C++. Not yet supported in C#.")
153155
endif()
@@ -523,15 +525,16 @@ if(ZLIB AND NOT TARGET ZLIB::ZLIB)
523525
find_package(ZLIB 1.2.3)
524526
endif()
525527

526-
if(CPack_CMake_INCLUDED EQUAL 0)
527-
include(CPack)
528-
endif()
529-
530-
set(CPACK_PACKAGE_VERSION_MAJOR "${HIGHS_VERSION_MAJOR}")
531-
set(CPACK_PACKAGE_VERSION_MINOR "${HIGHS_VERSION_MINOR}")
532-
set(CPACK_PACKAGE_VERSION_PATCH "${HIGHS_VERSION_PATCH}")
533-
set(CPACK_PACKAGE_VENDOR "University of Edinburgh")
528+
install(FILES README.md LICENSE.txt DESTINATION .)
534529

530+
# Set default generator based on platform
531+
if(WIN32)
532+
set(CPACK_GENERATOR "ZIP")
533+
elseif(APPLE)
534+
set(CPACK_GENERATOR "TGZ")
535+
else()
536+
set(CPACK_GENERATOR "TGZ")
537+
endif()
535538

536539
# Deprecate
537540
# string(TIMESTAMP TODAY "%Y-%m-%d")
@@ -838,3 +841,18 @@ else(FAST_BUILD)
838841
endif()
839842

840843
endif()
844+
845+
if(NOT CPack_CMake_INCLUDED)
846+
include(CPack)
847+
endif()
848+
849+
set(CPACK_PACKAGE_NAME "HiGHS")
850+
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
851+
set(CPACK_PACKAGE_VERSION_MAJOR "${HIGHS_VERSION_MAJOR}")
852+
set(CPACK_PACKAGE_VERSION_MINOR "${HIGHS_VERSION_MINOR}")
853+
set(CPACK_PACKAGE_VERSION_PATCH "${HIGHS_VERSION_PATCH}")
854+
set(CPACK_PACKAGE_VENDOR "University of Edinburgh")
855+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "\
856+
Open source serial and parallel solvers for large-scale sparse \
857+
linear programming (LP), mixed-integer programming (MIP), and \
858+
quadratic programming (QP) models")

LicenseNote.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The HiGHS source code in highs/ is available under MIT
2+
license (see LICENSE.TXT).
3+
4+
Some of the code in extern/ is available under other
5+
similar permissive licenses:
6+
- SuiteSparse AMD is available under BSD 3-clause license.
7+
- Metis is available under Apache 2.0 license.
8+
9+
These codes ara needed only when building HiGHS with HiPO
10+
support (-DHIPO=ON). If this is the case, then the resulting
11+
HiGHS library and executables are available with Apache 2.0
12+
license rather than MIT.

0 commit comments

Comments
 (0)