commit
432df53deb
|
@ -0,0 +1,47 @@
|
||||||
|
# CodeDocs.xyz Configuration File
|
||||||
|
|
||||||
|
# Optional project name, if left empty the GitHub repository name will be used.
|
||||||
|
PROJECT_NAME = "SageCal"
|
||||||
|
|
||||||
|
# One or more directories and files that contain example code to be included.
|
||||||
|
#EXAMPLE_PATH =
|
||||||
|
|
||||||
|
# One or more directories and files to exclude from documentation generation.
|
||||||
|
# Use relative paths with respect to the repository root directory.
|
||||||
|
EXCLUDE = pkg build
|
||||||
|
|
||||||
|
# One or more wildcard patterns to exclude files and directories from document
|
||||||
|
# generation.
|
||||||
|
#EXCLUDE_PATTERNS =
|
||||||
|
|
||||||
|
# One or more symbols to exclude from document generation. Symbols can be
|
||||||
|
# namespaces, classes, or functions.
|
||||||
|
#EXCLUDE_SYMBOLS =
|
||||||
|
|
||||||
|
# Override the default parser (language) used for each file extension.
|
||||||
|
EXTENSION_MAPPING =
|
||||||
|
|
||||||
|
# Set the wildcard patterns used to filter out the source-files.
|
||||||
|
# If left blank the default is:
|
||||||
|
# *.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl,
|
||||||
|
# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php,
|
||||||
|
# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox, *.py,
|
||||||
|
# *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
|
||||||
|
FILE_PATTERNS = *.c \
|
||||||
|
*.cpp \
|
||||||
|
*.cxx \
|
||||||
|
*.cu \
|
||||||
|
*.h \
|
||||||
|
*.hpp \
|
||||||
|
*.md
|
||||||
|
|
||||||
|
# Hide undocumented class members.
|
||||||
|
#HIDE_UNDOC_MEMBERS =
|
||||||
|
|
||||||
|
# Hide undocumented classes.
|
||||||
|
#HIDE_UNDOC_CLASSES =
|
||||||
|
|
||||||
|
# Specify a markdown page whose contents should be used as the main page
|
||||||
|
# (index.html). This will override a page marked as \mainpage. For example, a
|
||||||
|
# README.md file usually serves as a useful main page.
|
||||||
|
USE_MDFILE_AS_MAINPAGE = README.md
|
|
@ -0,0 +1,16 @@
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# Tab indentation (no size specified)
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.{c,h,cpp,hpp}]
|
||||||
|
indent_size = 2
|
|
@ -1,3 +1,5 @@
|
||||||
|
build
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
*/*.png
|
*/*.png
|
||||||
|
|
21
.travis.yml
21
.travis.yml
|
@ -6,18 +6,17 @@ language: cpp
|
||||||
#env:
|
#env:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- docker pull ubuntu:xenial
|
- docker pull fdiblen/ubuntu1604-test:latest
|
||||||
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build ubuntu:xenial
|
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build fdiblen/ubuntu1604-test:latest
|
||||||
|
- docker pull fdiblen/sl7-test:latest
|
||||||
|
- docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build fdiblen/sl7-test:latest
|
||||||
|
# - docker pull base/archlinux
|
||||||
|
# - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
||||||
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
|
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
|
||||||
- docker exec ubuntu-build apt-get update -y
|
- docker exec -e BRANCH=$BRANCH -e IMAGE='ubuntu' ubuntu-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
|
||||||
- docker exec ubuntu-build apt-get install software-properties-common -y
|
- docker exec -e BRANCH=$BRANCH -e IMAGE='sl7' sl-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
|
||||||
- docker exec ubuntu-build add-apt-repository -s ppa:kernsuite/kern-3 -y
|
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh"
|
||||||
- docker exec ubuntu-build apt-add-repository multiverse
|
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh"
|
||||||
- docker exec ubuntu-build apt-get update -y
|
|
||||||
- docker exec ubuntu-build apt-get install -y git cmake g++ pkg-config libcfitsio-bin libcfitsio-dev libopenblas-base libopenblas-dev wcslib-dev wcslib-tools libglib2.0-dev libcasa-casa2 casacore-dev casacore-data casacore-tools
|
|
||||||
- |
|
|
||||||
docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/test-builds/test-ubuntu.sh"
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,13 @@ enable_language(CXX)
|
||||||
|
|
||||||
#--------------------------------------- project
|
#--------------------------------------- project
|
||||||
project (SageCal)
|
project (SageCal)
|
||||||
|
|
||||||
|
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
||||||
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release" FORCE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(PROJECT_VERSION_MAJOR 0)
|
set(PROJECT_VERSION_MAJOR 0)
|
||||||
set(PROJECT_VERSION_MINOR 6)
|
set(PROJECT_VERSION_MINOR 6)
|
||||||
set(PROJECT_VERSION_PATCH 0)
|
set(PROJECT_VERSION_PATCH 0)
|
||||||
|
@ -10,6 +17,7 @@ set(PROJECT_VERSION_REVISION 1)
|
||||||
set(PROJECT_VERSION
|
set(PROJECT_VERSION
|
||||||
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
|
|
||||||
|
message(STATUS "\n############################\n# HOST SYSTEM v${CMAKE_HOST_SYSTEM_NAME}\n############################")
|
||||||
message(STATUS "\n############################\n# Building SageCal v${PROJECT_VERSION}\n############################")
|
message(STATUS "\n############################\n# Building SageCal v${PROJECT_VERSION}\n############################")
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
|
@ -27,7 +35,6 @@ SET(LIBRARY_OUTPUT_PATH "${MAINFOLDER}/dist/lib")
|
||||||
set( CMAKE_MODULE_PATH $ENV{CMAKE_MODULE_PATH} )
|
set( CMAKE_MODULE_PATH $ENV{CMAKE_MODULE_PATH} )
|
||||||
set( CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH} )
|
set( CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH} )
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------- cmake modules
|
#--------------------------------------- cmake modules
|
||||||
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/CMakeModules)
|
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/CMakeModules)
|
||||||
|
|
||||||
|
@ -49,14 +56,15 @@ IF("${isSystemDir}" STREQUAL "-1")
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||||
|
|
||||||
# libsynthesis has mix of C++ and Fortran which is not handled well by
|
|
||||||
# versions before 2.8.
|
|
||||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
|
||||||
if(NOT LIB_EXTRA_SYNTHESIS)
|
|
||||||
set(LIB_EXTRA_SYNTHESIS gfortran)
|
|
||||||
endif(NOT LIB_EXTRA_SYNTHESIS)
|
|
||||||
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
|
||||||
|
|
||||||
|
# # libsynthesis has mix of C++ and Fortran which is not handled well by
|
||||||
|
# # versions before 2.8.
|
||||||
|
# if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
||||||
|
# if(NOT LIB_EXTRA_SYNTHESIS)
|
||||||
|
# set(LIB_EXTRA_SYNTHESIS gfortran)
|
||||||
|
# endif(NOT LIB_EXTRA_SYNTHESIS)
|
||||||
|
# endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------- SageCal dependencies
|
#--------------------------------------- SageCal dependencies
|
||||||
|
@ -72,7 +80,7 @@ include_directories(${CASACORE_INCLUDE_DIR})
|
||||||
|
|
||||||
#cfitsio
|
#cfitsio
|
||||||
find_package(CfitsIO REQUIRED)
|
find_package(CfitsIO REQUIRED)
|
||||||
include_directories(${CFITSIO_INCLUDE_DIR})
|
include_directories(${CFITSIO_INCLUDE})
|
||||||
|
|
||||||
#lapack
|
#lapack
|
||||||
find_package(LAPACK REQUIRED)
|
find_package(LAPACK REQUIRED)
|
||||||
|
@ -90,10 +98,21 @@ include_directories(${OpenBLAS_INCLUDE_DIR})
|
||||||
#find_package(BLAS REQUIRED)
|
#find_package(BLAS REQUIRED)
|
||||||
#include_directories(${BLAS_INCLUDE_DIR})
|
#include_directories(${BLAS_INCLUDE_DIR})
|
||||||
|
|
||||||
# FIXME: is this really needed?
|
# ##gfortran
|
||||||
##gfortran
|
enable_language(Fortran)
|
||||||
#find_package(GFortranLibs REQUIRED)
|
#find_package(GFortranLibs REQUIRED)
|
||||||
#include_directories(${GFORTRAN_INCLUDE_DIR})
|
# include_directories(${GFORTRAN_INCLUDE_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# enable_language(Fortran)
|
||||||
|
# # get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
|
||||||
|
# set(FC "$ENV{FC}" CACHE INTERNAL "Got from environment variable")
|
||||||
|
# set(CMAKE_Fortran_COMPILER "$ENV{FC}" CACHE INTERNAL "Got from environment variable")
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
##hdf5
|
##hdf5
|
||||||
#find_package(HDF5 REQUIRED)
|
#find_package(HDF5 REQUIRED)
|
||||||
|
@ -121,11 +140,9 @@ endif()
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------- build parameters for all targets
|
#--------------------------------------- build parameters for all targets
|
||||||
#set (CMAKE_CXX_FLAGS "-g -O3 -Wall -Wextra -std=c++11 -W -pedantic -ansi -fPIC -fpermissive -fno-omit-frame-pointer -fno-inline-functions -fno-inline-functions-called-once -fno-optimize-sibling-calls")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x -g -O3")
|
||||||
# set (CMAKE_CXX_FLAGS "-std=c++0x -g -O3 -Wall -Wextra -W -pedantic -ansi -fPIC -fpermissive")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -pg -Wall -DNDEBUG -Wextra -Wcast-align -Wpointer-arith -Woverloaded-virtual -Wwrite-strings -Wcast-qual -Wctor-dtor-privacy -Wno-long-long-Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wno-unused")
|
||||||
set (CMAKE_CXX_FLAGS "-std=c++0x -g -O3 -Wall")
|
|
||||||
# FIXME: add debug build option
|
|
||||||
#set (CMAKE_CXX_FLAGS_DEBUG "-g -pg -pedantic -Wall -DNDEBUG -Wextra -Wcast-align -Wpointer-arith -Woverloaded-virtual -Wwrite-strings -Wcast-qual -Wctor-dtor-privacy -Wno-long-long-Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wno-unused")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,6 +150,7 @@ set (CMAKE_CXX_FLAGS "-std=c++0x -g -O3 -Wall")
|
||||||
#--------------------------------------- summary
|
#--------------------------------------- summary
|
||||||
message(STATUS "\n############################\n# Configuration summary\n############################")
|
message(STATUS "\n############################\n# Configuration summary\n############################")
|
||||||
message (STATUS "CMAKE_SYSTEM .......... = ${CMAKE_SYSTEM}")
|
message (STATUS "CMAKE_SYSTEM .......... = ${CMAKE_SYSTEM}")
|
||||||
|
message (STATUS "CMAKE_INSTALL_PREFIX .. = ${CMAKE_INSTALL_PREFIX}")
|
||||||
message (STATUS "CMAKE_BUILD_TYPE ...... = ${CMAKE_BUILD_TYPE}")
|
message (STATUS "CMAKE_BUILD_TYPE ...... = ${CMAKE_BUILD_TYPE}")
|
||||||
message (STATUS "BUILD_SHARED_LIBS ..... = ${BUILD_SHARED_LIBS}")
|
message (STATUS "BUILD_SHARED_LIBS ..... = ${BUILD_SHARED_LIBS}")
|
||||||
message (STATUS "CMAKE_INSTALL_NAME_DIR = ${CMAKE_INSTALL_NAME_DIR}")
|
message (STATUS "CMAKE_INSTALL_NAME_DIR = ${CMAKE_INSTALL_NAME_DIR}")
|
||||||
|
@ -143,30 +161,36 @@ message (STATUS "CMAKE_CXX_FLAGS ....... = ${CMAKE_CXX_FLAGS}")
|
||||||
message (STATUS "ENABLE_MPI ............ = ${ENABLE_MPI}")
|
message (STATUS "ENABLE_MPI ............ = ${ENABLE_MPI}")
|
||||||
message (STATUS "ENABLE_CUDA ........... = ${ENABLE_CUDA}")
|
message (STATUS "ENABLE_CUDA ........... = ${ENABLE_CUDA}")
|
||||||
|
|
||||||
message (STATUS "CASACORE_INCLUDE_DIR........... = ${CASACORE_INCLUDE_DIR}")
|
message (STATUS "CASACORE_INCLUDE_DIR....= ${CASACORE_INCLUDE_DIR}")
|
||||||
message (STATUS "CASACORE_LIBRARIES........... = ${CASACORE_LIBRARIES}")
|
message (STATUS "CASACORE_LIBRARIES......= ${CASACORE_LIBRARIES}")
|
||||||
|
|
||||||
message (STATUS "OpenBLAS_LIB .......... = ${OpenBLAS_LIB}")
|
message (STATUS "OpenBLAS_LIB .......... = ${OpenBLAS_LIB}")
|
||||||
|
|
||||||
message (STATUS "GLIB_PKG_INCLUDE_DIRS.............. = ${GLIB_PKG_INCLUDE_DIRS}")
|
message (STATUS "GLIB_PKG_INCLUDE_DIRS...= ${GLIB_PKG_INCLUDE_DIRS}")
|
||||||
message (STATUS "GLIB_PKG_LIBRARIES............. = ${GLIB_PKG_LIBRARIES}")
|
message (STATUS "GLIB_PKG_LIBRARIES......= ${GLIB_PKG_LIBRARIES}")
|
||||||
|
|
||||||
#message (STATUS "LAPACK-INC ............ = ${LAPACK_INCLUDE_DIR}")
|
#message (STATUS "LAPACK-INC ............ = ${LAPACK_INCLUDE_DIR}")
|
||||||
message (STATUS "LAPACK_LIBRARIES........... = ${LAPACK_LIBRARIES}")
|
message (STATUS "LAPACK_LIBRARIES........= ${LAPACK_LIBRARIES}")
|
||||||
|
|
||||||
#message (STATUS "GFORTRAN-INC ......... = ${GFORTRAN_INCLUDE_DIR}")
|
# message (STATUS "GFORTRAN-INC ......... = ${GFORTRAN_INCLUDE_DIR}")
|
||||||
#message (STATUS "GFORTRAN-LIBS ......... = ${LIBGFORTRAN_LIBRARIES}")
|
# message (STATUS "GFORTRAN-LIBS ......... = ${LIBGFORTRAN_LIBRARIES}")
|
||||||
|
message (STATUS "CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}")
|
||||||
|
|
||||||
message (STATUS "CFITSIO_INCLUDE_DIR.......... = ${CFITSIO_INCLUDE_DIR}")
|
message (STATUS "CFITSIO_ROOT_DIR........= ${CFITSIO_ROOT_DIR}")
|
||||||
message (STATUS "CFITSIO_LIBRARIES.......... = ${CFITSIO_LIBRARIES}")
|
message (STATUS "CFITSIO_INCLUDE.........= ${CFITSIO_INCLUDE}")
|
||||||
|
message (STATUS "CFITSIO_LIB.............= ${CFITSIO_LIB}")
|
||||||
|
|
||||||
message (STATUS "WCSLIB_INCLUDE_DIR........... = ${WCSLIB_INCLUDE_DIR}")
|
message (STATUS "WCSLIB_INCLUDE_DIRS.....= ${WCSLIB_INCLUDE_DIRS}")
|
||||||
message (STATUS "WCSLIB_LIBRARIES ........... = ${WCSLIB_LIBRARIES}")
|
message (STATUS "WCSLIB_LIBRARIES .......= ${WCSLIB_LIBRARIES}")
|
||||||
|
|
||||||
message (STATUS "HDF5_INCLUDE_DIR........... = ${HDF5_INCLUDE_DIRS}")
|
message (STATUS "HDF5_INCLUDE_DIR........= ${HDF5_INCLUDE_DIRS}")
|
||||||
message (STATUS "HDF5_LIBRARIES........... = ${HDF5_LIBRARIES}")
|
message (STATUS "HDF5_LIBRARIES..........= ${HDF5_LIBRARIES}")
|
||||||
|
|
||||||
|
|
||||||
|
message (STATUS "CMAKE_CURRENT_BINARY_DIR..........= ${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
message (STATUS "CMAKE_CURRENT_LIST_DIR..........= ${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
message (STATUS "CMAKE_INSTALL_PREFIX..........= ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------- include directories
|
#--------------------------------------- include directories
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
@ -177,3 +201,5 @@ add_subdirectory(src)
|
||||||
# FIXME: this will be the final step for testing
|
# FIXME: this will be the final step for testing
|
||||||
#file(COPY ${PROJECT_SOURCE_DIR}/test DESTINATION ${MAINFOLDER}/dist/test)
|
#file(COPY ${PROJECT_SOURCE_DIR}/test DESTINATION ${MAINFOLDER}/dist/test)
|
||||||
|
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/ DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
|
@ -71,7 +71,15 @@
|
||||||
# directly fed to the linker.
|
# directly fed to the linker.
|
||||||
#
|
#
|
||||||
# Usage: casacore_resolve_dependencies(result components...)
|
# Usage: casacore_resolve_dependencies(result components...)
|
||||||
#
|
|
||||||
|
|
||||||
|
if (NOT "$ENV{CASACORE_ROOT_DIR}" STREQUAL "")
|
||||||
|
set(CASACORE_ROOT_DIR "$ENV{CASACORE_ROOT_DIR}" CACHE INTERNAL "Got from environment variable")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
macro(casacore_resolve_dependencies _result)
|
macro(casacore_resolve_dependencies _result)
|
||||||
set(${_result} ${ARGN})
|
set(${_result} ${ARGN})
|
||||||
set(_index 0)
|
set(_index 0)
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
# CFITSIO_ROOT_DIR - CFITSIO root directory
|
# CFITSIO_ROOT_DIR - CFITSIO root directory
|
||||||
# Variables defined by this module:
|
# Variables defined by this module:
|
||||||
# CFITSIO_FOUND - system has CFITSIO
|
# CFITSIO_FOUND - system has CFITSIO
|
||||||
# CFITSIO_INCLUDE_DIR - the CFITSIO include directory (cached)
|
# CFITSIO_INCLUDE - the CFITSIO include directory (cached)
|
||||||
# CFITSIO_INCLUDE_DIRS - the CFITSIO include directories
|
# CFITSIO_INCLUDES - the CFITSIO include directories
|
||||||
# (identical to CFITSIO_INCLUDE_DIR)
|
# (identical to CFITSIO_INCLUDE)
|
||||||
# CFITSIO_LIBRARY - the CFITSIO library (cached)
|
# CFITSIO_LIBRARY - the CFITSIO library (cached)
|
||||||
# CFITSIO_LIBRARIES - the CFITSIO libraries
|
# CFITSIO_LIB - the CFITSIO libraries
|
||||||
# (identical to CFITSIO_LIBRARY)
|
# (identical to CFITSIO_LIBRARY)
|
||||||
# CFITSIO_VERSION_STRING the found version of CFITSIO, padded to 3 digits
|
# CFITSIO_VERSION_STRING the found version of CFITSIO, padded to 3 digits
|
||||||
|
|
||||||
|
@ -33,12 +33,17 @@
|
||||||
|
|
||||||
if(NOT CFITSIO_FOUND)
|
if(NOT CFITSIO_FOUND)
|
||||||
|
|
||||||
find_path(CFITSIO_INCLUDE_DIR fitsio.h
|
if (NOT "$ENV{CFITSIO_ROOT_DIR}" STREQUAL "")
|
||||||
|
set(CFITSIO_ROOT_DIR "$ENV{CFITSIO_ROOT_DIR}" CACHE INTERNAL "Got from environment variable")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
find_path(CFITSIO_INCLUDE fitsio.h
|
||||||
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio
|
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio
|
||||||
include/libcfitsio0)
|
include/libcfitsio0)
|
||||||
|
|
||||||
if(CFITSIO_INCLUDE_DIR)
|
if(CFITSIO_INCLUDE)
|
||||||
FILE(READ "${CFITSIO_INCLUDE_DIR}/fitsio.h" CFITSIO_H)
|
FILE(READ "${CFITSIO_INCLUDE}/fitsio.h" CFITSIO_H)
|
||||||
set(CFITSIO_VERSION_REGEX ".*#define CFITSIO_VERSION[^0-9]*([0-9]+)\\.([0-9]+).*")
|
set(CFITSIO_VERSION_REGEX ".*#define CFITSIO_VERSION[^0-9]*([0-9]+)\\.([0-9]+).*")
|
||||||
if ("${CFITSIO_H}" MATCHES ${CFITSIO_VERSION_REGEX})
|
if ("${CFITSIO_H}" MATCHES ${CFITSIO_VERSION_REGEX})
|
||||||
# Pad CFITSIO minor version to three digit because 3.181 is older than 3.35
|
# Pad CFITSIO minor version to three digit because 3.181 is older than 3.35
|
||||||
|
@ -51,24 +56,24 @@ if(NOT CFITSIO_FOUND)
|
||||||
else ()
|
else ()
|
||||||
set(CFITSIO_VERSION_STRING "Unknown")
|
set(CFITSIO_VERSION_STRING "Unknown")
|
||||||
endif()
|
endif()
|
||||||
endif(CFITSIO_INCLUDE_DIR)
|
endif(CFITSIO_INCLUDE)
|
||||||
|
|
||||||
find_library(CFITSIO_LIBRARY cfitsio
|
find_library(CFITSIO_LIBRARY cfitsio
|
||||||
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
|
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
|
||||||
find_library(M_LIBRARY m)
|
find_library(M_LIBRARY m)
|
||||||
mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY M_LIBRARY)
|
mark_as_advanced(CFITSIO_INCLUDE CFITSIO_LIBRARY M_LIBRARY)
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||||
find_package_handle_standard_args(CFITSIO DEFAULT_MSG
|
find_package_handle_standard_args(CFITSIO DEFAULT_MSG
|
||||||
CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE_DIR)
|
CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE)
|
||||||
else ()
|
else ()
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(CFITSIO
|
find_package_handle_standard_args(CFITSIO
|
||||||
REQUIRED_VARS CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE_DIR
|
REQUIRED_VARS CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE
|
||||||
VERSION_VAR CFITSIO_VERSION_STRING)
|
VERSION_VAR CFITSIO_VERSION_STRING)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(CFITSIO_INCLUDE_DIRS ${CFITSIO_INCLUDE_DIR})
|
set(CFITSIO_INCLUDES ${CFITSIO_INCLUDE})
|
||||||
set(CFITSIO_LIBRARIES ${CFITSIO_LIBRARY} ${M_LIBRARY})
|
set(CFITSIO_LIB ${CFITSIO_LIBRARY} ${M_LIBRARY})
|
||||||
|
|
||||||
endif(NOT CFITSIO_FOUND)
|
endif(NOT CFITSIO_FOUND)
|
||||||
|
|
|
@ -24,120 +24,128 @@ if(NOT CMAKE_REQUIRED_QUIET)
|
||||||
message(STATUS "Looking for gfortran related libraries...")
|
message(STATUS "Looking for gfortran related libraries...")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# enable_language(Fortran)
|
||||||
|
# if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
|
||||||
|
#
|
||||||
|
# # Basically, call "gfortran -v" to dump compiler info to the string
|
||||||
|
# # GFORTRAN_VERBOSE_STR, which will be used to get necessary paths
|
||||||
|
# message(STATUS "Extracting library and header information by calling 'gfortran -v'...")
|
||||||
|
# execute_process(COMMAND "${CMAKE_Fortran_COMPILER}" "-v" ERROR_VARIABLE
|
||||||
|
# GFORTRAN_VERBOSE_STR RESULT_VARIABLE FLAG)
|
||||||
|
#
|
||||||
|
# # For debugging
|
||||||
|
# message(STATUS "'gfortran -v' returned:")
|
||||||
|
# message(STATUS "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
#
|
||||||
|
# # Detect gfortran version
|
||||||
|
# string(REGEX MATCH "gcc version [^\t\n ]+" GFORTRAN_VER_STR "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
# string(REGEX REPLACE "gcc version ([^\t\n ]+)" "\\1" GFORTRAN_VERSION_STRING "${GFORTRAN_VER_STR}")
|
||||||
|
# message(STATUS "Detected gfortran version ${GFORTRAN_VERSION_STRING}")
|
||||||
|
# unset(GFORTRAN_VER_STR)
|
||||||
|
#
|
||||||
|
# set(MATCH_REGEX "[^\t\n ]+[\t\n ]+")
|
||||||
|
# set(REPLACE_REGEX "([^\t\n ]+)")
|
||||||
|
#
|
||||||
|
# # Find architecture for compiler
|
||||||
|
# string(REGEX MATCH "Target: [^\t\n ]+"
|
||||||
|
# GFORTRAN_ARCH_STR "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
# message(STATUS "Architecture string: ${GFORTRAN_ARCH_STR}")
|
||||||
|
# string(REGEX REPLACE "Target: ([^\t\n ]+)" "\\1"
|
||||||
|
# GFORTRAN_ARCH "${GFORTRAN_ARCH_STR}")
|
||||||
|
# message(STATUS "Detected gfortran architecture: ${GFORTRAN_ARCH}")
|
||||||
|
# unset(GFORTRAN_ARCH_STR)
|
||||||
|
#
|
||||||
|
# # Find install prefix, if it exists; if not, use default
|
||||||
|
# string(REGEX MATCH "--prefix=[^\t\n ]+[\t\n ]+"
|
||||||
|
# GFORTRAN_PREFIX_STR "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
# if(NOT GFORTRAN_PREFIX_STR)
|
||||||
|
# message(STATUS "Detected default gfortran prefix")
|
||||||
|
# set(GFORTRAN_PREFIX_DIR "/usr/local") # default prefix for gcc install
|
||||||
|
# else()
|
||||||
|
# string(REGEX REPLACE "--prefix=([^\t\n ]+)" "\\1"
|
||||||
|
# GFORTRAN_PREFIX_DIR "${GFORTRAN_PREFIX_STR}")
|
||||||
|
# endif()
|
||||||
|
# message(STATUS "Detected gfortran prefix: ${GFORTRAN_PREFIX_DIR}")
|
||||||
|
# unset(GFORTRAN_PREFIX_STR)
|
||||||
|
#
|
||||||
|
# # Find install exec-prefix, if it exists; if not, use default
|
||||||
|
# string(REGEX MATCH "--exec-prefix=[^\t\n ]+[\t\n ]+" "\\1"
|
||||||
|
# GFORTRAN_EXEC_PREFIX_STR "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
# if(NOT GFORTRAN_EXEC_PREFIX_STR)
|
||||||
|
# message(STATUS "Detected default gfortran exec-prefix")
|
||||||
|
# set(GFORTRAN_EXEC_PREFIX_DIR "${GFORTRAN_PREFIX_DIR}")
|
||||||
|
# else()
|
||||||
|
# string(REGEX REPLACE "--exec-prefix=([^\t\n ]+)" "\\1"
|
||||||
|
# GFORTRAN_EXEC_PREFIX_DIR "${GFORTRAN_EXEC_PREFIX_STR}")
|
||||||
|
# endif()
|
||||||
|
# message(STATUS "Detected gfortran exec-prefix: ${GFORTRAN_EXEC_PREFIX_DIR}")
|
||||||
|
# UNSET(GFORTRAN_EXEC_PREFIX_STR)
|
||||||
|
#
|
||||||
|
# # Find library directory and include directory, if library directory specified
|
||||||
|
# string(REGEX MATCH "--libdir=[^\t\n ]+"
|
||||||
|
# GFORTRAN_LIB_DIR_STR "${GFORTRAN_VERBOSE_STR}")
|
||||||
|
# if(NOT GFORTRAN_LIB_DIR_STR)
|
||||||
|
# message(STATUS "Found --libdir flag -- not found")
|
||||||
|
# message(STATUS "Using default gfortran library & include directory paths")
|
||||||
|
# set(GFORTRAN_LIBRARIES_DIR
|
||||||
|
# "${GFORTRAN_EXEC_PREFIX_DIR}/lib/gcc/${GFORTRAN_ARCH}/${GFORTRAN_VERSION_STRING}")
|
||||||
|
# string(CONCAT GFORTRAN_INCLUDE_DIR "${GFORTRAN_LIBRARIES_DIR}" "/include")
|
||||||
|
# else()
|
||||||
|
# message(STATUS "Found --libdir flag -- yes")
|
||||||
|
# string(REGEX REPLACE "--libdir=([^\t\n ]+)" "\\1"
|
||||||
|
# GFORTRAN_LIBRARIES_DIR "${GFORTRAN_LIB_DIR_STR}")
|
||||||
|
# string(CONCAT GFORTRAN_INCLUDE_DIR "${GFORTRAN_LIBRARIES_DIR}" "/gcc/" "${GFORTRAN_ARCH}" "/" "${GFORTRAN_VERSION_STRING}" "/include")
|
||||||
|
# endif()
|
||||||
|
# message(STATUS "gfortran libraries path: ${GFORTRAN_LIBRARIES_DIR}")
|
||||||
|
# message(STATUS "gfortran include path dir: ${GFORTRAN_INCLUDE_DIR}")
|
||||||
|
# unset(GFORTRAN_LIB_DIR_STR)
|
||||||
|
#
|
||||||
|
# # There are lots of other build options for gcc & gfortran. For now, the
|
||||||
|
# # options implemented above should cover a lot of common use cases.
|
||||||
|
#
|
||||||
|
# # Clean up be deleting the output string from "gfortran -v"
|
||||||
|
# unset(GFORTRAN_VERBOSE_STR)
|
||||||
|
#
|
||||||
|
# # Find paths for libgfortran, libquadmath, libgomp
|
||||||
|
# # libgomp needed for OpenMP support without Clang
|
||||||
|
# find_library(LIBGFORTRAN_LIBRARIES NAMES gfortran libgfortran
|
||||||
|
# HINTS ${GFORTRAN_LIBRARIES_DIR})
|
||||||
|
# find_library(LIBQUADMATH_LIBRARIES NAMES quadmath libquadmath
|
||||||
|
# HINTS ${GFORTRAN_LIBRARIES_DIR})
|
||||||
|
# find_library(LIBGOMP_LIBRARIES NAMES gomp libgomp
|
||||||
|
# HINTS ${GFORTRAN_LIBRARIES_DIR})
|
||||||
|
#
|
||||||
|
# # Find OpenMP headers
|
||||||
|
# find_path(LIBGOMP_INCLUDE_DIR NAMES omp.h HINTS ${GFORTRAN_INCLUDE_DIR})
|
||||||
|
#
|
||||||
|
# else()
|
||||||
|
# message(STATUS "CMAKE_Fortran_COMPILER_ID does not match 'GNU'!")
|
||||||
|
# endif()
|
||||||
|
#
|
||||||
|
# include(FindPackageHandleStandardArgs)
|
||||||
|
#
|
||||||
|
# # Required: libgfortran, libquadmath, path for gfortran libraries
|
||||||
|
# # Optional: libgomp, path for OpenMP headers, path for gcc/gfortran headers
|
||||||
|
# find_package_handle_standard_args(GFortranLibs
|
||||||
|
# REQUIRED_VARS LIBGFORTRAN_LIBRARIES LIBQUADMATH_LIBRARIES GFORTRAN_LIBRARIES_DIR
|
||||||
|
# VERSION_VAR GFORTRAN_VERSION_STRING)
|
||||||
|
#
|
||||||
|
# if(GFORTRANLIBS_FOUND)
|
||||||
|
# message(STATUS "Looking for gfortran libraries -- found")
|
||||||
|
# message(STATUS "gfortran version: ${GFORTRAN_VERSION_STRING}")
|
||||||
|
# else()
|
||||||
|
# message(STATUS "Looking for gfortran libraries -- not found")
|
||||||
|
# endif()
|
||||||
|
#
|
||||||
|
# mark_as_advanced(LIBGFORTRAN_LIBRARIES LIBQUADMATH_LIBRARIES
|
||||||
|
# LIBGOMP_LIBRARIES LIBGOMP_INCLUDE_DIR
|
||||||
|
# GFORTRAN_LIBRARIES_DIR GFORTRAN_INCLUDE_DIR)
|
||||||
|
# # FindGFortranLIBS.cmake ends here
|
||||||
|
|
||||||
|
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
|
# if (NOT "$ENV{FC}" STREQUAL "")
|
||||||
|
# set(FC "$ENV{FC}" CACHE INTERNAL "Got from environment variable")
|
||||||
# Basically, call "gfortran -v" to dump compiler info to the string
|
# set(CMAKE_Fortran_COMPILER "$ENV{FC}" CACHE INTERNAL "Got from environment variable")
|
||||||
# GFORTRAN_VERBOSE_STR, which will be used to get necessary paths
|
# set(GFORTRANLIBS_FOUND "1" CACHE INTERNAL "found environment variable")
|
||||||
message(STATUS "Extracting library and header information by calling 'gfortran -v'...")
|
# endif()
|
||||||
execute_process(COMMAND "${CMAKE_Fortran_COMPILER}" "-v" ERROR_VARIABLE
|
|
||||||
GFORTRAN_VERBOSE_STR RESULT_VARIABLE FLAG)
|
|
||||||
|
|
||||||
# For debugging
|
|
||||||
message(STATUS "'gfortran -v' returned:")
|
|
||||||
message(STATUS "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
|
|
||||||
# Detect gfortran version
|
|
||||||
string(REGEX MATCH "gcc version [^\t\n ]+" GFORTRAN_VER_STR "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
string(REGEX REPLACE "gcc version ([^\t\n ]+)" "\\1" GFORTRAN_VERSION_STRING "${GFORTRAN_VER_STR}")
|
|
||||||
message(STATUS "Detected gfortran version ${GFORTRAN_VERSION_STRING}")
|
|
||||||
unset(GFORTRAN_VER_STR)
|
|
||||||
|
|
||||||
set(MATCH_REGEX "[^\t\n ]+[\t\n ]+")
|
|
||||||
set(REPLACE_REGEX "([^\t\n ]+)")
|
|
||||||
|
|
||||||
# Find architecture for compiler
|
|
||||||
string(REGEX MATCH "Target: [^\t\n ]+"
|
|
||||||
GFORTRAN_ARCH_STR "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
message(STATUS "Architecture string: ${GFORTRAN_ARCH_STR}")
|
|
||||||
string(REGEX REPLACE "Target: ([^\t\n ]+)" "\\1"
|
|
||||||
GFORTRAN_ARCH "${GFORTRAN_ARCH_STR}")
|
|
||||||
message(STATUS "Detected gfortran architecture: ${GFORTRAN_ARCH}")
|
|
||||||
unset(GFORTRAN_ARCH_STR)
|
|
||||||
|
|
||||||
# Find install prefix, if it exists; if not, use default
|
|
||||||
string(REGEX MATCH "--prefix=[^\t\n ]+[\t\n ]+"
|
|
||||||
GFORTRAN_PREFIX_STR "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
if(NOT GFORTRAN_PREFIX_STR)
|
|
||||||
message(STATUS "Detected default gfortran prefix")
|
|
||||||
set(GFORTRAN_PREFIX_DIR "/usr/local") # default prefix for gcc install
|
|
||||||
else()
|
|
||||||
string(REGEX REPLACE "--prefix=([^\t\n ]+)" "\\1"
|
|
||||||
GFORTRAN_PREFIX_DIR "${GFORTRAN_PREFIX_STR}")
|
|
||||||
endif()
|
|
||||||
message(STATUS "Detected gfortran prefix: ${GFORTRAN_PREFIX_DIR}")
|
|
||||||
unset(GFORTRAN_PREFIX_STR)
|
|
||||||
|
|
||||||
# Find install exec-prefix, if it exists; if not, use default
|
|
||||||
string(REGEX MATCH "--exec-prefix=[^\t\n ]+[\t\n ]+" "\\1"
|
|
||||||
GFORTRAN_EXEC_PREFIX_STR "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
if(NOT GFORTRAN_EXEC_PREFIX_STR)
|
|
||||||
message(STATUS "Detected default gfortran exec-prefix")
|
|
||||||
set(GFORTRAN_EXEC_PREFIX_DIR "${GFORTRAN_PREFIX_DIR}")
|
|
||||||
else()
|
|
||||||
string(REGEX REPLACE "--exec-prefix=([^\t\n ]+)" "\\1"
|
|
||||||
GFORTRAN_EXEC_PREFIX_DIR "${GFORTRAN_EXEC_PREFIX_STR}")
|
|
||||||
endif()
|
|
||||||
message(STATUS "Detected gfortran exec-prefix: ${GFORTRAN_EXEC_PREFIX_DIR}")
|
|
||||||
UNSET(GFORTRAN_EXEC_PREFIX_STR)
|
|
||||||
|
|
||||||
# Find library directory and include directory, if library directory specified
|
|
||||||
string(REGEX MATCH "--libdir=[^\t\n ]+"
|
|
||||||
GFORTRAN_LIB_DIR_STR "${GFORTRAN_VERBOSE_STR}")
|
|
||||||
if(NOT GFORTRAN_LIB_DIR_STR)
|
|
||||||
message(STATUS "Found --libdir flag -- not found")
|
|
||||||
message(STATUS "Using default gfortran library & include directory paths")
|
|
||||||
set(GFORTRAN_LIBRARIES_DIR
|
|
||||||
"${GFORTRAN_EXEC_PREFIX_DIR}/lib/gcc/${GFORTRAN_ARCH}/${GFORTRAN_VERSION_STRING}")
|
|
||||||
string(CONCAT GFORTRAN_INCLUDE_DIR "${GFORTRAN_LIBRARIES_DIR}" "/include")
|
|
||||||
else()
|
|
||||||
message(STATUS "Found --libdir flag -- yes")
|
|
||||||
string(REGEX REPLACE "--libdir=([^\t\n ]+)" "\\1"
|
|
||||||
GFORTRAN_LIBRARIES_DIR "${GFORTRAN_LIB_DIR_STR}")
|
|
||||||
string(CONCAT GFORTRAN_INCLUDE_DIR "${GFORTRAN_LIBRARIES_DIR}" "/gcc/" "${GFORTRAN_ARCH}" "/" "${GFORTRAN_VERSION_STRING}" "/include")
|
|
||||||
endif()
|
|
||||||
message(STATUS "gfortran libraries path: ${GFORTRAN_LIBRARIES_DIR}")
|
|
||||||
message(STATUS "gfortran include path dir: ${GFORTRAN_INCLUDE_DIR}")
|
|
||||||
unset(GFORTRAN_LIB_DIR_STR)
|
|
||||||
|
|
||||||
# There are lots of other build options for gcc & gfortran. For now, the
|
|
||||||
# options implemented above should cover a lot of common use cases.
|
|
||||||
|
|
||||||
# Clean up be deleting the output string from "gfortran -v"
|
|
||||||
unset(GFORTRAN_VERBOSE_STR)
|
|
||||||
|
|
||||||
# Find paths for libgfortran, libquadmath, libgomp
|
|
||||||
# libgomp needed for OpenMP support without Clang
|
|
||||||
find_library(LIBGFORTRAN_LIBRARIES NAMES gfortran libgfortran
|
|
||||||
HINTS ${GFORTRAN_LIBRARIES_DIR})
|
|
||||||
find_library(LIBQUADMATH_LIBRARIES NAMES quadmath libquadmath
|
|
||||||
HINTS ${GFORTRAN_LIBRARIES_DIR})
|
|
||||||
find_library(LIBGOMP_LIBRARIES NAMES gomp libgomp
|
|
||||||
HINTS ${GFORTRAN_LIBRARIES_DIR})
|
|
||||||
|
|
||||||
# Find OpenMP headers
|
|
||||||
find_path(LIBGOMP_INCLUDE_DIR NAMES omp.h HINTS ${GFORTRAN_INCLUDE_DIR})
|
|
||||||
|
|
||||||
else()
|
|
||||||
message(STATUS "CMAKE_Fortran_COMPILER_ID does not match 'GNU'!")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
# Required: libgfortran, libquadmath, path for gfortran libraries
|
|
||||||
# Optional: libgomp, path for OpenMP headers, path for gcc/gfortran headers
|
|
||||||
find_package_handle_standard_args(GFortranLibs
|
|
||||||
REQUIRED_VARS LIBGFORTRAN_LIBRARIES LIBQUADMATH_LIBRARIES GFORTRAN_LIBRARIES_DIR
|
|
||||||
VERSION_VAR GFORTRAN_VERSION_STRING)
|
|
||||||
|
|
||||||
if(GFORTRANLIBS_FOUND)
|
|
||||||
message(STATUS "Looking for gfortran libraries -- found")
|
|
||||||
message(STATUS "gfortran version: ${GFORTRAN_VERSION_STRING}")
|
|
||||||
else()
|
|
||||||
message(STATUS "Looking for gfortran libraries -- not found")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(LIBGFORTRAN_LIBRARIES LIBQUADMATH_LIBRARIES
|
|
||||||
LIBGOMP_LIBRARIES LIBGOMP_INCLUDE_DIR
|
|
||||||
GFORTRAN_LIBRARIES_DIR GFORTRAN_INCLUDE_DIR)
|
|
||||||
# FindGFortranLIBS.cmake ends here
|
|
||||||
|
|
|
@ -32,20 +32,28 @@
|
||||||
# WCSLIB_LIBRARIES - the WCSLIB libraries
|
# WCSLIB_LIBRARIES - the WCSLIB libraries
|
||||||
# (identical to WCSLIB_LIBRARY)
|
# (identical to WCSLIB_LIBRARY)
|
||||||
|
|
||||||
|
# find paths
|
||||||
if(NOT WCSLIB_FOUND)
|
if(NOT WCSLIB_FOUND)
|
||||||
|
|
||||||
find_path(WCSLIB_INCLUDE_DIR wcslib/wcs.h
|
if (NOT "$ENV{WCSLIB_ROOT_DIR}" STREQUAL "")
|
||||||
HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES include)
|
set(WCSLIB_ROOT "$ENV{WCSLIB_ROOT_DIR}" CACHE INTERNAL "Got from environment variable")
|
||||||
find_library(WCSLIB_LIBRARY wcs
|
endif()
|
||||||
HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES lib)
|
|
||||||
|
find_path(WCSLIB_INCLUDE wcslib/wcs.h
|
||||||
|
HINTS ${WCSLIB_ROOT} PATH_SUFFIXES include)
|
||||||
|
find_library(WCSLIB_LIB wcs
|
||||||
|
HINTS ${WCSLIB_ROOT} PATH_SUFFIXES lib)
|
||||||
find_library(M_LIBRARY m)
|
find_library(M_LIBRARY m)
|
||||||
mark_as_advanced(WCSLIB_INCLUDE_DIR WCSLIB_LIBRARY M_LIBRARY)
|
mark_as_advanced(WCSLIB_INCLUDE WCSLIB_LIB M_LIBRARY)
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(WCSLIB DEFAULT_MSG
|
find_package_handle_standard_args(WCSLIB DEFAULT_MSG
|
||||||
WCSLIB_LIBRARY M_LIBRARY WCSLIB_INCLUDE_DIR)
|
WCSLIB_LIB M_LIBRARY WCSLIB_INCLUDE)
|
||||||
|
|
||||||
set(WCSLIB_INCLUDE_DIRS ${WCSLIB_INCLUDE_DIR})
|
set(WCSLIB_INCLUDE_DIRS ${WCSLIB_INCLUDE})
|
||||||
set(WCSLIB_LIBRARIES ${WCSLIB_LIBRARY} ${M_LIBRARY})
|
set(WCSLIB_LIBRARIES ${WCSLIB_LIB} ${M_LIBRARY})
|
||||||
|
|
||||||
|
set(WCSLIB_INCLUDE ${WCSLIB_INCLUDE})
|
||||||
|
set(WCSLIB_LIB ${WCSLIB_LIB} ${M_LIBRARY})
|
||||||
|
|
||||||
endif(NOT WCSLIB_FOUND)
|
endif(NOT WCSLIB_FOUND)
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||||
|
email, or any other method with the owners of this repository before making a change.
|
||||||
|
|
||||||
|
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||||
|
|
||||||
|
## Pull Request Process
|
||||||
|
|
||||||
|
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
||||||
|
build.
|
||||||
|
2. Update the README.md with details of changes to the interface, this includes new environment
|
||||||
|
variables, exposed ports, useful file locations and container parameters.
|
||||||
|
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
||||||
|
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
||||||
|
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
|
||||||
|
do not have permission to do that, you may request the second reviewer to merge it for you.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
### Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to making participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity and
|
||||||
|
orientation.
|
||||||
|
|
||||||
|
### Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
### Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
### Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
### Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
### Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
version=$(date +"%d%m%Y")
|
||||||
|
|
||||||
|
for folder in \
|
||||||
|
sl7-test \
|
||||||
|
ubuntu1604-test
|
||||||
|
|
||||||
|
do
|
||||||
|
name=${folder%%/}
|
||||||
|
echo
|
||||||
|
echo "==========================================="
|
||||||
|
echo "Building: "$name
|
||||||
|
echo "==========================================="
|
||||||
|
|
||||||
|
cmd="docker build -t fdiblen/$name:$version -t fdiblen/$name:latest ./$name"
|
||||||
|
echo
|
||||||
|
echo "Running:"
|
||||||
|
echo $cmd
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
eval $cmd
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
echo
|
||||||
|
echo "Successfully built the $name image!"
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "Could not build the $name image" >&2
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
#docker push fdiblen/$name:$version
|
||||||
|
#docker push fdiblen/$name:latest
|
||||||
|
done
|
|
@ -0,0 +1,42 @@
|
||||||
|
FROM scientificlinux/sl:7
|
||||||
|
MAINTAINER f.diblen@esciencecenter.nl
|
||||||
|
|
||||||
|
# add EPEL repository for openblas
|
||||||
|
RUN yum -y \
|
||||||
|
install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
RUN yum -y install \
|
||||||
|
wget git pkgconfig make cmake3 cmake3-gui gcc-gfortran gcc-c++ flex bison \
|
||||||
|
openblas openblas-devel glib2-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 mpich mpich-devel fftw fftw-libs fftw-devel
|
||||||
|
|
||||||
|
RUN mkdir /build && cd /build
|
||||||
|
|
||||||
|
# compile casacore
|
||||||
|
RUN git clone --progress --verbose https://github.com/casacore/casacore.git casacore_src && \
|
||||||
|
cd casacore_src && \
|
||||||
|
mkdir build && cd build && \
|
||||||
|
cmake3 .. -DUSE_FFTW3=ON \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/opt/casacore \
|
||||||
|
-DDATA_DIR=/opt/casacore/data -DUSE_OPENMP=ON \
|
||||||
|
-DUSE_HDF5=ON \
|
||||||
|
-DBUILD_PYTHON=ON \
|
||||||
|
-DUSE_THREADS=ON && \
|
||||||
|
make -j4 && \
|
||||||
|
make install
|
||||||
|
|
||||||
|
|
||||||
|
## compile sagecal
|
||||||
|
#RUN cd /build && \
|
||||||
|
# mkdir build-sl && cd build-sl && \
|
||||||
|
# cmake3 .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal \
|
||||||
|
# -DCASACORE_ROOT_DIR=/opt/casacore \
|
||||||
|
# -DCASACORE_INCLUDE=/opt/casacore/include/casacore
|
||||||
|
# make -j4 && \
|
||||||
|
# make install && \
|
||||||
|
#
|
||||||
|
#RUN ls -alsrt /opt/sagecal && \
|
||||||
|
# /opt/sagecal/bin/sagecal
|
|
@ -0,0 +1,28 @@
|
||||||
|
FROM ubuntu:xenial
|
||||||
|
MAINTAINER f.diblen@esciencecenter.nl
|
||||||
|
|
||||||
|
RUN apt-get update -y && \
|
||||||
|
apt-get install software-properties-common -y && \
|
||||||
|
add-apt-repository -s ppa:kernsuite/kern-3 -y && \
|
||||||
|
apt-add-repository multiverse && \
|
||||||
|
apt-get update -y
|
||||||
|
|
||||||
|
RUN apt-get install -y \
|
||||||
|
git cmake g++ pkg-config \
|
||||||
|
libcfitsio-bin libcfitsio-dev \
|
||||||
|
libopenblas-base libopenblas-dev \
|
||||||
|
wcslib-dev wcslib-tools \
|
||||||
|
libglib2.0-dev \
|
||||||
|
libcasa-casa2 casacore-dev casacore-data casacore-tools \
|
||||||
|
mpich \
|
||||||
|
fftw-dev libfftw3-mpi3 libfftw3-bin
|
||||||
|
|
||||||
|
|
||||||
|
## compile sagecal
|
||||||
|
#RUN mkdir /build && cd /build \
|
||||||
|
# mkdir build-ubuntu && cd build-ubuntu && \
|
||||||
|
# cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \
|
||||||
|
# make -j4 && \
|
||||||
|
# make install && \
|
||||||
|
# ls -alsrt /opt/sagecal && \
|
||||||
|
# /opt/sagecal/bin/sagecal
|
26
INSTALL.md
26
INSTALL.md
|
@ -1,6 +1,32 @@
|
||||||
di 28 aug 2018 9:37:58 CEST
|
di 28 aug 2018 9:37:58 CEST
|
||||||
# SAGECal Installation
|
# SAGECal Installation
|
||||||
|
|
||||||
|
|
||||||
|
## das5
|
||||||
|
|
||||||
|
Load the modules below before compiling SageCal.
|
||||||
|
```
|
||||||
|
module load cmake/3.8.2
|
||||||
|
module load mpich/ge/gcc/64/3.2
|
||||||
|
module load gcc/4.9.3
|
||||||
|
module load casacore/2.3.0-gcc-4.9.3
|
||||||
|
module load wcslib/5.13-gcc-4.9.3
|
||||||
|
module load wcslib/5.16-gcc-4.9.3
|
||||||
|
module load cfitsio/3.410-gcc-4.9.3
|
||||||
|
```
|
||||||
|
|
||||||
|
checkout the source code and compile it with the instructions below(in source folder):
|
||||||
|
```
|
||||||
|
git clone https://github.com/nlesc-dirac/sagecal.git
|
||||||
|
|
||||||
|
cd sagecal && mkdir build && cd build
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
$INSTALL_PATH is where you want to install SageCal.
|
||||||
|
|
||||||
|
|
||||||
## Cmake Build
|
## Cmake Build
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
|
@ -0,0 +1,339 @@
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 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.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, 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 software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, 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 redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
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 give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
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 Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
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 Program, 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 Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) 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; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, 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 executable. 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.
|
||||||
|
|
||||||
|
If distribution of executable or 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 counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||||
|
|
||||||
|
5. 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 Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program 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.
|
||||||
|
|
||||||
|
7. 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 Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program 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 Program.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program 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.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the 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 Program
|
||||||
|
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 Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, 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
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), 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 Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. 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.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
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.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License.
|
|
@ -4,9 +4,11 @@
|
||||||
| ------------- | ------------- |
|
| ------------- | ------------- |
|
||||||
| [![Build Status](https://travis-ci.org/nlesc-dirac/sagecal.svg?branch=master)](https://travis-ci.org/nlesc-dirac/sagecal) | [![Build Status](https://travis-ci.org/nlesc-dirac/sagecal.svg?branch=dev)](https://travis-ci.org/nlesc-dirac/sagecal) |
|
| [![Build Status](https://travis-ci.org/nlesc-dirac/sagecal.svg?branch=master)](https://travis-ci.org/nlesc-dirac/sagecal) | [![Build Status](https://travis-ci.org/nlesc-dirac/sagecal.svg?branch=dev)](https://travis-ci.org/nlesc-dirac/sagecal) |
|
||||||
|
|
||||||
|
[![Documentation](https://codedocs.xyz/nlesc-dirac/sagecal.svg)](https://codedocs.xyz/nlesc-dirac/sagecal/)
|
||||||
|
|
||||||
# SAGECAL
|
# SAGECAL
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Levenberg-Marquardt, LBFGS, Riemannian Trust Region, Nesterov's accelerated gradient descent algorithms
|
- Levenberg-Marquardt, LBFGS, Riemannian Trust Region, Nesterov's accelerated gradient descent algorithms
|
||||||
|
@ -23,6 +25,9 @@
|
||||||
Read INSTALL for installation. This file gives a brief guide to use SAGECal.
|
Read INSTALL for installation. This file gives a brief guide to use SAGECal.
|
||||||
Warning: this file may be obsolete. use sagecal -h to see up-to-date options.
|
Warning: this file may be obsolete. use sagecal -h to see up-to-date options.
|
||||||
|
|
||||||
|
## Code documentation
|
||||||
|
Code documentation can be found [here](https://codedocs.xyz/nlesc-dirac/sagecal).
|
||||||
|
|
||||||
|
|
||||||
## Step by Step Introduction:
|
## Step by Step Introduction:
|
||||||
|
|
||||||
|
@ -182,3 +187,6 @@ So for this cluster, there will be more than 1 column in the solution file, the
|
||||||
|
|
||||||
### Additional Info
|
### Additional Info
|
||||||
See [LOFAR Cookbook Chapter](https://support.astron.nl/LOFARImagingCookbook/sagecal.html).
|
See [LOFAR Cookbook Chapter](https://support.astron.nl/LOFARImagingCookbook/sagecal.html).
|
||||||
|
|
||||||
|
Please cite this code using the DOI.
|
||||||
|
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1289316.svg)](https://doi.org/10.5281/zenodo.1289316)
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo 'script: ' $0
|
||||||
|
|
||||||
|
echo "Building SageCal" && \
|
||||||
|
echo "Branch --> $BRANCH" && \
|
||||||
|
echo "Image --> $IMAGE"
|
||||||
|
|
||||||
|
BUILD_DIR=$IMAGE'-build'
|
||||||
|
|
||||||
|
cd /travis/workdir && \
|
||||||
|
mkdir $BUILD_DIR && cd $BUILD_DIR
|
||||||
|
|
||||||
|
CMAKE_EXE=''
|
||||||
|
OPTS=''
|
||||||
|
|
||||||
|
case $IMAGE in
|
||||||
|
ubuntu)
|
||||||
|
echo 'Building for Ubuntu'
|
||||||
|
CMAKE_EXE=$(which cmake)
|
||||||
|
OPTS=''
|
||||||
|
;;
|
||||||
|
sl7)
|
||||||
|
echo 'Building for Scientific Linux'
|
||||||
|
CMAKE_EXE=$(which cmake3)
|
||||||
|
OPTS='-DCASACORE_ROOT_DIR=/opt/casacore'
|
||||||
|
;;
|
||||||
|
arch)
|
||||||
|
OPTS=''
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 'Unknown image $IMAGE!'
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo 'CMAKE_EXE: ' $CMAKE_EXE
|
||||||
|
echo 'CMake options: ' $OPTS
|
||||||
|
echo 'pwd: ' $PWD
|
||||||
|
|
||||||
|
echo 'ls -asl: '
|
||||||
|
ls -asl
|
||||||
|
|
||||||
|
echo 'ls -asl /travis/workdir: '
|
||||||
|
ls -asl /travis/workdir
|
||||||
|
|
||||||
|
echo 'ls -asl /travis/workdir/$BUILD_DIR: '
|
||||||
|
ls -asl /travis/workdir/$BUILD_DIR
|
||||||
|
|
||||||
|
|
||||||
|
$CMAKE_EXE /travis/workdir -DCMAKE_INSTALL_PREFIX=/opt/sagecal $OPTS
|
||||||
|
|
||||||
|
make -j4 && \
|
||||||
|
make install && \
|
||||||
|
ls -alsrt /opt/sagecal && \
|
||||||
|
/opt/sagecal/bin/sagecal
|
|
@ -18,7 +18,7 @@ add_executable(sagecal-mpi ${SRCFILES})
|
||||||
|
|
||||||
target_link_libraries(sagecal-mpi
|
target_link_libraries(sagecal-mpi
|
||||||
${CASACORE_LIBRARIES}
|
${CASACORE_LIBRARIES}
|
||||||
${CFITSIO_LIBRARIES}
|
${CFITSIO_LIB}
|
||||||
${OpenBLAS_LIB}
|
${OpenBLAS_LIB}
|
||||||
${LAPACK_LIBRARIES}
|
${LAPACK_LIBRARIES}
|
||||||
${WCSLIB_LIBRARIES}
|
${WCSLIB_LIBRARIES}
|
||||||
|
@ -29,7 +29,6 @@ target_link_libraries(sagecal-mpi
|
||||||
-lopenblas
|
-lopenblas
|
||||||
-lgfortran
|
-lgfortran
|
||||||
-lpthread
|
-lpthread
|
||||||
-lcfitsio
|
|
||||||
-lm
|
-lm
|
||||||
-ldirac
|
-ldirac
|
||||||
-lradio
|
-lradio
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../MS/data.cpp
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
||||||
../MS/data.h
|
|
|
@ -0,0 +1,174 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
Copyright (C) 2006-2008 Sarod Yatawatta <sarod@users.sf.net>
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
$Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __DATA_H__
|
||||||
|
#define __DATA_H__
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <casacore/ms/MeasurementSets/MSIter.h>
|
||||||
|
#include <casacore/tables/Tables/Table.h>
|
||||||
|
#include <casacore/tables/Tables/TableVector.h>
|
||||||
|
#include <casacore/tables/Tables/TableRecord.h>
|
||||||
|
#include <casacore/tables/Tables/TableColumn.h>
|
||||||
|
#include <casacore/tables/Tables/TableIter.h>
|
||||||
|
#include <casacore/tables/Tables/ScalarColumn.h>
|
||||||
|
#include <casacore/tables/Tables/ArrayColumn.h>
|
||||||
|
#include <casacore/casa/Arrays/Array.h>
|
||||||
|
#include <casacore/casa/Arrays/Cube.h>
|
||||||
|
#include <fstream>
|
||||||
|
#include <math.h>
|
||||||
|
#include <complex>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace casacore;
|
||||||
|
|
||||||
|
namespace Data
|
||||||
|
{
|
||||||
|
|
||||||
|
struct IOData {
|
||||||
|
int N; /* no of stations */
|
||||||
|
int Nbase; /* baselines, exclude autocorrelations */
|
||||||
|
int tilesz;
|
||||||
|
int Nchan; /* total no of channels */
|
||||||
|
int Nms; /* no. of MS */
|
||||||
|
int *NchanMS; /* total channels per MS : Nms x 1 vector */
|
||||||
|
double deltat; /* integration time (s) */
|
||||||
|
int totalt; /* total no of time slots */
|
||||||
|
double ra0; /* phase center */
|
||||||
|
double dec0; /* phase center */
|
||||||
|
double *u; /* uvw coords, size Nbase*tilesz x 1 */
|
||||||
|
double *v;
|
||||||
|
double *w;
|
||||||
|
double *x; /* averaged data, size Nbase*8*tilez x 1
|
||||||
|
ordered by XX(re,im),XY(re,im),YX(re,im),YY(re,im), baseline, timeslots */
|
||||||
|
double *xo; /* unaveraged data, size Nbase*8*tilesz*Nchan x 1
|
||||||
|
ordered by XX(re,im),XY(re,im),YX(re,im),YY(re,im), baseline, timeslots, channel */
|
||||||
|
double *freqs; /* channel freqs, size Nchan x 1 */
|
||||||
|
double freq0; /* averaged freq */
|
||||||
|
double *flag; /* double for conforming with old routines size Nbase*tilesz x 1 */
|
||||||
|
double deltaf; /* total bandwidth for freq. smearing */
|
||||||
|
|
||||||
|
double fratio; /* flagged data ratio = flagged/total, not counting data excluded from uv cut */
|
||||||
|
/* if 1, all usable data are flagged */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Station beam info */
|
||||||
|
struct LBeam {
|
||||||
|
double *time_utc; /* time coord UTC (s), size tileszx1,
|
||||||
|
convert from MJD (s) to JD (days) */
|
||||||
|
int *Nelem; /* no of elements in each station, size Nx1 */
|
||||||
|
/* position (ITRF) of stations (m)
|
||||||
|
later changed to logitude,latitude,height (rad,rad,m) */
|
||||||
|
double *sx; /* x: size Nx1 */
|
||||||
|
double *sy; /* y: ... */
|
||||||
|
double *sz; /* z: ... */
|
||||||
|
/* x,y,z coords of elements, projected, converted to ITRF (m) */
|
||||||
|
double **xx; /* x coord pointer, size Nx1, each *x: x coord of station, size Nelem[]x1 */
|
||||||
|
double **yy; /* y ... */
|
||||||
|
double **zz; /* z ... */
|
||||||
|
/* pointing center of beams (only one) (could be different from phase center) */
|
||||||
|
double p_ra0;
|
||||||
|
double p_dec0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* read Auxilliary info and setup memory */
|
||||||
|
void readAuxData(const char *fname, IOData *data);
|
||||||
|
void readAuxData(const char *fname, IOData *data, LBeam *binfo);
|
||||||
|
|
||||||
|
void readAuxDataList(vector<string> msnames, IOData *data);
|
||||||
|
|
||||||
|
void readMSlist(char *fname, vector<string> *msnames);
|
||||||
|
/* load data using MS Iterator */
|
||||||
|
void loadData(Table t, IOData iodata, double *fratio);
|
||||||
|
void loadData(Table t, IOData iodata, LBeam binfo, double *fratio);
|
||||||
|
|
||||||
|
void loadDataList(vector<MSIter*> msitr, Data::IOData iodata, double *fratio);
|
||||||
|
/* write back data using MS Iterator */
|
||||||
|
void writeData(Table t, IOData iodata);
|
||||||
|
void writeDataList(vector<MSIter*> msitr, IOData iodata);
|
||||||
|
void freeData(IOData data);
|
||||||
|
void freeData(IOData data, LBeam binfo);
|
||||||
|
|
||||||
|
extern int numChannels;
|
||||||
|
extern unsigned long int numRows;
|
||||||
|
|
||||||
|
struct float2 {
|
||||||
|
float x,y;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern char *TableName; /* MS name */
|
||||||
|
extern char *MSlist; /* text file with MS names */
|
||||||
|
extern char *MSpattern; /* pattern to match all MS names used in calibration */
|
||||||
|
extern float min_uvcut;
|
||||||
|
extern float max_uvcut;
|
||||||
|
extern float max_uvtaper;
|
||||||
|
extern casacore::String DataField; /* input column DATA/CORRECTED_DATA */
|
||||||
|
extern casacore::String OutField; /* output column DATA/CORRECTED_DATA */
|
||||||
|
extern int TileSize; //Tile size
|
||||||
|
extern int Nt; /* no of worker threads */
|
||||||
|
extern char *SkyModel; /* sky model file */
|
||||||
|
extern char *Clusters; /* cluster file */
|
||||||
|
extern int format; /* sky model format 0: LSM, 1: LSM with 3 order spec idx*/
|
||||||
|
|
||||||
|
/* sagecal paramters */
|
||||||
|
extern int max_emiter;
|
||||||
|
extern int max_iter;
|
||||||
|
extern int max_lbfgs;
|
||||||
|
extern int lbfgs_m;
|
||||||
|
extern int gpu_threads;
|
||||||
|
extern int linsolv;
|
||||||
|
extern int solver_mode;
|
||||||
|
extern int ccid;
|
||||||
|
extern double rho;
|
||||||
|
extern char *solfile;
|
||||||
|
extern char *initsolfile;
|
||||||
|
extern char *ignorefile;
|
||||||
|
extern double nulow,nuhigh;
|
||||||
|
extern int randomize;
|
||||||
|
extern int whiten;
|
||||||
|
extern int DoSim; /* if 1, simulation mode */
|
||||||
|
extern int doChan; /* if 1, solve for each channel in multi channel data */
|
||||||
|
extern int doBeam; /* if 1, predict (LOFAR) beam array factor */
|
||||||
|
extern int DoDiag; /* if >0, enables diagnostics (Leverage) 1: write leverage as output (no residual), 2: only calculate fractions of leverage/noise */
|
||||||
|
extern int phaseOnly; /* if >0, and if any correction is done, extract phase and do phase only correction */
|
||||||
|
|
||||||
|
/* distributed sagecal parameters */
|
||||||
|
extern int Nadmm; /* ADMM iterations >=1 */
|
||||||
|
extern int Npoly; /* polynomial order >=1 */
|
||||||
|
extern int PolyType; /* what kind on polynomials to use 0,1,2,3 */
|
||||||
|
extern double admm_rho; /* regularization */
|
||||||
|
extern char *admm_rho_file; /* text file for regularization of each cluster */
|
||||||
|
extern int aadmm; /* if >0, enable adaptive update of rho */
|
||||||
|
/* for debugging, upper limit on time slots */
|
||||||
|
extern int Nmaxtime;
|
||||||
|
/* skipping initial timeslots */
|
||||||
|
extern int Nskip;
|
||||||
|
extern int verbose; /* if >0, enable verbose output */
|
||||||
|
extern int mdl; /* if given, calculate AIC/MDL for different poly configs and find minimum */
|
||||||
|
extern int GPUpredict; /* if given, use GPU for model calculation */
|
||||||
|
extern int heapsize; /* heap size in GPU (MB), for using malloc() */
|
||||||
|
/* for client server mode */
|
||||||
|
extern int servermode; /* 0: client, 1: server, else default operation */
|
||||||
|
extern char *servername; /* server host name or ip address */
|
||||||
|
extern char *portnumber; /* which port number to use for communication */
|
||||||
|
}
|
||||||
|
#endif //__DATA_H__
|
|
@ -23,7 +23,7 @@ add_executable(sagecal ${SRCFILES})
|
||||||
|
|
||||||
target_link_libraries(sagecal
|
target_link_libraries(sagecal
|
||||||
${CASACORE_LIBRARIES}
|
${CASACORE_LIBRARIES}
|
||||||
${CFITSIO_LIBRARIES}
|
${CFITSIO_LIB}
|
||||||
${OpenBLAS_LIB}
|
${OpenBLAS_LIB}
|
||||||
${LAPACK_LIBRARIES}
|
${LAPACK_LIBRARIES}
|
||||||
${WCSLIB_LIBRARIES}
|
${WCSLIB_LIBRARIES}
|
||||||
|
@ -32,7 +32,6 @@ target_link_libraries(sagecal
|
||||||
-lopenblas
|
-lopenblas
|
||||||
-lgfortran
|
-lgfortran
|
||||||
-lpthread
|
-lpthread
|
||||||
-lcfitsio
|
|
||||||
-lm
|
-lm
|
||||||
-ldirac
|
-ldirac
|
||||||
-lradio
|
-lradio
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
find_package(WcsLib REQUIRED)
|
find_package(WcsLib REQUIRED)
|
||||||
include_directories(${WCSLIB_INCLUDE_DIR}/wcslib)
|
include_directories(${WCSLIB_INCLUDE_DIRS}/wcslib)
|
||||||
|
include_directories(${WCSLIB_INCLUDE_DIRS})
|
||||||
include_directories(./)
|
include_directories(./)
|
||||||
|
|
||||||
link_directories(${LIBRARY_OUTPUT_PATH})
|
link_directories(${LIBRARY_OUTPUT_PATH})
|
||||||
|
@ -8,7 +9,7 @@ FILE(GLOB SRCFILES *.c)
|
||||||
add_executable(buildsky ${SRCFILES})
|
add_executable(buildsky ${SRCFILES})
|
||||||
|
|
||||||
target_link_libraries(buildsky
|
target_link_libraries(buildsky
|
||||||
${CFITSIO_LIBRARIES}
|
${CFITSIO_LIB}
|
||||||
${OpenBLAS_LIB}
|
${OpenBLAS_LIB}
|
||||||
${LAPACK_LIBRARIES}
|
${LAPACK_LIBRARIES}
|
||||||
${WCSLIB_LIBRARIES}
|
${WCSLIB_LIBRARIES}
|
||||||
|
@ -17,7 +18,6 @@ target_link_libraries(buildsky
|
||||||
-lopenblas
|
-lopenblas
|
||||||
-lgfortran
|
-lgfortran
|
||||||
-lpthread
|
-lpthread
|
||||||
-lcfitsio
|
|
||||||
-lm
|
-lm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,8 @@ cubic_interp(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
/* fallback value */
|
||||||
|
return (a+b)*0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -187,8 +187,8 @@ cubic_interp(
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* fallback value */
|
||||||
return 0;
|
return (a+b)*0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
find_package(WcsLib REQUIRED)
|
find_package(WcsLib REQUIRED)
|
||||||
find_package(FFTW REQUIRED)
|
find_package(FFTW REQUIRED)
|
||||||
include_directories(${WCSLIB_INCLUDE_DIR}/wcslib)
|
include_directories(${WCSLIB_INCLUDE_DIRS}/wcslib)
|
||||||
|
include_directories(${WCSLIB_INCLUDE_DIRS})
|
||||||
include_directories(./)
|
include_directories(./)
|
||||||
|
|
||||||
link_directories(${LIBRARY_OUTPUT_PATH})
|
link_directories(${LIBRARY_OUTPUT_PATH})
|
||||||
|
@ -9,7 +10,7 @@ FILE(GLOB SRCFILES *.c)
|
||||||
add_executable(restore ${SRCFILES})
|
add_executable(restore ${SRCFILES})
|
||||||
|
|
||||||
target_link_libraries(restore
|
target_link_libraries(restore
|
||||||
${CFITSIO_LIBRARIES}
|
${CFITSIO_LIB}
|
||||||
${OpenBLAS_LIB}
|
${OpenBLAS_LIB}
|
||||||
${LAPACK_LIBRARIES}
|
${LAPACK_LIBRARIES}
|
||||||
${WCSLIB_LIBRARIES}
|
${WCSLIB_LIBRARIES}
|
||||||
|
@ -20,7 +21,6 @@ target_link_libraries(restore
|
||||||
-lopenblas
|
-lopenblas
|
||||||
-lgfortran
|
-lgfortran
|
||||||
-lpthread
|
-lpthread
|
||||||
-lcfitsio
|
|
||||||
-lm
|
-lm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "Building SageCal" && \
|
|
||||||
echo "Branch --> $BRANCH" && \
|
|
||||||
cd /travis/workdir && \
|
|
||||||
mkdir build && cd build && \
|
|
||||||
cmake .. -DENABLE_CUDA=OFF && \
|
|
||||||
make -j4 && \
|
|
||||||
ls -alsrt ./dist/bin && \
|
|
||||||
./dist/bin/sagecal
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
from pyrap.tables import *
|
||||||
|
|
||||||
|
# You can use this script to create different MS data files by copying a single MS
|
||||||
|
# into MS with different names and changing their frequencies to unique values
|
||||||
|
|
||||||
|
# change freq
|
||||||
|
def read_corr(msname,freq):
|
||||||
|
import os
|
||||||
|
import math
|
||||||
|
tf=table(msname+'/SPECTRAL_WINDOW',readonly=False)
|
||||||
|
ch0=tf.getcol('CHAN_FREQ')
|
||||||
|
ch0[0,0]=freq
|
||||||
|
reffreq=tf.getcol('REF_FREQUENCY')
|
||||||
|
reffreq[0]=ch0[0,0]
|
||||||
|
tf.putcol('CHAN_FREQ',ch0)
|
||||||
|
tf.putcol('REF_FREQUENCY',reffreq)
|
||||||
|
tf.close()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# args MS
|
||||||
|
import sys
|
||||||
|
argc=len(sys.argv)
|
||||||
|
if argc==3:
|
||||||
|
read_corr(sys.argv[1],float(sys.argv[2]))
|
||||||
|
else:
|
||||||
|
print("thisscript MS frequency")
|
||||||
|
exit()
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Before running this, make sure you have at least 2 data files with names matching the pattern '*.ms'
|
||||||
|
|
||||||
|
# This command assumes sagecal-mpi binary is at ../src/MPI/sagecal-mpi
|
||||||
|
# 'regularization_factors.txt' should exactly match the cluster info given by '3c196.sky.txt.cluster'
|
||||||
|
mpirun -np 3 ../src/MPI/sagecal-mpi -f '*.ms' -A 10 -P 2 -Q 2 -G regularization_factors.txt -s 3c196.sky.txt -c 3c196.sky.txt.cluster -p zsol -n 2 -t 10 -e 4 -g 2 -l 10 -m 7 -x 30 -F 1 -j 5 -B 1 -k 1 -K 3 -W 0 -V > sagecal-mpi.ms.output
|
|
@ -1,2 +1,3 @@
|
||||||
# Before running this, untar sm.ms.tar and build sagecal
|
# Before running this, untar sm.ms.tar and build sagecal
|
||||||
|
# this command assumes sagecal binary is at ../src/MS/sagecal
|
||||||
../src/MS/sagecal -d sm.ms -s extended_source_list.txt -c extended_source_list.txt.cluster -n 4 -t 10 -p sm.ms.solutions -e 4 -g 2 -l 10 -m 7 -x 30 -F 1 -j 2 -k -1 -B 1 -W 0 > sm.ms.output
|
../src/MS/sagecal -d sm.ms -s extended_source_list.txt -c extended_source_list.txt.cluster -n 4 -t 10 -p sm.ms.solutions -e 4 -g 2 -l 10 -m 7 -x 30 -F 1 -j 2 -k -1 -B 1 -W 0 > sm.ms.output
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# format
|
||||||
|
# cluster_id hybrid admm_rho
|
||||||
|
-1 2 4
|
||||||
|
2 1 2
|
||||||
|
|
||||||
|
# end
|
Loading…
Reference in New Issue