Skip to content
Snippets Groups Projects
Verified Commit a31c7640 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Windows and macOS packages: move meson native/cross files to OS-specific directory

parent 4ef9245a
No related branches found
No related tags found
No related merge requests found
...@@ -479,7 +479,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5. ...@@ -479,7 +479,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.
```sh ```sh
export BUILDDIR=build-matlab export BUILDDIR=build-matlab
export MATLABPATH=/Applications/MATLAB_R2023b.app export MATLABPATH=/Applications/MATLAB_R2023b.app
arch -$ARCH meson setup --native-file scripts/homebrew-native-$ARCH.ini -Dmatlab_path=$MATLABPATH -Dbuildtype=debugoptimized -Dfortran_args="['-B','$DYNAREDIR/slicot/lib']" $BUILDDIR arch -$ARCH meson setup --native-file macOS/homebrew-native-$ARCH.ini -Dmatlab_path=$MATLABPATH -Dbuildtype=debugoptimized -Dfortran_args="['-B','$DYNAREDIR/slicot/lib']" $BUILDDIR
``` ```
where you need to adapt the path to MATLAB. where you need to adapt the path to MATLAB.
Similarly, if you want to compile for Octave, replace the `-Dmatlab_path` option by `-Dbuild_for=octave`, and change the build directory to `build-octave`. Similarly, if you want to compile for Octave, replace the `-Dmatlab_path` option by `-Dbuild_for=octave`, and change the build directory to `build-octave`.
......
...@@ -54,7 +54,7 @@ LIB64="$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64 ...@@ -54,7 +54,7 @@ LIB64="$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64
## - the macOS linker is different from GNU ld and does not have the equivalent of -Bstatic/-Bdynamic ## - the macOS linker is different from GNU ld and does not have the equivalent of -Bstatic/-Bdynamic
## - libgfortran.spec does not include --as-needed on macOS, hence it will link the library anyways ## - libgfortran.spec does not include --as-needed on macOS, hence it will link the library anyways
## Also, it does not seem possible to override libgfortran.spec with the --specs option. ## Also, it does not seem possible to override libgfortran.spec with the --specs option.
GCC_VERSION=$(sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" "$ROOTDIR"/scripts/homebrew-native-"$PKG_ARCH".ini) GCC_VERSION=$(sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" "$ROOTDIR"/macOS/homebrew-native-"$PKG_ARCH".ini)
QUADMATH_DIR=$(mktemp -d) QUADMATH_DIR=$(mktemp -d)
ln -s "$BREWDIR"/opt/gcc/lib/gcc/"$GCC_VERSION"/libquadmath.a "$QUADMATH_DIR" ln -s "$BREWDIR"/opt/gcc/lib/gcc/"$GCC_VERSION"/libquadmath.a "$QUADMATH_DIR"
...@@ -67,7 +67,7 @@ cd "$ROOTDIR" ...@@ -67,7 +67,7 @@ cd "$ROOTDIR"
# NB: the addition of -Wl,-ld_classic is a workaround for https://github.com/mesonbuild/meson/issues/12282 (see also the native file) # NB: the addition of -Wl,-ld_classic is a workaround for https://github.com/mesonbuild/meson/issues/12282 (see also the native file)
common_meson_opts=(-Dbuild_for=matlab -Dbuildtype=release -Dprefer_static=true -Dfortran_args="[ '-B', '$LIB64/Slicot/' ]" \ common_meson_opts=(-Dbuild_for=matlab -Dbuildtype=release -Dprefer_static=true -Dfortran_args="[ '-B', '$LIB64/Slicot/' ]" \
-Dc_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dcpp_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dfortran_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" \ -Dc_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dcpp_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dfortran_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" \
--native-file scripts/homebrew-native-$PKG_ARCH.ini) --native-file macOS/homebrew-native-$PKG_ARCH.ini)
# Build for MATLAB ⩾ R2018b (x86_64) and MATLAB ⩾ R2023b (arm64) # Build for MATLAB ⩾ R2018b (x86_64) and MATLAB ⩾ R2023b (arm64)
arch -"$PKG_ARCH" meson setup "${common_meson_opts[@]}" -Dmatlab_path="$MATLAB_PATH" build-matlab --wipe arch -"$PKG_ARCH" meson setup "${common_meson_opts[@]}" -Dmatlab_path="$MATLAB_PATH" build-matlab --wipe
......
...@@ -22,7 +22,7 @@ DEPS_ARCH ?= x86_64 # use x86_64 by default ...@@ -22,7 +22,7 @@ DEPS_ARCH ?= x86_64 # use x86_64 by default
BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local) BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local)
GCC_VERSION = $(shell sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" ../../scripts/homebrew-native-$(DEPS_ARCH).ini) GCC_VERSION = $(shell sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" ../homebrew-native-$(DEPS_ARCH).ini)
ROOT_PATH = $(realpath .) ROOT_PATH = $(realpath .)
......
File moved
...@@ -53,15 +53,15 @@ ln -s "$ROOT_DIRECTORY"/deps/mkoctfile64 /tmp/windeps/ ...@@ -53,15 +53,15 @@ ln -s "$ROOT_DIRECTORY"/deps/mkoctfile64 /tmp/windeps/
# Go to source root directory # Go to source root directory
cd .. cd ..
common_meson_opts=(-Dbuildtype=release --cross-file scripts/windows-cross.ini) common_meson_opts=(-Dbuildtype=release --cross-file windows/mingw-cross.ini)
# Create Windows 64-bit DLL binaries for MATLAB ≥ R2018b # Create Windows 64-bit DLL binaries for MATLAB ≥ R2018b
meson setup --cross-file scripts/windows-cross-matlab.ini -Dmatlab_path=/tmp/windeps/matlab64/R2018b \ meson setup --cross-file windows/mingw-cross-matlab.ini -Dmatlab_path=/tmp/windeps/matlab64/R2018b \
"${common_meson_opts[@]}" build-win-matlab "${common_meson_opts[@]}" build-win-matlab
meson compile -v -C build-win-matlab meson compile -v -C build-win-matlab
# Create Windows DLL binaries for Octave/MinGW (64bit) # Create Windows DLL binaries for Octave/MinGW (64bit)
meson setup --cross-file scripts/windows-cross-octave.ini \ meson setup --cross-file windows/mingw-cross-octave.ini \
"${common_meson_opts[@]}" build-win-octave "${common_meson_opts[@]}" build-win-octave
meson compile -v -C build-win-octave meson compile -v -C build-win-octave
......
File moved
File moved
# Meson common cross file for targeting Windows from Linux # Meson common cross file for targeting Windows from Linux
# To be included after windows-cross-{matlab,octave}.ini # To be included after mingw-cross-{matlab,octave}.ini
[constants] [constants]
# For the architectural baseline, we follow MSYS2: # For the architectural baseline, we follow MSYS2:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment