Skip to content

Commit

Permalink
fix f2c cython
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Jun 8, 2021
1 parent 8e6cb3d commit 74f0e09
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ jobs:

- name: Replace Makefile.am
if: matrix.name == 'ubuntu-f2c' || matrix.name == 'windows-f2c'
run: rm Makefile.am && mv Makefile_f2c.am Makefile.am
run: |
rm Makefile.am
mv Makefile_f2c.am Makefile.am
rm cython/setup.py
mv cython/setup-f2c.py cython/setup.py
- name: Replace Makefile.am
if: matrix.name == 'macos-f2c'
Expand Down
26 changes: 26 additions & 0 deletions cython/setup-f2c.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from setuptools import setup
from distutils.extension import Extension
from os.path import dirname, join, realpath

import numpy as np
from Cython.Build import cythonize

lib_path = realpath(join(dirname(__file__), "lib"))
file_path = realpath(join(dirname(__file__), "smelib.pyx"))

print("lib_path: " + lib_path)
print("file_path: " + file_path)

examples_extension = Extension(
name="smelib",
sources=[file_path],
libraries=["gfortran", "f2c", "sme"],
library_dirs=[lib_path],
runtime_library_dirs=[lib_path],
include_dirs=[np.get_include()],
)
setup(
name="smelib",
ext_modules=cythonize([examples_extension], language_level=3),
include_package_data=True,
)

0 comments on commit 74f0e09

Please sign in to comment.