lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

python wrapper compilation does not work; seems to be typo? #331

Open xiggystardust opened 4 years ago

xiggystardust commented 4 years ago

I'm trying to run "make" to compile the python wrapper, as indicated in the install instructions. I'm getting an 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

This is arising in autosetup.py; the issue is that the command that starts on line 37 has no closing parentheses. I noticed this command in another part of the code and it seems like potentially an entire line of code is missing from autosetup.py, but I might be wrong.

Anyways I tried also to simply close the paren on line 40 (instead of ending with a comma) but when I try to make again, autosetup.py gets overwritten with the wrong code again.

Thaks! Sarah

xiggystardust commented 4 years ago

I tracked this down a bit further. The issue comes because I'm installing without openMP and thus triggering this command in the Makefile: grep -v "lgomp" python/setup.py > python/autosetup.py

This causes autosetup.py to be missing the final line of the relevant command, thus missing a closing parenthesis. Easy enough fix for someone to put in!

Stefan-Heimersheim commented 4 years ago

Hey, this seems to be the same issue as #318, right?

From there: Changing line 41 in setup.py from

                       extra_link_args=['-lgomp'])

to

                       extra_link_args=['-lgomp']
                       )

would fix this.

Cheers, Stefan

xiggystardust commented 4 years ago

(note, it's clunky but I changed line 41 and 42 on setup.py to read:

,extra_link_args=['-lgomp']
)

and I removed the last comma on line 40. This allowed the install to complete.

xiggystardust commented 4 years ago

Thanks stephen, I didn't notice that other posting, sorry!

Stefan-Heimersheim commented 4 years ago

No worries, thanks for reporting! Nils @schoeneberg mentioned the change should be implemented in the next version, so it should be fixed soon.

SashaBrownsberger commented 4 years ago

Hello. I just wanted to add that I encountered the same error and implemented the same (hacky) solution - moving that closing parentheses from line 41 in setup.py. The installation appears to have worked. I downloaded the most up to date version of CLASS as of June 12, 2020.

Best!