Skip to content
Snippets Groups Projects
Unverified Commit 6ddf9e62 authored by Simon Ward's avatar Simon Ward
Browse files

More Fortran fixes

parent 169f8af0
No related branches found
No related tags found
2 merge requests!18Feature python api build wheels,!17Feature - Python_api wheels
......@@ -24,7 +24,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
os: [macos-10.15, macos-11.0, windows-latest]
gcc_v: [ 10 ] # Version of GFortran we want to use.
exclude:
......@@ -47,22 +47,29 @@ jobs:
with:
python-version: ${{matrix.python-version}}
# - name: Set Compiler (OSX)
# run: |
# echo "FC=gfortran-${{ matrix.gcc_v }}" >> $GITHUB_ENV
# echo "CC=gcc-${{ matrix.gcc_v }}" >> $GITHUB_ENV
- name: Install cmake
run: pip3 install cmake delocate
run: pip3 install cmake
- name: Build CFML
run: pip wheel ./ --no-deps -w ./dist/
- name: Build CFML (Windows)
if: contains(matrix.os, 'windows')
env:
FC: gfortran
CC: gcc
run: pip3 wheel ./ --no-deps -w ./dist/
- name: Fix Wheel
- name: Build CFML (OSX)
if: contains(matrix.os, 'macos')
run: delocate-wheel -w fixed_wheels -v ./dist/*.whl
env:
FC: gfortran-${{ matrix.gcc_v }}
CC: gcc-${{ matrix.gcc_v }}
run: |
pip3 wheel ./ --no-deps -w ./dist/
pip3 install delocate
delocate-wheel -w fixed_wheels -v ./dist/*.whl
mv ./dist ./old
mv ./fixed_wheels ./dist
- uses: actions/upload-artifact@v2
with:
name: CrysFML - ${{ matrix.os }} - Python ${{ matrix.python-version }}
path: ./fixed_wheels/*.whl
\ No newline at end of file
path: ./dist/*.whl
\ No newline at end of file
......@@ -14,17 +14,10 @@ import shutil
BITS = struct.calcsize("P") * 8
PACKAGE_NAME = "crysfml_api"
SOURCE_DIR = '.'
def cmd_exists(cmd):
return shutil.which(cmd) is not None
COMPILER = 'gfortran'
if not cmd_exists(COMPILER):
versions = [10, 9, 8]
for version in versions:
COMPILER = f'gfortran-{version}'
if cmd_exists(COMPILER):
break
if os.environ.get('FC', False):
COMPILER = os.environ.get('FC')
print(f'Compiler set to: {COMPILER}')
# We can use cmake provided from pip which (normally) gets installed at /bin
# Except that in the manylinux builds it's placed at /opt/python/[version]/bin/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment