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

a minor issue in python/setup.py when OMPFLAG is not set #383

Open
komatsu5147 opened this issue Jan 15, 2021 · 1 comment
Open

a minor issue in python/setup.py when OMPFLAG is not set #383

komatsu5147 opened this issue Jan 15, 2021 · 1 comment

Comments

@komatsu5147
Copy link

komatsu5147 commented Jan 15, 2021

It would be better to change the last line in the following part python/setup.py:

# Define cython extension and fix Python version
classy_ext = Extension("classy", [os.path.join(classy_folder, "classy.pyx")],
                           include_dirs=[nm.get_include(), include_folder],
                           libraries=liblist,
                           library_dirs=[root_folder, GCCPATH],
                           extra_link_args=['-lgomp'])

to

# Define cython extension and fix Python version
classy_ext = Extension("classy", [os.path.join(classy_folder, "classy.pyx")],
                           include_dirs=[nm.get_include(), include_folder],
                           libraries=liblist,
                           library_dirs=[root_folder, GCCPATH],
                           extra_link_args=['-lgomp'],
)

The reason: When OMPFLAG is not set, Makefile removes the line containing "lgomp". This means that the above line before modification becomes an incomplete line, yielding a syntax error:

grep -v "lgomp" python/setup.py > python/autosetup.py
cd python; export CC=gcc; python autosetup.py install || python autosetup.py install --user
  File "autosetup.py", line 41
    import six
    ^
SyntaxError: invalid syntax
  File "autosetup.py", line 41
    import six
    ^
SyntaxError: invalid syntax
make: *** [classy] Error 1

The above simple fix eliminates this error. Hope this is helpful!

@komatsu5147
Copy link
Author

Just realised that this fix was already reported in the pull request #343.
So, perhaps you could merge it to reflect this easy fix.

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