Skip to content

Commit

Permalink
Removed all the shinanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Aug 14, 2024
1 parent 22567b0 commit 96bafaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/publish_matlab_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@ jobs:
include:
- os: ubuntu-latest
label: linux-64
architecture: x64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
label: osx-arm64
architecture: arm64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: macos-13
label: osx-intel
architecture: x86_64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
architecture: x64
prefix: C:\Miniconda3\envs\ezc3d
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -82,7 +78,7 @@ jobs:
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DCMAKE_APPLE_SILICON_PROCESSOR=${{ matrix.architecture }} -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/run_matlab_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ jobs:
include:
- os: ubuntu-latest
label: linux-64
architecture: x64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
label: osx-arm64
architecture: arm64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: macos-13
label: osx-intel
architecture: x86_64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
architecture: x64
prefix: C:\Miniconda3\envs\ezc3d
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -80,7 +76,7 @@ jobs:
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DCMAKE_APPLE_SILICON_PROCESSOR=${{ matrix.architecture }} -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'
Expand Down
19 changes: 3 additions & 16 deletions binding/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,48 +42,35 @@ foreach(SUFFIXES Read Write)
# Set the name of the library
if(WIN32)
if (CMAKE_CL_64)
message(STATUS "Using MATLAB for Windows 64-bits")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexw64"
)
else(CMAKE_CL_64)
message(STATUS "Using MATLAB for Windows 32-bits")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexw32"
)
endif(CMAKE_CL_64)
elseif(APPLE)
# Get the current architecture
if (CMAKE_APPLE_SILICON_PROCESSOR)
set(OSX_ARCHITECTURE ${CMAKE_APPLE_SILICON_PROCESSOR} CACHE INTERNAL "The osx architecture" FORCE)
else(CMAKE_APPLE_SILICON_PROCESSOR)
set(OSX_ARCHITECTURE ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE INTERNAL "The osx architecture" FORCE)
endif(CMAKE_APPLE_SILICON_PROCESSOR)

if (OSX_ARCHITECTURE STREQUAL "x86_64")
message(STATUS "Using MATLAB for MacOS Intel")
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexmaci64"
PREFIX ""
)
elseif(OSX_ARCHITECTURE STREQUAL "arm64")
message(STATUS "Using MATLAB for MacOS Arm")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexmaca64"
PREFIX ""
)
else()
message(FATAL_ERROR "Unknown architecture: ${OSX_ARCHITECTURE}")
message(FATAL_ERROR "Unknown architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif ()
else()
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
message(STATUS "Using MATLAB for Linux 64-bits")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexa64"
PREFIX ""
)
else(CMAKE_SIZEOF_VOID_P MATCHES "8")
message(STATUS "Using MATLAB for Linux 32-bits")
set_target_properties(${PROJECT_NAME}_${SUFFIXES} PROPERTIES
SUFFIX ".mexglx"
PREFIX ""
Expand Down

0 comments on commit 96bafaf

Please sign in to comment.