fix missing modules on das5

This commit is contained in:
Faruk D 2018-10-01 19:36:52 +02:00
parent 6b9a037e45
commit a3a97c041c
7 changed files with 1531 additions and 150 deletions

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
@ -91,11 +92,22 @@ 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)
@ -144,28 +156,30 @@ 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.......... = ${CFITSIO_INCLUDE}") message (STATUS "CFITSIO_ROOT_DIR........= ${CFITSIO_ROOT_DIR}")
message (STATUS "CFITSIO_LIB.......... = ${CFITSIO_LIB}") 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}")

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

@ -33,6 +33,11 @@
if(NOT CFITSIO_FOUND) if(NOT CFITSIO_FOUND)
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 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)

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)

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__