onsala-space-observatory / UVMultiFit

UVMULTIFIT is a versatile library for fitting models directly to visibility data, currently implemented in CASA. These models can depend on frequency and fitting parameters in an arbitrary algebraic way.
Other
5 stars 3 forks source link

installation problem on Ubuntu Linux #4

Open Guang91 opened 2 years ago

Guang91 commented 2 years ago

Hi,

I tried to install UVMultiFit on my Ubuntu Linux. But got the error below: can't find 'Python.h' in your casa installation

Could you help me fix that? My casa is the most recent version (v6.4.0).

Thanks, Guang

molberg commented 2 years ago

Hi Guang,

This most likely means that you need to install 'libpython3-dev':

$ sudo apt update $ sudo apt install libpython3-dev

That should fix the error message you are getting.

Please note that we haven't tested UVMultiFit on casa v 6.4 yet. You are welcome to report back how it works out for you.

kind regards, Michael

On Mon, 2021-12-13 at 12:06 -0800, Guang wrote:

Hi,

I tried to install UVMultiFit on my Ubuntu Linux. But got the error below: can't find 'Python.h' in your casa installation

Could you help me fix that? My casa is the most recent version (v6.4.0).

Thanks, Guang

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Guang91 commented 2 years ago

Thanks for the reply. I have installed libpython3-dev, but still have the same error after "make install". I checked my casa directly. There is no file called "Python.h". Is this a CASA version issue?

Guang91 commented 2 years ago

okay, I just realized the Python.h is in another directory in CASA6.4. So, I have to modify the following lines in setup.py CASA_PYTHON_INCLUDE = CASA_INSTALLATION + "/include/python2.7" CASA_PYTHON_SITE_PACKAGES = CASA_INSTALLATION + "/lib/python2.7/site-packages" --> CASA_PYTHON_INCLUDE = CASA_INSTALLATION + "/lib/py/include/python3.8" CASA_PYTHON_SITE_PACKAGES = CASA_INSTALLATION + "/lib/py/lib/python3.8/site-packages"

But now, I have new issues: _uvmultimodel.cpp:177:19: error: 'Py_InitModule3' was not declared in this scope 177 | PyObject *m = Py_InitModule3("_uvmultimodel", module_methods, module_docstring); I realized it was a compiler issue after some googling (https://stackoverflow.com/questions/50323877/python3-mlpy-installation-error-py-initmodule3-was-not-declared-in-this-scop)

So, I use old versions of gcc & g++. But this leads to another issue: gcc-5: error: unrecognized command line option ‘-fno-plt’ Again, google says I should use a new gcc & g++ (https://stackoverflow.com/questions/46504700/gcc-compiler-not-recognizing-fno-plt-option)

I can't find a version that deals with both issues. Which gcc version are you using to compile?

-Guang

molberg commented 2 years ago

Hi Guang,

I'll try to build it myself for casa 6.4 during the next couple of days.

In the meantime, assuming you got the code via our repository on github, are you sure you downloaded the casa 6 branch of UVMultiFit? That one should not have had a reference to python2.7.

cheers, Michael

On Tue, 2021-12-14 at 11:25 -0800, Guang wrote:

okay, I just realized the Python.h is in another directory in CASA6.4. So, I have to modify the following lines in setup.py CASA_PYTHON_INCLUDE = CASA_INSTALLATION + "/include/python2.7" CASA_PYTHON_SITE_PACKAGES = CASA_INSTALLATION + "/lib/python2.7/site-packages" --> CASA_PYTHON_INCLUDE = CASA_INSTALLATION + "/lib/py/include/python3.8" CASA_PYTHON_SITE_PACKAGES = CASA_INSTALLATION + "/lib/py/lib/python3.8/site-packages"

But now, I have new issues: _uvmultimodel.cpp:177:19: error: 'Py_InitModule3' was not declared in this scope 177 | PyObject *m = Py_InitModule3("_uvmultimodel", module_methods, module_docstring); I realized it was a compiler issue after some googling ( https://stackoverflow.com/questions/50323877/python3-mlpy-installation-error-py-initmodule3-was-not-declared-in-this-scop ) So, I use old versions of gcc & g++. But this leads to another issue: gcc-5: error: unrecognized command line option ‘-fno-plt’

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Guang91 commented 2 years ago

Oops, I didn't realize there's a casa6 branch. Using the casa6 branch, I got many "does not name a type" errors, like

/home/guang/anaconda3/x86_64-conda-linux-gnu/sysroot/usr/include/stdlib.h:96:1: error: 'BEGIN_NAMESPACE_STD' does not name a type 96 | BEGIN_NAMESPACE_STD

Best, Guang

Guang91 commented 2 years ago

@molberg just a reminder :smiley: