Merge pull request #62 from nlesc-dirac/fix_das5

fix the build system for das5 and improve  continuous integration
This commit is contained in:
Sarod Yatawatta 2018-10-02 11:21:10 +02:00 committed by GitHub
commit 0a2165d1bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 1728 additions and 261 deletions

View File

@ -6,20 +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 pull base/archlinux
# - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux # - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux
# - docker pull scientificlinux/sl:7
# - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build scientificlinux/sl:7
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 --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/prepare-ubuntu.sh" - docker exec -e BRANCH=$BRANCH -e IMAGE='ubuntu' ubuntu-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
- docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/compile-ubuntu.sh" - docker exec -e BRANCH=$BRANCH -e IMAGE='sl7' sl-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh"
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh"
# - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh"
# - docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/prepare-sl.sh"
# - docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/compile-sl.sh"

View File

@ -50,14 +50,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
@ -73,7 +74,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)
@ -91,10 +92,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)
@ -134,6 +146,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}")
@ -144,30 +157,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)
@ -178,3 +197,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})

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

36
Docker/build_images.sh Executable file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,11 +0,0 @@
#!/bin/bash
echo "Building SageCal" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir && \
mkdir build-arch && cd build-arch && \
cmake .. -DENABLE_CUDA=OFF && \
make -j4 && \
ls -alsrt ./dist/bin && \
./dist/bin/sagecal

View File

@ -1,4 +0,0 @@
#!/bin/bash
pacman -Syy --needed --noconfirm \
base-devel cmake git glib2 cfitsio wcslib

56
build-tests/compile_sagecal.sh Executable file
View File

@ -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

View File

@ -1,32 +0,0 @@
#!/bin/bash
echo "Building SageCal for Scientific Linux" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir
# compile casacore first
# mkdir -p /opt/soft/casacore/data
# cd /opt/soft/casacore/data
# wget -c ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar
# tar zxfv WSRT_Measures.ztar && rm -f WSRT_Measures.ztar
cd /travis/workdir
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/soft/casacore -DDATA_DIR=/opt/soft/casacore/data -DUSE_OPENMP=ON \
-DUSE_HDF5=ON -DBUILD_PYTHON=ON -DUSE_THREADS=ON ..
make -j4
make install
# compile sagecal
cd /travis/workdir && \
mkdir build-sl && cd build-sl
cmake3 .. -DENABLE_CUDA=OFF && \
-DCASACORE_ROOT_DIR=/opt/soft/casacore -DCASACORE_INCLUDE=/opt/soft/casacore/include/casacore
make -j4 && \
ls -alsrt ./dist/bin && \
./dist/bin/sagecal

View File

@ -1,11 +0,0 @@
#!/bin/bash
# add EPEL repository for openblas
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# install dependencies
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

View File

@ -1,11 +0,0 @@
#!/bin/bash
echo "Building SageCal" && \
echo "Branch --> $BRANCH" && \
cd /travis/workdir && \
mkdir build-ubuntu && cd build-ubuntu && \
cmake .. -DENABLE_CUDA=OFF && \
make -j4 && \
ls -alsrt ./dist/bin && \
./dist/bin/sagecal

View File

@ -1,9 +0,0 @@
#!/bin/bash
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
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

View File

@ -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

View File

@ -1 +0,0 @@
../MS/data.cpp

1166
src/MPI/data.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
../MS/data.h

174
src/MPI/data.h Normal file
View File

@ -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__

View File

@ -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

View File

@ -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
) )

View File

@ -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
) )