Skip to content

add macos-14 #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
os: [ubuntu-latest, macos-13, macos-14]
python-version: ['3.8', '3.10']
exclude:
- os: macos-13
- os: macos-14
python-version: '3.8'
- os: macos-14
python-version: '3.10'
runs-on: ${{ matrix.os }}

Expand All @@ -34,6 +36,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.os == 'macos-14' && 'ARM64' || 'x64' }}

- name: Install FFTW3 (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand All @@ -44,12 +47,6 @@ jobs:
run: |
brew install fftw
brew install libomp
OMP_INCLUDE_FILE=$(find /usr/local/Cellar/libomp -name omp.h | head -n 1)
echo "OpenMP Header: $OMP_INCLUDE_FILE"
ln -s $OMP_INCLUDE_FILE /usr/local/include/
OMP_LIBRARY=$(find /usr/local/Cellar/libomp -name libomp.dylib | head -n 1)
echo "OpenMP Library: $OMP_LIBRARY"
ln -s $OMP_LIBRARY /usr/local/lib

- name: Install dependencies
run: |
Expand Down
43 changes: 41 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,47 @@ else()
WORKING_DIRECTORY ${SPARSEIMAGING_BUILD_DIR})
endif()
if(APPLE)
execute_process(COMMAND sed -i -e "s:-fopenmp:-Xpreprocessor -fopenmp -lomp :g" ${SPARSEIMAGING_MAKEFILE}
WORKING_DIRECTORY ${SPARSEIMAGING_BUILD_DIR})
# search path to Cellar directory for Apple Silicon model
execute_process(COMMAND find /opt/homebrew/Cellar/libomp -name omp.h
COMMAND head -n 1
COMMAND xargs dirname
COMMAND tr -d "\n"
ERROR_QUIET
OUTPUT_VARIABLE OMP_INCLUDE_DIR)
message(STATUS "OpenMP include directory (Silicon): ${OMP_INCLUDE_DIR}")
execute_process(COMMAND find /opt/homebrew/Cellar/libomp -name libomp.dylib
COMMAND head -n 1
COMMAND xargs dirname
COMMAND tr -d "\n"
ERROR_QUIET
OUTPUT_VARIABLE OMP_LIBRARY_DIR)
message(STATUS "OpenMP library directory (Silicon): ${OMP_LIBRARY_DIR}")
if(OMP_INCLUDE_DIR STREQUAL "")
# if it failed, try Cellar directory for Intel model
execute_process(COMMAND find /usr/local/Cellar/libomp -name omp.h
COMMAND head -n 1
COMMAND xargs dirname
COMMAND tr -d "\n"
ERROR_QUIET
OUTPUT_VARIABLE OMP_INCLUDE_DIR)
message(STATUS "OpenMP include file (Intel): ${OMP_INCLUDE_DIR}")
execute_process(COMMAND find /usr/local/Cellar/libomp -name libomp.dylib
COMMAND head -n 1
COMMAND xargs dirname
COMMAND tr -d "\n"
ERROR_QUIET
OUTPUT_VARIABLE OMP_LIBRARY_DIR)
message(STATUS "OpenMP library directory (Silicon): ${OMP_LIBRARY_DIR}")
endif()

if(NOT OMP_INCLUDE_DIR STREQUAL "")
# add custom path
execute_process(COMMAND sed -i -e "s:-fopenmp:-Xpreprocessor -fopenmp -I${OMP_INCLUDE_DIR} -L${OMP_LIBRARY_DIR} -lomp :g" ${SPARSEIMAGING_MAKEFILE}
WORKING_DIRECTORY ${SPARSEIMAGING_BUILD_DIR})
else()
execute_process(COMMAND sed -i -e "s:-fopenmp:-Xpreprocessor -fopenmp -lomp :g" ${SPARSEIMAGING_MAKEFILE}
WORKING_DIRECTORY ${SPARSEIMAGING_BUILD_DIR})
endif()
endif()
if(EIGEN3_INCLUDE_DIR)
message(STATUS "Edit makefile for sparseimaging")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def initialize_options(self):

package = 'sakura'
target = 'libsakura'
version = 'libsakura-5.1.6'
version = 'libsakura-5.3.0'
zipname = f'{version}.zip'
base_url = 'https://github.com/tnakazato/sakura'
if IS_GIT_OK:
Expand Down