Skip to content

Commit

Permalink
[CI] Fix the compilation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Nov 15, 2024
1 parent 80765b0 commit 1936a5f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
10 changes: 8 additions & 2 deletions .github/julia/build_tarballs_release.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ cd $WORKSPACE/srcdir/Uno
mkdir -p build
cd build
if [[ "${target}" == *mingw* ]]; then
LIBHIGHS=${prefix}/lib/libhighs.dll.a
else
LIBHIGHS=${libdir}/libhighs.${dlext}
fi
if [[ "${target}" == *apple* ]] || [[ "${target}" == *freebsd* ]]; then
OMP=omp
else
Expand All @@ -98,7 +104,7 @@ cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DAMPLSOLVER=${libdir}/libasl.${dlext} \
-DHIGHS=${libdir}/libhighs.${dlext} \
-DHIGHS=${LIBHIGHS} \
-DHSL=${libdir}/libhsl.${dlext} \
-DMUMPS_INCLUDE_DIR=${includedir} \
-DMETIS_INCLUDE_DIR=${includedir} \
Expand All @@ -117,7 +123,7 @@ install -v -m 755 "uno_ampl${exeext}" -t "${bindir}"
# Currently, Uno does not provide a shared library. This may be useful in the future once it has a C API.
# We just check that we can generate it, but we don't include it in the tarballs.
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -lopenblas -ldmumps -lmetis -lhsl
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -lopenblas -ldmumps -lmetis -lhsl -lhighs
cp libuno.a ${prefix}/lib/libuno.a
cp libuno.${dlext} ${libdir}/libuno.${dlext}
"""
Expand Down
6 changes: 4 additions & 2 deletions .github/julia/build_tarballs_yggdrasil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ cd build
if [[ "${target}" == *mingw* ]]; then
LBT=blastrampoline-5
LIBHIGHS=${prefix}/lib/libhighs.dll.a
else
LBT=blastrampoline
LIBHIGHS=${libdir}/libhighs.${dlext}
fi
if [[ "${target}" == *apple* ]] || [[ "${target}" == *freebsd* ]]; then
Expand All @@ -42,7 +44,7 @@ cmake \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DAMPLSOLVER=${libdir}/libasl.${dlext} \
-DHIGHS=${libdir}/libhighs.${dlext} \
-DHIGHS=${LIBHIGHS} \
-DHSL=${libdir}/libhsl.${dlext} \
-DBLA_VENDOR="libblastrampoline" \
-DMUMPS_INCLUDE_DIR=${includedir} \
Expand All @@ -62,7 +64,7 @@ install -v -m 755 "uno_ampl${exeext}" -t "${bindir}"
# Currently, Uno does not provide a shared library. This may be useful in the future once it has a C API.
# We just check that we can generate it, but we don't include it in the tarballs.
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -l${LBT} -ldmumps -lmetis -lhsl
${CXX} -shared $(flagon -Wl,--whole-archive) libuno.a $(flagon -Wl,--no-whole-archive) -o libuno.${dlext} -L${libdir} -l${OMP} -l${LBT} -ldmumps -lmetis -lhsl -lhighs
# cp libuno.${dlext} ${libdir}/libuno.${dlext}
"""

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ jobs:
echo "BINARYBUILDER_AUTOMATIC_APPLE=true" >> $GITHUB_ENV
echo "UNO_RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
echo "UNO_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
- name: Cross-compilation of Uno -- x86_64-linux-gnu-libgfortran5
- name: Cross-compilation of Uno -- x86_64-linux-gnu-cxx11
run: |
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-linux-gnu-libgfortran5 --verbose
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-linux-gnu-cxx11 --verbose
rm -r ~/.julia
- name: Cross-compilation of Uno -- x86_64-w64-mingw32-libgfortran5
- name: Cross-compilation of Uno -- x86_64-w64-mingw32-cxx11
run: |
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-w64-mingw32-libgfortran5 --verbose
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-w64-mingw32-cxx11 --verbose
rm -r ~/.julia
- name: Cross-compilation of Uno -- x86_64-apple-darwin-libgfortran5
- name: Cross-compilation of Uno -- x86_64-apple-darwin-cxx11
run: |
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-apple-darwin-libgfortran5 --verbose
julia --color=yes .github/julia/build_tarballs_release.jl x86_64-apple-darwin-cxx11 --verbose
rm -r ~/.julia
- name: Cross-compilation of Uno -- aarch64-apple-darwin-libgfortran5
- name: Cross-compilation of Uno -- aarch64-apple-darwin-cxx11
run: |
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
julia --color=yes .github/julia/build_tarballs_release.jl aarch64-apple-darwin-libgfortran5 --verbose
julia --color=yes .github/julia/build_tarballs_release.jl aarch64-apple-darwin-cxx11 --verbose
rm -r ~/.julia
- name: Generate the binaries
run: julia --color=yes .github/julia/generate_binaries.jl
Expand All @@ -61,7 +61,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-linux-gnu-libgfortran5.tar.gz
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-linux-gnu-cxx11.tar.gz
asset_name: Uno.${{ github.ref_name }}.linux.tar.gz
asset_content_type: application/gzip
- name: upload Mac (Intel) artifact
Expand All @@ -70,7 +70,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-libgfortran5.tar.gz
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-apple-darwin-cxx11.tar.gz
asset_name: Uno.${{ github.ref_name }}.mac-intel.tar.gz
asset_content_type: application/gzip
- name: upload Mac (ARM) artifact
Expand All @@ -79,7 +79,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-libgfortran5.tar.gz
asset_path: ./Uno_binaries.${{ github.ref_name }}.aarch64-apple-darwin-cxx11.tar.gz
asset_name: Uno.${{ github.ref_name }}.mac-arm.tar.gz
asset_content_type: application/gzip
- name: upload Windows artifact
Expand All @@ -88,6 +88,6 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-libgfortran5.zip
asset_path: ./Uno_binaries.${{ github.ref_name }}.x86_64-w64-mingw32-cxx11.zip
asset_name: Uno.${{ github.ref_name }}.windows.zip
asset_content_type: application/zip

0 comments on commit 1936a5f

Please sign in to comment.