-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't compile casatables_impl on arm64: narrowing conversion from 'int' to 'char' #345
Comments
unfortunately when I try running update.sh I get a few missing files, so things have obviously moved around a little bit between 3.1.1 and 3.5.0 casacore/casacore@v3.1.1...v3.5.0
Some notes from looking through the changes: casa/Arrays/ArrayIO → casa/IO/ArrayIO
|
We are probably due for an update of the casacore source. Do you think you might be able to wrangle the updates to |
Thanks Peter, |
OK, I'll try to take a look at it, and also think about how to make things more maintainable. Feel free to ping me about this since it's the kind of thing that might slip off my todo list. |
Hey Peter, This time I tried one minor release at a time, starting with upgrading from v3.1.1 to v3.2.1 (at least, I think vendor-casacore is v3.1.1 based on casatables_impl: update to casacore 3.1.1 ) The plan:
This should be simple, because there are only 2 commits that affect files under
but for some reason, I get many many conflicts when I do my rebase. You don't need to read all thisBecause I'm doing this on ubuntu22.04, I can't cmake casacore 3.2.0, so I did it in a docker image: # casacore-ubuntu18-gcc.Dockerfile
FROM ubuntu:18.04
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y \
gcc \
g++ \
cmake \
flex \
bison \
libblas-dev \
liblapack-dev \
libcfitsio-dev \
wcslib-dev \
libfftw3-dev \
gfortran \
libncurses5-dev \
libreadline6-dev \
libhdf5-serial-dev \
libboost-dev \
libboost-python-dev \
libboost-test-dev \
libgsl-dev \
python-numpy \
python3-numpy \
wget \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# Install WSRT Measures (extra casacore data, for tests)
# Note: The file on the ftp site is updated daily. When warnings regarding leap
# seconds appear, ignore them or regenerate the docker image.
&& wget -nv -O /WSRT_Measures.ztar ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar \
&& mkdir -p /usr/local/share/casacore/data \
&& cd /usr/local/share/casacore/data \
&& tar xfz /WSRT_Measures.ztar \
&& rm /WSRT_Measures.ztar cd ~/src/casacore
mkdir build
git checkout v3.2.1
docker build -f casacore-ubuntu18-gcc.Dockerfile -t d3vnull0/casacore-builder-ubuntu18-gcc .
docker run -it -v ${PWD}:${PWD} -w ${PWD} d3vnull0/casacore-builder-ubuntu18-gcc /bin/bash -c "cd build; cmake .."
cd ~/src/rubbl
git checkout vendor-casacore
casatables_impl/update.sh ~/src/casacore/build
# cp: cannot stat '/home/dev/src/casacore/casacore/casa/version.h': No such file or directory
rm casatables_impl/casacore/casa/version.h
git stage casatables_impl
git commit -m 'casatables_impl: update to casacore 3.2.1'
git checkout master
git rebase vendor-casacore When I do this, I get a conflict with this commit: casatables_impl/casacore/casa/System/Aipsrc.cc: attempt to defuse config-file reading I resolve this by making both Then I continue the rebase, but each commit runs into a new conflict: casatables_impl: fix warnings encountered with GCC 7.2 - I accept the incoming changes then I keep going for a few more conflicts until I get to this one, and I just don't understand how git thinks this is a conflict , and how to deal with it. |
I've made another attempt. The plan:
tl;drFor the update to casacore 3.2.1 and 3.3.0, simply reverting the files back to their state in master worked, since they have not received any additional changes. These are ready to go, although I can't see a lot in these changes that would be particularly valuable, except maybe ADIOS2 support. 3.4.0 adds a lot of important modernizations, but it's also where things get messy. I've written some notes in the hope that this might help. The problem I'm stuck on are these cyclic dependencies. Basically IPosition.h and Slice.h reference Vector.h, but don't include it, and Vector.h includes Array.h, which includes IPosition.h. I don't know how this mess even compiles in the first place. For Arm support we need 3.5.0 Lots of boring detailschanges between vendor-casacore and master casacore-3.2.1
get casacore source export CASACORE_VER=3.2.1
cd ~/src/casacore
sudo rm -rf build CMakeFiles CMakeCache.txt
git checkout v${CASACORE_VER}
docker build -f casacore-ubuntu18-gcc.Dockerfile -t d3vnull0/casacore-builder-ubuntu18-gcc .
mkdir build
docker run -it -v ${PWD}:${PWD} -w ${PWD}/build d3vnull0/casacore-builder-ubuntu18-gcc /bin/bash -c "cmake .."
cd ~/src/rubbl
git checkout master # sync'd my fork
git checkout -b casacore-${CASACORE_VER}
# patch update.sh to not care about the branch
sed -i 's/\[ "\$cur_branch" != vendor-casacore \]/false/g' casatables_impl/update.sh
casatables_impl/update.sh ../casacore/build changes needed to get the tests passing: # static_cast<void *> https://github.com/pkgw/rubbl/commit/bed1cea67ccc96564c0a1467c8b7d5a7f0644a5f
git checkout master -- casatables_impl/casacore/casa/Arrays/Array2Math.cc
# (char) -> static_cast<char>
git checkout master -- casatables_impl/casacore/casa/System/ObjectID2.cc
# buffer sizes https://github.com/pkgw/rubbl/commit/1bf45d29873accbde16db75cb5c8f6a66b9a9577
git checkout master -- casatables_impl/casacore/tables/Tables/ReadAsciiTable.cc
git checkout master -- casatables_impl/casacore/casa/Containers/RecordDescRep.cc
# impl =
git checkout master -- casatables_impl/casacore/casa/Quanta/MV*.h
# rubbl customization: never actually use any config files
git checkout master -- casatables_impl/casacore/casa/System/Aipsrc.cc
# remove TAQL references https://github.com/pkgw/rubbl/commit/79fe0b245d0537b4fdf837ef6cebd13be8661abe
git checkout master -- casatables_impl/casacore/tables/DataMan.h
git checkout master -- casatables_impl/casacore/tables/DataMan/{MSMIndColumn,DataManager}.cc
git checkout master -- casatables_impl/casacore/tables/Tables/{BaseTable,Table}.cc
git checkout master -- casatables_impl/casacore/tables/Tables/Table.cc
git checkout master -- casatables_impl/casacore/tables/Tables.h
# add fallthrough warnings
git checkout master -- casatables_impl/casacore/casa/{IO/RegularFileIO.cc,Utilities/cregex.cc,Utilities/Regex.cc,Utilities/ValType.cc} tests pass! here's the diff between master and my 3.2.1 changes: d3v-null@a08dd11 casacore-3.3.0
export CASACORE_VER=3.3.0
cd ~/src/casacore
sudo rm -rf build CMakeFiles CMakeCache.txt
git checkout v${CASACORE_VER}
mkdir build
docker run -it -v ${PWD}:${PWD} -w ${PWD}/build d3vnull0/casacore-builder-ubuntu18-gcc /bin/bash -c "cmake .."
cd ~/src/rubbl
git checkout -b casacore-${CASACORE_VER}
casatables_impl/update.sh ../casacore/build # static_cast<void *> https://github.com/pkgw/rubbl/commit/bed1cea67ccc96564c0a1467c8b7d5a7f0644a5f
git checkout master -- casatables_impl/casacore/casa/Arrays/Array2Math.cc
# (char) -> static_cast<char>
git checkout master -- casatables_impl/casacore/casa/System/ObjectID2.cc
# buffer sizes https://github.com/pkgw/rubbl/commit/1bf45d29873accbde16db75cb5c8f6a66b9a9577
git checkout master -- casatables_impl/casacore/tables/Tables/ReadAsciiTable.cc
git checkout master -- casatables_impl/casacore/casa/Containers/RecordDescRep.cc
# impl =
git checkout master -- casatables_impl/casacore/casa/Quanta/MV*.h
# rubbl customization: never actually use any config files
git checkout master -- casatables_impl/casacore/casa/System/Aipsrc.cc
# remove TAQL references https://github.com/pkgw/rubbl/commit/79fe0b245d0537b4fdf837ef6cebd13be8661abe
git checkout master -- casatables_impl/casacore/tables/DataMan.h
git checkout master -- casatables_impl/casacore/tables/DataMan/{MSMIndColumn,DataManager}.cc
git checkout master -- casatables_impl/casacore/tables/Tables/{BaseTable,Table}.cc
git checkout master -- casatables_impl/casacore/tables/Tables/Table.cc
git checkout master -- casatables_impl/casacore/tables/Tables.h tests pass again! diff from 3.2.1 to 3.3.0: d3v-null@0e130fd casacore-3.4.0
export CASACORE_VER=3.4.0
cd ~/src/casacore
sudo rm -rf build CMakeFiles CMakeCache.txt
git checkout v${CASACORE_VER}
mkdir build
docker run -it -v ${PWD}:${PWD} -w ${PWD}/build d3vnull0/casacore-builder-ubuntu18-gcc /bin/bash -c "cmake .."
cd ~/src/rubbl
git checkout -b casacore-${CASACORE_VER}
casatables_impl/update.sh ../casacore/build now we get more missing files: cp: cannot stat '/home/dev/src/casacore/casacore/casa/Arrays/ArrayIO.h': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/Arrays/ArrayIO.tcc': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/Arrays/IPosition2.cc': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/Arrays/LogiArrayFwd.h': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/BasicSL/RegexBase.cc': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/BasicSL/RegexBase.h': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/Utilities/cregex.cc': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/Utilities/cregex.h': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/casa/version.h': No such file or directory
cp: cannot stat '/home/dev/src/casacore/casacore/tables/Tables/ArrColData.tcc': No such file or directory so we move the files to the new locations, stage them in git (so # move casa/Arrays/ArrayIO → casa/IO/ArrayIO
mv casatables_impl/casacore/casa/Arrays/ArrayIO.{h,tcc} casatables_impl/casacore/casa/IO/
sed -i 's/Arrays\/ArrayIO/IO\/ArrayIO/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/IO/ArrayIO.{h,tcc}
# move casa/Arrays/IPosition2 → casa/IO/IPositionIO
mv casatables_impl/casacore/casa/Arrays/IPosition2.cc casatables_impl/casacore/casa/IO/IPositionIO.cc
sed -i 's/Arrays\/IPosition2/IO\/IPositionIO/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/IO/IPositionIO.cc
# move casa/Arrays/LogiArrayFwd → casa/Arrays/ArrayFwd
mv casatables_impl/casacore/casa/Arrays/LogiArrayFwd.h casatables_impl/casacore/casa/Arrays/ArrayFwd.h
sed -i 's/Arrays\/LogiArrayFwd/Arrays\/ArrayFwd/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ArrayFwd.h
# remove casa/BasicSL/RegexBase, casa/Utilities/cregex
rm casatables_impl/casacore/casa/BasicSL/RegexBase.{cc,h}
git stage casatables_impl/casacore/casa/BasicSL/RegexBase.{cc,h}
sed -i '/RegexBase/d' casatables_impl/build.rs
rm casatables_impl/casacore/casa/Utilities/cregex.{cc,h}
git stage casatables_impl/casacore/casa/Utilities/cregex.{cc,h}
sed -i '/cregex/d' casatables_impl/build.rs
# move tables/Tables/ArrColData.tcc → tables/Tables/ArrColData.cc
mv casatables_impl/casacore/tables/Tables/ArrColData.tcc casatables_impl/casacore/tables/Tables/ArrColData.cc
sed -i 's/ArrColData.tcc/ArrColData.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColData.cc
# add casa/Arrays/Storage
touch casatables_impl/casacore/casa/Arrays/Storage.h
sed -i 's/casacore\/casa\/Arrays\/Slicer.h/casacore\/casa\/Arrays\/Slicer.h",\n "casacore\/casa\/Arrays\/Storage.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/Storage.h
# add casa/Arrays/ArrayStr
touch casatables_impl/casacore/casa/Arrays/ArrayStr.h
sed -i 's/casacore\/casa\/Arrays\/ArrayPosIter.h/casacore\/casa\/Arrays\/ArrayPosIter.h",\n "casacore\/casa\/Arrays\/ArrayStr.h/' casatables_impl/build.rs
touch casatables_impl/casacore/casa/Arrays/ArrayStr.tcc
sed -i 's/casacore\/casa\/Arrays\/ArrayPosIter.h/casacore\/casa\/Arrays\/ArrayPosIter.h",\n "casacore\/casa\/Arrays\/ArrayStr.tcc/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ArrayStr.{h,tcc}
# add casa/Arrays/Memory
touch casatables_impl/casacore/casa/Arrays/Memory.h
sed -i 's/casacore\/casa\/Arrays\/Matrix.tcc/casacore\/casa\/Arrays\/Matrix.tcc",\n "casacore\/casa\/Arrays\/Memory.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/Memory.h
# add casa/Arrays/ElementFunctions.h
touch casatables_impl/casacore/casa/Arrays/ElementFunctions.h
sed -i 's/casacore\/casa\/Arrays\/Cube.tcc/casacore\/casa\/Arrays\/Cube.tcc",\n "casacore\/casa\/Arrays\/ElementFunctions.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ElementFunctions.h
# add tables/Tables/ArrayColumnBase.cc
touch casatables_impl/casacore/tables/Tables/ArrayColumnBase.cc
sed -i 's/casacore\/tables\/Tables\/ArrColDesc_tmpl.cc/casacore\/tables\/Tables\/ArrColDesc_tmpl.cc",\n "casacore\/tables\/Tables\/ArrayColumnBase.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrayColumnBase.cc
# add tables/Tables/ArrColData.cc
touch casatables_impl/casacore/tables/Tables/ArrColData.cc
sed -i 's/casacore\/tables\/Tables\/ArrayColumnBase.cc/casacore\/tables\/Tables\/ArrayColumnBase.cc",\n "casacore\/tables\/Tables\/ArrColData.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColData.cc
# add tables/Tables/ArrColDesc.cc
touch casatables_impl/casacore/tables/Tables/ArrColDesc.cc
sed -i 's/casacore\/tables\/Tables\/ArrayColumnBase.cc/casacore\/tables\/Tables\/ArrayColumnBase.cc",\n "casacore\/tables\/Tables\/ArrColDesc.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColDesc.cc
# add tables/Tables/RowNumbers.cc
touch casatables_impl/casacore/tables/Tables/RowNumbers.cc
sed -i 's/casacore\/tables\/Tables\/RowCopier.cc/casacore\/tables\/Tables\/RowCopier.cc",\n "casacore\/tables\/Tables\/RowNumbers.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/RowNumbers.cc
# add tables/DataMan/DataManagerColumn.cc
touch casatables_impl/casacore/tables/DataMan/DataManagerColumn.cc
sed -i 's/casacore\/tables\/DataMan\/DataManager.cc/casacore\/tables\/DataMan\/DataManager.cc",\n "casacore\/tables\/DataMan\/DataManagerColumn.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/DataManagerColumn.cc
# add tables/DataMan/StManColumnBase.cc
touch casatables_impl/casacore/tables/DataMan/StManColumnBase.cc
sed -i 's/casacore\/tables\/DataMan\/StManColumn.cc/casacore\/tables\/DataMan\/StManColumn.cc",\n "casacore\/tables\/DataMan\/StManColumnBase.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/StManColumnBase.cc
# add tables/DataMan/VirtArrCol.cc
touch casatables_impl/casacore/tables/DataMan/VirtArrCol.cc
sed -i 's/casacore\/tables\/DataMan\/VirtColEng.cc/casacore\/tables\/DataMan\/VirtColEng.cc",\n "casacore\/tables\/DataMan\/VirtArrCol.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VirtArrCol.cc
# add tables/DataMan/VirtScaCol.cc
touch casatables_impl/casacore/tables/DataMan/VirtScaCol.cc
sed -i 's/casacore\/tables\/DataMan\/VirtColEng.cc/casacore\/tables\/DataMan\/VirtColEng.cc",\n "casacore\/tables\/DataMan\/VirtScaCol.cc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VirtScaCol.cc
# delete tables/Tables/ArrColData.tcc
git rm casatables_impl/casacore/tables/Tables/ArrColData.tcc
# add tables/Tables/ArrayColumnBase.h
touch casatables_impl/casacore/tables/Tables/ArrayColumnBase.h
sed -i 's/casacore\/tables\/Tables\/ArrayColumn.h/casacore\/tables\/Tables\/ArrayColumn.h",\n "casacore\/tables\/Tables\/ArrayColumnBase.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrayColumnBase.h
# add tables/Tables/RowNumbers.h
touch casatables_impl/casacore/tables/Tables/RowNumbers.h
sed -i 's/casacore\/tables\/Tables\/RowCopier.h/casacore\/tables\/Tables\/RowCopier.h",\n "casacore\/tables\/Tables\/RowNumbers.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/RowNumbers.h
# add tables/DataMan/DataManagerColumn.h
touch casatables_impl/casacore/tables/DataMan/DataManagerColumn.h
sed -i 's/casacore\/tables\/DataMan\/DataManager.h/casacore\/tables\/DataMan\/DataManager.h",\n "casacore\/tables\/DataMan\/DataManagerColumn.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/DataManagerColumn.h
# add tables/DataMan/StManColumnBase.h
touch casatables_impl/casacore/tables/DataMan/StManColumnBase.h
sed -i 's/casacore\/tables\/DataMan\/StManColumn.h/casacore\/tables\/DataMan\/StManColumn.h",\n "casacore\/tables\/DataMan\/StManColumnBase.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/StManColumnBase.h
# add tables/DataMan/VACEngine.h
touch casatables_impl/casacore/tables/DataMan/VACEngine.h
sed -i 's/casacore\/tables\/DataMan\/VSCEngine.tcc/casacore\/tables\/DataMan\/VSCEngine.tcc",\n "casacore\/tables\/DataMan\/VACEngine.h/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VACEngine.h
# add tables/DataMan/VACEngine.tcc
touch casatables_impl/casacore/tables/DataMan/VACEngine.tcc
sed -i 's/casacore\/tables\/DataMan\/VSCEngine.tcc/casacore\/tables\/DataMan\/VSCEngine.tcc",\n "casacore\/tables\/DataMan\/VACEngine.tcc/' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VACEngine.tcc pull the source from casacore again casatables_impl/update.sh ../casacore/build apply changes again these changes are no longer necessary?
these changes were manually applied:
safe to checkout from master: git checkout master -- casatables_impl/casacore/casa/Containers/RecordDescRep.cc and now, it takes several minutes just to print all the compiler errors, because of these cyclic dependencies flowchart TB
classDef highlight fill:#f0f;
casa/Arrays.h --"includes"--> casa/Arrays/IPosition.h
casa/Arrays.h --"includes"--> casa/Arrays/Slicer.h
casa/Arrays.h --"includes"--> casa/Arrays/Slice.h
casa/Arrays.h --"includes"--> casa/Arrays/Array.h
casa/Arrays.h --"includes"--> casa/Arrays/Vector.h
class casa/Arrays/Vector.h highlight
casa/Arrays/Vector.h --"includes"--> casa/Arrays/Array.h
casa/Arrays/Array.h --"includes"--> casa/Arrays/ArrayBase.h
casa/Arrays/Array.h --"includes"--> casa/Arrays/ArrayError.h
casa/Arrays/Array.h --"includes"--> casa/Arrays/IPosition.h
casa/Arrays/ArrayBase.h --"includes"--> casa/Arrays/IPosition.h
casa/Arrays/ArrayError.h --"includes"--> casa/Arrays/IPosition.h
casa/Arrays/Slicer.h --"includes"--> casa/Arrays/IPosition.h
%% however
casa/Arrays/Slice.h -."should include".-> casa/Arrays/Vector.h
casa/Arrays/IPosition.h -."should include".-> casa/Arrays/Vector.h
%% casa/Arrays/IPosition.h --"includes"--> casa/Arrays/ArrayFwd.h
%% casa/Arrays.h --"includes"--> casa/Arrays/Matrix.h
%% casa/Arrays.h --"includes"--> casa/Arrays/Cube.h
%% casa/Arrays.h --"includes"--> casa/Arrays/ArrayIter.h
%% casa/Arrays.h --"includes"--> casa/Arrays/MatrixIter.h
%% casa/Arrays.h --"includes"--> casa/Arrays/VectorIter.h
%% casa/Arrays/ArrayPosIter.h --"includes"--> casa/Arrays/IPosition.h
%% casa/Arrays/ArrayMapping.h --"includes"--> casa/Arrays/IPosition.h
%% casa/Arrays/ArraySpecifier.h --"includes"--> casa/Arrays/IPosition.h
%% casa/Arrays/Array.h --"includes"--> casa/Arrays/Storage.h
casacore-3.5.0 |
finally got 3.5.0 tests passing! diff (from 3.3.0) here: d3v-null@db7a405 these are the only remaining compiler warnings: Blocking waiting for file lock on build directory
Compiling rubbl_casatables_impl v0.0.0-dev.0 (/home/dev/src/rubbl/casatables_impl)
warning: rubbl_casatables_impl@0.0.0-dev.0: casacore/casa/OS/Memory.cc: In static member function ‘static size_t rubbl_casacore::Memory::allocatedMemoryInBytes()’:
warning: rubbl_casatables_impl@0.0.0-dev.0: casacore/casa/OS/Memory.cc:75:32: warning: ‘mallinfo mallinfo()’ is deprecated [-Wdeprecated-declarations]
warning: rubbl_casatables_impl@0.0.0-dev.0: 75 | struct mallinfo m = mallinfo();
warning: rubbl_casatables_impl@0.0.0-dev.0: | ~~~~~~~~^~
warning: rubbl_casatables_impl@0.0.0-dev.0: In file included from ./casacore/casa/OS/malloc.h:52,
warning: rubbl_casatables_impl@0.0.0-dev.0: from casacore/casa/OS/Memory.cc:37:
warning: rubbl_casatables_impl@0.0.0-dev.0: /usr/include/malloc.h:114:24: note: declared here
warning: rubbl_casatables_impl@0.0.0-dev.0: 114 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
warning: rubbl_casatables_impl@0.0.0-dev.0: | ^~~~~~~~
warning: rubbl_casatables_impl@0.0.0-dev.0: casacore/casa/OS/Memory.cc: In static member function ‘static size_t rubbl_casacore::Memory::assignedMemoryInBytes()’:
warning: rubbl_casatables_impl@0.0.0-dev.0: casacore/casa/OS/Memory.cc:92:33: warning: ‘mallinfo mallinfo()’ is deprecated [-Wdeprecated-declarations]
warning: rubbl_casatables_impl@0.0.0-dev.0: 92 | struct mallinfo m = mallinfo();
warning: rubbl_casatables_impl@0.0.0-dev.0: | ~~~~~~~~^~
warning: rubbl_casatables_impl@0.0.0-dev.0: In file included from ./casacore/casa/OS/malloc.h:52,
warning: rubbl_casatables_impl@0.0.0-dev.0: from casacore/casa/OS/Memory.cc:37:
warning: rubbl_casatables_impl@0.0.0-dev.0: /usr/include/malloc.h:114:24: note: declared here
warning: rubbl_casatables_impl@0.0.0-dev.0: 114 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
warning: rubbl_casatables_impl@0.0.0-dev.0: | ^~~~~~~~
Compiling rubbl_casatables v0.0.0-dev.0 (/home/dev/src/rubbl/casatables)
warning: use of deprecated associated function `ndarray::impl_constructors::<impl ndarray::ArrayBase<S, D>>::uninitialized`: This method is hard to use correctly. Use `uninit` instead.
--> casatables/src/lib.rs:363:27
|
363 | Ok(unsafe { Self::uninitialized(D::from_shape_slice(shape)?) })
| ^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: dereferencing a null pointer
--> casatables/src/glue.rs:110:19
|
110 | unsafe { &(*(::std::ptr::null::<StringBridge>())).data as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
|
= note: `#[warn(deref_nullptr)]` on by default
warning: dereferencing a null pointer
--> casatables/src/glue.rs:120:19
|
120 | unsafe { &(*(::std::ptr::null::<StringBridge>())).n_bytes as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^ this code causes undefined behavior when executed
warning: dereferencing a null pointer
--> casatables/src/glue.rs:148:19
|
148 | unsafe { &(*(::std::ptr::null::<ExcInfo>())).message as *const _ as usize },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed steps to go from v3.3.0 to 3.5.0these are the steps I applied from the v3.3.0 branch I mentioned in the last comment ( i gave up on 3.4.0. I probably just made a simple mistake and got lucky this time around). # 3.3.0 -> 3.4.0
# move casa/Arrays/ArrayIO → casa/IO/ArrayIO
mv casatables_impl/casacore/casa/Arrays/ArrayIO.{h,tcc} casatables_impl/casacore/casa/IO/
sed -i 's!Arrays/ArrayIO!IO/ArrayIO!' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/IO/ArrayIO.{h,tcc}
# move casa/Arrays/IPosition2 → casa/IO/IPositionIO
mv casatables_impl/casacore/casa/Arrays/IPosition2.cc casatables_impl/casacore/casa/IO/IPositionIO.cc
sed -i 's!Arrays/IPosition2!IO/IPositionIO!' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/IO/IPositionIO.cc
# move casa/Arrays/LogiArrayFwd → casa/Arrays/ArrayFwd
mv casatables_impl/casacore/casa/Arrays/LogiArrayFwd.h casatables_impl/casacore/casa/Arrays/ArrayFwd.h
sed -i 's!Arrays/LogiArrayFwd!Arrays/ArrayFwd!' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ArrayFwd.h
# remove casa/BasicSL/RegexBase, casa/Utilities/cregex
rm casatables_impl/casacore/casa/BasicSL/RegexBase.{cc,h}
git stage casatables_impl/casacore/casa/BasicSL/RegexBase.{cc,h}
sed -i '/RegexBase/d' casatables_impl/build.rs
rm casatables_impl/casacore/casa/Utilities/cregex.{cc,h}
git stage casatables_impl/casacore/casa/Utilities/cregex.{cc,h}
sed -i '/cregex/d' casatables_impl/build.rs
# move tables/Tables/ArrColData.tcc → tables/Tables/ArrColData.cc
mv casatables_impl/casacore/tables/Tables/ArrColData.tcc casatables_impl/casacore/tables/Tables/ArrColData.cc
sed -i 's!ArrColData.tcc!ArrColData.cc!' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColData.cc
# add casa/Arrays/Storage
touch casatables_impl/casacore/casa/Arrays/Storage.h
sed -i '/casacore\/casa\/Arrays\/Slicer.h/a \ "casacore\/casa\/Arrays\/Storage.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/Storage.h
# add casa/Arrays/ArrayStr
touch casatables_impl/casacore/casa/Arrays/ArrayStr.{h,tcc}
sed -i '/casacore\/casa\/Arrays\/ArrayPosIter.h/a \ "casacore/casa/Arrays/ArrayStr.h",' casatables_impl/build.rs
sed -i '/casacore\/casa\/Arrays\/ArrayPosIter.h/a \ "casacore/casa/Arrays/ArrayStr.tcc",' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ArrayStr.{h,tcc}
# add casa/Arrays/Memory
touch casatables_impl/casacore/casa/Arrays/Memory.h
sed -i '/casacore\/casa\/Arrays\/Matrix.tcc/a \ "casacore/casa/Arrays/Memory.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/Memory.h
# add casa/Arrays/ElementFunctions.h
touch casatables_impl/casacore/casa/Arrays/ElementFunctions.h
sed -i '/casacore\/casa\/Arrays\/Cube.tcc/a \ "casacore/casa/Arrays/ElementFunctions.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/casa/Arrays/ElementFunctions.h
# add tables/Tables/ArrayColumnBase.cc
touch casatables_impl/casacore/tables/Tables/ArrayColumnBase.cc
sed -i '/casacore\/tables\/Tables\/ArrColDesc_tmpl.cc/a \ "casacore/tables/Tables/ArrayColumnBase.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrayColumnBase.cc
# add tables/Tables/ArrColData.cc
touch casatables_impl/casacore/tables/Tables/ArrColData.cc
sed -i '/casacore\/tables\/Tables\/ArrayColumnBase.cc/a \ "casacore/tables/Tables/ArrColData.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColData.cc
# add tables/Tables/ArrColDesc.cc
touch casatables_impl/casacore/tables/Tables/ArrColDesc.cc
sed -i '/casacore\/tables\/Tables\/ArrayColumnBase.cc/a \ "casacore/tables/Tables/ArrColDesc.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrColDesc.cc
# add tables/Tables/RowNumbers.cc
touch casatables_impl/casacore/tables/Tables/RowNumbers.cc
sed -i '/casacore\/tables\/Tables\/RowCopier.cc/a \ "casacore/tables/Tables/RowNumbers.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/RowNumbers.cc
# add tables/DataMan/DataManagerColumn.cc
touch casatables_impl/casacore/tables/DataMan/DataManagerColumn.cc
sed -i '/casacore\/tables\/DataMan\/DataManager.cc/a \ "casacore/tables/DataMan/DataManagerColumn.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/DataManagerColumn.cc
# add tables/DataMan/StManColumnBase.cc
touch casatables_impl/casacore/tables/DataMan/StManColumnBase.cc
sed -i '/casacore\/tables\/DataMan\/StManColumn.cc/a \ "casacore/tables/DataMan/StManColumnBase.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/StManColumnBase.cc
# add tables/DataMan/VirtArrCol.cc
touch casatables_impl/casacore/tables/DataMan/VirtArrCol.cc
sed -i '/casacore\/tables\/DataMan\/VirtColEng.cc/a \ "casacore/tables/DataMan/VirtArrCol.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VirtArrCol.cc
# add tables/DataMan/VirtScaCol.cc
touch casatables_impl/casacore/tables/DataMan/VirtScaCol.cc
sed -i '/casacore\/tables\/DataMan\/VirtColEng.cc/a \ "casacore/tables/DataMan/VirtScaCol.cc",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VirtScaCol.cc
# add tables/Tables/ArrayColumnBase.h
touch casatables_impl/casacore/tables/Tables/ArrayColumnBase.h
sed -i '/casacore\/tables\/Tables\/ArrayColumn.h/a \ "casacore/tables/Tables/ArrayColumnBase.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/ArrayColumnBase.h
# add tables/Tables/RowNumbers.h
touch casatables_impl/casacore/tables/Tables/RowNumbers.h
sed -i '/casacore\/tables\/Tables\/RowCopier.h/a \ "casacore/tables/Tables/RowNumbers.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/Tables/RowNumbers.h
# add tables/DataMan/DataManagerColumn.h
touch casatables_impl/casacore/tables/DataMan/DataManagerColumn.h
sed -i '/casacore\/tables\/DataMan\/DataManager.h/a \ "casacore/tables/DataMan/DataManagerColumn.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/DataManagerColumn.h
# add tables/DataMan/StManColumnBase.h
touch casatables_impl/casacore/tables/DataMan/StManColumnBase.h
sed -i '/casacore\/tables\/DataMan\/StManColumn.h/a \ "casacore/tables/DataMan/StManColumnBase.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/StManColumnBase.h
# add tables/DataMan/VACEngine.h
touch casatables_impl/casacore/tables/DataMan/VACEngine.h
sed -i '/casacore\/tables\/DataMan\/VSCEngine.tcc/a \ "casacore/tables/DataMan/VACEngine.h",' casatables_impl/build.rs
git stage casatables_impl/casacore/tables/DataMan/VACEngine.h
# add tables/DataMan/VACEngine.tcc
touch casatables_impl/casacore/tables/DataMan/VACEngine.tcc
sed -i '/casacore\/tables\/DataMan\/VSCEngine.tcc/a \ "casacore/tables/DataMan/VACEngine.tcc",' casatables_impl/build.rs
# 3.4.0 -> 3.5.0
# delete casa/Utilities/Register.{tcc,h}
git rm casatables_impl/casacore/casa/Utilities/Register.{tcc,h}
sed -i '!casacore/casa/Utilities/Register.tcc!d' casatables_impl/build.rs
sed -i '!casacore/casa/Utilities/Register.h!d' casatables_impl/build.rs
# delete casa/Utilities/RegSequence.{cc,h}
git rm casatables_impl/casacore/casa/Utilities/RegSequence.{cc,h}
sed -i '!casacore/casa/Utilities/RegSequence.cc!d' casatables_impl/build.rs
sed -i '!casacore/casa/Utilities/RegSequence.h!d' casatables_impl/build.rs
# delete casa/OS/Mutex.cc
git rm casatables_impl/casacore/casa/OS/Mutex.cc
sed -i '!casacore/casa/OS/Mutex.cc!d' casatables_impl/build.rs
# add casacore/casa/Utilities/Sort.tcc
touch casatables_impl/casacore/casa/Utilities/Sort.tcc
sed -i '/casacore\/casa\/Utilities\/Sort.h/a \ "casacore/casa/Utilities/Sort.tcc",' casatables_impl/build.rs
git add casatables_impl/casacore/casa/Utilities/Sort.tcc
# add casacore/tables/Tables/TableUtil.h
touch casatables_impl/casacore/tables/Tables/TableUtil.h
sed -i '/casacore\/tables\/Tables\/TableTrace.h/a \ "casacore/tables/Tables/TableUtil.h",' casatables_impl/build.rs
git add casatables_impl/casacore/tables/Tables/TableUtil.h
casatables_impl/update.sh ../casacore/build re-apply rubbl changesno longer necessary
// in v3.3.0 it was
memcpy (const_cast<Complex*>(carray.data()), rarray.data(), rarray.nelements() * sizeof(Float));
// in rubbl:master it is
memcpy (const_cast<Complex*>(carray.data()), static_cast<const void*>(rarray.data()), rarray.nelements() * sizeof(Float));
// in v3.4.0 it is
std::copy_n(rarray.data(), rarray.nelements(), reinterpret_cast<float*>(const_cast<std::complex<float>*>(carray.data()))); safe to checkoutgit checkout master -- casatables_impl/casacore/casa/System/ObjectID2.cc patch manually# buffer sizes
sed -i 's!char strc\[16\]; // should be plenty large...!char strc[32];!' casatables_impl/casacore/casa/Containers/RecordDescRep.cc
sed -i 's!char name\[24\];!char name[32];!' casatables_impl/casacore/tables/Tables/ReadAsciiTable.cc
# impl =
sed -i '/typ((MVAngle::formatTypes)/a \ Format& operator=(const Format&) = default;' casatables_impl/casacore/casa/Quanta/MVAngle.h
sed -i '/typ((MVTime::formatTypes)/a \ Format& operator=(const Format&) = default;' casatables_impl/casacore/casa/Quanta/MVTime.h
# impl default
sed -i '/# Operators/a \ MVBaseline(const MVBaseline&) = default;' casatables_impl/casacore/casa/Quanta/MVBaseline.h
sed -i '/# Operators/a \ MVDirection(const MVDirection&) = default;' casatables_impl/casacore/casa/Quanta/MVDirection.h
sed -i '/# Operators/a \ MVEarthMagnetic(const MVEarthMagnetic&) = default;' casatables_impl/casacore/casa/Quanta/MVEarthMagnetic.h
sed -i '/# Operators/a \ MVuvw(const MVuvw&) = default;' casatables_impl/casacore/casa/Quanta/MVuvw.h
# remove TAQL references https://github.com/pkgw/rubbl/commit/79fe0b245d0537b4fdf837ef6cebd13be8661abe
sed -i '/VirtualTaQLColumn/d' casatables_impl/casacore/tables/DataMan.h
sed -i '/VirtualTaQLColumn/d' casatables_impl/casacore/tables/DataMan/DataManager.cc
sed -i '/TaQL/d' casatables_impl/casacore/tables/Tables.h
sed -i '/ExprNode/d' casatables_impl/casacore/tables/Tables/BaseTable.cc
sed -i '/BaseTable::select (const TableExprNode/,/return resultTable.transfer();/d' casatables_impl/casacore/tables/Tables/BaseTable.cc
sed -i '/Do the row selection./,/}/d' casatables_impl/casacore/tables/Tables/BaseTable.cc
# don't throw DataManInternalError
sed -i '/if (data_p \!= 0) {/,/}/d' casatables_impl/casacore/tables/DataMan/MSMIndColumn.cc
# !! plus one more line
# in casatables_impl/casacore/tables/Tables/Table.cc, remove ExprDerNode.h and ExprNode.h
sed -i '/ExprDerNode.h/d' casatables_impl/casacore/tables/Tables/Table.cc
sed -i '/ExprNode.h/d' casatables_impl/casacore/tables/Tables/Table.cc
sed -i '/# Create an expression node to handle a keyword./,/# Select rows based on row numbers./d' casatables_impl/casacore/tables/Tables/Table.cc
it even passes on macos arm64 with hundreds of warnings! So... now that I've been able to show it's possible, what's next? Sorry for all the spam! Hopefully the spoiler tags give you the tl;dr |
Hey @pkgw , Is there anything I can do to help progress this issue? I know there's a lot here so I'll just summarize. I hope I have adequately demonstrated the changes needed to update the casacore source between each minor version (except 3.4.0).
The question is: what needs to happen next? This is my understanding, but I wanted to hear your thoughts:
So to update casacore versions, one would need to:
I can't see a way around this that doesn't involve rewriting history and force pushing to main, which I would need special permissions to do on this repo. If this is something that you don't have time to do, I totally understand. I may however need to start working on my own fork. If so, do you have any tips on how I might use your cranko-based release process on my own fork ? would it just be a matter of renaming all the packages to be Thanks again. |
I am finally working on this. Sorry for taking so long to follow up with you. PR #389 merges in your work. One important correction/clarification to the checklist you wrote in your latest comment (from a month ago, sigh): once Instead, the model is to merge the updated
The point is, you can merge While I was writing this, #389 built and I merged it in. I will take a look at whether there are any other touchups needed. In particular, it is probably time to deal with the warning about uninitialized memory in |
Thanks Peter! rubbl main is working great for me.
Other than the sprintf warnings, the only other warnings I'm seeing are
edit: once you've got a handle on the ndarray thing, It'd be great if we could do a release. Thanks! |
Hey Peter,
I've been trying to get rubbl compiling within an arm64 docker image. No need to test this on arm hardware, the latest version of Docker desktop will automatically emulate it for you.
Here's a dockerfile:
if you haven't already, you'll need to set up docker buildx with
Building this on amd64 works fine: (but the example itself has a bug)
but it fails to compile on arm64:
In upstream casacore, the type of
toEBCDIC
has changed fromstatic char
tostatic signed char
https://github.com/casacore/casacore/blob/c6c5513af42b0fd2aaa8d342e876ba1b05542b0a/casa/OS/IBMConversion.cc#L53so it might just be a matter of updating the casacore source.
Cheers!
The text was updated successfully, but these errors were encountered: