Skip to content
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

Compile on debian 11 with python 3.9 and gcc10 #37

Open
marcelobianchi opened this issue Nov 1, 2021 · 0 comments
Open

Compile on debian 11 with python 3.9 and gcc10 #37

marcelobianchi opened this issue Nov 1, 2021 · 0 comments

Comments

@marcelobianchi
Copy link

I was not able to compile it on a Debian 11 with plain python 3.9 and gcc10. The first issue is a type mismatch on GCC and the second issue is the order to compile the Fortran files. The spectra.f90 should be the first one to be compiled but distutils does not respect that.

Solutions:

  1. Add the option -fallow-argument-mismatch" to the compile flag.
  2. Create a secondary fake library to force distutil to compile spectra.f90 first (this is hackish) but point me to the solution.

What I did to get it installed and compiled in a pretty hackish manner, don't recommend to anyone, but pointing to what should be properly done on distutils:

stavanger:~/mtspec$ git diff
diff --git a/setup.py b/setup.py
index b7ac047..d6ddbd3 100644
--- a/setup.py
+++ b/setup.py
@@ -141,10 +141,20 @@ if arch_flag:
 else:
     extra_link_args = None
 
+liba = MyExtension('mtspeca',
+                  libraries=["gfortran"],
+                  library_dirs=get_libgfortran_dir(),
+                  extra_link_args=extra_link_args,
+                  extra_compile_args = ["-fallow-argument-mismatch"],
+                  sources=[
+                      src + 'spectra.f90'])
+
+
 lib = MyExtension('mtspec',
                   libraries=["gfortran"],
                   library_dirs=get_libgfortran_dir(),
                   extra_link_args=extra_link_args,
+                  extra_compile_args = ["-fallow-argument-mismatch"],
                   sources=[
                       src + 'spectra.f90', src + 'adaptspec.f90',
                       src + 'atanh2.f90',
@@ -187,7 +197,7 @@ setup_config = dict(
         'tests': ['flake8>=3']
     },
     ext_package='mtspec.lib',
-    ext_modules=[lib],
+    ext_modules=[liba, lib],
     classifiers=[
         'Development Status :: 4 - Beta',
         'Environment :: Console',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant