Browse Source

Full code reorganize + build system into 21st c'ry

The JIVE specific CASA/casacore (formerly: AIPS++) code started its life at
the end of the '90s of last century of the previous millenium as subsidiary
project under the AIPS++ code tree.

As such it borrowed its project structure and build system from the parent
project, AIPS++. This, obviously, was a disaster and was a bugger to
compile. But sometimes it worked.

Then the AIPS++ project dissolved and became CASA ("Common Astronomy
Software blah"), insofar as you were ALMA, then you were common. Other
instruments/techniques (e.g. VLBI) were deemed not so common and thus left
in the dust. Some enterpreneuring spirits got a wild idea: cut the useful
bits out of CASA and make those available as library. This of course was
'casacore' - the useful core components of CASA.

JIVE's utilities never were very taxing on the full CASA stack and would do
very well with just the useful bits. But now there was a fork in the
CASA/casacore road: the JIVE code could either be part of CASA (and use that
build system) OR it was a standalone project which just needed to link
agains the useful core components of CASA to work.

So, a second, home-grown, build system was attached to the code structure
and a user could choose which build system to use by using:
    make -f makefile  (CASA/AIPS++ subproject)
    make -f Makefile  (set up manually to link against casacore)

Following the fork in the road parallel developments were developed in
parallel in both camps. CASA, obviously, *also* needed useful bits to do its
smart stuff onto, but both projects made changes independently because each
operated on their own version of the code. A minor effort was in place to
keep both implementations of core functionality a bit in sync, and often
unsuccesfully of course.

After long enough time had passed for the ego factors to have dwindled into
a small fractional number and new software developers had been (forcibly)
working in- and with this situation had had enough and cried out "No more!".
And it was decided that CASA should usurp casacore (the smart people were in
the casacore camp, you can tell) to have once more a single set of shared
useful bits.

Then came the time that the hardware at JIVE these JIVE specific tools were
run on had to be replaced with Newer And Faster Stuff (tm). Of course the
staff at JIVE, not being half idiots themselves, having seen this fork- and
merger process unfold before their very eyes, decided it might not be a bad
idea to re-organise the JIVE CASA software and bring it kicking + screaming
into the 21st century.

The latter not only because of the core-ification of CASA but also various
build systems and build-system-generation tools rose, shone and fell over
the life time of the JIVE CASA code. The "autotools" once were "A Thing" but
by 2019 (for it is 2019's seconds, days and weeks flowing as this is typed)
their Thing was a Thing Of The Past; it would seem that CMake had come out
victoriously in the great build-system war of the early years of the 3rd
millenium after Christ, J.

Thus was said and done. Without the need to be structured along the lines
laid down in the old runes of the AIPS++ of before, the source code files
could find a new home in a saner organization, guided by the best of practices
as preached by contemporary CMake gurus (of which there seemed
to be many, with slightly differing interpretations of "best", but I digress).

Configuring and building the JIVE CASA code should now be a more pleasurable
experience than it ever was, although I cannot deliver you from the evil
that CASA is. Things will get better but never quite allright.
reorganize-branch
haavee 3 years ago
parent
commit
d6d6ad3ac7
  1. 33
      CMakeLists.txt
  2. 60
      README.md
  3. 3
      apps/2bitVV/2bitVV.cc
  4. 0
      apps/2bitVV/ANNOUNCE
  5. 15
      apps/2bitVV/CMakeLists.txt
  6. 10
      apps/CMakeLists.txt
  7. 9
      apps/j2ms2/CMakeLists.txt
  8. 0
      apps/j2ms2/j2ms2.cc
  9. 9
      apps/jfilt/CMakeLists.txt
  10. 6
      apps/jfilt/jfilt.cc
  11. 9
      apps/tConvert/CMakeLists.txt
  12. 0
      apps/tConvert/tConvert.cc
  13. 49
      cmake/FindCFITSIO.cmake
  14. 295
      cmake/FindCasacore.cmake
  15. 61
      cmake/FindPython.cmake
  16. 26
      cmake/FindVEX.cmake
  17. 49
      cmake/FindWCSLIB.cmake
  18. 148
      cmake/PythonInstall.cmake
  19. 107
      code/jive/README
  20. 5
      code/jive/apps/2bitVV/makefile
  21. 42
      code/jive/apps/Makefile
  22. 509
      code/jive/apps/fixfbs/fixfbs.cc
  23. 32
      code/jive/apps/j2ms2/Makefile
  24. 18
      code/jive/apps/j2ms2/makefile
  25. 12
      code/jive/apps/jfilt/makefile
  26. 6
      code/jive/apps/makefile
  27. 12
      code/jive/apps/plotiterator/makefile
  28. 831
      code/jive/apps/plotiterator/plotiterator.cc
  29. 1551
      code/jive/apps/rawpgplot/boring.cc
  30. 55
      code/jive/apps/rawpgplot/boring.h
  31. 9
      code/jive/apps/rawpgplot/makefile
  32. 341
      code/jive/apps/rawpgplot/rawpgplot.cc
  33. 29
      code/jive/apps/tConvert/Makefile
  34. 11
      code/jive/apps/tConvert/makefile
  35. 231
      code/jive/fixincldir.sh
  36. 39
      code/jive/implement/Makefile
  37. 26
      code/jive/implement/Utilities/Makefile
  38. 9
      code/jive/implement/Utilities/makefile
  39. 189
      code/jive/implement/_ReposFiller/.oldies/templates.fits
  40. 267
      code/jive/implement/_ReposFiller/.oldies/templates.frozen
  41. 47
      code/jive/implement/assertfail.h
  42. 17
      code/jive/implement/evnfraflags.h
  43. 32
      code/jive/implement/j2ms/Makefile
  44. 16
      code/jive/implement/j2ms/makefile
  45. 34
      code/jive/implement/labels/Makefile
  46. 8
      code/jive/implement/labels/makefile
  47. 21
      code/jive/implement/makefile
  48. 8
      code/jive/implement/ms2uvfitsimpl/Converters/makefile
  49. 7
      code/jive/implement/ms2uvfitsimpl/FITSUtils/makefile
  50. 8
      code/jive/implement/ms2uvfitsimpl/Generators/makefile
  51. 26
      code/jive/implement/ms2uvfitsimpl/Makefile
  52. 8
      code/jive/implement/ms2uvfitsimpl/makefile
  53. 9
      code/jive/implement/tmplsrc/makefile
  54. 61
      code/jive/makedefs
  55. 42
      code/jive/makefiles/Apps.toplevel
  56. 38
      code/jive/makefiles/Libs.toplevel
  57. 34
      code/jive/makefiles/Makefile
  58. 38
      code/jive/makefiles/Modules.toplevel
  59. 34
      code/jive/makefiles/README
  60. 23
      code/jive/makefiles/makefile.app
  61. 23
      code/jive/makefiles/makefile.lib
  62. 23
      code/jive/makefiles/makefile.module
  63. 149
      code/jive/system/app.mak
  64. 257
      code/jive/system/compiler.mak
  65. 17
      code/jive/system/dependencies.sed
  66. 2
      code/jive/system/findCsrc
  67. 2
      code/jive/system/findccsrc
  68. 2
      code/jive/system/findcsrc
  69. 84
      code/jive/system/finddeps.tcl
  70. 136
      code/jive/system/lib.mak
  71. 326
      code/jive/system/locations.mak
  72. 16
      code/jive/system/locdet.mak
  73. 134
      code/jive/system/modules.mak
  74. 181
      code/jive/system/rules.mak
  75. 532
      code/vlbi/apps/j2ms2/j2ms2.cc
  76. 8
      code/vlbi/apps/j2ms2/makefile
  77. 1469
      code/vlbi/apps/rawpgplot/boring.cc
  78. 49
      code/vlbi/apps/rawpgplot/boring.h
  79. 7
      code/vlbi/apps/rawpgplot/makefile
  80. 324
      code/vlbi/apps/rawpgplot/rawpgplot.cc
  81. 8
      code/vlbi/apps/tConvert/makefile
  82. 272
      code/vlbi/apps/tConvert/tConvert.cc
  83. 23
      code/vlbi/implement/DtdLUT/AlbertTypedefs.h
  84. 123
      code/vlbi/implement/DtdLUT/BaseLine.cc
  85. 109
      code/vlbi/implement/DtdLUT/BaseLine.h
  86. 119
      code/vlbi/implement/DtdLUT/BaseLineIdx.h
  87. 20
      code/vlbi/implement/DtdLUT/CorrelationCode.cc
  88. 146
      code/vlbi/implement/DtdLUT/CorrelationCode.h
  89. 290
      code/vlbi/implement/DtdLUT/DtdLUT.cc
  90. 261
      code/vlbi/implement/DtdLUT/DtdLUT.h
  91. 15
      code/vlbi/implement/DtdLUT/DualIndex.cc
  92. 122
      code/vlbi/implement/DtdLUT/DualIndex.h
  93. 19
      code/vlbi/implement/DtdLUT/InterferometerDescr.cc
  94. 59
      code/vlbi/implement/DtdLUT/InterferometerDescr.h
  95. 151
      code/vlbi/implement/DtdLUT/JobDescr.h
  96. 166
      code/vlbi/implement/DtdLUT/SubArrayDescr.h
  97. 204
      code/vlbi/implement/DtdLUT/VisLabel.cc
  98. 318
      code/vlbi/implement/DtdLUT/VisLabel.h
  99. 227
      code/vlbi/implement/DtdLUT/evnfra_transf.h
  100. 199
      code/vlbi/implement/DtdLUT/evnfra_transf_new.h

33
CMakeLists.txt

@ -0,0 +1,33 @@
project(jive-casa)
cmake_minimum_required (VERSION 2.6.0)
include(CheckCXXCompilerFlag)
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 1)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION_REVISION 0)
set(PROJECT_VERSION
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Set policy to require CMakeLists.txt in every source directory
cmake_policy(SET CMP0014 NEW)
# https://cmake.org/cmake/help/latest/policy/CMP0022.html#policy:CMP0022
cmake_policy(SET CMP0022 OLD)
# Build shared libraries by default
option(BUILD_SHARED_LIBS "Build shared library" ON)
# RPATH handling - for 3rd party dependencies we want to retain
# the link path in the RPATH thank you very much
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# We require CASACORE, VEX
find_package(Casacore REQUIRED ms meas scimath measures tables casa fits)
find_package(VEX REQUIRED)
# include libs, apps
add_subdirectory(jive)
add_subdirectory(apps)

60
README.md

@ -0,0 +1,60 @@
The suite of JIVE specific CASA(CORE) based tools for correlation
post-processing:
- j2ms2:
a tool to convert output from various VLBI correlators used at JIVE to
CASA MeasurementSet format
- tConvert:
a tool to export CASA MeasurementSet format data to FITS-IDI file(s)
- jfilt/2bitVV:
historic tools used for MarkIV hardware correlator output data. Not built
by default, uncomment in apps/CMakeLists.txt if desired
Necessary dependencies:
* casacore; the collection of C++ libraries for creating and
handling MeasurementSet data files.
git clone https://github.com/casacore/casacore.git
* VEX; V(LBI) EX(periment) file parser
This is the VEX grammar extracted from the NASA FieldSystem
code + code to extract fields from the parsed data structure
into application usable variables.
git clone [user@]code.jive.eu/code/git/myvex.git
Both dependendencies are CMake-ified, just like this project.
After building & installing the dependencies, proceed as follows as per
standard CMake practice:
- memorize the directory this file is in; hereafter called
${JIVE_CASA_ROOT}
- mkdir /path/to/build/area
- cd /path/to/build/area
- Invoke CMake:
cmake -DCASACORE_ROOT_DIR=/path/to/casacore \\
-DVEX_ROOT_DIR=/path/to/vex \\
-DCMAKE_INSTALL_PREFIX=/where/you/want/these/installed \\
[other cmake options] \\
${JIVE_CASA_ROOT}
- make [-j NNN] [install]
[-j NNN] is optional, NNN is number of parallel compiles performed by
(c)make. On multicore systems speeds up compilation considerably
[install] if given, will build+install in one go, without it just build,
useful if unsure code will actually compile.
After install your file system will be enriched with:
${CMAKE_INSTALL_PREFIX}
|
-----------------/bin/
|
--- j2ms2, tConvert [, jfilt] [, 2bitVV]
/lib/
|
--- {libUtilities, liblabels, libj2ms, libms2uvfitsimpl}.[so|a]

3
code/jive/apps/2bitVV/2bitVV.cc → apps/2bitVV/2bitVV.cc

@ -578,8 +578,7 @@ VanVleckCorrector::correct (bool verbose)
// Iterate over data blocks corresponding to the same time.
Block<String> iterKeys(1);
iterKeys[0] = "TIME";
TableIterator iter(ms, iterKeys, TableIterator::DontCare,
TableIterator::NoSort);
TableIterator iter(ms, iterKeys, TableIterator::Ascending);
uInt numIterations = 0;
uInt numRows = 0;

0
code/jive/apps/2bitVV/ANNOUNCE → apps/2bitVV/ANNOUNCE

15
apps/2bitVV/CMakeLists.txt

@ -0,0 +1,15 @@
# How to make 2bitVV
# Note: this CMakeLists.txt file is included for reference
# but DOES NOT GET BUILT BY DEFAULT.
# The code in here is, in principle, highly MarkIV
# hardware correlator specific.
# The code itself is retained for posterity and
# illustration of how bit statistics can be used
# under certain circumstances.
add_executable(2bitVV 2bitVV.cc)
# Set the libraries this target depends on
target_link_libraries(2bitVV PUBLIC casacore)
# and where this target should end up after installation
install(TARGETS 2bitVV DESTINATION bin)

10
apps/CMakeLists.txt

@ -0,0 +1,10 @@
# all applications
add_subdirectory(j2ms2)
add_subdirectory(tConvert)
# The jfilt/2bitVV applications are MarkIV
# hardware correlator specific. But the code
# is kept for future reference and should compile
# and install just fine if uncommented
#add_subdirectory(jfilt)
#add_subdirectory(2bitVV)

9
apps/j2ms2/CMakeLists.txt

@ -0,0 +1,9 @@
# How to make j2ms2
add_executable(j2ms2 j2ms2.cc)
# Set the libraries this target depends on
target_link_libraries(j2ms2 PUBLIC Utilities labels j2ms vex casacore)
# and where this target should end up after installation
install(TARGETS j2ms2 DESTINATION bin)

0
code/jive/apps/j2ms2/j2ms2.cc → apps/j2ms2/j2ms2.cc

9
apps/jfilt/CMakeLists.txt

@ -0,0 +1,9 @@
# How to make jfilt
add_executable(jfilt jfilt.cc)
# Set the libraries this target depends on
target_link_libraries(jfilt PUBLIC casacore)
# and where this target should end up after installation
install(TARGETS jfilt DESTINATION bin)

6
code/jive/apps/jfilt/jfilt.cc → apps/jfilt/jfilt.cc

@ -66,13 +66,7 @@
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/Arrays/ArrayUtil.h>
#include <casacore/casa/Arrays/Vector.h>
#include <casacore/casa/Arrays/Vector.cc>
#include <casacore/casa/Arrays/Vector2.cc>
#include <casacore/casa/Arrays/MaskedArray.cc>
#include <casacore/casa/Containers/Block.h>
#include <casacore/casa/Utilities/Copy.cc>
#include <casacore/casa/Utilities/CountedPtr.cc>
#include <casacore/casa/Arrays/ArrayIO.cc>
#include <casacore/casa/Utilities/GenSort.h>
#include <casacore/casa/Utilities/Regex.h>

9
apps/tConvert/CMakeLists.txt

@ -0,0 +1,9 @@
# How to make tConvert
add_executable(tConvert tConvert.cc)
# Set the libraries this target depends on
target_link_libraries(tConvert PUBLIC Utilities ms2uvfitsimpl casacore)
# and where this target should end up after installation
install(TARGETS tConvert DESTINATION bin)

0
code/jive/apps/tConvert/tConvert.cc → apps/tConvert/tConvert.cc

49
cmake/FindCFITSIO.cmake

@ -0,0 +1,49 @@
# - Try to find CFITSIO.
# Variables used by this module:
# CFITSIO_ROOT_DIR - CFITSIO root directory
# Variables defined by this module:
# CFITSIO_FOUND - system has CFITSIO
# CFITSIO_INCLUDE_DIR - the CFITSIO include directory (cached)
# CFITSIO_INCLUDE_DIRS - the CFITSIO include directories
# (identical to CFITSIO_INCLUDE_DIR)
# CFITSIO_LIBRARY - the CFITSIO library (cached)
# CFITSIO_LIBRARIES - the CFITSIO libraries
# (identical to CFITSIO_LIBRARY)
# Copyright (C) 2009
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: FindCFITSIO.cmake 22498 2012-10-23 10:51:12Z loose $
if(NOT CFITSIO_FOUND)
find_path(CFITSIO_INCLUDE_DIR fitsio.h
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio include/libcfitsio0)
find_library(CFITSIO_LIBRARY cfitsio
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
find_library(M_LIBRARY m)
mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY M_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CFITSIO DEFAULT_MSG
CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE_DIR)
set(CFITSIO_INCLUDE_DIRS ${CFITSIO_INCLUDE_DIR})
set(CFITSIO_LIBRARIES ${CFITSIO_LIBRARY} ${M_LIBRARY})
endif(NOT CFITSIO_FOUND)

295
cmake/FindCasacore.cmake

@ -0,0 +1,295 @@
# - Try to find Casacore include dirs and libraries
# Usage:
# find_package(Casacore [REQUIRED] [COMPONENTS components...])
# Valid components are:
# casa, coordinates, derivedmscal, fits, images, lattices, meas,
# measures, mirlib, ms, msfits, python, scimath, scimath_f, tables
#
# The component python will be replaced by python3 if the version of the
# python interpreter found is >= 3.
#
# Note that most components are dependent on other (more basic) components.
# In that case, it suffices to specify the "top-level" components; dependent
# components will be searched for automatically.
#
# The dependency tree can be generated using the script get_casacore_deps.sh.
# For this, you need to have a complete casacore installation, built with shared
# libraries, at your disposal.
#
# The dependencies in this macro were generated against casacore release 2.0.
#
# Variables used by this module:
# CASACORE_ROOT_DIR - Casacore root directory.
#
# Variables defined by this module:
# CASACORE_FOUND - System has Casacore, which means that the
# include dir was found, as well as all
# libraries specified (not cached)
# CASACORE_INCLUDE_DIR - Casacore include directory (cached)
# CASACORE_INCLUDE_DIRS - Casacore include directories (not cached)
# identical to CASACORE_INCLUDE_DIR
# CASACORE_LIBRARIES - The Casacore libraries (not cached)
# CASA_${COMPONENT}_LIBRARY - The absolute path of Casacore library
# "component" (cached)
# HAVE_AIPSPP - True if system has Casacore (cached)
# for backward compatibility with AIPS++
# HAVE_CASACORE - True if system has Casacore (cached)
# identical to CASACORE_FOUND
# TAQL_EXECUTABLE - The absolute path of the TaQL executable
# (cached)
#
# ATTENTION: The component names need to be in lower case, just as the
# casacore library names. However, the CMake variables use all upper case.
# Copyright (C) 2009-2015
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: FindCasacore.cmake 39709 2018-06-14 12:07:59Z dijkema $
# - casacore_resolve_dependencies(_result)
#
# Resolve the Casacore library dependencies for the given components.
# The list of dependent libraries will be returned in the variable result.
# It is sorted from least dependent to most dependent library, so it can be
# directly fed to the linker.
#
# Usage: casacore_resolve_dependencies(result components...)
#
macro(casacore_resolve_dependencies _result)
set(${_result} ${ARGN})
set(_index 0)
# Do a breadth-first search through the dependency graph; append to the
# result list the dependent components for each item in that list.
# Duplicates will be removed later.
while(1)
list(LENGTH ${_result} _length)
if(NOT _index LESS _length)
break()
endif(NOT _index LESS _length)
list(GET ${_result} ${_index} item)
list(APPEND ${_result} ${Casacore_${item}_DEPENDENCIES})
math(EXPR _index "${_index}+1")
endwhile(1)
# Remove all duplicates in the current result list, while retaining only the
# last of each duplicate.
list(REVERSE ${_result})
list(REMOVE_DUPLICATES ${_result})
list(REVERSE ${_result})
endmacro(casacore_resolve_dependencies _result)
# - casacore_find_library(_name)
#
# Search for the library ${_name}.
# If library is found, add it to CASACORE_LIBRARIES; if not, add ${_name}
# to CASACORE_MISSING_COMPONENTS and set CASACORE_FOUND to false.
#
# Usage: casacore_find_library(name)
#
macro(casacore_find_library _name)
string(TOUPPER ${_name} _NAME)
find_library(${_NAME}_LIBRARY ${_name}
HINTS ${CASACORE_ROOT_DIR} PATH_SUFFIXES lib)
mark_as_advanced(${_NAME}_LIBRARY)
if(${_NAME}_LIBRARY)
list(APPEND CASACORE_LIBRARIES ${${_NAME}_LIBRARY})
else(${_NAME}_LIBRARY)
set(CASACORE_FOUND FALSE)
list(APPEND CASACORE_MISSING_COMPONENTS ${_name})
endif(${_NAME}_LIBRARY)
endmacro(casacore_find_library _name)
# - casacore_find_package(_name)
#
# Search for the package ${_name}.
# If the package is found, add the contents of ${_name}_INCLUDE_DIRS to
# CASACORE_INCLUDE_DIRS and ${_name}_LIBRARIES to CASACORE_LIBRARIES.
#
# If Casacore itself is required, then, strictly speaking, the packages it
# requires must be present. However, when linking against static libraries
# they may not be needed. One can override the REQUIRED setting by switching
# CASACORE_MAKE_REQUIRED_EXTERNALS_OPTIONAL to ON. Beware that this might cause
# compile and/or link errors.
#
# Usage: casacore_find_package(name [REQUIRED])
#
macro(casacore_find_package _name)
if("${ARGN}" MATCHES "^REQUIRED$" AND
Casacore_FIND_REQUIRED AND
NOT CASACORE_MAKE_REQUIRED_EXTERNALS_OPTIONAL)
find_package(${_name} REQUIRED)
else()
find_package(${_name})
endif()
if(${_name}_FOUND)
list(APPEND CASACORE_INCLUDE_DIRS ${${_name}_INCLUDE_DIRS})
list(APPEND CASACORE_LIBRARIES ${${_name}_LIBRARIES})
endif(${_name}_FOUND)
endmacro(casacore_find_package _name)
# Define the Casacore components.
set(Casacore_components
casa
coordinates
derivedmscal
fits
images
lattices
meas
measures
mirlib
ms
msfits
python
python3
scimath
scimath_f
tables
)
# Define the Casacore components' inter-dependencies.
set(Casacore_casa_DEPENDENCIES)
set(Casacore_coordinates_DEPENDENCIES fits measures casa)
set(Casacore_derivedmscal_DEPENDENCIES ms measures tables casa)
set(Casacore_fits_DEPENDENCIES measures tables casa)
set(Casacore_images_DEPENDENCIES coordinates mirlib lattices fits measures scimath tables casa)
set(Casacore_lattices_DEPENDENCIES tables scimath casa)
set(Casacore_meas_DEPENDENCIES measures tables casa)
set(Casacore_measures_DEPENDENCIES tables casa)
set(Casacore_mirlib_DEPENDENCIES)
set(Casacore_ms_DEPENDENCIES measures scimath tables casa)
set(Casacore_msfits_DEPENDENCIES ms fits measures tables casa)
set(Casacore_python_DEPENDENCIES casa)
set(Casacore_python3_DEPENDENCIES casa)
set(Casacore_scimath_DEPENDENCIES scimath_f casa)
set(Casacore_scimath_f_DEPENDENCIES)
set(Casacore_tables_DEPENDENCIES casa)
# Initialize variables.
set(CASACORE_FOUND FALSE)
set(CASACORE_DEFINITIONS)
set(CASACORE_LIBRARIES)
set(CASACORE_MISSING_COMPONENTS)
# Search for the header file first.
if(NOT CASACORE_INCLUDE_DIR)
find_path(CASACORE_INCLUDE_DIR casacore/casa/aips.h
HINTS ${CASACORE_ROOT_DIR} PATH_SUFFIXES include)
mark_as_advanced(CASACORE_INCLUDE_DIR)
endif(NOT CASACORE_INCLUDE_DIR)
# Fallback for systems that have old casacore installed in directory not called 'casacore'
# This fallback can be removed once we move to casacore 2.0 which always puts headers in 'casacore'
if(NOT CASACORE_INCLUDE_DIR)
find_path(CASACORE_INCLUDE_DIR casa/aips.h
HINTS ${CASACORE_ROOT_DIR} PATH_SUFFIXES include)
mark_as_advanced(CASACORE_INCLUDE_DIR)
endif(NOT CASACORE_INCLUDE_DIR)
if(NOT CASACORE_INCLUDE_DIR)
set(CASACORE_ERROR_MESSAGE "Casacore: unable to find the header file casa/aips.h.\nPlease set CASACORE_ROOT_DIR to the root directory containing Casacore.")
else(NOT CASACORE_INCLUDE_DIR)
# We've found the header file; let's continue.
set(CASACORE_FOUND TRUE)
# Note that new Casacore uses #include<casacore/casa/...>, while
# LOFAR still uses #include<casa/...>. Hence use both in -I path.
set(CASACORE_INCLUDE_DIRS ${CASACORE_INCLUDE_DIR} ${CASACORE_INCLUDE_DIR}/casacore)
# Search for some often used binaries.
find_program(TAQL_EXECUTABLE taql
HINTS ${CASACORE_ROOT_DIR}/bin)
mark_as_advanced(TAQL_EXECUTABLE)
# If the user specified components explicity, use that list; otherwise we'll
# assume that the user wants to use all components.
if(NOT Casacore_FIND_COMPONENTS)
set(Casacore_FIND_COMPONENTS ${Casacore_components})
endif(NOT Casacore_FIND_COMPONENTS)
# Get a list of all dependent Casacore libraries that need to be found.
casacore_resolve_dependencies(_find_components ${Casacore_FIND_COMPONENTS})
# For python3, change the python component to python3
if("${_find_components}" MATCHES "python")
find_package(Python)
if(PYTHON_FOUND)
if(PYTHON_VERSION_MAJOR GREATER 2)
string(REPLACE "python" "python3" _find_components "${_find_components}")
endif(PYTHON_VERSION_MAJOR GREATER 2)
else(PYTHON_FOUND)
message(SEND_ERROR "casacore-python was requested but python was not found.")
endif(PYTHON_FOUND)
endif("${_find_components}" MATCHES "python")
# Find the library for each component, and handle external dependencies
foreach(_comp ${_find_components})
casacore_find_library(casa_${_comp})
if(${_comp} STREQUAL casa)
casacore_find_package(HDF5)
casacore_find_library(m)
list(APPEND CASACORE_LIBRARIES ${CMAKE_DL_LIBS})
elseif(${_comp} STREQUAL coordinates)
casacore_find_package(WCSLIB REQUIRED)
elseif(${_comp} STREQUAL fits)
casacore_find_package(CFITSIO REQUIRED)
elseif(${_comp} STREQUAL scimath_f)
casacore_find_package(LAPACK REQUIRED)
endif(${_comp} STREQUAL casa)
endforeach(_comp ${_find_components})
endif(NOT CASACORE_INCLUDE_DIR)
# Set HAVE_CASACORE; and HAVE_AIPSPP (for backward compatibility with AIPS++).
if(CASACORE_FOUND)
set(HAVE_CASACORE TRUE CACHE INTERNAL "Define if Casacore is installed")
set(HAVE_AIPSPP TRUE CACHE INTERNAL "Define if AIPS++/Casacore is installed")
endif(CASACORE_FOUND)
# Compose diagnostic message if not all necessary components were found.
if(CASACORE_MISSING_COMPONENTS)
set(CASACORE_ERROR_MESSAGE "Casacore: the following components could not be found:\n ${CASACORE_MISSING_COMPONENTS}")
endif(CASACORE_MISSING_COMPONENTS)
# Print diagnostics.
if(CASACORE_FOUND)
if(NOT Casacore_FIND_QUIETLY)
message(STATUS "Found the following Casacore components: ")
foreach(_comp ${_find_components})
string(TOUPPER casa_${_comp} _COMP)
message(STATUS " ${_comp}: ${${_COMP}_LIBRARY}")
endforeach(_comp ${_find_components})
endif(NOT Casacore_FIND_QUIETLY)
else(CASACORE_FOUND)
if(Casacore_FIND_REQUIRED)
message(FATAL_ERROR "${CASACORE_ERROR_MESSAGE}")
else(Casacore_FIND_REQUIRED)
message(STATUS "${CASACORE_ERROR_MESSAGE}")
endif(Casacore_FIND_REQUIRED)
endif(CASACORE_FOUND)
if(CASACORE_FOUND)
list(GET CASACORE_LIBRARIES 0 FIRST_CASA_LIB)
list(REMOVE_AT CASACORE_LIBRARIES 0)
add_library(casacore UNKNOWN IMPORTED)
set_target_properties(casacore PROPERTIES
IMPORTED_LOCATION "${FIRST_CASA_LIB}"
IMPORTED_LINK_INTERFACE_LIBRARIES "${CASACORE_LIBRARIES}"
INSTALL_RPATH_USE_LINK_PATH TRUE
INTERFACE_LINK_LIBRARIES "${CASACORE_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${CASACORE_INCLUDE_DIRS}")
endif(CASACORE_FOUND)

61
cmake/FindPython.cmake

@ -0,0 +1,61 @@
# - Try to find the Python interpreter, Python header files and libraries.
# This macro effectively wraps the FindPythonInterp and FindPythonLibs macros
# provided by CMake.
#
# In addition to the variables that are set by FindPythonInterp and
# FindPythonLibs, this will define:
# PYTHON_FOUND - system has Python interpreter, Python headers
# files and libraries
# PYTHON_INCLUDE_DIRS - path to the Python header files
# PYTHON_BUILD_DIR - build directory for Python extensions (cached)
# PYTHON_INSTALL_DIR - installation directory for Python extensions (cached)
# Copyright (C) 2009
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: FindPython.cmake 39709 2018-06-14 12:07:59Z dijkema $
# Set options string to pass to the find_package() commands below.
set(_options ${Python_FIND_VERSION})
if(Python_FIND_VERSION_EXACT)
list(APPEND _options EXACT)
endif(Python_FIND_VERSION_EXACT)
if(Python_FIND_QUIETLY)
list(APPEND _options QUIET)
endif(Python_FIND_QUIETLY)
if(Python_FIND_REQUIRED)
list(APPEND _options REQUIRED)
endif(Python_FIND_REQUIRED)
# Search for the Python interpreter.
find_package(PythonInterp ${_options})
# Search for the Python header files and libraries.
find_package(PythonLibs ${_options})
# Set PYTHON_INCLUDE_DIRS variable, because FindPythonLibs does not do it.
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_PATH}")
# PythonInstall sets PYTHON_BUILD_DIR and PYTHON_INSTALL_DIR
include(PythonInstall)
# Set PYTHON_FOUND to TRUE if both Python interpreter and libraries are found.
set(PYTHON_FOUND FALSE)
if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)
set(PYTHON_FOUND TRUE)
endif(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)

26
cmake/FindVEX.cmake

@ -0,0 +1,26 @@
# - Try to find VEX (the Vlbi EXperiment file) parser
# part of NASA's FieldSystem
# Variables used by this module:
# VEX_ROOT_DIR - root directory, VEX_ROOT_DIR/lib/libvex.a, VEX_ROOT_DIR/include/...
# Variables defined by this module:
# VEX_FOUND - system has CFITSIO
# VEX_INCLUDE_DIR - the VEX include directory (cached)
# VEX_LIBRARY - the VEX library (cached)
# VEX_LIBRARY_DIR - the -L<path> for finding -lvex
if(NOT VEX_FOUND)
find_path(VEX_INCLUDE_DIR vex_parser.h
HINTS ${VEX_ROOT_DIR} PATH_SUFFIXES include)
find_library(VEX_LIBRARY vex
HINTS ${VEX_ROOT_DIR} PATH_SUFFIXES lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VEX DEFAULT_MSG
VEX_LIBRARY VEX_INCLUDE_DIR)
# if we found the vex library ...
add_library(vex UNKNOWN IMPORTED)
set_target_properties(vex PROPERTIES
IMPORTED_LOCATION "${VEX_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${VEX_ROOT_DIR}/include"
INSTALL_RPATH_USE_LINK_PATH TRUE
)
endif(NOT VEX_FOUND)

49
cmake/FindWCSLIB.cmake

@ -0,0 +1,49 @@
# - Try to find WCSLIB: the FITS "World Coordinate System" library
# Variables used by this module:
# WCSLIB_ROOT_DIR - WCSLIB root directory
# Variables defined by this module:
# WCSLIB_FOUND - system has WCSLIB
# WCSLIB_INCLUDE_DIR - the WCSLIB include directory (cached)
# WCSLIB_INCLUDE_DIRS - the WCSLIB include directories
# (identical to WCSLIB_INCLUDE_DIR)
# WCSLIB_LIBRARY - the WCSLIB library (cached)
# WCSLIB_LIBRARIES - the WCSLIB libraries
# (identical to WCSLIB_LIBRARY)
# Copyright (C) 2009
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: FindWCSLIB.cmake 16402 2010-09-27 14:50:22Z loose $
if(NOT WCSLIB_FOUND)
find_path(WCSLIB_INCLUDE_DIR wcslib/wcs.h
HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES include)
find_library(WCSLIB_LIBRARY wcs
HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES lib)
find_library(M_LIBRARY m)
mark_as_advanced(WCSLIB_INCLUDE_DIR WCSLIB_LIBRARY M_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WCSLIB DEFAULT_MSG
WCSLIB_LIBRARY M_LIBRARY WCSLIB_INCLUDE_DIR)
set(WCSLIB_INCLUDE_DIRS ${WCSLIB_INCLUDE_DIR})
set(WCSLIB_LIBRARIES ${WCSLIB_LIBRARY} ${M_LIBRARY})
endif(NOT WCSLIB_FOUND)

148
cmake/PythonInstall.cmake

@ -0,0 +1,148 @@
# - Install Python source files.
# python_install(source1..sourceN DESTINATION install_dir)
# Install Python source files and byte-compile them in the directory
# ${PYTHON_INSTALL_DIR}/${install_dir}.
# Copyright (C) 2008-2009
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, softwaresupport@astron.nl
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: PythonInstall.cmake 32905 2015-11-17 15:31:54Z schaap $
# Search for the Python interpreter.
find_package(PythonInterp)
# Derive the Python site-packages installation directory and build directory.
if(PYTHON_EXECUTABLE)
set(_cmd
"from distutils.sysconfig import get_python_lib"
"from os.path import join"
"print(join(
get_python_lib(plat_specific=True, standard_lib=True, prefix=''),
'site-packages'))"
)
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "-c" "${_cmd}"
OUTPUT_VARIABLE _pydir
ERROR_VARIABLE _pyerr
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_pyerr)
message(FATAL_ERROR "Python command failed:\n${_pyerr}")
endif(_pyerr)
if(NOT DEFINED PYTHON_BUILD_DIR)
set(_PRINT_PYTHON_DIRS TRUE)
endif()
set(PYTHON_BUILD_DIR "${CMAKE_BINARY_DIR}/${_pydir}" CACHE PATH
"Build directory for Python extensions" FORCE)
set(PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${_pydir}" CACHE PATH
"Installation directory for Python extensions" FORCE)
if(_PRINT_PYTHON_DIRS)
message(STATUS "Build directory for Python extensions: ${PYTHON_BUILD_DIR}")
message(STATUS "Installation directory for Python extensions: ${PYTHON_INSTALL_DIR}")
endif()
endif(PYTHON_EXECUTABLE)
#
# macro python_install
#
macro(python_install)
# Precondition check.
if(NOT PYTHON_EXECUTABLE)
message(FATAL_ERROR "python_install: Python interpreter not available")
endif(NOT PYTHON_EXECUTABLE)
# Parse arguments.
# apart from the python files list, there are two additional arguments
# DESTINATION (required), where to put the py files (relative to python lib dir)
# EXECUTABLE (optional), makes the py files executable
string(REGEX REPLACE ";?DESTINATION.*" "" _py_files "${ARGN}")
string(REGEX REPLACE ";?EXECUTABLE.*" "" _py_files "${_py_files}")
string(REGEX MATCH "DESTINATION;.*" _dest_dir "${ARGN}")
string(REGEX REPLACE "^DESTINATION;" "" _dest_dir "${_dest_dir}")
string(REGEX REPLACE ";?EXECUTABLE.*" "" _dest_dir "${_dest_dir}")
string(REGEX MATCH "EXECUTABLE;" _executable "${ARGN}")
#check if optional argument EXECUTABLE is set
#if so, then install the _py_files as EXECUTABLE type (executable)
#else as normal files (not executable)
if("${_executable}" STRGREATER "")
set(INSTALL_TYPE PROGRAMS)
else()
set(INSTALL_TYPE FILES)
endif("${_executable}" STRGREATER "")
if(_py_files MATCHES "^$")
message(FATAL_ERROR "python_install: no sources files specified")
endif(_py_files MATCHES "^$")
if(_dest_dir MATCHES "^$" OR _dest_dir MATCHES ";")
message(FATAL_ERROR "python_install: destination directory invalid")
endif(_dest_dir MATCHES "^$" OR _dest_dir MATCHES ";")
# Set python package build/install directory.
set(_inst_dir "${PYTHON_INSTALL_DIR}/${_dest_dir}")
set(_build_dir "${PYTHON_BUILD_DIR}/${_dest_dir}")
# Install and byte-compile each Python file.
foreach(_py ${_py_files})
get_filename_component(_py_path ${_py} PATH)
get_filename_component(_py_abs ${_py} ABSOLUTE)
# check if _py is a path in CMAKE_BINARY_DIR. If so, then it is most likely a configured_file.
# then strip the CMAKE_CURRENT_BINARY_DIR prefix.
if(${_py} MATCHES "^(${CMAKE_CURRENT_BINARY_DIR})")
string(REGEX REPLACE "^(${CMAKE_CURRENT_BINARY_DIR}/)" "" _py "${_py}")
get_filename_component(_py_path ${_py} PATH)
endif()
# Create a symlink to each Python file; needed to mimic install tree.
file(MAKE_DIRECTORY ${_build_dir}/${_py_path})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${_py_abs} ${_build_dir}/${_py})
install(${INSTALL_TYPE} ${_py_abs} DESTINATION ${_inst_dir}/${_py_path})
if(USE_PYTHON_COMPILATION)
set(_py_code
"import py_compile, os"
"destdir = os.environ.get('DESTDIR','')"
"print('-- Byte-compiling: %s${_inst_dir}/${_py}' % destdir)"
"py_compile.compile('%s${DESTDIR}${_inst_dir}/${_py}' % destdir, doraise=True)")
install(CODE
"execute_process(COMMAND ${PYTHON_EXECUTABLE} -c \"${_py_code}\"
RESULT_VARIABLE _result)
if(NOT _result EQUAL 0)
message(FATAL_ERROR \"Byte-compilation FAILED: \$ENV{DESTDIR}${_inst_dir}/${_py}\")
endif(NOT _result EQUAL 0)")
endif(USE_PYTHON_COMPILATION)
endforeach(_py ${_py_files})
# Make sure that there's a __init__.py file in each build/install directory.
string(REGEX REPLACE "/" ";" _dir_list ${_dest_dir})
set(_init_dir)
foreach(_dir ${_dir_list})
set(_init_dir "${_init_dir}/${_dir}")
execute_process(COMMAND ${CMAKE_COMMAND} -E touch
"${PYTHON_BUILD_DIR}${_init_dir}/__init__.py")
install(CODE
"execute_process(COMMAND ${CMAKE_COMMAND} -E touch
\"\$ENV{DESTDIR}${PYTHON_INSTALL_DIR}${_init_dir}/__init__.py\")")
endforeach(_dir ${_dir_list})
endmacro(python_install)

107
code/jive/README

@ -1,107 +0,0 @@
This is the codebase for the JIVE aips++/casa/casacore libraries + programs like j2ms2 and tConvert.
The code can be compiled in two "major" modes, "aips++/casa" and "casacore". Each directory contains two makefiles - one for each buildmode.
The one thing they share is that the codetree contains "libraries" and "applications". The build is therefore a two-step process.
First build the libraries (found under "code/jive/implement"), then build the applications ("code/jive/apps").
Definitions:
<Path>: the directory where you executed 'cvs checkout' from.
This file is located at <Path>/code/jive/README
Important notice wrt an important dependency:
# 24/06/2016 - Locally (@JIVE) hacked VEX parser is now put under CVS version control
# cvs -d jive_cc@jopXX.jive.nl/export/home/jive_cvs/HAAVEE/myvex co myvex
# [VEX1.5 parsert with unofficial $BITSTREAMS and $THREADS support]
Contact verkouter@jive.eu for details.
AIPS++/CASA mode
================
In this mode the JIVE code essentially becomes part of the aips++/casa codetree. It uses the AIPS++/CASA makesystem to compile and link.
The aips++/casa makesystem must contain definitions for the packages that this codebase needs (VEX, JCCS etc).
Usually these definitions are located in a 'makedefs' file which is located under $AIPSROOT/ and possibly some levels deeper.
Also, a symlink in the code tree must be created such that the structure adheres to what aips++/casa expect.
This buildmode uses the makefiles called 'makefile' (lowercase m)
0) environment
make sure you have sourced the aipsinit.[c]sh script of the aips++/casa tree you want to link against
1) dealing with the makedefs
Copy the makedefs file from here (where this README is) to where you want it (read on a bit) and edit it such that the <PACKAGE>ROOT variables contain the correct paths.
You
The $AIPSPATH variable contains 4 pieces of information: the AIPSROOT, the ARCHITECTURE, the current SITE and finally the HOST on which you are running.
The makesystem of AIPS++/CASA is insane; allowing packages to be defined/changed on all levels.
The system starts by including the main 'makedefs' file, in which packages (and compilers and flags etc) can be defined.
this one pulls in (if exists) the
${AIPSROOT}/${ARCHITECTURE}/makedefs makefilefragment, which allows you to add (or change) packages, flags etc, suitable
for the current ${ARCHITECTURE}
this on in turn pulls in (if exists)
${AIPSROOT}/${ARCHITECTURE}/${SITE}/makedefs which allows for SITE-specific configuration/settings
which in turn pulls in (if exists)
${AIPSROOT}/${ARCHITECTURE}/${SITE}/${HOST}/makedefs which allows for host-specific configuration
So your package definitions may occur in any/all of these and may be overridden in any/all of these.
Put the makedefs in any of these places.
2) run fixincldir.sh
The script 'fixincldir.sh' is located in <Path>/code/jive/
If you run it it will set up the directoryhierarchy that aips++/casa expects.
Check the script for more details about this.
3) build
$> cd <Path>/code/jive/implement
$> make -f makefile OPT=1
$> cd ../../apps
$> make -f makefile OPT=1
Casacore mode
=============
In this mode the JIVE code becomes the "application" and casacore essentially a third party library. At this moment only j2ms2 and tConvert can be linked against casacore.
The makesystem of casacore is completely different from the system that aips++/casa uses and, for all practical purposes, completely useless to compile our own code with.
The quick solution was to take an existing makesystem (one that I understood) and adapt it to build the jive libraries and applications.
This buildmode uses the makefiles called 'Makefile' (uppercase M) and
supports building in 32- or 64-bit mode. See below for how to do this.
0) environment
This makesystem requires you to set an environmentvariable called 'ROOT' and make it point at <Path>/code/jive:
$> export ROOT=<Path>/code/jive
1) dealing with packages
this system also needs configuration of the packages, where they are located. all packages that _could_ be used by the system are defined in one file:
${ROOT}/system/locations.mak
you may edit but preferably not commit this changed file ;-)
2) symlink
only one symlink needs to be created:
$> cd <Path>/code/jive
$> ln -s implement jive
3) build
The make command in this step supports an optional argument:
B2B=32|64 to force compilation in the indicated mode - B2B=32 for 32 bits
(B2B is short for 'bits to build'). It is advisable to build the libs and
apps with the same setting ...
$> cd <Path>/code/jive/implement
$> make -f Makefile [B2B=32|64]
$> cd ../../apps
$> make -f Makefile [B2B=32|64]

5
code/jive/apps/2bitVV/makefile

@ -1,5 +0,0 @@
EXTRA_C++FLAGS=-fimplicit-templates
# Use the generic AIPS++ application makefile
#--------------------------------------------
include $(word 1, $(AIPSPATH))/code/install/makefile.app

42
code/jive/apps/Makefile

@ -1,42 +0,0 @@
#
# This will be the apps makefile - makes sure all apps are built
#
# Execute a gmake all in all subdirs...
#
override MAKEFLAGS := --no-print-directory --keep-going -e -f Makefile
#
# Consider only the subdirs of this directory itself
#
SUBDIRS := $(shell find . -name Makefile | sed 's+/Makefile++' | sed 's+^\./\{0,1\}++' )
ifneq ($(strip $(DONOTBUILD)),)
SUBDIRS := $(filter-out $(DONOTBUILD), $(SUBDIRS))
endif
.PHONY: all clean clobber
all:
@@echo;echo; \
echo "Not building $(DONOTBUILD)";\
for mod in $(SUBDIRS); \
do \
(cd $$mod; $(MAKE) -f Makefile all;);\
echo; \
done;
clean:
@@for mod in $(SUBDIRS); \
do \
(cd $$mod; $(MAKE) -f Makefile clean;);\
echo; \
done;
clobber:
@@for mod in $(SUBDIRS); \
do \
(cd $$mod; $(MAKE) -f Makefile clobber;);\
echo; \
done;
info:
@echo "SUBDIRS=$(SUBDIRS)"

509
code/jive/apps/fixfbs/fixfbs.cc

@ -1,509 +0,0 @@
#include <casacore/casa/BasicMath/Math.h>
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/Arrays/Slicer.h>
#include <casacore/casa/BasicSL/Complex.h>
#include <casacore/casa/Utilities/Assert.h>
#include <casacore/casa/Utilities/Regex.h>
#include <casacore/measures/Measures/Stokes.h>
#include <casacore/ms/MeasurementSets/MeasurementSet.h>
#include <casacore/ms/MeasurementSets/MSMainColumns.h>
#include <casacore/ms/MeasurementSets/MSDataDescColumns.h>
#include <casacore/ms/MeasurementSets/MSPolColumns.h>
#include <casacore/ms/MeasurementSets/MSSpWindowColumns.h>
#include <casacore/scimath/Functionals/Chebyshev.h>
#include <casacore/scimath/Mathematics/FFTServer.h>
#include <casacore/tables/Tables/TableIter.h>
#include <casacore/tables/Tables/TableParse.h>
using namespace casacore;
using namespace std;
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <map>
#include <set>
#include <sstream>
#include <stdexcept>
Double pi = 2*asin(1.0);
void fail(string s)
{
cerr << s << endl;
exit(1);
}
vector<string> split(string s){
vector<string> res;
string::size_type i=0;
while (i!=s.size()) {
while(isblank(s[i]) && i!=s.size()) {
i++;
}
string::size_type j=i;
while((!isblank(s[j])) && j!=s.size()) {
j++;
}
if (i!=j) {
res.push_back(s.substr(i,j-i));
}
i = j;
}
return res;
}
typedef vector<Double> Polycoeffs;
struct Polyset {
Double start;
Double end;
vector<Polycoeffs> delay_coeffs;
vector<Polycoeffs> phase_coeffs;
};
typedef map<String, vector<Polyset> > antenna_poly_t;
typedef map<String, antenna_poly_t> full_poly_t;
bool checky = False;
vector<Double> linfit2(Double t1, Double t2, vector<Double> a)
{
// alternate way of fitting line to poly over an integration
// PlyDly = a[1] + a[2]*(t-t0) + a[3]*(t-t0)^2 + .... + a[6]*(t-t0)^5
// where t0 = start of the poly-set,
// t1 = start of the integration period (counting from t0... thus <120s)
// t2 = end " " " " " " " " <=120s)
// lply = b[1] + b[2]*(t-t0)
vector<Double> b;
b.resize(2);
Double tmid = (t1+t2)/2.0;
// Double tint = t2-t1;
//compute poly delay at begin,midpoint,end of integ
Double tijd[3] = {t1, tmid, t2};
Double pdly[3];
for (Int j=0; j<3; j++) {
pdly[j] = a[5];
for (Int i=4; i>=0; i--) {
pdly[j] = tijd[j]*pdly[j]+a[i];
}
}
// cout << "Poly: " ;
// for (int f=0; f<6; f++) {
// cout << a[f] << " ";
// }
// cout << endl;
// cout << "t: " << tmid << endl;
//compute two kinds of slopes: connecting end points; tangent at
//mid-point m1 := (p2-p1)/tint;
Double m2 = 5*a[5];
for (Int i=4; i>=1; i--) {
m2 = tijd[2]*m2 + i*a[i];
}
b[0] = pdly[2] - tijd[2]*m2;
b[1] = m2;
Double diff[3];
for (Int i=0; i<3; i++) {
diff[i] = (b[0] + b[1]*tijd[i]) - pdly[i];
}
b[0] -= 0.63/3.0*(diff[0]+diff[1]+diff[2]); //numerical factor to ~centroid area
return b;
}
Double fbscalc (vector<Double> b, Double tint, Double lag, Double t1) {
// "integrate over" linear model over (t1,t2) modulo the integral lags to
// compute the "effective" uncompensated FBS -- here for single BW for this int
Double t2 = t1 + tint;
Double absb2 = abs(b[1]);
Double delt = absb2*tint/lag; //span of delay in [lags] over int
Double l1 = (b[0] + b[1]*t1)/lag; //delay in [lags] at begin of int
Double f1 = l1 - floor(l1+0.5); //same, WRT to closest intgral lag