Repository navigation
Open
Description
Trying to install the whole LOFAR software on an ubuntu 20.04 workstation.
- Create and activate a virtualenv using the system python 3.8 in
/opt/LOFAR/python:
$ python3 -m venv --prompt lofar /opt/LOFAR/python
$ source /opt/LOFAR/python/bin/activate
- Install python requirements and ipython:
$ pip install numpy wheel ipython
-
Download casacore data into
/opt/LOFAR/casa/data -
Building and install casacore:
$ curl -L https://github.com/casacore/casacore/archive/refs/tags/v3.4.0.tar.gz | tar xz
$ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/opt/LOFAR/casa/3.4.0 -DUSE_OPENMP=ON -DUSE_HDF5=ON -DBUILD_PYTHON=OFF -DBUILD_PYTHON3=ON -DUSE_THREADS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDATA_DIR=/opt/LOFAR/casa/data
$ cmake --build build -- -j24
$ cmake --install build
- Download and install dysco:
$ curl -L https://github.com/aroffringa/dysco/archive/refs/tags/v1.2.tar.gz | tar xz
$ cd dysco-1.2
$ cmake -S. -B build -DCMAKE_INSTALL_PREFIX=/opt/LOFAR/casa/3.4.0 -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ cmake --build build -- -j24
$ cmake --install build
- Install
python-casacorein--no-binary-mode:
$ export CFLAGS="--std=c++11 -L/opt/LOFAR/casa/3.4.0/lib -I/opt/LOFAR/casa/3.4.0/include"
$ export LDFLAGS="-Wl,-rpath,/opt/LOFAR/casa/3.4.0/lib"
$ pip install --no-binary python-casacore --no-cache python-casacore
I then get:
In [1]: from casacore import tables
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from casacore import tables
File /opt/LOFAR/python/lib/python3.8/site-packages/casacore/tables/__init__.py:60, in <module>
1 # __init__.py: Top level .py file for python table interface
2 # Copyright (C) 2006
3 # Associated Universities, Inc. Washington DC, USA.
(...)
25 #
26 # $Id: __init__.py,v 1.6 2006/11/06 01:54:21 gvandiep Exp $
28 """Python interface to the Casacore tables module.
29
30 A `casacore table <../../casacore/doc/html/group__Tables__module.html>`_
(...) 57
58 """
---> 60 from .msutil import *
61 from .table import table
62 from .table import default_ms
File /opt/LOFAR/python/lib/python3.8/site-packages/casacore/tables/msutil.py:29, in <module> 27 import numpy as np
28 import six
---> 29 from casacore.tables.table import (table, taql,
30 _required_ms_desc,
31 _complete_ms_desc)
32 from casacore.tables.tableutil import (makescacoldesc, makearrcoldesc,
33 makecoldesc, maketabdesc)
36 def required_ms_desc(table=None):
File /opt/LOFAR/python/lib/python3.8/site-packages/casacore/tables/table.py:40, in <module>
25 """Access to Casacore tables.
26
27 The :class:`table` class is the main class to access a table. Its constructor
(...)
36
37 """
39 from six import string_types
---> 40 from ._tables import (Table,
41 _default_ms,
42 _default_ms_subtable,
43 _required_ms_desc,
44 _complete_ms_desc)
46 from .tablehelper import (_add_prefix, _remove_prefix, _do_remove_prefix,
47 _format_row)
48 import six
ImportError: /opt/LOFAR/python/lib/python3.8/site-packages/casacore/tables/_tables.cpython-38-x86_64-linux-gnu.so: undefined symbol: register_derivedmscal
Any help would be much appreciated!
Metadata
Metadata
Assignees
Labels
No labels
Activity
StFroese commentedon Mar 18, 2022
This may be related
python-casacore/src/tables.cc
Lines 57 to 61 in f722ae9
maxnoe commentedon Mar 18, 2022
Ah, dam. There was a hint about adding
-DBUILD_SHARED_LIBSsomewhere. I guess we need to add this to the casacore cmake call.StFroese commentedon Mar 18, 2022
There's a hint to use this flag for the AOFlagger install on the LOFAR software page here
StFroese commentedon Mar 19, 2022
I rebuilt it from scratch with
-DBUILD_SHARED_LIBS=ONfor the casacore cmake but the error still remains.StFroese commentedon Mar 19, 2022
I think I figured out a fix for this.
libcasa_derivedmscal.sodoesn't show up in the_tables.cpython-38-x86_64-linux-gnu.soldcalled--as-neededon Ubuntu which results in libraries not beeing linked (take a look here)export LDFLAGS="-Wl,-rpath,/opt/LOFAR/casa/3.4.0/lib,--no-as-needed -lcasa_derivedmscal"as recommended here resolves the error. The library now shows upand the module can be imported
tammojan commentedon Mar 19, 2022
Wow that's a nasty flag. Thanks for figuring it out! So do you think we should put this flag in the setup.py of python-casacore?
maxnoe commentedon Mar 19, 2022
From troubleshooting "as-nneded":