diff --git a/README.md b/README.md index 9c3061f3b908f5249f7bf843f6ad2df4ae1448d9..fb14a555d75d6b3b7b5ec0c4199027780f6c988c 100644 --- a/README.md +++ b/README.md @@ -479,7 +479,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5. ```sh export BUILDDIR=build-matlab 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. 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`. diff --git a/macOS/build.sh b/macOS/build.sh index 18c6fbc9e6586893630c6a313c619d9158f1a9a2..ff4423b34e2a9eae8346198e621c24523abbdbb2 100755 --- a/macOS/build.sh +++ b/macOS/build.sh @@ -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 ## - 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. -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) ln -s "$BREWDIR"/opt/gcc/lib/gcc/"$GCC_VERSION"/libquadmath.a "$QUADMATH_DIR" @@ -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) 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' ]" \ - --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) arch -"$PKG_ARCH" meson setup "${common_meson_opts[@]}" -Dmatlab_path="$MATLAB_PATH" build-matlab --wipe diff --git a/macOS/deps/Makefile b/macOS/deps/Makefile index 0edf3d132fc457c1a3c9f933c8dfbf250f467867..dd89649f865e56e960d52188eaf728920174bb0e 100644 --- a/macOS/deps/Makefile +++ b/macOS/deps/Makefile @@ -22,7 +22,7 @@ DEPS_ARCH ?= x86_64 # use x86_64 by default 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 .) diff --git a/scripts/homebrew-native-arm64.ini b/macOS/homebrew-native-arm64.ini similarity index 100% rename from scripts/homebrew-native-arm64.ini rename to macOS/homebrew-native-arm64.ini diff --git a/scripts/homebrew-native-x86_64.ini b/macOS/homebrew-native-x86_64.ini similarity index 100% rename from scripts/homebrew-native-x86_64.ini rename to macOS/homebrew-native-x86_64.ini diff --git a/windows/build.sh b/windows/build.sh index 9c1c854de16cec567c5bf922dd1243df5cb357a2..7dd42ddb864f23492d616a11a63deaf78a26e2d2 100755 --- a/windows/build.sh +++ b/windows/build.sh @@ -53,15 +53,15 @@ ln -s "$ROOT_DIRECTORY"/deps/mkoctfile64 /tmp/windeps/ # Go to source root directory 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 -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 meson compile -v -C build-win-matlab # 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 meson compile -v -C build-win-octave diff --git a/scripts/windows-cross-matlab.ini b/windows/mingw-cross-matlab.ini similarity index 100% rename from scripts/windows-cross-matlab.ini rename to windows/mingw-cross-matlab.ini diff --git a/scripts/windows-cross-octave.ini b/windows/mingw-cross-octave.ini similarity index 100% rename from scripts/windows-cross-octave.ini rename to windows/mingw-cross-octave.ini diff --git a/scripts/windows-cross.ini b/windows/mingw-cross.ini similarity index 96% rename from scripts/windows-cross.ini rename to windows/mingw-cross.ini index 69b127e076419a64f981b9bcb59121b9d65b8b1d..e1989937071f4beef3a4ad2a0f12edf75272869f 100644 --- a/scripts/windows-cross.ini +++ b/windows/mingw-cross.ini @@ -1,5 +1,5 @@ # 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] # For the architectural baseline, we follow MSYS2: