pax_global_header00006660000000000000000000000064152566601760014530gustar00rootroot0000000000000052 comment=de676b9bcdd933025d524a03020c2c264e795d31 casacore-casacore-de676b9/000077500000000000000000000000001525666017600155165ustar00rootroot00000000000000casacore-casacore-de676b9/.clang-format000066400000000000000000000102221525666017600200660ustar00rootroot00000000000000--- Language: Cpp # BasedOnStyle: Google AccessModifierOffset: -1 AlignAfterOpenBracket: Align AlignConsecutiveMacros: false AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true AllowAllArgumentsOnNextLine: true AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortLoopsOnASingleLine: true AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: false AfterEnum: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false AfterExternBlock: false BeforeCatch: false BeforeElse: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 100 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: true DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeBlocks: Regroup IncludeCategories: - Regex: '^' Priority: 2 - Regex: '^<.*\.h>' Priority: 1 - Regex: '^<.*' Priority: 2 - Regex: '.*' Priority: 3 IncludeIsMainRegex: '([-_](test|unittest))?$' IndentCaseLabels: true IndentPPDirectives: None IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBinPackProtocolList: Never ObjCBlockIndentWidth: 2 ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Left RawStringFormats: - Language: Cpp Delimiters: - cc - CC - cpp - Cpp - CPP - 'c++' - 'C++' CanonicalDelimiter: '' BasedOnStyle: google - Language: TextProto Delimiters: - pb - PB - proto - PROTO EnclosingFunctions: - EqualsProto - EquivToProto - PARSE_PARTIAL_TEXT_PROTO - PARSE_TEST_PROTO - PARSE_TEXT_PROTO - ParseTextOrDie - ParseTextProtoOrDie CanonicalDelimiter: '' BasedOnStyle: google ReflowComments: true SortIncludes: false SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: c++17 StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 UseTab: Never ... casacore-casacore-de676b9/.dockerignore000066400000000000000000000000331525666017600201660ustar00rootroot00000000000000cmake-build-*/ build/ .git casacore-casacore-de676b9/.gitattributes000066400000000000000000000002361525666017600204120ustar00rootroot00000000000000# Explicitly declare text files you want to always be normalized and converted # to native line endings on checkout. *.txt text *.cc text *.tcc text *.h text casacore-casacore-de676b9/.github/000077500000000000000000000000001525666017600170565ustar00rootroot00000000000000casacore-casacore-de676b9/.github/workflows/000077500000000000000000000000001525666017600211135ustar00rootroot00000000000000casacore-casacore-de676b9/.github/workflows/docker.yml000066400000000000000000000035441525666017600231130ustar00rootroot00000000000000name: Publish Docker images on: push: branches: - 'master' tags: - 'v*' pull_request: branches: - 'master' env: REGISTRY: quay.io ORGANIZATION: casacore IMAGE: ${{ github.repository }} jobs: build_images: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Checkout repository uses: actions/checkout@v6 - name: Determine build-args id: args run: | py_major=$(echo ${{ matrix.python-version }} | cut -d'.' -f1) py_minor=$(echo ${{ matrix.python-version }} | cut -d'.' -f2) echo "PYMAJOR=${py_major}" >> "$GITHUB_OUTPUT" echo "PYMINOR=${py_minor}" >> "$GITHUB_OUTPUT" - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v6 with: flavor: prefix=py${{ steps.args.outputs.PYMAJOR }}${{ steps.args.outputs.PYMINOR }}_ images: ${{ env.REGISTRY }}/${{ env.IMAGE }} - name: Login to registry id: login uses: docker/login-action@v4 if: github.event_name != 'pull_request' with: # Credentials for robot account "github" on Quay for organization "casacore" registry: ${{ env.REGISTRY }} username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - name: Build and push docker image id: build-push uses: docker/build-push-action@v7 with: build-args: | PYMAJOR=${{ steps.args.outputs.PYMAJOR }} PYMINOR=${{ steps.args.outputs.PYMINOR }} file: docker/py_wheel.docker push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} casacore-casacore-de676b9/.github/workflows/linux.yml000066400000000000000000000016741525666017600230050ustar00rootroot00000000000000name: Linux on: push: branches: [ master ] pull_request: branches: [ master ] jobs: Linux: runs-on: ubuntu-24.04 strategy: matrix: dist: - ubuntu2404_clang - ubuntu2404_gcc - ubuntu2604_clang - ubuntu2604_gcc steps: - name: Checkout uses: actions/checkout@v6 - name: Build container run: docker build . -t ${{ matrix.dist }} -f docker/${{ matrix.dist }}.docker - name: Test run: docker run --rm ${{ matrix.dist }} /bin/bash -c 'cd /code/build && ctest --output-on-failure' Format: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v6 - name: Build container run: docker build . -t ubuntu2604_format -f docker/ubuntu2604_format.docker - name: Check formatting run: docker run --rm ubuntu2604_format /bin/bash -c 'cd /code && scripts/run-format.sh' casacore-casacore-de676b9/.github/workflows/osx.yml000066400000000000000000000044331525666017600224530ustar00rootroot00000000000000name: macOS on: push: branches: [master] tags: ["*"] pull_request: branches: [master] jobs: osx: runs-on: ${{matrix.os}} strategy: fail-fast: false matrix: os: - macos-15-intel # x86-64 (will retire in Fall 2027) - macos-15 # arm64 steps: - name: checkout uses: actions/checkout@v6 - name: install dependencies, set python environment run: | # Delete GitHub Python, See https://github.com/orgs/Homebrew/discussions/3895#discussioncomment-4130560 find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -print -delete brew install bison fftw hdf5 boost-python3 numpy cfitsio wcslib gsl ninja gcc libdeflate # ensure we use homebrew python and gcc export PATH=$(brew --prefix python)/bin:${PATH} export PATH=$(brew --prefix gcc)/bin:${PATH} export PATH="$(brew --prefix bison)/bin:$PATH" echo PATH=$PATH | tee -a $GITHUB_ENV - name: set up build and install dir with WSRT measures run: | wget https://iers.astron.nl/WSRT_Measures.ztar -O WSRT_Measures.ztar mkdir -p build install cd build tar zxvf ../WSRT_Measures.ztar rm ../WSRT_Measures.ztar - name: configure run: | cd build cmake \ -G Ninja \ -DCMAKE_Fortran_COMPILER=$(which gfortran) \ -DCMAKE_PREFIX_PATH=/usr/local/ \ -DBoost_NO_BOOST_CMAKE=True \ -DBUILD_TESTING=ON \ -DBUILD_PYTHON=OFF \ -DBUILD_PYTHON3=ON \ -DPython3_EXECUTABLE=$(which python3) \ -DUSE_HDF5=ON \ -DUSE_OPENMP=OFF \ -DDATA_DIR=. \ -DCMAKE_INSTALL_PREFIX=../install \ .. - name: make run: cmake --build build - name: run tests run: | cd build export ctest_args="" # disable tests on amd64 https://github.com/casacore/casacore/issues/1352 if [[ "$(uname -m)" == "arm64" ]]; then export ctest_args="-E tLSQaips|tLSQFit" fi CTEST_OUTPUT_ON_FAILURE=1 ctest $ctest_args - name: install run: | cmake --build build --target install casacore-casacore-de676b9/.gitignore000066400000000000000000000002031525666017600175010ustar00rootroot00000000000000doc/html/ build/ *~ *table.lock *CMakeCache.txt *CMakeFiles .project .cproject .settings .vscode WSRT_Measures.ztar sofa.tgz sofa/ casacore-casacore-de676b9/CHANGES.md000066400000000000000000000342151525666017600171150ustar00rootroot00000000000000# 3.8.2 (29 September 2026) ## General - Methods in `casacore::String` that are not compatible with `std::string` have been deprecated and will be removed in the next casacore release: #1495 - The Fallible class has been deprecated in favour of std::optional: #1506 - Macros that depend on the name of the casacore::String class have been rewritten using generic functions: #1501, #1510, #1511, #1512 - Casacore code is now formatted using clang-format. - The CountedPtr class has been removed and replaced by std::shared_ptr. - Unit tests can now be run as root inside a Docker container: #1526 - The default C++ standard is now C++20: #1486 - Fixed operator!= in `LCLattice` causing problems in C++20 mode: #1525 - Fixed various compiler warnings: #1507, #1532 - Fixed handling of the IAU2000 APP frame bias, which caused slightly inaccurate JNAT–APP and J2000–APP conversions: #1464 - Updated the Measures URL to the latest recommended path. - Use `READLINE_INCLUDE_DIRS` to fix build failures on certain systems: #1487 # 3.8.1 (24 June 2026) ## General - Fix performance regression - avoid/defer construction of instances in MCFrame: #1454 - Cleanup and improvement of AlwaysAssert and DebugAssert: #1467 - Clean up the Block class and deprecate the PtrBlock class: #1471 - Remove Block::prohibitChangingAllocator() and Block::permitChangingAllocator() as they were not used. - Switch to new EOP files for Measures: #1476 ## Storage manager related - Fix read/write of array Adios2StMan columns by rows - Added write-after-read mode in Sisco: #1463 - Fixes in StokesIStMan: #1469 - Added a Sisco Stokes I mode: #1470 - Build Sisco by default: #1481, #1483. Note: this requires a compiler that supports C++20, and libdeflate >= 1.19. # 3.8.0 ## General - Updates for compatibility with more recent compiler versions: #1418, #1419, #1435 - Updates related to measures data tarball: #1413, #1429, #1411 - Improvements to thread safety, particularly in Measures: #1421, #1422, #1423, #1425, #1426, #1430, #1424, #1431 - Improvements to MSConcat: #1433, #1443 - Fix math within FFTServer for non-integer shifts: #1282 - Avoid overflow in LatticeStatistics: #1441 - Various small improvements: #1428, #1437, #1444, #1445, #1412 ## Storage manager related - Fix an indexing bug in DataManInfo::removeDminfoColumns: #1410 - Allow MPI data updates to tiled column data: #1308 - New storage manager named Sisco for (simulated) data without noise: #1436, #1438, #1439, #1446, #1447 - Improve metadata compression: #1409 # 3.7.1 - Fix an issue in 'Stokes I Storage manager' when used on boolean columns (flag column): #1407 - Fix a bug in Dysco when antenna indices are swapped: #1406 # 3.7.0 ## Highlights - Add new storage managers which losslessly compress data #1385, #1394, #1395, #1398, #1399, #1396, #1397, #1400 - Improvements to FITS-IDI / MSFits conversions #1370, #1373, #1384, #1386 - Switch to C++17 and use some of its features #1346 ## General - Solved various issues with newer compilers and boost versions #1365, #1374, #1377, #1379, #1401 - Fixed memory issues #1391, #1402 - Build system improvements #1368, #1357, #1375, #1376 # 3.6.1 - Use the latest numpy for dockers; this should make python-casacore compatible with numpy 2.0. # 3.6.0 ## General - Improvements on FITS import and export (#1215, #1229, #1251, #1267, #1268, #1304, #1318, #1341) - Small improvements to Dysco (#1305, #1313, #1337, #1343) - C++ modernizations (#1185, #1199, #1271, #1280, #1284, #1288, #1289, #1294, #1296, #1298, #1309, #1316, #1353, #1355) - Build system and CI improvements (#1219, #1236, #1252, #1315, #1328, #1330, #1334, #1335, #1349) - Code cleanup (#1204, #1245, #1269, #1277, #1279, #1300, #1301, #1302) - TaQL improvements (#1221, #1232, #1244, #1247, #1259, #1260, #1263, #1270, #1276, #1299) - Add new SI prefixes quetta, ronna, ronto and quecto (#1257) - Fix several issues that arose in CASA use (#1200, #1227, #1246, #1262, #1290, #1291, #1292, #1329, #1323) - Fix data race in images toWord / toPixel (#1235) - Update e-mail address (#1339) # 3.5.0 ## Highlights Apart from many bug fixes and modernizations, a few new features were introduced: - TaQL now supports copying columns to new columns (e.g. to make a backup of the `FLAG` column) - Non-zero coordinates in JPL frames, e.g. the `SUN` frame, are now interpreted as an offset in right ascension and declination. Previously, coordinates in a JPL coordinate frame were ignored. - The Dysco storage manager is now built by default as part of casacore. ## General - Improve continuous integration (#1180, #1182), move from Travis CI to Github Actions (#1086, #1097, #1098, #1161) - Modernizations: remove Mutex (#1095, #1127, #1128), typing system (#1172, #1176) - Allow building with newer compilers (#1134, #1137, #1145, #1206, #1208, #1210, #1211) - Build python3 by default, not python2 (#1209) ## MeasurementSet - Improve reading of DataDescriptionId (#1103) - Compute feed information (#1104) and field attributes (#1109) on demand - UVFits improvements: support X-Y mounts (#1115), allow large antenna numbers (#1144), fix handling FITS-IDI `GAIN_CURVE` (#1151) - Fix precision in `T+dT` syntax (#1118) ## Measures - Allow offsets to JPL coordinates (#1160) ## Tables - Cache iteration boundaries while sorting tables (#1106) - Use RefTable for iteration (#1108) - Adios2 related changes: #1110, #1116, #1121, #1148 - Make Dysco part of casacore (#1117, #1125, #1146, #1166) - Add TaQL commands `LIKE`, `COPYCOLUMN` and `DROPTABLE` (#1154, #1169) - Fix one bug in `rownr_t` migration for TiledDataStMan (#1156) - Improve documentation (#1192) ## Images - Support CARTA opening images with a custom handler (#1158) - Allow easier python handling of beams (#1184) # 3.4.0 ## General - Major modernization of Arrays, bringing it more in line with C++11 (#1012) - Use std::regex (#1072) - Remove many warnings (#1024, #1036, #1062) - Use FFTW as default FFT provider (#1029, #1047, #1049) - UVFITS improvements (#1033, #1040, #1064, #1066, #1067) - Support for 64-bit row numbers. # 3.3.0 ## General - Replace implementation of complex trig functions by std:: (#1010) - Fix bug SciMath / StatsFramework where parameters were passed incorrectly (#984) ## Tables - Pass sorting algorithm optio nthrough to table iterator (#992) - Support for ADIOS2 (#1006) - Add .casarc option to disable table locking (#1002) ## Measurement Set / UVFits - Fix antenna swapping in MSConcat (#977) - Merge PROCESSOR table in MSConcat (#1004) - Fix antenna positions in importing old VLA UVFITS (#1005) ## Images - More efficient WCS batch coordinate lookups (#932) # 3.2.1 - Increment the SO version, otherwise identical to 3.2 (#981) # 3.2 ## General - Remove some unused functionality (#854, #947) - Prevent setting OpenMP num_threads to zero (#962) ## Tables - Fix locking issue with IncrementalStorageManager (#970, #974) - Various improvements to TaQL - Various ADIOS2 improvements (#943, #966) ## Measures - Update hardcoded URLs for fetching measures data (#975) ## FITS - Correctly convert Nasmyth mount types (#946, #954) # 3.1.2 - Bump version in version.h (since in 3.1.1 it was still at '3.1.0') # 3.1.1 ## General - Only use DataManager.get/putSlice if possible (#901) - User docker for Linux build on Travis for CI (#856) - improve unicode support (#853) - Changed MadfmFunc so that it inherits from ArrayFunctorBase (#905) - Fix memory leak in TableProxy::getColumnDescription (#900) - Allow colon and fix recursive bison parsing (#894) - ObjectID's hash function behavior fix (#897) - Add a public getter for the mask array to LCRegionFixed (#895) - Replace STL-like containers by their STL counterparts (#890) ## Python support - Boost 1.67 Python components require a Python version suffix (#844) - Handle numpy Unicode arrays (#912) - Fix memory leak when converting Python unicode to casa string (#910) - Possible leak bug (#908) - Always use TpInt64 for PyLong (#916) - Improve CMake FindPython (#922) ## Build system - Travis macOS fails on Python3 OSX build system (#778) - Switch travis to docker /xenial (#847) # 3.1 ## General - Removed many warnings issued by newer compiler versions (#798, #809, #819, #820, #866, #883) - Further improved thread-safety (#817, #869, #877, #886) - Added variance and standard deviation of complex numbers (#851) ## Tables - Improved parallel storage manager based on ADIOS2 - Support of Int64 table columns (#859) - Added O_DIRECT support when using MultiFile (#885) - TaQL improvements (#813, #851, #867) - Small CTDS fixes (#840, #868) ## Measurement Set - Small improvements (#858, #864, #872) - Better handling of FITS-IDI data bit sampling (#836) ## Images - Support for non-chunked HDF5 data sets (#879, #880) - Fixed count overflow on very large images (#849) # 3.0 ## General - Building with C++11 is now required - Improved thread-safety of statics (#775) - Improve statistics code (#785, #776, #662, #663) ## Tables - Avoid growing the size of tables when overwriting data (#768) - TaQL support for radial velocity, earth magnetic field and Doppler (#750) - Added performance tests for tables (#658) ## Measurement Set - Improvements to MSConcat (#779, #701) - Better handling of FITS-IDI flag history (#748) ## Images - Better support for double precision images (#752, #751) ## Other - A full list of changes can be found on the [issue tracker](https://github.com/casacore/casacore/milestone/8?closed=1). # 2.4.1 ## General - This release fixes a bug where TableIterator would skip a row # 2.4.0 ## General - Bug fixes and improvements - This version can be used to compile CASA 5.0 - Improved error checking when parsing dates/times (#619) - Statistics: allow data provider to specify number of threads (#645) ## MS - Disable caching of MS main table columns (#597) - Properly copy the `SIGMA_SPECTRUM` column, if present (#599) - Implement getTimesForSpws (#600) ## FITS and FITS-IDI - Implement digital corrections for DiFX/VLBA (#602) - Several improvements for WEIGHTS when reading FITS-IDI (#590, #608) - Parallactic angle calculation for Nasmyth mounts (#627) - Modernised matrix syntax in FITS files now follows standard 3.0 (#606) # 2.3.0 ## General - Bug fixes and improvements - Improved installation documentation in README - Add an option to use Ccache (`-DUseCcache`) (#549) - Add some statistics functionality (#569) ## Python - Make some of the TableProxy functionality publicly available (#559) - Make version checking from python (or plain C) possible (#583) ## TaQL - Fix transpose in TaQL (#563) - Added functions `delay` and `uvwapp` to `mscal` (#562) ## FITS - MSFitsOutput now writes ant diams (#536) - Improvements to FITS-IDI conversion (#538, #590, #579) # 2.2.0 ## General - Lots of bug fixes and improvements - Tests are not built by default anymore, use `-DBUILD_TESTING=True` to build them - Building with C++11 is now default, use `-DCXX11=False` if you do not have a recent compiler (#533) - Added JSON support (#506) ## TaQL - Major improvements in TaQL, such as masked arrays, new commands `ALTER TABLE`, `SHOW TABLE`, `HELP` (#388) ## Images - ImageConcat and ImageExpr now use JSON export (#517) # 2.1.0 ## General - Lots of code improvement, optimization and added tests ## Measures - The default search path for measures data is now smaller. The path can be set at cmake time by specifying `-DDATA_DIR=/path/to/data`. This path can contain `%CASAROOT%` which is expanded at run time, to support relocatable installations. The measures path can also still be set in `.casarc`. (#277) - Inserted fix to leap second handling problem (#290) - Various coordinate performance improvements (#258) ## Tables - Renamed showtable to showtableinfo (#320) - Added several TaQL functions (#229) ## MS - Improve testing of MSSummary (#330) - Many improvements for the MS related functions (#318, #291, #228, #208, ...) - Fix multithreaded MS creation (#298) ## Python - Build python bindings by default (not for CASA build) - Add experimental Python3 support. Read the README for instructions (#280) - Changed behavior from 2.0.3: Use PYTHON2_* configuration options to set your python2 interpreter. (#280) # 2.0.3 ## General - Merge of CASA work into casacore, CASA should compile with casacore now - Under-the-hood optimizations, like using allocator features (#132) - Building with gcc 5 is now possible (#166) - Compatibility with more versions of wcslib and cfitsio - SOFA is now an external dependency (#105) ## Tables - Arrays can now sometimes be reshaped while keeping allocated memory (#113) ## MS - Selection of baselines with a regexp between stations is now possible (#99) - Several new methods to MSMetaData (#138) ## Bug fixes - Fix a bug which caused an error with LOFAR measurement sets with the LOFAR tool msoverview (#140) - Fix a bug where TaQL would not write output when an expression was used (#184) # 2.0.2 This version was not released # 2.0.1 changes since 2.0.0 ## Bug fixes - Does not build if checkout root folder is not named casacore (#79) # 2.0.0 changes since 1.7.0 ## General - Fixed all build problems for GCC and clang on various platforms (up to OS-X 10.10) - Fixed all valgrind issues found in test programs - Made the statics in all of casacore thread-safe. Similar to libstdc++ the user is responsible for thread-safety when using casacore ojbects. - Added casacore/ to the #include path of all header files - Changed namespace from casa to casacore (but still #defined as casa for time being) - Split Tables, MeasurementSets and Lattices into smaller parts - The 3 changes above give rise to backward incompatibilities. Scripts in casacore/changescripts (notably updateall) can be used to fix client code. ## Tables - Added GROUPBY/HAVING/aggregation function to TaQL - Optimized TaQL's IN operator (linear time for integer sets) - Added table tracing (class TableTrace) - Fixed TiledStMan issue where BucketCache was not shrinked - Added MultiFile option to combine table files in a single one ## Components - This module has been removed (too CASA specific) ## Images - Added support for beam per frequency channel and Stokes - Added persistency for ImageExpr and ImageCocat objects ## Python - Moved converters from pyrap to casacore/Python casacore-casacore-de676b9/CMakeLists.txt000066400000000000000000000631521525666017600202650ustar00rootroot00000000000000cmake_minimum_required (VERSION 3.14.0) project(casacore VERSION 3.8.2) include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) include(CheckFunctionExists) include(CheckCXXSourceCompiles) include(cmake/PCHSupport.cmake) # Fixes warnings on cmake 3.x+ about missing extensions if (POLICY CMP0115) cmake_policy (SET CMP0115 NEW) endif() # Enable _ROOT variables for recent versions of CMake if (POLICY CMP0074) cmake_policy (SET CMP0074 NEW) endif() # Use LOCATION as Python find strategy. if (POLICY CMP0094) cmake_policy (SET CMP0094 NEW) endif() # Increment the PROJECT_SOVERSION every time you update VERSION_MINOR! SET(PROJECT_SOVERSION 9) SET(NO_SOVERSION FALSE CACHE BOOL "do not add version information to shared libraries") set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_NAME "casacore") set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") set(CPACK_PACKAGE_CONTACT "Malte Marquarding") #required set(CPACK_PACKAGE_VENDOR "https://github.com/casacore/casacore") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Astronomical data processing library") set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # By default build only Python3 bindings option (BUILD_PYTHON "Build the python2 bindings" NO) option (BUILD_PYTHON3 "Build the python3 bindings" YES) option (BUILD_DEPRECATED "build and install deprecated classes (such as Map)" NO) option (BUILD_FFTPACK_DEPRECATED "build FFTPack" NO) option (BUILD_DYSCO "Build the Dysco compression storage manager" YES) option (BUILD_SISCO "Build the Sisco compression storage manager" YES) # By default build shared libraries option (ENABLE_SHARED "Build shared libraries" YES) option (ENABLE_RPATH "Include rpath in executables and shared libraries" YES) # Check if O_DIRECT is available. # Note this does not work well with check_c_source_compiles. check_cxx_source_compiles(" #include main() { int i = O_DIRECT; } " HAVE_O_DIRECT) if (HAVE_O_DIRECT) add_definitions(-DHAVE_O_DIRECT) endif() # By default do not use ADIOS2, HDF5 option (ENABLE_TABLELOCKING "Make locking for concurrent table access possible" YES) option (USE_READLINE "Build readline support" YES) option (USE_ADIOS2 "Build ADIOS2 " NO) option (USE_HDF5 "Build HDF5 " NO) option (USE_THREADS "Use Mutex thread synchronization" YES) option (USE_OPENMP "Use OpenMP threading" NO) option (USE_MPI "Use MPI for parallel IO" NO) option (USE_STACKTRACE "Show stacktrace in case of exception" NO) option (CASA_BUILD "Building in the CASA (http://casa.nrao.edu) environment" NO) set(CASA_DEFAULT_ALIGNMENT "32" CACHE STRING "Default alignment of casa::AlignedAllocator") # ccache use is optional option( UseCcache OFF ) if (UseCcache) message (STATUS "Searching for ccache.") find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) message (STATUS "Ccache found.") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif(CCACHE_FOUND) endif() # basic setup for building within CASA environment if( CASA_BUILD ) if( NOT DATA_DIR ) set(DATA_DIR "%CASAROOT%/data") endif( ) set(USE_OPENMP ON) set(USE_THREADS ON) set(BUILD_FFTPACK_DEPRECATED ON) set(BUILD_PYTHON OFF) set(Boost_NO_BOOST_CMAKE 1) if (EXISTS "/opt/casa/02/include/python2.7") ### RHEL7 set(PYTHON_LIBRARY "/opt/casa/02/lib/libpython2.7.so") set(PYTHON_INCLUDE_DIR "/opt/casa/02/include/python2.7") set(NUMPY_INCLUDE_DIRS "/opt/casa/02/lib/python2.7/site-packages/numpy/core/include") set(PYTHON_EXECUTABLE:FILEPATH "/opt/casa/02/bin/python") if (EXISTS "/usr/include/boost") set(BOOST_ROOT "/usr") endif( ) set(WCSLIB_INCLUDE_DIR "/opt/casa/02/include") set(WCSLIB_LIBRARY "/opt/casa/02/lib/libwcs.so") set(PYTHON2_NUMPY_INCLUDE_DIRS "/opt/casa/02/lib/python2.7/site-packages/numpy/core/include") elseif (EXISTS "/opt/casa/01/include/python2.7") ### RHEL7 set(PYTHON_LIBRARY "/opt/casa/01/lib/libpython2.7.so") set(PYTHON_INCLUDE_DIR "/opt/casa/01/include/python2.7") set(PYTHON_EXECUTABLE:FILEPATH "/opt/casa/01/bin/python") if (EXISTS "/usr/include/boost") set(BOOST_ROOT "/usr") endif( ) elseif(EXISTS "/usr/lib64/casa/01/include/python2.7") ### RHEL5/RHEL6 set(PYTHON_LIBRARY "/usr/lib64/casa/01/lib/libpython2.7.so") set(PYTHON_INCLUDE_DIR "/usr/lib64/casa/01/include/python2.7") set(PYTHON_EXECUTABLE:FILEPATH "/usr/lib64/casa/01/bin/python") if (EXISTS "/usr/lib64/casa/01/include/boost") ### RHEL5 set(BOOST_ROOT "/usr/lib64/casa/01") elseif (EXISTS "/usr/include/boost") ### RHEL6 set(BOOST_ROOT="/usr") endif( ) endif( ) endif( ) # Test if shared libraries have to be built. if (ENABLE_SHARED) option (BUILD_SHARED_LIBS "" YES) if (ENABLE_RPATH) # Set RPATH to use for installed targets; append linker search path set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" ) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_MACOSX_RPATH TRUE) endif (ENABLE_RPATH) if( CASA_BUILD ) option(NO_SOVERSION "Build shared libraries without version information" NO) if( NOT NO_SOVERSION ) set( epochdelta 1385614800 ) execute_process( COMMAND perl -e "$t=time( )-${epochdelta};$z=$t & 0xff; $y=($t>>8)&0xff; $x=($t>>16)&0xffff; print \"$x.$y.$z\"" OUTPUT_VARIABLE __casa_soversion ) set(casa_soversion ${__casa_soversion} CACHE STRING "version for shared objects") message( STATUS "Shared object version number ${casa_soversion}" ) file( WRITE ${CMAKE_INSTALL_PREFIX}/casa_sover.txt "# generated by casacore/CMakeList.txt... Do not edit\n" "${casa_soversion}\n" ) else( ) message( STATUS "User disabled shared library versioning" ) endif( ) endif( ) else() option (BUILD_SHARED_LIBS "" NO) endif (ENABLE_SHARED) if (UseCasaNamespace) add_definitions (-DUseCasaNamespace) message (STATUS "Using namespace casa. This will be deprecated at some point.") else () message (STATUS "Using namespace casacore.") endif () # Define the compiler flags to be used. # Note: -Wshadow and -Wunreachable-code give (too) many warnings. # Casacore uses longlong, so no warnings for it. # Clang gives warning on bison generated code; disable unneeded-internal-declaration. if (NOT CMAKE_CXX_FLAGS) set (CMAKE_CXX_FLAGS "-Wextra -Wall -W -Wpointer-arith -Woverloaded-virtual -Wwrite-strings -pedantic") #SET(CMAKE_CXX_FLAGS="-g -O0 -Wall -Wextra -Wshadow -Wunused-variable # -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers # -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs # -ftest-coverage -Wold-style-cast -Weffc++ -Wconversion") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unneeded-internal-declaration") endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") endif (NOT CMAKE_CXX_FLAGS) # Set build type if not given. if (NOT CMAKE_BUILD_TYPE) # Use debug mode if building in dbg or debug directory. get_filename_component(_cmpvar ${CMAKE_BINARY_DIR} NAME) if(_cmpvar STREQUAL "dbg" OR _cmpvar STREQUAL "debug") set (CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAIPS_DEBUG") else() if(_cmpvar STREQUAL "cov") set (CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage") set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} --coverage") else() set (CMAKE_BUILD_TYPE Release) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG") endif(_cmpvar STREQUAL "cov") endif(_cmpvar STREQUAL "dbg" OR _cmpvar STREQUAL "debug") endif (NOT CMAKE_BUILD_TYPE) # We need a C++-20 compatible compiler set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Ensure clang is not complaining about unused arguments. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "-Qunused-arguments ${CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS "-Qunused-arguments ${CMAKE_C_FLAGS}") endif() # Since 2015, we need pread and pwrite (POSIX 2001) check_function_exists(pread HAVE_PREAD) check_function_exists(pwrite HAVE_PWRITE) if (NOT (HAVE_PREAD AND HAVE_PWRITE)) message(FATAL_ERROR "Casacore requires pread and pwrite functionality" ) endif (NOT (HAVE_PREAD AND HAVE_PWRITE)) # Since 2020, we need GCC 4.9 for regex support # Additionally we need cmake 2.8.10 for CMAKE_CXX_COMPILER_VERSION if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) message(FATAL_ERROR "Casacore requires at least gcc-4.9") endif() # FindHDF5 uses environment variables, so set it if needed. if (HDF5_ROOT_DIR) set (ENV{HDF5_ROOT} ${HDF5_ROOT_DIR}) endif (HDF5_ROOT_DIR) # Find out which modules to build. if (NOT MODULE) set (MODULE all) endif (NOT MODULE) set (_uselapack NO) set (_usefortran NO) set (_usefits NO) set (_usewcs NO) set (_modules casa) set (_modules2 ) if (NOT ${MODULE} STREQUAL "casa") set (_modules ${_modules} tables) if (NOT ${MODULE} STREQUAL "tables") set (_modules ${_modules} scimath_f scimath measures meas) set (_uselapack YES) set (_usefortran YES) if (NOT ${MODULE} STREQUAL "measures") if (${MODULE} STREQUAL "ms") set (_modules ${_modules} ms derivedmscal) endif() if (${MODULE} STREQUAL "msfits" OR ${MODULE} STREQUAL "all") set (_modules2 ${_modules2} ms msfits derivedmscal) set (_usefits YES) endif() if (${MODULE} STREQUAL "images" OR ${MODULE} STREQUAL "all") set (_modules2 ${_modules2} lattices mirlib coordinates images) set (_usewcs YES) set (_usefits YES) endif() endif() endif() endif() if (_usefits) set (_modules ${_modules} fits) endif() set (_modules ${_modules} ${_modules2}) if (BUILD_PYTHON) set (_modules ${_modules} python) endif (BUILD_PYTHON) if (BUILD_PYTHON3) set (_modules ${_modules} python3) endif (BUILD_PYTHON3) # Determine which external packages to use. include (CTest) if (_usefortran) enable_language (Fortran) # use faster fortran rules for complex operations, removes restoring complex # infinities if naive computation results in NAN + NAN * I #Handling complex multiplication and division with correct treating of complex #infinities (one element Inf regardless of the other) according to the C is #complicated. #E.g. a = NaN + 1e30 i; a * a is not NaN but a complex infinity (-Inf - NaN). # #Treating this situation correctly has large performance impact. In GCC's #implementation it is about 4 times slower than the naive implementation, with #vectorization enabled the impact is even larger. #As correct treatment of complex infinities when NaN appear in results is seldom #accounted for, or not required and most other languages do not have these #rules, the correct treatmeant can be disabled with the -fcx-fortran-rules flag. #This changes the semantics to those of the FORTRAN language which is removes #the need for rescuing the result when NaN appear. Python also follows FORTRAN #rules. #Additionally the correct behavior is not implemented in all compilers, #most notably clang which is the default compiler on MacOS. So turning off #correct treatment with GCC does not only make our code faster but also behave #the same on more compilers. # #This has measurable impact on e.g. applycal where the cpu performance improves #by about 20%. # For one reason or another the check on the compiler flag has no # effect; it still adds the option which fails for clang. if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") check_cxx_compiler_flag(-fcx-fortran-rules HAS_GXX_FORTRAN_RULES) check_c_compiler_flag(-fcx-fortran-rules HAS_GCC_FORTRAN_RULES) # added before cmake flags so it can be disabled with # -fno-cx-fortran-rules for testing if (HAS_GXX_FORTRAN_RULES) set(CMAKE_CXX_FLAGS "-fcx-fortran-rules ${CMAKE_CXX_FLAGS}") endif() if (HAS_GCC_FORTRAN_RULES) set(CMAKE_C_FLAGS "-fcx-fortran-rules ${CMAKE_C_FLAGS}") endif() endif() endif() find_package (DL) if (USE_READLINE) find_package (Readline REQUIRED) endif (USE_READLINE) if (BUILD_TESTING) find_package (SOFA) endif() if (USE_ADIOS2) find_package (ADIOS2 2.6.0 CONFIG REQUIRED) if(NOT USE_MPI) set(CASACORE_ADIOS_LIBRARY adios2::cxx11) elseif (NOT ADIOS2_HAVE_MPI) message(FATAL_ERROR "ADIOS2 found without MPI support but MPI support requested") else() set(CASACORE_ADIOS_LIBRARY adios2::cxx11_mpi) endif() endif (USE_ADIOS2) if (USE_HDF5) find_package (HDF5 REQUIRED) endif (USE_HDF5) find_package (FLEX REQUIRED) find_package (BISON 3 REQUIRED) if (_uselapack STREQUAL YES) find_package (BLAS REQUIRED) find_package (LAPACK REQUIRED) if (FFTW3_DISABLE_THREADS) find_package (FFTW3 COMPONENTS single double REQUIRED) else() find_package (FFTW3 COMPONENTS single double threads REQUIRED) endif (FFTW3_DISABLE_THREADS) endif (_uselapack STREQUAL YES) if (_usefits STREQUAL YES) find_package (CFITSIO 3.030 REQUIRED) # Should pad to three decimal digits endif (_usefits STREQUAL YES) if (_usewcs STREQUAL YES) # find_package (WCSLIB 4.20 REQUIRED) find_package (WCSLIB 4.7 REQUIRED) # needed for CASA if (WCSLIB_VERSION_STRING STREQUAL "5.14") # WCSlib 5.14 throws segfaults on lots of tests, e.g. tTempImage message(WARNING "Casacore is not compatible with wcslib 5.14, see issue gh-384.") endif (WCSLIB_VERSION_STRING STREQUAL "5.14") endif (_usewcs STREQUAL YES) # Set the include directories and HAVE compiler variables include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) if (BUILD_DYSCO) add_definitions(-DHAVE_DYSCO) endif (BUILD_DYSCO) if (BUILD_SISCO) add_definitions(-DHAVE_SISCO) endif (BUILD_SISCO) if (WCSLIB_FOUND) include_directories (SYSTEM ${WCSLIB_INCLUDE_DIRS}) add_definitions (-DWCSLIB_VERSION_MAJOR=${WCSLIB_VERSION_MAJOR} -DWCSLIB_VERSION_MINOR=${WCSLIB_VERSION_MINOR}) endif (WCSLIB_FOUND) if (CFITSIO_FOUND) include_directories (SYSTEM ${CFITSIO_INCLUDE_DIRS}) add_definitions (-DCFITSIO_VERSION_MAJOR=${CFITSIO_VERSION_MAJOR} -DCFITSIO_VERSION_MINOR=${CFITSIO_VERSION_MINOR}) endif (CFITSIO_FOUND) if (Boost_FOUND) include_directories (SYSTEM ${Boost_INCLUDE_DIRS}) add_definitions(-DHAVE_BOOST) endif (Boost_FOUND) if (ADIOS2_FOUND) include_directories (SYSTEM ${ADIOS2_INCLUDE_DIRS}) add_definitions(-DHAVE_ADIOS2) endif (ADIOS2_FOUND) if (HDF5_FOUND) # Use BEFORE to achieve that HDF5 is not taken from /usr/local/include ##include_directories (BEFORE SYSTEM ${HDF5_INCLUDE_DIRS}) include_directories (SYSTEM ${HDF5_INCLUDE_DIRS}) add_definitions(-DHAVE_HDF5) endif (HDF5_FOUND) include_directories (SYSTEM ${FFTW3_INCLUDE_DIRS}) add_definitions(-DHAVE_FFTW3) if (NOT FFTW3_DISABLE_THREADS) add_definitions(-DHAVE_FFTW3_THREADS) endif (NOT FFTW3_DISABLE_THREADS) if (DL_FOUND) add_definitions(-DHAVE_DL) endif (DL_FOUND) if (READLINE_FOUND) include_directories (SYSTEM ${READLINE_INCLUDE_DIRS}) add_definitions(-DHAVE_READLINE) endif (READLINE_FOUND) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") ## setting intel libraries with e.g. ## ## find_library( INTEL_IRNG irng HINTS ${INTEL_PATH} ) ## ## causes CMAKE to substitute fully qualified paths which makes ## python shared object unrelocatable in the case of libirng.so ## get_filename_component(INTEL_PATH ${CMAKE_CXX_COMPILER} DIRECTORY) set(INTEL_LIB_PATH ${INTEL_PATH}/../lib/intel64) set(CASACORE_ARCH_LIBS ${CASACORE_ARCH_LIBS} -L${INTEL_LIB_PATH} -limf -lsvml -lirng -lintlc -lifport -lifcore -liomp5) endif() if(USE_MPI) find_package(MPI COMPONENTS C REQUIRED) include_directories (SYSTEM ${MPI_C_INCLUDE_PATH}) add_definitions(-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX) add_definitions(-DHAVE_MPI) set(ENABLE_TABLELOCKING OFF) set(CASACORE_MPI_LIBRARY ${MPI_C_LIBRARIES}) message (STATUS "ENABLE_TABLELOCKING is turned off as required by MPI") endif(USE_MPI) if(USE_OPENMP) set (USE_THREADS YES) find_package (OpenMP) if (OPENMP_FOUND) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopenmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qopenmp") else( ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") endif( ) else (OPENMP_FOUND) message(WARNING "Cannot fullfill USE_OPENMP, compiler does not support it") endif (OPENMP_FOUND) endif() # Thread support? if(USE_THREADS) set(_errmsg "FIXME: Don't know how to enable thread support for ") find_package(Pthreads REQUIRED) add_definitions(-DUSE_THREADS) if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") else() if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") else() message(FATAL_ERROR "${_errmsg} (${CMAKE_C_COMPILER_ID}): ${CMAKE_C_COMPILER}") endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") endif(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") else() if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") else() message(FATAL_ERROR "${_errmsg} (${CMAKE_C_COMPILER_ID}): ${CMAKE_CXX_COMPILER}") endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") endif(CMAKE_COMPILER_IS_GNUCXX) else() # Compile with -fno-threadsafe-statics if supp to reduce some thread safety overhead. check_cxx_compiler_flag(-fno-threadsafe-statics HAS_CXX_NO_THREADSAFE_STATICS) if (HAS_CXX_NO_THREADSAFE_STATICS) set(CMAKE_CXX_FLAGS "-fno-threadsafe-statics ${CMAKE_CXX_FLAGS}") endif() check_c_compiler_flag(-fno-threadsafe-statics HAS_C_NO_THREADSAFE_STATICS) if (HAS_C_NO_THREADSAFE_STATICS) set(CMAKE_C_FLAGS "-fno-threadsafe-statics ${CMAKE_C_FLAGS}") endif() endif(USE_THREADS) # Set default DATA_DIR if undefined. if (NOT DATA_DIR) set (DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/casacore/data) endif (NOT DATA_DIR) # Let cmake cache DATA_DIR. set (DATA_DIR "${DATA_DIR}" CACHE PATH "Measures tables root") # Set compiler flag if deprecated Casacore header files are allowed. if (BUILD_DEPRECATED) add_definitions(-DAIPS_USE_DEPRECATED) endif () # Set compiler flag if no table locking. if (NOT ENABLE_TABLELOCKING) add_definitions(-DAIPS_TABLE_NOLOCKING) endif (NOT ENABLE_TABLELOCKING) # Set compiler flag if stack tracing. if(USE_STACKTRACE) add_definitions(-DUSE_STACKTRACE) endif(USE_STACKTRACE) # Enable cmake testing and add make check target that builds and runs the test enable_testing() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) # This legacy flag always builds the tests and runs them with make test. There # seems to be no good way to make test executable depend on the test target if (NOT BUILD_TESTING) set(EXCL_ALL EXCLUDE_FROM_ALL) endif (NOT BUILD_TESTING) # Determine the SOVERSION and define as compile variable. if (casa_soversion) set (LIB_VERSION "${casa_soversion}") set (LIB_SOVERSION "${casa_soversion}") set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" ) else( ) set (LIB_VERSION "${PROJECT_SOVERSION}") set (LIB_SOVERSION "${PROJECT_SOVERSION}") endif( ) # Add the modules to be built. add_subdirectory (build-tools) foreach (module ${_modules}) add_subdirectory (${module}) set_target_properties( casa_${module} PROPERTIES VERSION "${LIB_VERSION}" SOVERSION "${LIB_SOVERSION}" ) if (CASA_BUILD) if (PYTHON_SHARED_LINKER_FLAGS AND ${module} STREQUAL python) set_target_properties(casa_python PROPERTIES LINK_FLAGS ${PYTHON_SHARED_LINKER_FLAGS}) endif (PYTHON_SHARED_LINKER_FLAGS AND ${module} STREQUAL python) endif (CASA_BUILD) if (APPLE) if (${module} STREQUAL scimath_f OR ${module} STREQUAL fits OR ${module} STREQUAL mirlib OR ${module} STREQUAL coordinates) set_target_properties(casa_${module} PROPERTIES LINK_FLAGS -single_module) endif (${module} STREQUAL scimath_f OR ${module} STREQUAL fits OR ${module} STREQUAL mirlib OR ${module} STREQUAL coordinates) endif (APPLE) set(PRIVATE_LIBS "${PRIVATE_LIBS} -lcasa_${module}") endforeach (module) # Install pkg-config support file CONFIGURE_FILE("casacore.pc.in" "casacore.pc" @ONLY) set(CASA_PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/casacore.pc" DESTINATION "${CASA_PKGCONFIG_INSTALL_PREFIX}") # Show summary. message (STATUS "CMAKE_SYSTEM .......... = ${CMAKE_SYSTEM}") message (STATUS "CMAKE_BUILD_TYPE ...... = ${CMAKE_BUILD_TYPE}") message (STATUS "Modules to be built ... = ${_modules}") message (STATUS "BUILD_SHARED_LIBS ..... = ${BUILD_SHARED_LIBS}") message (STATUS "ENABLE_RPATH .......... = ${ENABLE_RPATH}") message (STATUS "CMAKE_INSTALL_NAME_DIR = ${CMAKE_INSTALL_NAME_DIR}") message (STATUS "ENABLE_TABLELOCKING ... = ${ENABLE_TABLELOCKING}") message (STATUS "USE_PCH ............... = ${USE_PCH}") message (STATUS "USE_THREADS ........... = ${USE_THREADS}") message (STATUS "USE_OPENMP ............ = ${USE_OPENMP}") message (STATUS "USE_MPI ............... = ${USE_MPI}") message (STATUS "USE_STACKTRACE ........ = ${USE_STACKTRACE}") message (STATUS "HAVE_O_DIRECT ......... = ${HAVE_O_DIRECT}") message (STATUS "CMAKE_CXX_COMPILER .... = ${CMAKE_CXX_COMPILER}") message (STATUS "CMAKE_CXX_FLAGS ....... = ${CMAKE_CXX_FLAGS}") message (STATUS "DATA directory ........ = ${DATA_DIR}") message (STATUS "DL library? ........... = ${DL_LIBRARIES}") message (STATUS "Pthreads library? ..... = ${PTHREADS_LIBRARIES}") message (STATUS "Readline library? ..... = ${READLINE_LIBRARIES}") message (STATUS "BLAS library? ......... = ${BLAS_LIBRARIES}") message (STATUS "LAPACK library? ....... = ${LAPACK_LIBRARIES}") message (STATUS "WCS library? .......... = ${WCSLIB_LIBRARIES}") message (STATUS "SOFA library? ......... = ${SOFA_LIBRARIES}") message (STATUS "CFitsio library? ...... = ${CFITSIO_LIBRARIES}") message (STATUS "ADIOS2 library? ....... = ${CASACORE_ADIOS_LIBRARY}") message (STATUS "HDF5 library? ......... = ${HDF5_hdf5_LIBRARY}") message (STATUS "FFTW3 library? ........ = ${FFTW3_LIBRARIES}") message (STATUS "BUILD_FFTPACK_DEPRECATED= ${BUILD_FFTPACK_DEPRECATED}") message (STATUS "BUILD_DEPRECATED ...... = ${BUILD_DEPRECATED}") message (STATUS "BUILD_DYSCO ........... = ${BUILD_DYSCO}") message (STATUS "BUILD_SISCO ........... = ${BUILD_SISCO}") message (STATUS "BUILD_PYTHON .......... = ${BUILD_PYTHON}") message (STATUS "BUILD_PYTHON3 ......... = ${BUILD_PYTHON3}") if (BUILD_PYTHON) message (STATUS "PYTHON2_EXECUTABLE ......... = ${PYTHON2_EXECUTABLE}") message (STATUS "PYTHON2_LIBRARIES........... = ${PYTHON2_LIBRARIES}") message (STATUS "PYTHON2_NUMPY_INCLUDE_DIRS . = ${PYTHON2_NUMPY_INCLUDE_DIRS}") message (STATUS "PYTHON2_Boost_LIBRARIES .... = ${PYTHON2_Boost_LIBRARIES}") message (STATUS "PYTHON2_Boost_INCLUDE_DIRS . = ${PYTHON2_Boost_INCLUDE_DIRS}") endif (BUILD_PYTHON) if (BUILD_PYTHON3) message (STATUS "PYTHON3_EXECUTABLE ......... = ${PYTHON3_EXECUTABLE}") message (STATUS "PYTHON3_LIBRARIES .......... = ${PYTHON3_LIBRARIES}") message (STATUS "PYTHON3_NUMPY_INCLUDE_DIRS . = ${PYTHON3_NUMPY_INCLUDE_DIRS}") message (STATUS "PYTHON3_Boost_LIBRARIES .... = ${PYTHON3_Boost_LIBRARIES}") message (STATUS "PYTHON3_Boost_INCLUDE_DIRS . = ${PYTHON3_Boost_INCLUDE_DIRS}") endif (BUILD_PYTHON3) # List of build variables and defaults. # BUILD_PYTHON YES # BUILD_PYTHON3 NO # BUILD_DEPRECATED NO # ENABLE_SHARED YES # ENABLE_RPATH YES # ENABLE_TABLELOCKING YES # USE_ADIOS2 NO # USE_HDF5 NO # USE_THREADS YES # USE_OPENMP NO # USE_MPI NO # USE_STACKTRACE NO # DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/casacore/data # MODULE all # Possible value for MODULE (previous built too): # - casa (casa) # - tables (tables) # - measures (scimath,scimath_f,measures,meas) # - ms (ms,derivedmscal) # or msfits (fits,ms,msfits,derivedmscal) # or images (fits,lattices,mirlib,coordinates,images) # - all # # List of possibly used external packages and where # CFITSIO fits # WCSLIB coordinates # SOFA measures (optional, only for testing) # DL casa (optional) # READLINE casa (optional) # HDF5 casa (optional) # BISON casa,tables,images # FLEX casa,tables,images # ADIOS2 tables (optional) # LAPACK scimath # BLAS scimath # FFTW scimath # BOOST python (Boost-Python only) # PYTHON python # NUMPY python casacore-casacore-de676b9/CONTRIBUTING.md000066400000000000000000000057511525666017600177570ustar00rootroot00000000000000# Casacore contribution policy Casacore is an open source project and everybody is encouraged to help improve the quality of the code. You can help by reporting issues or even better fix issues yourself. We use github as a central communication and development platform. Issues can be reported there. If you have a patch for casacore we use the github pull request system. Also to keep the casacore code quality high we have written down some guidelines for contributing, see below. ## General considerations * If you have problems or questions with/about git or github, first check [1]. * If you modify any code, make sure the test suite still runs (`make test`). If it fails, fix the code or the relevant test. * If you change a function/method signature, update the doxygen documentation accordingly. * If you add a function or method, add a test for it add it to the doxygen documentation. * The tested code coverage line count should increase, not decrease. * Follow the google style code as much as possible [2]. ## Contribution procedure 1. Create a github account, setup SSH keys. 2. Fork the casacore repository on github [3]. 3. Create a branch and commit your changes to this branch. 4. Push your branch to your github fork (not the original casacore, you probably don't have permission). 5. Issue a pull request [4]. 6. When the pull request is reviewed and there are no problems it will be accepted. Merging a pull request should always happen by someone else. 7. It can happen there are some mistakes here and there, we use the github commenting system to discuss these issues. 8. If there is a problem with the commit, you need to fix it. You can commit to the same branch, the PR will be updated automatically. ## General notes about Pull requests * Please create descriptive commits containing atomic changes. Use short commit messages (try 50 characters, max is 70 characters); longer commit messages are possible in the body of the commit message (separated from the subject by an empty line). See [5]. * If you fix an existing github issue, reference it in the commit message body, e.g. 'Fixes #41'. * If your Pull request does not refer to an existing github issue, it is not necessary to create one (because github will present the PR just like an issue). * You can rewrite the history of the commits in your branch using rebase, but don't rewrite the history before the first commit of your new branch. * We like to keep the history clean, and prevent a lot of 'fix typo' messages. * If you rewrite your history of your branch you can force push those changes to your branch. The PR will be updated. See e.g. [6]. ## Links * [1] http://help.github.com * [2] https://google.github.io/styleguide/cppguide.html * [3] https://help.github.com/articles/fork-a-repo/ * [4] https://help.github.com/articles/creating-a-pull-request/ * [5] https://chris.beams.io/posts/git-commit * [6] https://developer.atlassian.com/blog/2015/04/force-with-lease/ casacore-casacore-de676b9/COPYING000066400000000000000000000614501525666017600165570ustar00rootroot00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! casacore-casacore-de676b9/CTDS-64bit.md000066400000000000000000000132541525666017600175300ustar00rootroot00000000000000# CTDS support of very large tables A major change has been made to the Casacore Table Data System (CTDS). So far, tables larger than 2^31 rows could not be supported, but this change makes it possible to have tables up to 2^63 rows. ## Data format change The change had quite some impact on the Tables data format, but the changes have been done in a compatible way. * The new software can still read and update existing tables. It means it is fully backward compatible. * A new table will be written in the old format if it contains less than 2^31 rows. It means that an older Casacore version can still access most tables created with the new version. ## API change The API has changed considerably, both at the Tables and the DataManager level. The main changes at the Tables level are: * `rownr_t` (typedef-ed to `uInt64`) instead of `uInt` is now used to represent a row number. * class `RowNumbers` instead of `Vector` is used to represent a vector of row numbers. It can convert automatically from and to a `Vector` of `rownr_t` and optionally to `uInt` (giving backward compatibility). * The functions `getColumnXXX` in class `TableExprNode` are available for `RowNumbers` and optionally for `Vector`. To assure that software is using 64-bit row numbers, conversion of `RowNumbers` from and to `Vector` is made explicit. However, if `IMPLICIT_CTDS_32BIT` is defined, the conversion is implicit (thus automatic). Similarly, the `Vector` versions of `TableExprNode::getColumnXXX` are only public if `IMPLICIT_CTDS_32BIT` is defined. It means that with this `#define` existing software can be built against the new and an old Casacore version without any change. The DataManager interface has been changed more drastically, but still in a backward compatible way. Specialized storage managers such as LofarStMan, ASDMStMan and DyscoStMan should build fine against the new and an old Casacore version without any change. However, in this way such storage managers can only support tables with less than 2^31 rows. To extend it to 2^63 rows, they should use the new interface as depicted in DataManagerColumn.h. The main changes are: * Several virtual functions in class `DataManager` got the suffix 64 (e.g. `create64`) to differentiate them from the old function names which still exist for backward compatibility. * `DataManager` column classes (such as `ISMColumn`) should be derived from class `StManColumnBase` which implements some common functionality. * The `canAccess` functions are obsolete and can be removed. Formerly the Tables classes `ScalarColumn` and `ArrayColumn` contained the default implementations for `getColumn`, `getSlice`, etc.. This has been moved to class `DataManagerColumn` making the `canAccess` functions obsolete in the new interface. Of course, these functions should be kept if backward compatibility is needed. * The interface of get/put functions handling arrays has been changed from `void*` to `ArrayBase&`, mainly to have it more clear. The native storage manager classes now often can use Array functionality to handle most array data types instead of having to handle these data types explicitly. Although the DataManager interface has changed considerably, it is still fully backward compatible. The default implementations of the new functions call the old functions in the `StManColumn` class and convert `rownr_t` to `uInt` (while checking if its value is < 2^31). The test programs tExternalStMan.cc and tExternalStManNew.cc show how the old and the new interface are used in a data manager. They reside in tables/DataMan/test. Note that the build of tExternalStMan.cc and other unchanged data manager classes give hidden virtual function warnings. The reason is that in the new interface functions such as `shape` are overloaded for `rownr_t` and `uInt`, while only the `uInt` version is used in these classes using the old interface. Note that a nice side-effect of the DataManager change is that `libcasa_tables.so` shrunk about 10%. It will even be more once the backward compatibility functionality can be removed. ## ABI change As can be expected, the ABI has been changed considerably, so software needs to be rebuilt between using the new and old Casacore libraries. It results in the new major Casacore version 3.4.0. ## Changes in other software All other software in the Casacore package, notably the MS package, has been changed to use the new CTDS interface. A few external packages (LOFAR, CASA) have been built against the new interface. With one minor (backward compatible) change LOFAR built fine. CASA built fine after defining `-DIMPLICIT_CTDS_32BIT` in its main CMakeLists.txt. It means that both packages can be built against the old and new interface without any problem. Of course, over time packages such as CASA should change to using `rownr_t` instead of `uInt` where applicable. ## Backward compatibility functions Several functions have been added to make the API change backward compatible. They are intended to be temporary, so they should be removed once all software using Casacore uses 64-bit row numbers. Tables backward compatibility to be removed consists of the following functions: * In class `RowNumbers` the `Vector` and `std::vector` constructor and the `Vector` operator. * In class `RefRows` the functions using `Vector`. * In class `TableExprNode` the functions getColumnXXX using Vector. Once all external data managers use 64-bit row numbers, the following DataMan classes and functions can be removed. * In class `DataManager` the functions `create`, `open`, `open1`, `resync`, `resync1`, `addRow` and `removeRow`. * The entire class `StManColumn`. casacore-casacore-de676b9/README.md000066400000000000000000000071231525666017600170000ustar00rootroot00000000000000 # Casacore A suite of C++ libraries for radio astronomy data processing. # Installation ## Debian / Ubuntu Casacore is now part of Debian and Ubuntu, use apt to search for the package you need: ```bash $ apt-get update $ apt-get search casacore ``` ## MacOS Use Homebrew with the `casacore` tap to install casacore: ```bash $ brew tap casacore/tap $ brew install casacore ``` ## Docker We now also publish docker images for each github branch on [quay.io](https://quay.io/repository/casacore/casacore): ``` $ docker pull quay.io/casacore/casacore:master ``` ## Building from source ### Getting the source code The casacore source code is maintained on github. You can obtain it using: ``` $ git clone https://github.com/casacore/casacore ``` ### Requirements To compile casacore you need to meet the following requirements: * cmake * gfortran * g++ * flex * bison * blas * lapack * cfitsio (3.181 or later) * wcslib (4.20 or later) * sofa (optional, only for testing casacore measures) * fftw3 * hdf5 (optional) * numpy (optional) * boost-python (optional) * ncurses (optional) On Debian / Ubuntu you can install these with: ``` $ sudo apt-get install build-essential cmake gfortran g++ libncurses5-dev \ libreadline-dev flex bison libblas-dev liblapacke-dev libcfitsio-dev \ wcslib-dev libfftw3-dev ``` and the optional libraries: ``` $ sudo apt-get install libhdf5-serial-dev python-numpy \ libboost-python-dev libpython3.4-dev libpython2.7-dev ``` On CentOS7 you can install these with: ```bash $ sudo yum install cmake cmake-gui gcc-gfortran gcc-c++ flex bison \ blas blas-devel lapack lapack-devel cfitsio cfitsio-devel \ wcslib wcslib-devel ncurses ncurses-devel readline readline-devel\ python-devel boost boost-devel fftw fftw-devel hdf5 hdf5-devel\ numpy boost-python ``` ## Obtaining measures data Various parts of casacore require measures data, which requires regular updating. You can obtain the WSRT measures archive from the ASTRON FTP server: ftp://ftp.astron.nl/outgoing/Measures/ Extract this somewhere on a permanent location on your filesystem. ## Compilation In the casacore source folder run: ``` mkdir build cd build cmake .. make make install ``` there are various flags available to cmake to enable and disable options: ``` $ cmake -DDATA_DIR=/usr/share/casacore/data -DUSE_OPENMP=ON \ -DUSE_HDF5=ON -DBUILD_PYTHON3=ON -DUSE_THREADS=ON ``` The `DATA_DIR` should point to the location where you extracted the measures data. Special variables `%CASAROOT%` and `%CASAHOME%` can be used here, which can be set at run time through the `.casarc` file. Older versions of CMake may have problems detecting the correct python libraries and headers, in which case you may need to set them manually. For example: ``` -DPYTHON3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.4m.so -DPYTHON3_INCLUDE_DIR=/usr/include/python3.4 ``` To configure Python3 specific settings use: ``` PYTHON3_EXECUTABLE PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR ``` If you run into problems with boost libraries, try setting `-DBoost_NO_BOOST_CMAKE=True`. This may be necessary if you have the libraries from NRAO casa in your `PATH` or `LD_LIBRARY_PATH`. # Documentation http://casacore.github.io/casacore # Problems & bugs If you have any issues compiling or using casacore, please open an issue on the issue tracker on github. If you have patches please open a pull request. Your contributions are more than welcome! But to maintain a high code quality we have written a [contribution manual](https://github.com/casacore/casacore/blob/master/CONTRIBUTING.md), please read that first. casacore-casacore-de676b9/build-tools/000077500000000000000000000000001525666017600177535ustar00rootroot00000000000000casacore-casacore-de676b9/build-tools/CMakeLists.txt000066400000000000000000000000541525666017600225120ustar00rootroot00000000000000# # CASA build-tools # # nothing to install casacore-casacore-de676b9/build-tools/casacore_assay000077500000000000000000000125451525666017600226700ustar00rootroot00000000000000#!/bin/sh #----------------------------------------------------------------------------- # assay: Invoke an AIPS++ test program and verify its output #----------------------------------------------------------------------------- # # Copyright (C) 1995,1996,1998,1999,2001,2003 # Associated Universities, Inc. Washington DC, USA. # # 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., 675 Mass Ave, Cambridge, MA 02139, USA. # # Correspondence concerning AIPS++ should be addressed as follows: # Internet email: casa-feedback@nrao.edu. # Postal address: AIPS++ Project Office # National Radio Astronomy Observatory # 520 Edgemont Road # Charlottesville, VA 22903-2475 USA # #----------------------------------------------------------------------------- # Usage: assay #----------------------------------------------------------------------------- # assay invokes a casacore test program. If the test program has an associated # .run file then it simply invokes it. Otherwise assay invokes the test # executable directly, and, if there is a corresponding .out file, compares # its output with that. # # The env.var. CASACORE_CHECK can be defined to do checking using tools # like valgrind. It defines a script that will execute the command. The # script can invoke the checking tool. If set to 1, yes, or YES, the script # casacore_memcheck will be used that uses valgrind's memcheck tool. # # If there is a .in file associated with the test program then assay will # redirect stdin from it. # # Options: # none # # Status returns: # 0: success # 1: test execution failed # 2: test output disagreement # 3: untested (usually returned from a .run) # 130: interrupt # # Original: 1995/11/01 by Mark Calabretta, ATNF #============================================================================= # Find the path used to start the script. It is used for other scripts. pgmpath=`dirname $0` pgmpath=`cd $pgmpath > /dev/null 2>&1 && pwd` # Also set PYTHONPATH. if [ "$PYTHONPATH" = "" ] then PYTHONPATH=. else PYTHONPATH=".:$PYTHONPATH" fi CLEANUP= # Set testsrcdir to . if undefined. if [ "$testsrcdir" = "" ] then testsrcdir=. fi # Determine if a program checktool (like valgrind) has to be used. casa_checktool=$CASACORE_CHECK # Empty or no means no checktool. if test "$casa_checktool" = "0" -o "$casa_checktool" = "no" -o "$casa_checktool" = "NO"; then casa_checktool= fi # Default checktool is casacore_memcheck (using valgrind). if test "$casa_checktool" = "1" -o "$casa_checktool" = "yes" -o "$casa_checktool" = "YES"; then casa_checktool=$pgmpath/casacore_memcheck fi # Export, so it can be used in possible .run files. export casa_checktool # Delete possible already existing checktool output. rm -rf $1.checktool* # Define exit and interrupt handler. trap 'rm -rf $CLEANUP core ${1}_tmp* ; \ trap - 0 ; \ exit $STATUS' 0 1 2 3 15 # Get the command. COMMAND="$casa_checktool $@" set $@ # Get the current directory (resolving symlinks). curdir=`pwd -P` # If there is a .run file then use it without checktool. # Start it using sh if not executable. if [ -f "$1.run" ] then COMMAND="sh $1.run" if [ -x "$1.run" ] then COMMAND="$1.run" fi fi # If there is a .in file then use it as input. if [ -f "$1.in" ] then COMMAND="$COMMAND < $1.in" fi # Remove possible old output files. rm -rf ${1}_tmp* eval "$COMMAND" > ${1}_tmp.out STATUS=$? if [ $STATUS != 0 ] then if [ $STATUS = 3 ] then echo "UNTESTED: $*" else echo "FAIL (execution failure): $*" fi exit fi if [ -f $1.out ] then CAT="$1.out" else echo "PASS (execution succeeded): $*" STATUS=0 exit fi # Strip out demarked text. # First text on a single line enclosed in >>> and <<<. # Then lines enclosed in lines starting with >>> and <<<. # Remove the current directory from the output (to avoid system dependencies). sed -e 's/>>>.*<<>>/,/^<< ${1}_tmp.out2 mv -f ${1}_tmp.out2 ${1}_tmp.out # Compare with the expected output. cat "$CAT" | sed -e 's/>>>.*<<>>/,/^<< ${1}_tmpo.out if diff ${1}_tmp.out ${1}_tmpo.out then echo "PASS (output verified): $*" STATUS=0 exit fi # Not fully equal. Check with floating point accuracy. $pgmpath/casacore_floatcheck ${1}_tmp.out ${1}_tmpo.out 1e-5 stat=$? case $stat in 0) echo "PASS (floating point discrepancies <= 1e-5): $1" ;; 1) echo "FAIL (output not verified): $*" ;; *) echo "FAIL (floating point discrepancies > 1e-5): $1" ;; esac STATUS=$stat exit casacore-casacore-de676b9/build-tools/casacore_cov000077500000000000000000000042641525666017600223360ustar00rootroot00000000000000#!/bin/sh # Get directory of module or package to test. # It can be run in something like build, build/ or # build///test. # If run in the test directory, the directory containing the object files # should be included. Its name is ../../CMakeFiles/casa_.dir/. cwd=`pwd` cwd1=`echo "$cwd" | sed -e "s%/test$"%%` srcdir= if [ "$cwd" != "$cwd1" ]; then part=`echo $cwd1 | sed -e "s%.*/%%"` # remove till last slash module=`echo $cwd1 | sed -e "s%/${part}$%%" -e "s%.*/%%"` srcdir="--directory ../../CMakeFiles/casa_${module}.dir/${part}" fi mod=`pwd | sed -e "s%.*/build/[^/]*/%/%" -e "s%.*/build/[^/]*$%%" -e "s%/test$%%"` # Clear coverage counters. echo "Initializing coverage info for module $mod ..." lcov --zerocounters --directory . $srcdir > testcov.log 2>&1 # Create baseline coverage data. lcov --rc lcov_function_coverage=0 --capture --initial --directory . $srcdir --output-file testcov.bl >> testcov.log 2>&1 #lcov --capture --initial --directory $cwd --output-file testcov # Run the tests and extract line and branch coverage information. echo "Running tests ..." ctest >> testcov.log 2>&1 echo "Collecting coverage info ..." lcov --rc lcov_function_coverage=0 --rc lcov_branch_coverage=1 --no-checksum --capture --directory . $srcdir --output-file testcov.data >> testcov.log 2>&1 #lcov --no-checksum --capture --directory $cwd --output-file testcov.info # Combine with baseline. lcov --rc lcov_function_coverage=0 --rc lcov_branch_coverage=1 -a testcov.bl -a testcov.data -o testcov.info >> testcov.log 2>&1 # Get information for this module only. echo "Filtering coverage info ..." lcov --rc lcov_function_coverage=0 --rc lcov_branch_coverage=1 --output-file testcov.full --extract testcov.info "*casacore$mod/*" >> testcov.log 2>&1 # Get it without the test programs. lcov --rc lcov_function_coverage=0 --rc lcov_branch_coverage=1 --output-file testcov.module --remove testcov.full "*/test/*" >> testcov.log 2>&1 # Convert to html. echo "Converting coverage info to ./cov/index.html ..." rm -rf cov genhtml --rc lcov_function_coverage=0 --rc lcov_branch_coverage=1 --output-directory=cov testcov.module >> testcov.log 2>&1 echo "Ready; log output in ./testcov.log"casacore-casacore-de676b9/build-tools/casacore_floatcheck000077500000000000000000000064571525666017600236600ustar00rootroot00000000000000#!/usr/bin/env python3 #----------------------------------------------------------------------------- # floatcheck: Check files within floating point accuracy #----------------------------------------------------------------------------- # # Copyright (C) 2009 # Associated Universities, Inc. Washington DC, USA. # # 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., 675 Mass Ave, Cambridge, MA 02139, USA. # # Correspondence concerning AIPS++ should be addressed as follows: # Internet email: casa-feedback@nrao.edu. # Postal address: AIPS++ Project Office # National Radio Astronomy Observatory # 520 Edgemont Road # Charlottesville, VA 22903-2475 USA # # This script compares two text files for equality. # If numbers mismatch, it is checked if they are near each other. # The tolerance can be given as the third argument; it defaults to 1e-5. import re import sys def splitfile (filename, regexp): f = open(filename, 'r') res = [] for line in f: # Make sure numbers are separated by blanks. line = regexp.sub (r' \g ', line) res.extend (line.split()) f.close() return res; def near (val1, val2, tol): # ok if both close to zero. if abs(val1) <= tol*1e-10 and abs(val2) <= tol*1e-10: return True; if (val1>0) != (val2>0): return False return abs(val1-val2) <= tol*max(abs(val1),abs(val2)) def main(argv=None): if argv is None: argv = sys.argv if len(argv) < 3: sys.stderr.write ('run as: floatcheck.py file1 file2 [tolerance]\n') return 1 tol = 1e-5; if len(argv) > 3: tol = float(argv[3]) # Regular expression for an integer or float number. numre = re.compile (r'(?P[+-]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+|[0-9]+)([ed][+-][0-9]+)?)', re.IGNORECASE) # Split file in separate values. res1 = splitfile (argv[1], numre); res2 = splitfile (argv[2], numre); # Keep list of possible numbers to compare. num1 = [] num2 = [] # Compare res1 and res2 for equality. # Mismatching numbers are kept and compared later. if len(res1) != len(res2): return 1 # mismatch for i in range(len(res1)): if res1[i] != res2[i]: if numre.sub('', res1[i]) != '' or numre.sub('', res2[i]) != '': return 1 num1.append (res1[i]) num2.append (res2[i]) # Now compare if numbers are more or less equal. for i in range(len(num1)): val1 = float(num1[i]) val2 = float(num2[i]) if not near(val1, val2, tol): return 2 return 0 if __name__ == "__main__": sys.exit(main()) casacore-casacore-de676b9/build-tools/casacore_memcheck000077500000000000000000000027431525666017600233230ustar00rootroot00000000000000#!/bin/sh # Find the path used to start the script. It is used for other scripts. pgmpath=`dirname $0` pgmpath=`cd $pgmpath > /dev/null 2>&1 && pwd` # Get name of program to test. pgm=$1 shift # Exit if valgrind does not exist. which valgrind > /dev/null 2>&1 if [ $? != 0 ]; then echo "*** memcheck of $pgm cannot be done; valgrind cannot be found ***" 1>&2 exit 1 fi # Use valgrind's memcheck tool on a program. # Filter out possible errors to give an overview. rm -f ${pgm}_tmp.valgrind valgrind --tool=memcheck --num-callers=50 --ignore-range-below-sp=1024-1 --leak-check=yes --track-fds=yes --suppressions=$pgmpath/casacore_memcheck.supp --log-file=${pgm}_tmp.valgrind $pgm "$@" # Check if any error, definite or possible leak, or open fd is found. # If so, list the file and rename to keep it. # Note that fd 0,1,2 are always open (stdin,stdout,stderr). # Furthermore 3 and/or 4 can be open for the valgrind log file and # the ctest output. errors=`(grep "ERROR SUMMARY: " ${pgm}_tmp.valgrind | grep -v " 0 errors ") || echo ""` deflost=`(grep "definitely lost: " ${pgm}_tmp.valgrind | grep -v " 0 bytes ") || echo ""` poslost=`(grep "possibly lost: " ${pgm}_tmp.valgrind | grep -v " 0 bytes ") || echo ""` openfds=`(grep " Open file descriptor " ${pgm}_tmp.valgrind | grep -v "descriptor [01234]:") || echo ""` if test "$errors" != "" -o "$deflost" != "" -o "$poslost" != "" -o "$openfds" != ""; then cat ${pgm}_tmp.valgrind >> $pgm.checktool.valgrind fi rm -f ${pgm}_tmp.valgrind casacore-casacore-de676b9/build-tools/casacore_memcheck.supp000066400000000000000000000052711525666017600243050ustar00rootroot00000000000000# This file contains the valgrind errors to be suppressed for casacore. # Where needed, it has lines for namespace casa and casacore. # Very often libc gives an invalid free error at exit. { Ubuntu-gcc-freeres-error-in-libc Memcheck:Free fun:free obj:/lib/libc-2.11.1.so obj:/lib/libc-2.11.1.so fun:_vgnU_freeres } # putenv takes over the pointer, but valgrind does not notice. { Class-EnvVar-putenv-takes-over-pointer-4 Memcheck:Leak fun:_Znam fun:_ZN4casa19EnvironmentVariable3setERKNS_6StringES3_ } { Class-EnvVar-putenv-takes-over-pointer-8 Memcheck:Leak fun:_Znam fun:_ZN8casacore19EnvironmentVariable3setERKNS_6StringES3_ } # Casacore's IO sometimes uses uninitialized fill characters. { Casacore-write-not-fully-initialized-buffer-LargeFilebufIO-4 Memcheck:Param write(buf) fun:__write_nocancel fun:_ZN4casa9FiledesIO5writeExPKv } { Casacore-write-not-fully-initialized-buffer-LargeFilebufIO-8 Memcheck:Param write(buf) fun:__write_nocancel fun:_ZN8casacore9FiledesIO5writeExPKv } { Casacore-write-not-fully-initialized-buffer-FilebufIO-dbg4 Memcheck:Param write(buf) fun:__write_nocancel fun:_ZN4casa9FilebufIO11writeBufferExPKcx } { Casacore-write-not-fully-initialized-buffer-FilebufIO-dbg8 Memcheck:Param write(buf) fun:__write_nocancel fun:_ZN8casacore9FilebufIO11writeBufferExPKcx } { Casacore-write-not-fully-initialized-buffer-FilebufIO-opt4 Memcheck:Param write(buf) fun:??? fun:_ZN4casa9FilebufIO11writeBufferExPKcx } { Casacore-write-not-fully-initialized-buffer-FilebufIO-opt8 Memcheck:Param write(buf) fun:??? fun:_ZN8casacore9FilebufIO11writeBufferExPKcx } { Casacore-write-not-fully-initialized-buffer-FiledesIO-dbg8 Memcheck:Param pwrite64(buf) fun:__pwrite_nocancel fun:_ZN8casacore9FiledesIO6pwriteExxPKv } { Casacore-write-not-fully-initialized-buffer-FiledesIO-opt8 Memcheck:Param pwrite64(buf) fun:??? fun:_ZN8casacore9FiledesIO6pwriteExxPKv } # The function strlen is optimized by testing multiple byte simultaneously. # This gives an uninitialized condition error for the bytes beyond the end. { Optimized-strlen-uses-multiple-bytes Memcheck:Cond fun:__GI_strlen fun:_ZNSsC1EPKcRKSaIcE } { Optimized-strlen-uses-multiple-bytes-2 Memcheck:Cond fun:strlen fun:_ZNSsC1EPKcRKSaIcE } # On lhd002 the nss functions (called by getpwnam) leak { getpwnam-nss-leak Memcheck:Leak fun:malloc fun:nss_parse_service-list fun:__nss_database_lookup } # OpenMP with glibc-2.2.5 seems to give a pthread leak { openmp-pthread-leak Memcheck:Leak fun:calloc fun:_dl_allocate_tls fun:pthread_create@@GLIBC_2.2.5 } casacore-casacore-de676b9/build-tools/doxygen_pp000077500000000000000000000535101525666017600220610ustar00rootroot00000000000000#!/usr/bin/perl # # Copyright (C) 2006 # ASTRON (Netherlands Foundation for Research in Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, diepen@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 # Convert multiple C++ "slash-slash" style comment lines # into one spanning C-style comment (/* ... */), ignoring # lines that start with "slash-slash-hash style comments. # Lines starting with //# are blanked except for the ones at the beginning # showing the copyright. # # The cxx2html tags are converted to doxygen or html tags. # Code from cxx2html (Html.pm) has been copied for this purpose. # When converting, the line numbers should stay the same, so doxygen # errors/warnings refer to the correct line. Also the line numbers and # source file shown by doxygen will be correct. $NON_COMMENT_BLOCK = 0; $COMMENT_BLOCK = 1; $FIRST_SUMMARY = 1; # If the caller supplied precisely one command line argument, then this script # can proceed. ###open OUT, ">> doc/doxygen.done"; $arguments = @ARGV; if ($arguments == 1) { # The argument represents the name of the file to process. $filename = $ARGV[0]; # Get current directory without trailing slash. $cwd = `pwd`; chop($cwd); $cwd =~ s|/$||; # Append file name to it (which may contain a path as well). $fullnm = $filename; if ($filename !~ m|^/|) { $fullnm = $cwd . "/" . $filename; } $filnm = $filename; $filnm =~ s|$cwd||; # remove current directory (thus keep past casacore) $filnm =~ s|^/||; # remove leading slash # Get the name of the header. $hdrnm = $filnm; $hdrnm =~ s|.*/||; # remove directory (until last slash) $hdrnm =~ s|\..*||; # remove extension # Get the name of the package and module. $isModHdr = 0; $modnm = ""; $pkgnm = $filnm; $pkgnm =~ s|/.*||; # remove first slash and beyond giving package name $modna = $filnm; $modna =~ s|$pkgnm/||; # remove package name # The old situation has an extra layer like casa/casa/OS or casa/implement/OS. # Remove that too. $modna =~ s%$pkgnm/|implement/%%; # remove package name $modnm = $modna; $modnm =~ s|/.*||; # again remove first slash and beyond giving module if ($modnm eq $modna) { # Nothing removed, so we have a .h file outside a module. $modnm =~ s|\..*||; # remove extension # It is a module header if a directory with the same name exists. $tmpnm = $fullnm; $tmpnm =~ s|\.h$||; if (-d $tmpnm) { $isModHdr = 1; } } # On OS-X package tables and module Tables get the same (casa-insensitive) # file name which is solved by appending '_module' to a module name. $modnm .= "_module"; ### print OUT "$fullnm $filnm $hdrnm $modnm $pkgnm $isModHdr\n"; # Open the file. $status = open(FILEHANDLE, $filename); ### open DOXOUT, ">> doc/" . $hdrnm . $isModHdr . ".dout"; # If the file could be opened then read the contents. if ($status) { # Read the contents of the file. @text = ; # Close the file. close(FILEHANDLE); # Process the contents of the file. change_comment_style(@text); } # Otherwise report an error condition. else { print "ERROR: file \"$filename\" could not be opened.\n"; } } # Otherwise, display the proper invocation for this script. else { print "usage: $0 filename\n"; } # Handle changing a linkto tag. # Replace linkto by the class linked to; remove possible ':description' # Similarly replace module link; link ':classes' to the same. # The closing has already been removed. sub handleLinkto { my $linkstr = shift(@_); # Remove :description or :classes. $linkstr =~ s%:(description|classes)(['"]?\s*>)%$2%i; my $endlink = ""; if ($linkstr =~ m||i) { # A link to a class. $linkstr =~ s|| \\link casacore::$1 |i; $endlink = "\\endlink"; } elsif ($linkstr =~ m%%i) { # A link to a module. $linkstr =~ s%% \\ref $1_module_anchor "%i; $endlink = '"'; } else { # A link to an anchor in a group or file. if ($linkstr =~ m%%i) { my $grpnm = $2; my $ref = $3; $grpnm =~ s|\..*||; $grpnm =~ s|\s*['".]\s*||g; $grpnm =~ s|\s+|_|g; $ref =~ s|\s*['".]\s*||g; $ref =~ s|\s+|_|g; $ref =~ s|:description||; $ref =~ s|[:]|_|g; $linkstr =~ s%% \\ref ${grpnm}_$ref "%i; $endlink = '"'; } elsif ($linkstr =~ m%%i) { # A link to a class member function. Remove the signature. my $classnm = $1; my $funcnm = $2; $linkstr =~ s%% \\link ${classnm}::$funcnm() %i; $endlink = '\\endlink'; } elsif ($linkstr =~ m%%) { # A link to a class or module anchor. my $grpnm = $2; my $ref = $3; $grpnm =~ s|\s*['".]\s*||g; $grpnm =~ s|\s+|_|g; $ref =~ s|\s*['".]\s*||g; $ref =~ s|\s+|_|g; $ref =~ s|:description||; $ref =~ s|[:]|_|g; $linkstr =~ s%%\\ref ${grpnm}_$ref "%i; $endlink = '"'; } else { # For the time being cannot really handle other linkto commands. $linkstr =~ s|(.*?)|(see $2 ($1))|i; } } $linkstr .= $endlink; return $linkstr; } # Handle changing a reviewed tag. sub handleReviewed { # Get argument and remove tags delimiters. my $attr = shift(@_); $attr =~ s|^\s*<\s*reviewed\s*||; $attr =~ s|\s*>\s*$||; # Organize review info nicely. @attr = split(/(?:=["'][^'"]*['"]|=[^\s>]*)\s*/,$attr); $attr =~ s/.*?=//; my @val = split(/\s*\w+=/,$attr); my %attr = (); my $attrcnt = 0; while ( ($_ = shift(@attr)) && ($val = shift(@val)) ) { $val =~ s/^["']\s*//; $val =~ s/\s*["']$//; $val =~ s/@/\\@/g; # doxygen treats @ as special, so escape $val =~ s/\.cc//g; # doxygen cannot deal with . in
if ( $val ) { $attr{$_} = $val; $attrcnt++; } } my $str = ""; if ( $attrcnt ) { $str = "

Review Status

"; $str .= "
Reviewed By:
" . $attr{'reviewer'} if defined $attr{'reviewer'}; $str .= "
Date Reviewed:
" . $attr{'date'} if defined $attr{'date'}; $str .= "
Test programs:
" . $attr{'tests'} if defined $attr{'tests'}; $str .= "
Demo programs:
" . $attr{'demos'} if defined $attr{'demos'}; $str .= "
"; } return $str; } # Loop through all lines and change comments as needed. sub change_comment_style { $keephash = 1; $state = $NON_COMMENT_BLOCK; $newstate = $NON_COMMENT_BLOCK; @spanning_comment = (); $indent = ""; $comment = ""; $extraline = ""; $grouplevel = 0; $namedgrouplevel = 0; $nexamples = 0; $code = 0; # no block found $link = 0; # no block found $linkfr = 0; # no found $linkstr = ""; $todo = 0; # no found $prereq = 0; # no found $thrown = 0; # no found $emnote = 0; # no found $review = 0; # no block found $reviewstr = ""; $nadded = 0; # nr of added lines for which blank lines are removed $summinx = -1; # index of summary line in spanning_comment foreach $line (@_) { $skip = 0; $newstate = $NON_COMMENT_BLOCK; # slash-slash-hash or slash-slash-space-hash is blanked if not at beginning of file. if ($keephash == 0 && $line =~ m|^\s*// ?\#|) { $line = "\n"; } $comment = $line; # If this line contains only a slash-slash comment, then # the comment block might need to be converted. if ($line =~ m|(^\s*)(//)(\s*)(.*)|) { # Remove indentation, because doxygen treats a line with 4 leading spaces # (after an empty line) as an example code block. $indent = $1; $indent2 = $3; $comment = $4; if ($indent2 =~ m|\s.*|) { $comment = " $comment"; } # slash-slash-slash/hash are kept as such (is doxygen already). # Four slashes is comment in code examples, thus is normal comment. if ($comment !~ m|^[/#][^/]| && $comment !~ m|^[/#]$|) { $keephash = 0; $newstate = $COMMENT_BLOCK; # Doxygen treats #name as a request to link to name. # So escape the #. Don't do that for #include and if. $comment =~ s|([ (])#([a-z]+)|$1\\#$2|ig; $comment =~ s| \\#include| #include|g; $comment =~ s| \\#if| #if|g; $comment =~ s| \\#endif| #endif|g; # Remove possible prototype text. $comment =~ s|You should have at least a preliminary understanding of these classes:||; $comment =~ s|
  • ||; # A module header is turned into a defgroup and added to the package. if ($isModHdr == 1) { if ($comment =~ m|^\s*|i) { $comment =~ s|| \\anchor ${modnm}_anchor \\ingroup $pkgnm\n\\defgroup $modnm $modnm|i; $nadded += 2; } $comment =~ s||*/\n/** \\ingroup $modnm\n\\defgroup ${modnm}_internal_classes ${modnm}_internal_classes\n\\brief Internal $modnm classes and functions|i; $comment =~ s|^\s*| \\brief |ig; $comment =~ s||

    See below for an overview of the classes in this module.|i; } else { # A class or group header's summary is added to the module's defgroup. if ($comment =~ m|^\s*

    |i) { if ($FIRST_SUMMARY == 1) { $comment =~ s|| \\anchor ${hdrnm}_summary \\ingroup $modnm \n\\brief |i; $FIRST_SUMMARY = 0; } else { $comment =~ s|| \\ingroup $modnm \n\\brief |i; } $nadded += 1; $summinx = @spanning_comment + 1; # index of ingroup line } $comment =~ s|||i; } # Handle group tags (also the old fashioned +grp/-grp). # Turn a named group with a summary into a struct, so doxygen # puts it into the module header at the right place. # Keep track of the group level, so such a named group is ended # like a struct with };. # Named groups are always preceeded by an anchor for linkto references. # Unnamed groups are removed because doxygen handles them in a strange way. # Sometimes they do not appear in the summary output. $comment =~ s|^\s*\+grp||; $comment =~ s|^\s*-grp||; if ($comment =~ m||i) { $named = 1; $grpnm = $1; $grpnm =~ s|\s*['".]\s*||g; $grpnm =~ s|\s+|_|g; $grpnm =~ s|:|_|g; $comment = "\\anchor ${hdrnm}_$grpnm "; # Only a named group at the highest level is turned into a struct. # Do this only if it has a summary, which indicates it describes # a group of functions outside a class. if ($grouplevel == 0 && $summinx >= 0) { $namedgrouplevel += 1; $extraline = "struct ${hdrnm}_global_functions_${grpnm} {\n"; $nadded += 1; } else { # Otherwise open a doxygen group. $extraline = "//@\{\n"; $nadded += 1; } $grouplevel += 1; } elsif ($comment =~ m||) { $named = 0; ## $comment =~ s|| \\name='' @\{|i; ## $comment =~ s||@\{|i; $comment =~ s|||i; $grouplevel += 1; } elsif ($comment =~ m||) { if ($namedgrouplevel == $grouplevel) { $line = "\};\n"; $newstate = $NON_COMMENT_BLOCK; $namedgrouplevel -= 1; } else { if ($named == 1) { $comment =~ s||@\}|i; } else { $comment =~ s|||i; } } $grouplevel -= 1; } # Change an anchor tag. # Replace it by a doxygen \anchor tag and an tag. # Prepend the doxygen name with the header name. # The latter one is used for internal references. if ( $comment =~ m||i ) { my $nm = $1; my $rem = $2; my $dnm = $nm; $dnm =~ s|\s*['".]\s*||g; $dnm =~ s|\s+|_|g; $dnm =~ s|:|_|g; $comment =~ s|| \\anchor $dnm |i; } $comment =~ s|||ig; # Handle linkto tags. There can be multiple of them and they can be # spread over multiple lines. if ( $link==1 ) { if ( $comment =~ m|(.*?)(.*)|i ) { my $b = $2; $linkstr = handleLinkto ($linkstr . " $1"); $comment = "$linkstr $b"; $link = 0; } else { $linkstr .= " $comment"; $comment = ""; } } while ( $link==0 && $comment =~ m|(.*)|i ) { my $a = $1; my $c = $3; my $linkstr = handleLinkto ("(.*)|i ) { $comment = $2; $linkfr = 0; } else { $comment = ""; } } while ( $linkfr==0 && $comment =~ m|(.*)|i ) { $comment = "$1 $3"; } elsif ( $comment =~ m|(.*?)| \\code |ig; $comment =~ s|| \\endcode |ig; $comment =~ s||

    Motivation

    |ig; $comment =~ s|
    ||ig; $comment =~ s||

    Synopsis

    |ig; $comment =~ s|
    ||ig; if ( $comment =~ m||i ) { $nexamples += 1; $comment =~ s||

    Example

    \\anchor ${hdrnm}_example${nexamples}|ig; } $comment =~ s|
    ||ig; $comment =~ s||

    Etymology

    |ig; $comment =~ s|
    ||ig; $comment =~ s||

    Motivation

    |ig; $comment =~ s|
    ||ig; # Remove obsolete category tag (used in e.g. Map.h>). $comment =~ s|||i; # Use current date in todo if needed. if ( $comment =~ //i ) { my $date = $1; if ( $date ) { $comment =~ s||

    To Do ($date)

      |i; } else { $comment =~ s||

      To Do

        |i; } $todo = 1; $todostr = $comment; $comment = ""; } # Do not insert todo if empty (i.e. no
      • lines). if ( $todo ) { if ( $comment =~ m||i ) { $comment = ""; $todo = 0; } elsif ( $comment =~ m|
      • |i ) { $comment = $todostr . $comment; $todo = 0; } else { $todostr .= $comment; $comment = "" } } $comment =~ s||
      |i; # Do not use
        for an empty prerequisite. if ( $comment =~ /^\s*/i ) { $comment = ""; $prereq = 1; } elsif ( $prereq ) { if ( $comment =~ m|^\s*|i ) { # No lines, so do not insert
      . $comment = ""; $prereq = 0; } elsif ( $comment !~ m|^\s*$| ) { # First non-empty line, so prepend with
        . $comment = "

        Prerequisite

          " . $comment; $prereq = 0; } } $comment =~ s|^\s*|
        |i; # Do not use
          for an empty thrown. if ( $comment =~ /^\s*/i ) { $comment = ""; $thrown = 1; } elsif ( $thrown ) { if ( $comment =~ m|^\s*|i ) { # No lines, so do not insert
        . $comment = ""; $thrown = 0; } elsif ( $comment !~ m|^\s*$| ) { # First non-empty line, so prepend with