Skip to content

Commit 8fc764a

Browse files
committed
cpack
1 parent 4d23ead commit 8fc764a

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

.github/julia/build_tarballs_release.jl

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ using BinaryBuilder, Pkg
99
name = "HiGHS"
1010
version = VersionNumber(ENV["HIGHS_RELEASE"])
1111

12-
sources = [GitSource(ENV["HIGHS_URL"], ENV["HIGHS_COMMIT"])]
12+
sources = [GitSource(ENV["HIGHS_URL"], ENV["HIGHS_COMMIT"])
13+
# ArchiveSource("https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21.tar.gz",
14+
# "f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca")
15+
ArchiveSource(
16+
"https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.30/OpenBLAS-0.3.30.tar.gz",
17+
"27342cff518646afb4c2b976d809102e368957974c250a25ccc965e53063c95d")
18+
]
1319

1420
script = raw"""
1521
export BUILD_SHARED="OFF"
@@ -28,15 +34,33 @@ if [[ "${BUILD_SHARED}" == "OFF" ]] && [[ "${target}" == *-mingw* ]]; then
2834
export CXXFLAGS="-static"
2935
fi
3036
37+
if [[ "${target}" == *-darwin-* ]]; then
3138
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
3239
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
3340
-DCMAKE_BUILD_TYPE=Release \
34-
-DBUILD_SHARED_LIBS=${BUILD_SHARED} \
3541
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
3642
-DHIPO=ON \
3743
-DBUILD_STATIC_EXE=ON \
38-
-DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}" \
3944
..
45+
else
46+
cd $WORKSPACE/srcdir/OpenBLAS*
47+
make DYNAMIC_ARCH=1 NO_SHARED=1 USE_OPENMP=0 NUM_THREADS=64 BINARY=64 -j${nproc}
48+
make install PREFIX=${prefix} NO_SHARED=1
49+
50+
cd $WORKSPACE/srcdir/HiGHS
51+
apk del cmake
52+
mkdir -p build
53+
cd build
54+
55+
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
56+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
57+
-DCMAKE_BUILD_TYPE=Release \
58+
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
59+
-DHIPO=ON \
60+
-DBUILD_STATIC_EXE=ON \
61+
-DBLAS_LIBRARIES="${prefix}/lib/libopenblas.a" \
62+
..
63+
fi
4064
4165
if [[ "${target}" == *-linux-* ]]; then
4266
make -j ${nproc}
@@ -63,7 +87,6 @@ platforms = expand_cxxstring_abis(platforms)
6387
dependencies = [
6488
Dependency("CompilerSupportLibraries_jll"),
6589
Dependency("Zlib_jll"),
66-
Dependency("OpenBLAS32_jll"),
6790
HostBuildDependency(PackageSpec(; name="CMake_jll")),
6891
]
6992

.github/workflows/release-cpack.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- name: Build
1717
run: |
18-
cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_SHARED_LIBS=OFF
18+
cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON \
19+
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++"
1920
cmake --build build -j2
2021
cd build && cpack
2122
@@ -41,7 +42,8 @@ jobs:
4142

4243
- name: Build
4344
run: |
44-
cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON
45+
cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON \
46+
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++"
4547
cmake --build build -j2
4648
cd build && cpack
4749
@@ -61,7 +63,7 @@ jobs:
6163
- name: Build
6264
run: |
6365
cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
64-
-DHIPO=ON -DBUILD_OPENBLAS=ON
66+
-DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON
6567
cmake --build build --config Release --parallel
6668
cd build
6769
cpack -C Release
@@ -81,7 +83,7 @@ jobs:
8183
- name: Build
8284
run: |
8385
cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} `
84-
-DHIPO=ON -DBUILD_OPENBLAS=ON
86+
-DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON
8587
cmake --build build --config Release --parallel
8688
cd build
8789
cpack -C Release
@@ -98,8 +100,9 @@ jobs:
98100
- uses: actions/checkout@v3
99101
- name: Build Universal Binary
100102
run: |
101-
cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
102-
cmake --build build -DHIPO=ON --parallel
103+
cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
104+
-DBUILD_STATIC_EXE=ON
105+
cmake --build build --parallel
103106
cd build && cpack
104107
105108
- name: Upload artifacts

cmake/FindHipoDeps.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if (BUILD_OPENBLAS)
33
include(FetchContent)
44
set(FETCHCONTENT_QUIET OFF)
55
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
6-
set(BUILD_SHARED_LIBS ON)
6+
# set(BUILD_SHARED_LIBS ON)
77
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
88
set(BUILD_TESTING OFF)
99
set(CMAKE_Fortran_COMPILER OFF)

highs/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ else()
202202
message(STATUS "Linking against OpenBLAS via raw library: ${OPENBLAS_LIB}")
203203
target_link_libraries(highs PRIVATE ${OPENBLAS_LIB})
204204
target_include_directories(highs PRIVATE ${OPENBLAS_INCLUDE_DIR})
205+
elseif(BUILD_OPENBLAS)
206+
target_link_libraries(highs PRIVATE openblas)
207+
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
205208
else()
206209
message(FATAL_ERROR "OpenBLAS not found on Windows.")
207210
endif()

0 commit comments

Comments
 (0)