brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 80 forks source link

Planck likelihood code 2018 #202

Closed SafaeCosmology closed 3 years ago

SafaeCosmology commented 3 years ago

Hello everyone, I have problem with installing the Planck 2018 likelihood code , when I execute ''./waf configure --install_all_deps'' the following error would appear : '''testing pyembed configuration : could not build a python embedded interpreter''' if anyone can help me solve this problem. thank you in advance.

shan1525 commented 3 years ago

Hi @SafaeCosmology , Have you installed cython? And also can you please elaborate your problem. I mean show me the whole set of errors you got so that I can understand your problem well. Then I will see if I could help .

SafaeCosmology commented 3 years ago

Thank you very much @shan1525 for your answer, the problem is solved, when I changed the version of Python 2.7 which is compatible with Planck, but when i run montepython, I get the following error: ''AttributeError: 'module' object has no attribute 'lkl' '' I don't know what the problem is, knowing that I followed all the steps indicated in #68.

dchooper commented 3 years ago

Hi, Could you provide the complete error message? What parameter file are you running, and with what command? We need this information to try to debug your issue.

Also I would not recommend downgrading to Python 2.7: this is deprecated and many modules (including numpy and scipy) no longer have support, and therefore may cause unfixable bugs and issues.

Best, Deanna

SafaeCosmology commented 3 years ago

Thank you very much @dchooper for your reply, the parameter file , that I used is the following:


data.experiments=['Planck_lowl_TT']

------ Parameter list ------

Cosmological parameters list

data.parameters['omega_b'] = [2.249, -1,-1, 0.016, 0.01,'cosmo'] data.parameters['omega_cdm'] = [0.1120, -1,-1, 0.0016,1, 'cosmo']

data.parameters['A_planck'] = [ 1.00061, 0.9, 1.1, 0.0025, 1, 'nuisance']

Derived parameter list

data.parameters['Omega_Lambda'] = [0, -1, -1, 0,1, 'derived'] data.parameters['sigma8'] = [0.8, None, None, 0, 1, 'derived']

------ Mcmc parameters ----

Number of steps taken, by default (overwritten by the -N command)

data.N=10

Number of accepted steps before writing to file the chain. Larger means less

access to disc, but this is not so much time consuming.

data.write_step=5


when I use only Pantheon data (for example) , MontePython works, but when I add 'Planck_lowl_TT data, it gives me the following error.

_**--------------------------------------------------------------------------------------

Running Monte Python v3.4.0

with CLASS v3.0.1

Testing likelihoods for: ->Planck_lowl_TT

Cannot use clik wrapper (cause = 'libcfitsio.so.9: cannot open shared object file: No such file or directory') Cannot use clik_lensing wrapper (cause = 'libcfitsio.so.9: cannot open shared object file: No such file or directory') Traceback (most recent call last): File "montepython/MontePython.py", line 40, in sys.exit(run()) File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/run.py", line 32, in run custom_command) File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/run.py", line 191, in safe_initialisation cosmo, data, command_line, success = initialise(custom_command) File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/initialise.py", line 67, in initialise data = Data(command_line, path) File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/data.py", line 356, in init self.initialise_likelihoods(self.experiments) File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/data.py", line 493, in initialise_likelihoods elem, elem, folder, elem)) File "", line 1, in File "/home/safae_cosmology/Bureau/CLASS_MP/montepython/montepython/likelihood_class.py", line 894, in init except clik.lkl.CError: AttributeError: 'module' object has no attribute 'lkl'

-------------------------------------------------------------------------------**_ thank you in advance

shan1525 commented 3 years ago

Hi @SafaeCosmology , Thanks @dchooper for elaborating my query. I think @SafaeCosmology that when you are installing the likelihood, it is searching for the library libcfitsio.so.9 which is not installed in your system. I would suggest you to install cfitsio. You can find the link for cfitsio in readme file. I think this will resolve your issue.

Best, Shan

shan1525 commented 3 years ago

Sorry I forgot to ask, have you installed the plik code itself. If you have installed it already,then don't mind the question.

SafaeCosmology commented 3 years ago

Hi @shan1525 thank you for your reply, yes I have installed the CFITSIO library available at https://heasarc.gsfc.nasa.gov/fitsio/, and also the plik code . I don't know what the problem is :/ .

dchooper commented 3 years ago

Hi, Have you tested if the plik code itself is working independently of MP? One quick way to do this is to run clik_print (make sure you have the Planck likelihood sourced first, and then you can run that in any directory). You should see something like usage : %s lkl_file If instead you get an error message, then the issue is directly with the Planck likelihoods and not with MP. Let me know how the test goes. Best, Deanna

SafaeCosmology commented 3 years ago

finally, the problem is solved thank you so much @dchooper and @shan1525, Best regards. SAFAE

dchooper commented 3 years ago

Hi Safae, Great news! If you could, it would be great if you could add a comment with what the problem and solution were, in case someone else encounters the same issue in the future. Best, Deanna

SafaeCosmology commented 3 years ago

Hi @dchooper, Yes of course, I just used the following commands: cd Planck / code / plc_3.0 / plc-3.01 ./waf config --install_all_deps --cfitsio_lib = / home / .................. / Desktop /cfitsio-3.49 / lib

Instead of [./waf configuration --install_all_deps'], lib is the directory where the libcfitsio.so.9 library is located, of course after a good installation of CFITSIO. Best regards. Safae

dchooper commented 3 years ago

Thanks for posting the solution Safae!