From c5f06e8315ce92262d53fa512180fc6cc26d895c Mon Sep 17 00:00:00 2001 From: Jimmy Charnley Kromann Date: Mon, 13 Jan 2025 21:38:22 +0100 Subject: [PATCH 1/4] Fixing flags --- _compile.py | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/_compile.py b/_compile.py index 62381ac3..22208251 100644 --- a/_compile.py +++ b/_compile.py @@ -60,26 +60,6 @@ def find_env() -> dict[str, str]: fc = os.environ.get("FC", DEFAULT_FC) - linker_mathlib_dirs = [ - "/usr/lib/", # Debian - "/lib/", # Alpine - "/usr/local/lib/", # FreeBSD - "/usr/lib64/", # Redhat - ] - - mathlib_path = None - - for dir in linker_mathlib_dirs: - - if not Path(dir).is_dir(): - continue - - mathlib_path = dir - break - - if mathlib_path is None: - print("Unable to find mathlib path") - # TODO Check if FC is there, not not raise Error # TODO Check if lapack / blas is there, if not raise Error # TODO Check if omp is installed @@ -115,10 +95,8 @@ def find_env() -> dict[str, str]: "-llapack", ] - if mathlib_path is not None: - linker_math += [f"-L{mathlib_path}"] - - if sys.platform == "darwin": + # MacOS X specific flags + if "darwin " in sys.platform: expected_omp_dir = Path("/opt/homebrew/opt/libomp/lib") @@ -136,6 +114,11 @@ def find_env() -> dict[str, str]: compiler_openmp = [] linker_openmp = [] + # FreeBSD specific flags + if "freebsd" in sys.platform: + # Location of BLAS / Lapack for FreeBSD 14 + linker_math += ["/usr/local/lib/"] + fflags = [] + compiler_flags + compiler_openmp ldflags = [] + linker_flags + linker_math + linker_openmp From a8efedf560b1ba29f13356d82755beb6290b6e33 Mon Sep 17 00:00:00 2001 From: Jimmy Charnley Kromann Date: Mon, 13 Jan 2025 21:39:38 +0100 Subject: [PATCH 2/4] Remove release --- .github/workflows/release.yml | 56 ----------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1165fd67..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,56 +0,0 @@ -# name: Release Version - -# # When merged into main -# # - Only when src is changed -# # - minor version bump - if new test functions are added? -# # - patch version bump - if no new tests - -# on: -# push: -# branches: -# - main - -# jobs: -# release: -# name: Creating release -# runs-on: "ubuntu-latest" -# permissions: write-all -# defaults: -# run: -# shell: bash -l {0} -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# with: -# fetch-depth: 2 - -# - name: Early exit -# env: -# GH_RUN_ID: ${{ github.run_id }} -# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# run: make gh-has-src-changed || make gh-cancel - -# - name: Setup -# run: | -# git config --global user.name 'Github Actions' -# git config --global user.email 'none@none.none' - -# - name: -# run: echo $(git log -5 --oneline) - -# - name: Bump version -# run: make bump-version-auto - -# - name: Commit version -# run: make commit-version-tag - -# - name: Push to main -# run: git push origin $(git rev-parse --abbrev-ref HEAD) --tags - -# - name: Create release -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# run: | -# export tag="$( make version )" -# echo "$tag" -# make gh-release From ea3a9ba71c9c8258608ab8f025b365f1ed67dd8c Mon Sep 17 00:00:00 2001 From: Jimmy Charnley Kromann Date: Mon, 13 Jan 2025 21:41:54 +0100 Subject: [PATCH 3/4] Add linker flags to mac --- _compile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_compile.py b/_compile.py index 22208251..bb9c1147 100644 --- a/_compile.py +++ b/_compile.py @@ -108,6 +108,7 @@ def find_env() -> dict[str, str]: f"-L{expected_omp_dir}", "-lomp", ] + linker_math += ["-L/usr/lib/"] else: print(f"Expected OpenMP dir not found: {expected_omp_dir}, compiling without OpenMP") @@ -117,7 +118,7 @@ def find_env() -> dict[str, str]: # FreeBSD specific flags if "freebsd" in sys.platform: # Location of BLAS / Lapack for FreeBSD 14 - linker_math += ["/usr/local/lib/"] + linker_math += ["-L/usr/local/lib/"] fflags = [] + compiler_flags + compiler_openmp ldflags = [] + linker_flags + linker_math + linker_openmp From 5e7964a4ef53244e2a6364b33d99d2122ca1078b Mon Sep 17 00:00:00 2001 From: Jimmy Charnley Kromann Date: Mon, 13 Jan 2025 21:45:18 +0100 Subject: [PATCH 4/4] typo in darwin check --- _compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_compile.py b/_compile.py index bb9c1147..382ed0ba 100644 --- a/_compile.py +++ b/_compile.py @@ -93,10 +93,11 @@ def find_env() -> dict[str, str]: linker_math = [ "-lblas", "-llapack", + "-L/usr/lib/", ] # MacOS X specific flags - if "darwin " in sys.platform: + if "darwin" in sys.platform: expected_omp_dir = Path("/opt/homebrew/opt/libomp/lib") @@ -108,7 +109,6 @@ def find_env() -> dict[str, str]: f"-L{expected_omp_dir}", "-lomp", ] - linker_math += ["-L/usr/lib/"] else: print(f"Expected OpenMP dir not found: {expected_omp_dir}, compiling without OpenMP")