|
187 | 187 | $ cd /path/to/cosmo/
|
188 | 188 | $ git clone https://github.com/lesgourg/class_public.git CLASS --depth=1
|
189 | 189 | $ cd CLASS
|
190 |
| - $ make |
| 190 | + $ python setup.py build |
191 | 191 |
|
192 | 192 | If the **second** line produces an error (because you don't have ``git`` installed),
|
193 | 193 | download the latest snapshot from `here
|
194 | 194 | <https://github.com/lesgourg/class_public/archive/master.zip>`_, decompress it, rename the
|
195 |
| -resulting ``class_public-master`` folder to ``CLASS`` (optional) and run the ``make`` |
196 |
| -command from there. |
197 |
| -
|
198 |
| -.. note:: |
199 |
| -
|
200 |
| - If CLASS seems to compile and install correctly, but you cannot import it from Python |
201 |
| - manually, or Cobaya fails to import it, it may be that the CLASS installation script is |
202 |
| - not using the right Python version. To fix that, if your preferred Python command is |
203 |
| - e.g. ``python3``, re-do the ``make`` step as |
204 |
| -
|
205 |
| - .. code:: bash |
206 |
| -
|
207 |
| - $ PYTHON=python3 make |
| 195 | +resulting ``class_public-master`` folder to ``CLASS`` (optional) and run the |
| 196 | +``python setup.py build`` command from there. |
208 | 197 |
|
209 | 198 | If the instructions above failed, follow those in the
|
210 | 199 | `official CLASS web page <https://class-code.net/>`_.
|
@@ -329,9 +318,11 @@ def initialize(self):
|
329 | 318 | # Add general CLASS stuff
|
330 | 319 | self.extra_args["output"] = self.extra_args.get("output", "")
|
331 | 320 | if "sBBN file" in self.extra_args:
|
332 |
| - self.extra_args["sBBN file"] = self.extra_args["sBBN file"].format( |
333 |
| - classy=self.path |
334 |
| - ) |
| 321 | + sbbn_dir, sbbn_file = os.path.split(self.extra_args["sBBN file"]) |
| 322 | + if not os.path.isabs(sbbn_dir): |
| 323 | + # Discard dir, since it's standardized in the C code anyway. |
| 324 | + self.extra_args["sBBN file"] = os.path.join("/external/bbn", sbbn_file) |
| 325 | + # The "else" case (abs path) will fail in CLASS, and should be fixed. |
335 | 326 | # Normalize `non_linear` vs `non linear`: prefer underscore
|
336 | 327 | # Keep this convention throughout the rest of this module!
|
337 | 328 | if "non linear" in self.extra_args:
|
@@ -1008,7 +999,13 @@ def install(cls, path=None, code=True, no_progress_bars=False, **_kwargs):
|
1008 | 999 |
|
1009 | 1000 | env = deepcopy(os.environ)
|
1010 | 1001 | env.update({"PYTHON": sys.executable})
|
1011 |
| - process_make = Popen(["make"], cwd=classy_path, stdout=PIPE, stderr=PIPE, env=env) |
| 1002 | + process_make = Popen( |
| 1003 | + [sys.executable, "setup.py", "build"], |
| 1004 | + cwd=classy_path, |
| 1005 | + stdout=PIPE, |
| 1006 | + stderr=PIPE, |
| 1007 | + env=env, |
| 1008 | + ) |
1012 | 1009 | out, err = process_make.communicate()
|
1013 | 1010 | if process_make.returncode:
|
1014 | 1011 | log.info(out.decode("utf-8"))
|
|
0 commit comments