diff --git a/.gitignore b/.gitignore index 13a89ab2..08135d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,6 @@ # Matlab projects /dymola-adapter/bin/ /dynamic-indexes/*/bin/ + +# iPST compilation settings +install.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 401672ec..5aef4fe5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,8 @@ set(BUILD_MATLAB false CACHE BOOL "") set(BUILD_EUROSTAG false CACHE BOOL "") set(BUILD_DYMOLA false CACHE BOOL "") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -std=c++0x -fPIC") @@ -19,17 +21,19 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -std=c++0x -fPIC") set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) +set(USE_STATIC_LIBS true CACHE BOOL "") +set(Boost_USE_STATIC_LIBS ${USE_STATIC_LIBS}) + set(CMAKE_VERBOSE_MAKEFILE off) -# thirdparty libraries location -if (DEFINED thirdparty_prefix) - message("thirdparty_prefix=${thirdparty_prefix}") +if (DEFINED thirdparty_prefix AND IS_DIRECTORY "${thirdparty_prefix}") + message(STATUS "Found thirdparty libraries: ${thirdparty_prefix}") else() - message(FATAL_ERROR "thirdparty_prefix is NOT defined") + message(FATAL_ERROR "Thirdparty libraries not found. The variable thirdparty_prefix is NOT set or is NOT a valid directory.") endif() set(PROTOBUF_HOME ${thirdparty_prefix}/protobuf) set(LIBARCHIVE_HOME ${thirdparty_prefix}/libarchive) -set(BOOST_HOME ${thirdparty_prefix}/boost) +set(BOOST_ROOT ${thirdparty_prefix}/boost) set(LOG4CPP_HOME ${thirdparty_prefix}/log4cpp) set(SZIP_HOME ${thirdparty_prefix}/szip) set(ZLIB_HOME ${thirdparty_prefix}/zlib) @@ -39,32 +43,30 @@ set(MATIO_HOME ${thirdparty_prefix}/matio) add_subdirectory(mpi-communication) if(BUILD_EUROSTAG) - message(STATUS "BUILD_EUROSTAG = " ${BUILD_EUROSTAG} ": eurostag-indexes and wp43adapter binaries will be compiled.") - add_subdirectory(eurostag-indexes) - add_subdirectory(wp43adapter) + message(STATUS "Eurostag based components (eurostag-indexes and wp43adapter) will be compiled.") + add_subdirectory(eurostag-indexes) + add_subdirectory(wp43adapter) else() - message(STATUS "BUILD_EUROSTAG = " ${BUILD_EUROSTAG} ": eurostag-indexes and wp43adapter binaries will not be compiled.") + message(STATUS "Eurostag based components (eurostag-indexes and wp43adapter) will not be compiled.") endif() if(BUILD_MATLAB) - message(STATUS "BUILD_MATLAB = " ${BUILD_MATLAB} ": Matlab based components will be compiled.") - add_subdirectory(sampling) - add_subdirectory(mcla) - add_subdirectory(dynamic-indexes) - if(BUILD_DYMOLA) - message(STATUS "BUILD_DYMOLA = " ${BUILD_DYMOLA} ": matlab based dymola adapters will be compiled.") - add_subdirectory(dymola-adapter) - else() - message(STATUS "BUILD_DYMOLA = " ${BUILD_DYMOLA} ": matlab based dymola adapters will not be compiled.") - endif() + message(STATUS "Matlab based components (sampling, mcla and dynamic-indexes) will be compiled.") + add_subdirectory(sampling) + add_subdirectory(mcla) + add_subdirectory(dynamic-indexes) + if(BUILD_DYMOLA) + message(STATUS "Dymola/Matlab based components (dymola-adapter) will be compiled.") + add_subdirectory(dymola-adapter) + else() + message(STATUS "Dymola/Matlab based components (dymola-adapter) will not be compiled.") + endif() else() - message(STATUS "BUILD_MATLAB = " ${BUILD_MATLAB} ": Matlab based components will not be compiled.") + message(STATUS "Matlab based components (sampling, mcla and dynamic-indexes) will not be compiled.") endif() find_package(Doxygen) - if(DOXYGEN_FOUND) - set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(doxyfile ${CMAKE_BINARY_DIR}/Doxyfile) diff --git a/README.md b/README.md index 625a1a8f..fad76def 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,117 @@ [![Build Status](https://travis-ci.org/itesla/ipst.svg?branch=master)](https://travis-ci.org/itesla/ipst) [![Coverage Status](https://coveralls.io/repos/github/itesla/ipst/badge.svg?branch=master)](https://coveralls.io/github/itesla/ipst?branch=master) +[![MPL-2.0 License](https://img.shields.io/badge/license-MPL_2.0-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/) # iTESLA http://www.itesla-project.eu/ +http://www.itesla-pst.org + +## Environment requirements +In order to build iPST you need: + * JDK *(1.8 or greater)* + * Maven + * CMake *(2.6 or greater)* + * Recent C++ compiler (GNU g++ or Clang) + * OpenMPI *(1.8.3 or greater)* + +Optional C++ modules requires: + * Intel Fortran Compiler + * Matlab + * Dymola + * Eurostag + +### OpenMPI (required) +In order to support the MPI modules, you need to compile and install the [OpenMPI](https://www.open-mpi.org/) library. +``` +$> wget http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.3.tar.bz2 +$> tar xjf openmpi-1.8.3.tar.bz2 +$> cd openmpi-1.8.3 +$> ./configure --prefix= --enable-mpi-thread-multiple +$> make install +$> export PATH=$PATH:/bin +``` + +### Intel Fortran Compiler +To compile Eurostag dependant modules, you have to set your INTEL_HOME environment variable to the root of the +Intel Fortran Compiler installation. + +## Install +To easily compile iPST, you can use the toolchain: +``` +$> git clone https://github.com/itesla/ipst.git +$> ./install.sh +``` +By default, the toolchain will: + * download and compile all external packages from the Internet + * compile C++ and Java modules + * install iPST + +### Targets + +| Target | Description | +| ------ | ----------- | +| clean | Clean iPST modules | +| clean-thirdparty | Clean the thirdparty libraries | +| compile | Compile iPST modules | +| package | Compile iPST modules and create a distributable package | +| __install__ | __Compile iPST modules and install it__ | +| docs | Generate the documentation (Doxygen/Javadoc) | +| help | Display this help | + +### Options + +The toolchain options are saved in the *install.cfg* configuration file. This configuration file is loaded and updated +each time you use the toolchain. + +#### iPST + +| Option | Description | Default value | +| ------ | ----------- | ------------- | +| --help | Display this help | | +| --prefix | Set the installation directory | $HOME/itesla | +| --package-type | Set the package format. The supported formats are zip, tar, tar.gz and tar.bz2 | zip | + +#### C++ modules + +| Option | Description | Default value | +| ------ | ----------- | ------------- | +| --with-dymola | Enable the compilation of Dymola dependant modules | $DYMOLA_HOME | +| --without-dymola | Disable the compilation of Dymola dependant modules | | +| --with-eurostag | Enable the compilation of Eurostag dependant modules | $EUROSTAG_SDK_HOME | +| --without-eurostag | Disable the compilation of Eurostag dependant modules | | +| --with-matlab | Enable the compilation of Matlab dependant modules | $MATLAB_HOME | +| --without-matlab | Disable the compilation of Matlab dependant modules | | + +#### Third-parties + +| Option | Description | Default value | +| ------ | ----------- | ------------- | +| --with-thirdparty | Enable the compilation of thirdparty libraries | | +| --without-thirdparty | Disable the compilation of thirdparty libraries | | +| --thirdparty-prefix | Set the thirdparty installation directory | $HOME/itesla_thirdparty | +| --thirdparty-download | Sets false to compile thirdparty libraries from a local repository | true | +| --thirdparty-packs | Sets the thirdparty libraries local repository | $HOME/itesla_packs | + +### Default configuration file +``` +ipst_prefix=$HOME/itesla +ipst_package_type=zip + +# -- iPST C++ modules options -- +eurostag_build=false +eurostag_home=$EUROSTAG_SDK_HOME +dymola_build=false +dymola_home=$DYMOLA_HOME +matlab_build=false +matlab_home=$MATLAB_HOME + +# -- iPST thirdparty libraries -- +thirdparty_build=true +thirdparty_prefix=$HOME/itesla_thirdparty +thirdparty_download=true +thirdparty_packs=$HOME/itesla_packs +``` + ## License -https://www.mozilla.org/en-US/MPL/2.0/ \ No newline at end of file +https://www.mozilla.org/en-US/MPL/2.0/ diff --git a/cmake/FindDymola.cmake b/cmake/FindDymola.cmake new file mode 100644 index 00000000..687c45b8 --- /dev/null +++ b/cmake/FindDymola.cmake @@ -0,0 +1,24 @@ +# - Find Dymola +# +# Dymola_FOUND True if Dymola exists, false otherwise +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT DYMOLA_HOME AND NOT $ENV{DYMOLA_HOME} STREQUAL "") + set(DYMOLA_HOME $ENV{DYMOLA_HOME}) +endif() + +if (NOT DYMOLA_HOME AND NOT $ENV{DYMOLA_ROOT} STREQUAL "") + set(DYMOLA_HOME $ENV{DYMOLA_ROOT}) +endif() + +if (NOT DYMOLA_HOME OR NOT IS_DIRECTORY "${DYMOLA_HOME}") + message(FATAL_ERROR "Dymola not found. The variable DYMOLA_HOME is NOT set or is NOT a valid directory") +endif() + +set(Dymola_FOUND TRUE) diff --git a/cmake/FindEurostag.cmake b/cmake/FindEurostag.cmake new file mode 100644 index 00000000..bc010be6 --- /dev/null +++ b/cmake/FindEurostag.cmake @@ -0,0 +1,64 @@ +# - Find Eurostag +# +# Eurostag_FOUND True if Eurostag exists, false otherwise +# Eurostag_INCLUDE_DIRS Include path +# Eurostag_LIBRARIES Eurostag libraries +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT EUROSTAG_SDK_HOME AND NOT $ENV{EUROSTAG_SDK_HOME} STREQUAL "") + set(EUROSTAG_SDK_HOME $ENV{EUROSTAG_SDK_HOME}) +endif() + +if (NOT EUROSTAG_SDK_HOME AND NOT $ENV{EUROSTAG_SDK_ROOT} STREQUAL "") + set(EUROSTAG_SDK_HOME $ENV{EUROSTAG_SDK_ROOT}) +endif() + +if (NOT EUROSTAG_SDK_HOME) + message(FATAL_ERROR "Eurostag SDK not found. The variable EUROSTAG_SDK_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(Eurostag_INCLUDE_DIR NAME api_eurostag.h HINTS ${EUROSTAG_SDK_HOME}/include) +mark_as_advanced(Eurostag_INCLUDE_DIR) + +set(components + eustag_esg eustag_cpt + eustag_a light_lib_a_t + eustag_i + eustag_s light_lib_s + eustag_lf + light_lib_t_s light_lib_t + eustag_bld + util klu amd +) + +include(FindPackageHandleStandardArgs) +foreach(component ${components}) + string(TOUPPER ${component} COMPONENT) + set(Eurostag_${component}_FIND_QUIETLY true) + + find_library(Eurostag_${component}_LIBRARY lib${component}.a HINTS ${EUROSTAG_SDK_HOME}/lib) + mark_as_advanced(Eurostag_${component}_LIBRARY) + find_package_handle_standard_args(Eurostag_${component} DEFAULT_MSG Eurostag_${component}_LIBRARY) + + if (EUROSTAG_${COMPONENT}_FOUND) + set(Eurostag_LIBRARIES ${Eurostag_LIBRARIES} ${Eurostag_${component}_LIBRARY}) + else() + message(FATAL_ERROR "Eurostag library not found: ${component}") + endif() + + unset(EUROSTAG_${COMPONENT}_FOUND) + unset(COMPONENT) + unset(Eurostag_${component}_FIND_QUIETLY) + unset(Eurostag_${component}_LIBRARY) +endforeach() + +set(Eurostag_FOUND true) +set(Eurostag_INCLUDE_DIRS ${Eurostag_INCLUDE_DIR}) +message(STATUS "Eurostag SDK found: ${EUROSTAG_SDK_HOME}") + diff --git a/cmake/FindHDF5.cmake b/cmake/FindHDF5.cmake new file mode 100644 index 00000000..c1f5e600 --- /dev/null +++ b/cmake/FindHDF5.cmake @@ -0,0 +1,60 @@ +# - Find HDF5 +# +# HDF5_FOUND True if HDF5 exists, false otherwise +# HDF5_INCLUDE_DIRS Include path +# HDF5_LIBRARIES HDF5 libraries +# HDF5_VERSION_STRING Library version +# HDF5_VERSION_MAJOR Library version (major version) +# HDF5_VERSION_MINOR Library version (minor version) +# HDF5_VERSION_PATCH Library version (patch level) +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT HDF5_HOME AND NOT $ENV{HDF5_HOME} STREQUAL "") + set(HDF5_HOME $ENV{HDF5_HOME}) +endif() + +if (NOT HDF5_HOME AND NOT $ENV{HDF5_ROOT} STREQUAL "") + set(HDF5_HOME $ENV{HDF5_ROOT}) +endif() + +if (NOT HDF5_HOME) + message(FATAL_ERROR "HDF5 libraries not found. The variable HDF5_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(HDF5_INCLUDE_DIR NAME hdf5.h H5pubconf.h HINTS ${HDF5_HOME}/include) +if (USE_STATIC_LIBS) + find_library(HDF5_LIBRARY libhdf5.a HINTS ${HDF5_HOME}/lib) +else() + find_library(HDF5_LIBRARY hdf5 HINTS ${HDF5_HOME}/lib) +endif() + +mark_as_advanced(HDF5_INCLUDE_DIR HDF5_LIBRARY) + +if (HDF5_INCLUDE_DIR AND EXISTS "${HDF5_INCLUDE_DIR}/H5pubconf.h") + set(_HDF5_VERSION_REGEX "^#define[ ^t]+H5_VERSION[ \t]+\"([^\"]+)\".*$") + file(STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h" _HDF5_VERSION_STRING LIMIT_COUNT 1 REGEX ${_HDF5_VERSION_REGEX}) + if (_HDF5_VERSION_STRING) + string(REGEX REPLACE "${_HDF5_VERSION_REGEX}" "\\1" HDF5_VERSION_STRING "${_HDF5_VERSION_STRING}") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HDF5 DEFAULT_MSG HDF5_LIBRARY HDF5_INCLUDE_DIR) +if (HDF5_FOUND) + if (DEFINED HDF5_FIND_VERSION) + if (${HDF5_FIND_VERSION} VERSION_GREATER ${HDF5_VERSION_STRING}) + message(FATAL_ERROR "HDF5 ${HDF5_VERSION_STRING} found but ${HDF5_FIND_VERSION} is required") + endif() + endif() + + set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR}) + set(HDF5_LIBRARIES ${HDF5_LIBRARY}) + + message(STATUS "HDF5 version: ${HDF5_VERSION_STRING}") +endif() diff --git a/cmake/FindIntelFortran.cmake b/cmake/FindIntelFortran.cmake new file mode 100644 index 00000000..b4fb4d52 --- /dev/null +++ b/cmake/FindIntelFortran.cmake @@ -0,0 +1,57 @@ +# - Find Intel Fortran +# +# IntelFortran_FOUND True if Intel Fortran exists, false otherwise +# IntelFortran_INCLUDE_DIRS Include path +# IntelFortran_LIBRARIES Fortran libraries +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT INTEL_HOME AND NOT $ENV{INTEL_HOME} STREQUAL "") + set(INTEL_HOME $ENV{INTEL_HOME}) +endif() + +if (NOT INTEL_HOME AND NOT $ENV{INTEL_ROOT} STREQUAL "") + set(INTEL_HOME $ENV{INTEL_ROOT}) +endif() + +if (NOT INTEL_HOME) + message(FATAL_ERROR "Intel Fortran libraries not found. The variable INTEL_HOME is NOT set or is NOT a valid directory") +endif() + +include(FindPackageHandleStandardArgs) +foreach (component ${IntelFortran_FIND_COMPONENTS}) + string(TOUPPER ${component} COMPONENT) + set(IntelFortran_${component}_FIND_QUIETLY true) + + find_library(IntelFortran_${component}_LIBRARY ${component} HINTS ${INTEL_HOME}/lib/intel64) + mark_as_advanced(IntelFortran_${component}_LIBRARY) + find_package_handle_standard_args(IntelFortran_${component} DEFAULT_MSG IntelFortran_${component}_LIBRARY) + + if (INTELFORTRAN_${COMPONENT}_FOUND) + if (IntelFortran_LIBRARIES) + set(IntelFortran_LIBRARIES ${IntelFortran_LIBRARIES} ${IntelFortran_${component}_LIBRARY}) + else() + set(IntelFortran_LIBRARIES ${IntelFortran_${component}_LIBRARY}) + endif() + set(IntelFortran_${COMPONENT}_FOUND true) + elseif (INTELFORTRAN_${COMPONENT}_REQUIRE) + message(FATAL_ERROR "Required Intel Fortran component ${component} not found") + endif() + + unset(INTELFORTRAN_${COMPONENT}_FOUND) +endforeach() + +set(IntelFortran_FOUND true) +message(STATUS "Found the following Intel Fortran libraries:") +foreach (component ${IntelFortran_FIND_COMPONENTS}) + string(TOUPPER ${component} COMPONENT) + if (DEFINED IntelFortran_${COMPONENT}_FOUND) + message(STATUS " ${component}\t\t(${IntelFortran_${component}_LIBRARY})") + endif() +endforeach() +unset(COMPONENT) diff --git a/cmake/FindLibArchive.cmake b/cmake/FindLibArchive.cmake new file mode 100644 index 00000000..61fd7ddf --- /dev/null +++ b/cmake/FindLibArchive.cmake @@ -0,0 +1,70 @@ +# - Find LibArchive +# +# LibArchive_FOUND True if LibArchive exists, false otherwise +# LibArchive_INCLUDE_DIRS Include path +# LibArchive_LIBRARIES LibArchive libraries +# LibArchive_VERSION_STRING Library version +# LibArchive_VERSION_MAJOR Library version (major version) +# LibArchive_VERSION_MINOR Library version (minor version) +# LibArchive_VERSION_PATCH Library version (patch level) +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT LIBARCHIVE_HOME AND NOT $ENV{LIBARCHIVE_HOME} STREQUAL "") + set(LIBARCHIVE_HOME $ENV{LIBARCHIVE_HOME}) +endif() + +if (NOT LIBARCHIVE_HOME AND NOT $ENV{LIBARCHIVE_ROOT} STREQUAL "") + set(LIBARCHIVE_HOME $ENV{LIBARCHIVE_ROOT}) +endif() + +if (NOT LIBARCHIVE_HOME) + message(FATAL_ERROR "LibArchive libraries not found. The variable LIBARCHIVE_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(LibArchive_INCLUDE_DIR NAME archive.h archive_entry.h HINTS ${LIBARCHIVE_HOME}/include) +if (USE_STATIC_LIBS) + find_library(LibArchive_LIBRARY libarchive.a HINTS ${LIBARCHIVE_HOME}/lib) +else() + find_library(LibArchive_LIBRARY archive HINTS ${LIBARCHIVE_HOME}/lib) +endif() + +mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY) + +if (LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h") + # The version string appears in one of two known formats in the header: + # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12" + # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4" + # Match either format. + set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$") + file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}") + if(_LibArchive_VERSION_STRING) + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION_STRING "${_LibArchive_VERSION_STRING}") + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1" LibArchive_VERSION_MAJOR "${_LibArchive_VERSION_STRING}") + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\2" LibArchive_VERSION_MINOR "${_LibArchive_VERSION_STRING}") + string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\3" LibArchive_VERSION_PATCH "${_LibArchive_VERSION_STRING}") + endif() + unset(_LibArchive_VERSION_REGEX) + unset(_LibArchive_VERSION_STRING) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibArchive DEFAULT_MSG LibArchive_LIBRARY LibArchive_INCLUDE_DIR) +if (LIBARCHIVE_FOUND) + if (DEFINED LibArchive_FIND_VERSION) + if (${LibArchive_FIND_VERSION} VERSION_GREATER ${LibArchive_VERSION_STRING}) + message(FATAL_ERROR "LibArchive ${LibArchive_VERSION_STRING} found but ${LibArchive_FIND_VERSION} is required") + endif() + endif() + + set(LibArchive_FOUND ${LIBARCHIVE_FOUND}) + set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR}) + set(LibArchive_LIBRARIES ${LibArchive_LIBRARY}) + + message(STATUS "LibArchive version: ${LibArchive_VERSION_STRING}") +endif() diff --git a/cmake/FindLog4cpp.cmake b/cmake/FindLog4cpp.cmake new file mode 100644 index 00000000..4b2e421d --- /dev/null +++ b/cmake/FindLog4cpp.cmake @@ -0,0 +1,60 @@ +# - Find Log4cpp +# +# Log4cpp_FOUND True if Log4cpp exists, false otherwise +# Log4cpp_INCLUDE_DIRS Include path +# Log4cpp_LIBRARIES Log4cpp libraries +# Log4cpp_VERSION_STRING Library version +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT LOG4CPP_HOME AND NOT $ENV{LOG4CPP_HOME} STREQUAL "") + set(LOG4CPP_HOME $ENV{LOG4CPP_HOME}) +endif() + +if (NOT LOG4CPP_HOME AND NOT $ENV{LOG4CPP_ROOT} STREQUAL "") + set(LOG4CPP_HOME $ENV{LOG4CPP_ROOT}) +endif() + +if (NOT LOG4CPP_HOME) + message(FATAL_ERROR "Log4Cpp libraries not found. The variable LOG4CPP_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(Log4cpp_INCLUDE_DIR NAME log4cpp/Category.hh log4cpp/Appender.hh HINTS ${LOG4CPP_HOME}/include) +if (USE_STATIC_LIBS) + find_library(Log4cpp_LIBRARY liblog4cpp.a HINTS ${LOG4CPP_HOME}/lib) +else() + find_library(Log4cpp_LIBRARY log4cpp HINTS ${LOG4CPP_HOME}/lib) +endif() + +mark_as_advanced(Log4cpp_INCLUDE_DIR Log4cpp_LIBRARY) + +if (Log4cpp_INCLUDE_DIR AND EXISTS "${Log4cpp_INCLUDE_DIR}/log4cpp/config.h") + set(_Log4cpp_VERSION_REGEX "^#define[ \t]+LOG4CPP_VERSION[ \t]+\"(.*)\".*$") + file(STRINGS "${Log4cpp_INCLUDE_DIR}/log4cpp/config.h" _Log4cpp_VERSION_STRING LIMIT_COUNT 1 REGEX "${_Log4cpp_VERSION_REGEX}") + if (_Log4cpp_VERSION_STRING) + string(REGEX REPLACE "${_Log4cpp_VERSION_REGEX}" "\\1" Log4cpp_VERSION_STRING "${_Log4cpp_VERSION_STRING}") + endif() + unset(_Log4cpp_VERSION_REGEX) + unset(_Log4cpp_VERSION_STRING) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Log4cpp DEFAULT_MSG Log4cpp_LIBRARY Log4cpp_INCLUDE_DIR) +if (LOG4CPP_FOUND) + if (DEFINED Log4cpp_FIND_VERSION) + if (${Log4cpp_FIND_VERSION} VERSION_GREATER ${Log4cpp_VERSION_STRING}) + message(FATAL_ERROR "Log4cpp ${Log4cpp_VERSION_STRING} found but ${Log4cpp_FIND_VERSION} is required") + endif() + endif() + + set(Log4cpp_FOUND ${LOG4CPP_FOUND}) + set(Log4cpp_INCLUDE_DIRS ${Log4cpp_INCLUDE_DIR}) + set(Log4cpp_LIBRARIES ${Log4cpp_LIBRARY}) + + message(STATUS "Log4cpp version: ${Log4cpp_VERSION_STRING}") +endif() diff --git a/cmake/FindMatio.cmake b/cmake/FindMatio.cmake new file mode 100644 index 00000000..828aa57d --- /dev/null +++ b/cmake/FindMatio.cmake @@ -0,0 +1,73 @@ +# - Find Matio +# +# Matio_FOUND True if Matio exists, false otherwise +# Matio_INCLUDE_DIRS Include path +# Matio_LIBRARIES Matio libraries +# Matio_VERSION_STRING Library version +# Matio_VERSION_MAJOR Library version (major version) +# Matio_VERSION_MINOR Library version (minor version) +# Matio_VERSION_PATCH Library version (patch level) +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +function (GetVersionInfo filename regex varname) + file(STRINGS ${filename} _VERSION_STRING LIMIT_COUNT 1 REGEX ${regex}) + if (_VERSION_STRING) + string(REGEX REPLACE "${regex}" "\\1" VERSION_STRING "${_VERSION_STRING}") + endif() + + set(${varname} ${VERSION_STRING} PARENT_SCOPE) + unset(VERSION_STRING) +endfunction() + + +if (NOT MATIO_HOME AND NOT $ENV{MATIO_HOME} STREQUAL "") + set(MATIO_HOME $ENV{MATIO_HOME}) +endif() + +if (NOT MATIO_HOME AND NOT $ENV{MATIO_ROOT} STREQUAL "") + set(MATIO_HOME $ENV{MATIO_ROOT}) +endif() + +if (NOT MATIO_HOME) + message(FATAL_ERROR "Matio libraries not found. The variable MATIO_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(Matio_INCLUDE_DIR NAME matio.h matio_pubconf.h HINTS ${MATIO_HOME}/include) +if (USE_STATIC_LIBS) + find_library(Matio_LIBRARY libmatio.a HINTS ${MATIO_HOME}/lib) +else() + find_library(Matio_LIBRARY matio HINTS ${MATIO_HOME}/lib) +endif() + +mark_as_advanced(Matio_INCLUDE_DIR Matio_LIBRARY) + +if (Matio_INCLUDE_DIR AND EXISTS "${Matio_INCLUDE_DIR}/matio_pubconf.h") + GetVersionInfo("${Matio_INCLUDE_DIR}/matio_pubconf.h" "^#define[ ^t]+MATIO_MAJOR_VERSION[ \t]+([0-9]+).*$" "Matio_VERSION_MAJOR") + GetVersionInfo("${Matio_INCLUDE_DIR}/matio_pubconf.h" "^#define[ ^t]+MATIO_MINOR_VERSION[ \t]+([0-9]+).*$" "Matio_VERSION_MINOR") + GetVersionInfo("${Matio_INCLUDE_DIR}/matio_pubconf.h" "^#define[ ^t]+MATIO_RELEASE_LEVEL[ \t]+([0-9]+).*$" "Matio_VERSION_PATCH") + if (Matio_VERSION_MAJOR AND Matio_VERSION_MINOR AND Matio_VERSION_PATCH) + set(Matio_VERSION_STRING "${Matio_VERSION_MAJOR}.${Matio_VERSION_MINOR}.${Matio_VERSION_PATCH}") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Matio DEFAULT_MSG Matio_LIBRARY Matio_INCLUDE_DIR) +if (MATIO_FOUND) + if (DEFINED Matio_FIND_VERSION) + if (${Matio_FIND_VERSION} VERSION_GREATER ${Matio_VERSION_STRING}) + message(FATAL_ERROR "Matio ${Matio_VERSION_STRING} found but ${Matio_FIND_VERSION} is required") + endif() + endif() + + set(Matio_FOUND ${MATIO_FOUND}) + set(Matio_INCLUDE_DIRS ${Matio_INCLUDE_DIR}) + set(Matio_LIBRARIES ${Matio_LIBRARY}) + + message(STATUS "Matio version: ${Matio_VERSION_STRING}") +endif() diff --git a/cmake/FindMatlab.cmake b/cmake/FindMatlab.cmake new file mode 100644 index 00000000..3bff229b --- /dev/null +++ b/cmake/FindMatlab.cmake @@ -0,0 +1,100 @@ +# - Find Matlab +# +# Matlab_FOUND True if Matlab exists, false otherwise +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT MATLAB_HOME AND NOT $ENV{MATLAB_HOME} STREQUAL "") + set(MATLAB_HOME $ENV{MATLAB_HOME}) +endif() + +if (NOT MATLAB_HOME AND NOT $ENV{MATLAB_ROOT} STREQUAL "") + set(MATLAB_HOME $ENV{MATLAB_ROOT}) +endif() + +if (NOT MATLAB_HOME) + message(FATAL_ERROR "Matlab not found. The variable MATLAB_HOME is NOT set or is NOT a valid directory") +endif() + +find_program(Matlab_COMPILER mcc HINTS ${MATLAB_HOME}/bin) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Matlab "Matlab compiler not found." Matlab_COMPILER) + +if (NOT MATLAB_FOUND) + message(FATAL_ERROR "Matlab compiler not found.") +endif() + +# Define a new executable +function (add_matlab_executable exec_name sources) + + # Sources + foreach (source ${sources}) + if (NOT exec_sources) + set(exec_sources "-v" "${CMAKE_CURRENT_SOURCE_DIR}/${source}") + else() + set(exec_sources ${exec_sources} "-a" "${CMAKE_CURRENT_SOURCE_DIR}/${source}") + endif() + endforeach() + unset(source) + + # Dymola sources + set (dymola_sources ${ARGN}) + foreach (source ${dymola_sources}) + set(exec_sources ${exec_sources} "-a" "${DYMOLA_HOME}/${source}") + endforeach() + unset(source) + + # Runtime options + set(matlab_runtime_options "") + if (DEFINED MATLAB_RUNTIME_OPTIONS) + foreach (option ${MATLAB_RUNTIME_OPTIONS}) + set(matlab_runtime_options ${matlab_runtime_options} "-R" "${option}") + endforeach() + unset(option) + endif() + + # Include directories + set(matlab_include_directories "-N") + if (DEFINED MATLAB_INCLUDE_DIRECTORIES) + foreach (include_directory ${MATLAB_INCLUDE_DIRECTORIES}) + set(matlab_include_directories ${matlab_include_directories} "-p" "${include_directory}") + endforeach() + unset(include_directory) + endif() + + # Warnings + set(matlab_warning_options "") + if (DEFINED MATLAB_WARNING_OPTIONS) + foreach (option ${MATLAB_WARNING_OPTIONS}) + set(matlab_warning_options "${matlab_warning_options}" "-w" "${option}") + endforeach() + unset(option) + endif() + + add_custom_command( + COMMENT "Compiling ${exec_name}" + OUTPUT ${exec_name} + DEPENDS ${sources} + COMMAND ${MATLAB_HOME}/bin/mcc + ARGS -o ${exec_name} + -W main:${exec_name} + -T link:exe + -d ${CMAKE_CURRENT_BINARY_DIR} + ${matlab_include_directories} + ${matlab_warning_options} + ${matlab_runtime_options} + ${exec_sources} + ) + + unset(matlab_include_directories) + unset(matlab_warning_options) + unset(matlab_runtime_options) + unset(exec_sources) + +endfunction() + diff --git a/cmake/FindProtobuf.cmake b/cmake/FindProtobuf.cmake new file mode 100644 index 00000000..56363b78 --- /dev/null +++ b/cmake/FindProtobuf.cmake @@ -0,0 +1,66 @@ +# - Find Protobuf +# +# Protobuf_FOUND True if Protobuf exists, false otherwise +# Protobuf_INCLUDE_DIRS Include path +# Protobuf_LIBRARIES Protobuf libraries +# Protobuf_VERSION_STRING Library version +# Protobuf_VERSION_MAJOR Library version (major version) +# Protobuf_VERSION_MINOR Library version (minor version) +# Protobuf_VERSION_PATCH Library version (patch level) +# +# ============================================================================= +# Copyright (c) 2016, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ============================================================================= + +if (NOT PROTOBUF_HOME AND NOT $ENV{PROTOBUF_HOME} STREQUAL "") + set(PROTOBUF_HOME $ENV{PROTOBUF_HOME}) +endif() + +if (NOT PROTOBUF_HOME AND NOT $ENV{PROTOBUF_ROOT} STREQUAL "") + set(PROTOBUF_HOME $ENV{PROTOBUF_ROOT}) +endif() + +if (NOT PROTOBUF_HOME) + message(FATAL_ERROR "Protobuf libraries not found. The variable PROTOBUF_HOME is NOT set or is NOT a valid directory") +endif() + +find_path(Protobuf_INCLUDE_DIR NAME google/protobuf/service.h HINTS ${PROTOBUF_HOME}/include) +if (USE_STATIC_LIBS) + find_library(Protobuf_LIBRARY libprotobuf.a HINTS ${PROTOBUF_HOME}/lib) +else() + find_library(Protobuf_LIBRARY protobuf HINTS ${PROTOBUF_HOME}/lib) +endif() + +mark_as_advanced(Protobuf_INCLUDE_DIR Protobuf_LIBRARY) + +if (Protobuf_INCLUDE_DIR AND EXISTS "${Protobuf_INCLUDE_DIR}/google/protobuf/stubs/common.h") + set(_Protobuf_VERSION_REGEX "^#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+([0-9]+).*$") + file(STRINGS "${Protobuf_INCLUDE_DIR}/google/protobuf/stubs/common.h" _Protobuf_VERSION_STRING LIMIT_COUNT 1 REGEX "${_Protobuf_VERSION_REGEX}") + if(_Protobuf_VERSION_STRING) + math(EXPR Protobuf_VERSION_MAJOR "${_Protobuf_VERSION_STRING} / 1000000") + math(EXPR Protobuf_VERSION_MINOR "${_Protobuf_VERSION_STRING} / 1000 % 1000") + math(EXPR Protobuf_VERSION_PATCH "${_Protobuf_VERSION_STRING} % 1000") + set(Protobuf_VERSION_STRING "${Protobuf_VERSION_MAJOR}.${Protobuf_VERSION_MINOR}.${Protobuf_VERSION_PATCH}") + endif() + unset(_Protobuf_VERSION_REGEX) + unset(_Protobuf_VERSION_STRING) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Protobuf DEFAULT_MSG Protobuf_LIBRARY Protobuf_INCLUDE_DIR) +if (PROTOBUF_FOUND) + if (DEFINED Protobuf_FIND_VERSION) + if (Protobuf_FIND_VERSION VERSION_GREATER ${Protobuf_VERSION_STRING}) + message(FATAL_ERROR "Protobuf ${Protobuf_VERSION_STRING} found but ${Protobuf_FIND_VERSION} is required") + endif() + endif() + + set(Protobuf_FOUND ${PROTOBUF_FOUND}) + set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR}) + set(Protobuf_LIBRARIES ${Protobuf_LIBRARY}) + + message(STATUS "Protobuf version: ${Protobuf_VERSION_STRING}") +endif() diff --git a/distribution/src/main/resources/assemblies/full.xml b/distribution/src/main/resources/assemblies/full.xml index fa129797..eaecb7f7 100644 --- a/distribution/src/main/resources/assemblies/full.xml +++ b/distribution/src/main/resources/assemblies/full.xml @@ -8,8 +8,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> full dir @@ -75,5 +75,28 @@ 0644 + + + + ${project.basedir}/../target/site/apidocs + doc/java + + + * + + + 0644 + + + + + ${project.basedir}/../build/html + doc/cpp + + * + + 0644 + + diff --git a/dymola-adapter/CMakeLists.txt b/dymola-adapter/CMakeLists.txt index a9b86dfe..5ef973b9 100644 --- a/dymola-adapter/CMakeLists.txt +++ b/dymola-adapter/CMakeLists.txt @@ -3,128 +3,60 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cmake_minimum_required (VERSION 2.6) -set(exec_name1 wp43dymadapter_overload) -set(exec_name2 wp43dymadapter_smallsignal) -set(exec_name3 wp43dymadapter_transient) -set(exec_name4 wp43dymadapter_underovervoltage) +find_package(Matlab REQUIRED) +find_package(Dymola REQUIRED) +set(MATLAB_INCLUDE_DIRECTORIES + stats +) -set(script_file wp43_dymola.sh) - -set(matlabhome $ENV{MATLABHOME}) -set(dymolahome $ENV{DYMOLAHOME}) -set(sdir ${CMAKE_CURRENT_SOURCE_DIR}/sources) -set(ddir ${dymolahome}/Mfiles/dymtools) - -set(builddir ${CMAKE_CURRENT_BINARY_DIR}) +set(MATLAB_RUNTIME_OPTIONS + -nojvm + -nodisplay + -singleCompThread + -nosplash +) -add_custom_command( - COMMENT "Compiling ${exec_name1}" - OUTPUT ${exec_name1} - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name1} - -W main:${exec_name1} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/wp43dymadapter_overload.m - -a ${ddir}/dymload.m - -a ${ddir}/dymget.m - ) +set(MATLAB_WARNING_OPTIONS + enable:specified_file_mismatch + enable:repeated_file + enable:switch_ignored + enable:missing_lib_sentinel + enable:demo_license +) -add_custom_command( - COMMENT "Compiling ${exec_name2}" - OUTPUT ${exec_name2} - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name2} - -W main:${exec_name2} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/wp43dymadapter_smallsignal.m - -a ${ddir}/dymload.m - -a ${ddir}/dymget.m - ) + set(DYMOLA_SOURCES + Mfiles/dymtools/dymload.m + Mfiles/dymtools/dymget.m +) -add_custom_command( - COMMENT "Compiling ${exec_name3}" - OUTPUT ${exec_name3} - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name3} - -W main:${exec_name3} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/wp43dymadapter_transient.m - -a ${ddir}/dymload.m - -a ${ddir}/dymget.m - ) +set(WP43DYMADAPTER_OVERLOAD_SOURCES + sources/wp43dymadapter_overload.m +) +add_matlab_executable(wp43dymadapter_overload "${WP43DYMADAPTER_OVERLOAD_SOURCES}" "${DYMOLA_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name4}" - OUTPUT ${exec_name4} - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name4} - -W main:${exec_name4} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/wp43dymadapter_underovervoltage.m - -a ${ddir}/dymload.m - -a ${ddir}/dymget.m - ) +set(WP43DYMADAPTER_SMALLSIGNAL_SOURCES + sources/wp43dymadapter_smallsignal.m +) +add_matlab_executable(wp43dymadapter_smallsignal "${WP43DYMADAPTER_SMALLSIGNAL_SOURCES}" "${DYMOLA_SOURCES}") +set(WP43DYMADAPTER_TRANSIENT_SOURCES + sources/wp43dymadapter_transient.m +) +add_matlab_executable(wp43dymadapter_transient "${WP43DYMADAPTER_TRANSIENT_SOURCES}" "${DYMOLA_SOURCES}") +set(WP43DYMADAPTER_UNDEROVERVOLTAGE_SOURCES + sources/wp43dymadapter_transient.m +) +add_matlab_executable(wp43dymadapter_underovervoltage "${WP43DYMADAPTER_UNDEROVERVOLTAGE_SOURCES}" "${DYMOLA_SOURCES}") add_custom_target(dymola_adapters ALL COMMENT "building dymola adapters matlab binaries to ${EXECUTABLE_OUTPUT_PATH}" - DEPENDS ${exec_name1} ${exec_name2} ${exec_name3} ${exec_name4} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name1} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name2} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name3} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name4} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${sdir}/${script_file} ${EXECUTABLE_OUTPUT_PATH} + DEPENDS wp43dymadapter_overload wp43dymadapter_smallsignal wp43dymadapter_transient wp43dymadapter_underovervoltage + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43dymadapter_overload ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43dymadapter_smallsignal ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43dymadapter_transient ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43dymadapter_underovervoltage ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/sources/wp43_dymola.sh ${EXECUTABLE_OUTPUT_PATH} ) - diff --git a/dymola-adapter/compile_matlab.sh b/dymola-adapter/compile_matlab.sh deleted file mode 100755 index e74e33c1..00000000 --- a/dymola-adapter/compile_matlab.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp43 V1.3 matlab modules -############################### - -#export MATLABHOME=/adisk03/MATLAB/MATLAB_Production_Server/R2013a/bin -#export DYMOLAHOME - - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -if [ -z "$DYMOLAHOME" ]; then - echo "Need to set enviroment variable DYMOLAHOME, pointing to a Dymola installation. Compilation requires two files from DYMOLAHOME/Mfiles/dymtools: dymload.m and dymget.m" - exit 1 -fi - - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp43dymadapter_overload -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - wp43dymadapter_overload.m \ - $DYMOLAHOME/Mfiles/dymtools/dymload.m \ - $DYMOLAHOME/Mfiles/dymtools/dymget.m - -exename=wp43dymadapter_smallsignal -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - wp43dymadapter_smallsignal.m \ - $DYMOLAHOME/Mfiles/dymtools/dymload.m \ - $DYMOLAHOME/Mfiles/dymtools/dymget.m - -exename=wp43dymadapter_transient -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - wp43dymadapter_transient.m \ - $DYMOLAHOME/Mfiles/dymtools/dymload.m \ - $DYMOLAHOME/Mfiles/dymtools/dymget.m - - -exename=wp43dymadapter_underovervoltage -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - wp43dymadapter_underovervoltage.m \ - $DYMOLAHOME/Mfiles/dymtools/dymload.m \ - $DYMOLAHOME/Mfiles/dymtools/dymget.m - -cp wp43_dymola.sh $targetfolder - -cd $cwd diff --git a/dynamic-indexes/1_Static_Overload/compile_matlab.sh b/dynamic-indexes/1_Static_Overload/compile_matlab.sh deleted file mode 100755 index 0136e5bb..00000000 --- a/dynamic-indexes/1_Static_Overload/compile_matlab.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp43 V1.3 matlab modules -############################### - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp43_overload -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - overload_HELPER.m \ - static_overload.m - -cd $cwd diff --git a/dynamic-indexes/2_Static_UnderOver_Voltage/compile_matlab.sh b/dynamic-indexes/2_Static_UnderOver_Voltage/compile_matlab.sh deleted file mode 100755 index 3684ff99..00000000 --- a/dynamic-indexes/2_Static_UnderOver_Voltage/compile_matlab.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp43 V1.3 matlab modules -############################### - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp43_underovervoltage -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - underovervoltage_HELPER.m \ - static_voltage.m - -cd $cwd diff --git a/dynamic-indexes/3_Dynamic_Transient/compile_matlab.sh b/dynamic-indexes/3_Dynamic_Transient/compile_matlab.sh deleted file mode 100755 index 7366cbf4..00000000 --- a/dynamic-indexes/3_Dynamic_Transient/compile_matlab.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp43 V1.3 matlab modules -############################### - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp43_transient -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - transient_HELPER.m \ - dynamic_transient.m - -cd $cwd diff --git a/dynamic-indexes/4_Dynamic_SmallSignal/compile_matlab.sh b/dynamic-indexes/4_Dynamic_SmallSignal/compile_matlab.sh deleted file mode 100755 index 587c87f4..00000000 --- a/dynamic-indexes/4_Dynamic_SmallSignal/compile_matlab.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp43 V1.3 matlab modules -############################### - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp43_smallsignal -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - smallsignal_HELPER.m \ - Dynamic_smallsignal_example.m \ - pronyiTesla.m \ - signal_filter.m \ - sssi.m - -cd $cwd diff --git a/dynamic-indexes/CMakeLists.txt b/dynamic-indexes/CMakeLists.txt index 0c6c8703..11fa3a57 100644 --- a/dynamic-indexes/CMakeLists.txt +++ b/dynamic-indexes/CMakeLists.txt @@ -3,123 +3,58 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cmake_minimum_required (VERSION 2.6) +find_package(Matlab REQUIRED) -set(exec_name1 wp43_overload) -set(exec_name2 wp43_underovervoltage) -set(exec_name3 wp43_transient) -set(exec_name4 wp43_smallsignal) - -set(matlabhome $ENV{MATLABHOME}) -set(sdir ${CMAKE_CURRENT_SOURCE_DIR}) -set(builddir ${CMAKE_CURRENT_BINARY_DIR}) +set(MATLAB_INCLUDE_DIRECTORIES + stats +) -add_custom_command( - COMMENT "Compiling ${exec_name1}" - OUTPUT ${exec_name1} - DEPENDS ${sdir}/1_Static_Overload/sources/overload_HELPER.m ${sdir}/1_Static_Overload/sources/static_overload.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name1} - -W main:${exec_name1} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/1_Static_Overload/sources/overload_HELPER.m - -a ${sdir}/1_Static_Overload/sources/static_overload.m +set(MATLAB_RUNTIME_OPTIONS + -nojvm + -nodisplay + -singleCompThread + -nosplash ) -add_custom_command( - COMMENT "Compiling ${exec_name2}" - OUTPUT ${exec_name2} - DEPENDS ${sdir}/2_Static_UnderOver_Voltage/sources/underovervoltage_HELPER.m ${sdir}/2_Static_UnderOver_Voltage/sources/static_voltage.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name2} - -W main:${exec_name2} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/2_Static_UnderOver_Voltage/sources/underovervoltage_HELPER.m - -a ${sdir}/2_Static_UnderOver_Voltage/sources/static_voltage.m +set(MATLAB_WARNING_OPTIONS + enable:specified_file_mismatch + enable:repeated_file + enable:switch_ignored + enable:missing_lib_sentinel + enable:demo_license ) -add_custom_command( - COMMENT "Compiling ${exec_name3}" - OUTPUT ${exec_name3} - DEPENDS ${sdir}/3_Dynamic_Transient/sources/transient_HELPER.m ${sdir}/3_Dynamic_Transient/sources/dynamic_transient.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name3} - -W main:${exec_name3} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/3_Dynamic_Transient/sources/transient_HELPER.m - -a ${sdir}/3_Dynamic_Transient/sources/dynamic_transient.m +set(WP43_OVERLOAD_SOURCES + 1_Static_Overload/sources/overload_HELPER.m + 1_Static_Overload/sources/static_overload.m ) +add_matlab_executable(wp43_overload "${WP43_OVERLOAD_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name4}" - OUTPUT ${exec_name4} - DEPENDS ${sdir}/4_Dynamic_SmallSignal/sources/smallsignal_HELPER.m ${sdir}/4_Dynamic_SmallSignal/sources/pronyiTesla.m ${sdir}/4_Dynamic_SmallSignal/sources/signal_filter.m ${sdir}/4_Dynamic_SmallSignal/sources/sssi.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name4} - -W main:${exec_name4} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/4_Dynamic_SmallSignal/sources/smallsignal_HELPER.m - -a ${sdir}/4_Dynamic_SmallSignal/sources/pronyiTesla.m - -a ${sdir}/4_Dynamic_SmallSignal/sources/signal_filter.m - -a ${sdir}/4_Dynamic_SmallSignal/sources/sssi.m +set(WP43_UNDEROVERVOLTAGE_SOURCES + 2_Static_UnderOver_Voltage/sources/underovervoltage_HELPER.m + 2_Static_UnderOver_Voltage/sources/static_voltage.m ) +add_matlab_executable(wp43_underovervoltage "${WP43_UNDEROVERVOLTAGE_SOURCES}") +set(WP43_TRANSIENT_SOURCES + 3_Dynamic_Transient/sources/transient_HELPER.m + 3_Dynamic_Transient/sources/dynamic_transient.m +) +add_matlab_executable(wp43_transient "${WP43_TRANSIENT_SOURCES}") +set(WP43_SMALLSIGNAL_SOURCES + 4_Dynamic_SmallSignal/sources/smallsignal_HELPER.m + 4_Dynamic_SmallSignal/sources/pronyiTesla.m + 4_Dynamic_SmallSignal/sources/signal_filter.m + 4_Dynamic_SmallSignal/sources/sssi.m +) +add_matlab_executable(wp43_smallsignal "${WP43_SMALLSIGNAL_SOURCES}") add_custom_target(dynamic_index ALL COMMENT "building dynamic indexes matlab binaries to ${EXECUTABLE_OUTPUT_PATH}" - DEPENDS ${exec_name1} ${exec_name2} ${exec_name3} ${exec_name4} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name1} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name2} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name3} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name4} ${EXECUTABLE_OUTPUT_PATH} + DEPENDS wp43_overload wp43_underovervoltage wp43_transient wp43_smallsignal + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43_overload ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43_underovervoltage ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43_transient ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp43_smallsignal ${EXECUTABLE_OUTPUT_PATH} ) - diff --git a/eurostag-indexes/CMakeLists.txt b/eurostag-indexes/CMakeLists.txt index 0da8d7b3..f898849f 100644 --- a/eurostag-indexes/CMakeLists.txt +++ b/eurostag-indexes/CMakeLists.txt @@ -8,56 +8,27 @@ cmake_minimum_required(VERSION 2.6) project(indexes) -if (DEFINED ENV{EUROSTAG_SRC_HOME}) - message("EUROSTAG_SRC_HOME=$ENV{EUROSTAG_SRC_HOME}") -else() - message(FATAL_ERROR "EUROSTAG_SRC_HOME is NOT defined") -endif() -if (DEFINED ENV{INTEL_HOME}) - message("INTEL_HOME=$ENV{INTEL_HOME}") -else() - message(FATAL_ERROR "INTEL_HOME is NOT defined") -endif() -if (DEFINED BOOST_HOME) - message("BOOST_HOME=${BOOST_HOME}") -else() - message(FATAL_ERROR "BOOST_HOME is NOT defined") -endif() +find_package(Boost 1.57 REQUIRED) +find_package(Eurostag REQUIRED) +find_package(IntelFortran REQUIRED COMPONENTS ifcore ifport imf intlc) -file(GLOB_RECURSE source_files src/*) +# tsoindexes executable +set(TSOINDEXES_SOURCES + src/TimeSeries.cpp + src/EurostagTimeSeries.cpp + src/tsoindexes.cpp +) +add_executable(tsoindexes ${TSOINDEXES_SOURCES}) +target_link_libraries(tsoindexes ${Eurostag_LIBRARIES} ${IntelFortran_LIBRARIES} ${CMAKE_DL_LIBS}) -ADD_LIBRARY(eustag_cpt STATIC IMPORTED) -ADD_LIBRARY(eustag_esg STATIC IMPORTED) -ADD_LIBRARY(eustag_a STATIC IMPORTED) -ADD_LIBRARY(light_lib_a_t STATIC IMPORTED) -ADD_LIBRARY(eustag_i STATIC IMPORTED) -ADD_LIBRARY(eustag_s STATIC IMPORTED) -ADD_LIBRARY(light_lib_s STATIC IMPORTED) -ADD_LIBRARY(eustag_lf STATIC IMPORTED) -ADD_LIBRARY(light_lib_t_s STATIC IMPORTED) -ADD_LIBRARY(light_lib_t STATIC IMPORTED) -ADD_LIBRARY(eustag_bld STATIC IMPORTED) -ADD_LIBRARY(util STATIC IMPORTED) -ADD_LIBRARY(klu STATIC IMPORTED) -ADD_LIBRARY(amd STATIC IMPORTED) -SET_TARGET_PROPERTIES(eustag_cpt PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/bin/libeustag_cpt.a) -SET_TARGET_PROPERTIES(eustag_esg PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/bin/libeustag_esg.a) -SET_TARGET_PROPERTIES(eustag_a PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaga/bin/libeustag_a.a) -SET_TARGET_PROPERTIES(light_lib_a_t PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaga/bin/liblight_lib_a_t.a) -SET_TARGET_PROPERTIES(eustag_i PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagi/bin/libeustag_i.a) -SET_TARGET_PROPERTIES(eustag_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustags/bin/libeustag_s.a) -SET_TARGET_PROPERTIES(light_lib_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustags/bin/liblight_lib_s.a) -SET_TARGET_PROPERTIES(eustag_lf PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaglf/bin/libeustag_lf.a) -SET_TARGET_PROPERTIES(light_lib_t_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagt/bin/liblight_lib_t_s.a) -SET_TARGET_PROPERTIES(light_lib_t PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagt/bin/liblight_lib_t.a) -SET_TARGET_PROPERTIES(eustag_bld PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagbld/bin/libeustag_bld.a) -SET_TARGET_PROPERTIES(util PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/util/bin/libutil.a) -SET_TARGET_PROPERTIES(klu PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/klu/bin/libklu.a) -SET_TARGET_PROPERTIES(amd PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/amd/bin/libamd.a) +# tsextract executable +set(TSEXTRACT_SOURCES + src/TimeSeries.cpp + src/EurostagTimeSeries.cpp + src/tsextract.cpp +) +add_executable(tsextract ${TSEXTRACT_SOURCES}) +target_link_libraries(tsextract ${Eurostag_LIBRARIES} ${IntelFortran_LIBRARIES} ${CMAKE_DL_LIBS}) -include_directories(${BOOST_HOME}/include $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/sources) -link_directories($ENV{INTEL_HOME}/lib/intel64/) -add_executable(tsoindexes src/TimeSeries.cpp src/EurostagTimeSeries.cpp src/tsoindexes.cpp) -add_executable(tsextract src/TimeSeries.cpp src/EurostagTimeSeries.cpp src/tsextract.cpp) -target_link_libraries(tsoindexes eustag_esg eustag_cpt eustag_a light_lib_a_t eustag_i eustag_s light_lib_s eustag_lf light_lib_t_s light_lib_t eustag_bld util klu amd ifcore ifport intlc imf irc svml dl pthread) -target_link_libraries(tsextract eustag_esg eustag_cpt eustag_a light_lib_a_t eustag_i eustag_s light_lib_s eustag_lf light_lib_t_s light_lib_t eustag_bld util klu amd ifcore ifport intlc imf irc svml dl pthread) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${Eurostag_INCLUDE_DIRS}) diff --git a/install.sh b/install.sh index 50ec75d1..6044ccfa 100755 --- a/install.sh +++ b/install.sh @@ -5,263 +5,365 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -## -## before setting these settings to true, make sure that these enviroment variables are available -## - EUROSTAG_SRC_HOME and INTEL_HOME (to compile EUROSTAG based modules) -## - MATLABHOME: to compile MATLAB CODE, must point to the root of a MATLAB v>R2015 installation -## - DYMOLAHOME: to compile the matlab integration module) -## -BUILD_EUROSTAG=false -BUILD_MATLAB=false -BUILD_DYMOLA=false -BUILD_THIRDPARTY=true - -## ipst top source directory sourceDir=$(dirname $(readlink -f $0)) -## default ipst installation target directory -installDir=$HOME/itesla -## default ipst thirdparty directory -thirdpartyDir=$HOME/itesla_thirdparty -## stop script execution if installDir already exists -overwriteInstallation=false +## install default settings +############################################################################### +ipst_prefix=$HOME/itesla +ipst_package_version=` mvn -f "$sourceDir/pom.xml" org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version | grep -v "\["` +ipst_package_name=ipst-$ipst_package_version +ipst_package_type=zip -## remove non java ipst build dir, before triggering a new build -removeNonJavaBuildDir=false +dymola_build=false +dymola_home= +eurostag_build=false +eurostag_home= +matlab_build=false +matlab_home= -## remove thord-party build dir, before triggering a new build -removeThirdpartyBuildDir=false +thirdparty_build=true +thirdparty_prefix=$HOME/itesla_thirdparty +thirdparty_download=true +thirdparty_packs=$HOME/itesla_packs +# Targets +ipst_clean=false +ipst_compile=false +ipst_docs=false +ipst_package=false +ipst_install=false +thirdparty_clean=false + +## read settings from configuration file +############################################################################### +settings="$sourceDir/install.cfg" +if [ -f "${settings}" ]; then + source "${settings}" +fi + + +## Usage/Help +############################################################################### cmd=$0 usage() { - echo "usage: $cmd [--help] [--installDir ] [--thirdpartyDir ] [--overwriteInstallation] [--clean] [--removeNonJavaBuildDir] [--removeThirdpartyBuildDir] [--buildMATLAB] [--buildEUROSTAG] [--buildDYMOLA]"; + echo "usage: $cmd [options] [target...]" + echo "" + echo "Available targets:" + echo " clean Clean iPST modules" + echo " clean-thirdparty Clean the thirdparty libraries" + echo " compile Compile iPST modules" + echo " package Compile iPST modules and create a distributable package" + echo " install Compile iPST modules and install it (default target)" + echo " help Display this help" + echo " docs Generate the documentation (Doxygen/Javadoc)" + echo "" + echo "iPST options:" + echo " --help Display this help" + echo " --prefix Set the installation directory (default is $HOME/itesla)" + echo " --package-type Set the package format. The supported formats are zip, tar, tar.gz and tar.bz2 (default is zip)" + echo "" + echo "iPST C++ options:" + echo " --with-dymola Enable the compilation of Dymola dependant modules (DYMOLA_HOME)" + echo " --without-dymola Disable the compilation of Dymola dependant modules (default)" + echo " --with-eurostag Enable the compilation of Eurostag dependant modules (EUROSTAG_SDK_HOME)" + echo " --without-eurostag Disable the compilation of Eurostag dependant modules (default)" + echo " --with-matlab Enable the compilation of Matlab dependant modules (MATLAB_HOME)" + echo " --without-matlab Disable the compilation of Matlab dependant modules (default)" + echo "" + echo "Thirdparty options:" + echo " --with-thirdparty Enable the compilation of thirdparty libraries (default)" + echo " --without-thirdparty Disable the compilation of thirdparty libraries" + echo " --thirdparty-prefix Set the thirdparty installation directory (default is $HOME/itesla_thirdparty)" + echo " --thirdparty-download Sets false to compile thirdparty libraries from a local repository (default is true)" + echo " --thirdparty-packs Sets the thirdparty libraries local repository (default is $HOME/itesla_packs)" echo "" - exit 1 } -help() { - echo "usage: $cmd [--help] [--installDir ] [--thirdpartyDir ] [--overwriteInstallation]"; - echo " --installDir the target directory; default is /itesla; installation will not proceed if it already exists,"; - echo " unless --overwriteInstallation is set (in this case the existing installation will be overwritten)"; - echo " --thirdpartyDir the target path for the thirdparty libraries, required to build IPST (default is /itesla_thirdparty)"; - echo " --overwriteInstallation if set, the install script overwrites an existing installation (default is not set: stop script execution if installDir already exists)"; - echo " --buildMATLAB if set, build MATLAB components (default is false, this option requires installation of MATLAB and MATLAB compiler)"; - echo " --buildEUROSTAG if set, build EUROSTAG components (default is false, this option requires installation of EUROSTAG and EUROSTAG SDK)"; - echo " --buildDYMOLA if set, build DYMOLA components (default is false, this option requires installation of DYMOLA)"; - echo " --removeThirdpartyBuildDir if set, remove an already existing third-party build dir before starting a new build (default is false)"; - echo " --removeNonJavaBuildDir if set, remove an already existing non java ipst build dir before starting a new build (default is false)"; - echo " --clean remove compiled files and directories generated during a build (thirdpartyDir excluded) and exit."; - echo " --help "; + +## Write Settings functions +############################################################################### +writeSetting() { + if [[ $# -lt 2 || $# -gt 3 ]]; then + echo "WARNING: writeSetting [comment (true|false)]" + exit 1 + fi + + SETTING=$1 + VALUE=$2 + if [[ $# -eq 3 ]]; then + echo -ne "# " + fi + echo "${SETTING}=${VALUE}" + + return 0 +} + +writeComment() { + echo "# $*" + return 0 +} + +writeEmptyLine() { echo "" - exit + return 0 } +writeSettings() { + writeComment " -- iPST global options --" + writeSetting "ipst_prefix" ${ipst_prefix} + writeSetting "ipst_package_type" ${ipst_package_type} + + writeEmptyLine + + writeComment " -- iPST C++ modules options --" + writeSetting "eurostag_build" ${eurostag_build} + writeSetting "eurostag_home" "${eurostag_home}" + writeSetting "dymola_build" ${dymola_build} + writeSetting "dymola_home" "${dymola_home}" + writeSetting "matlab_build" ${matlab_build} + writeSetting "matlab_home" "${matlab_home}" -cleanIPST=false; - -for ((i=1;i<=$#;i++)); -do - if [ ${!i} = "--installDir" ] - then ((i++)) - installDir=${!i}; - elif [ ${!i} = "--thirdpartyDir" ]; - then ((i++)) - thirdpartyDir=${!i}; - elif [ ${!i} = "--overwriteInstallation" ]; - then - overwriteInstallation=true; - elif [ ${!i} = "--buildMATLAB" ]; - then - BUILD_MATLAB=true; - elif [ ${!i} = "--buildEUROSTAG" ]; - then - BUILD_EUROSTAG=true; - elif [ ${!i} = "--buildDYMOLA" ]; - then - BUILD_DYMOLA=true; - elif [ ${!i} = "--skipThirdpartyBuild" ]; - then - BUILD_THIRDPARTY=false; - elif [ ${!i} = "--removeThirdpartyBuildDir" ]; - then - removeThirdpartyBuildDir=true; - elif [ ${!i} = "--removeNonJavaBuildDir" ]; - then - removeNonJavaBuildDir=true; - elif [ ${!i} = "--clean" ]; - then - cleanIPST=true; - elif [ ${!i} = "--help" ]; - then ((i++)) - help; + writeEmptyLine + + writeComment " -- iPST thirdparty libraries --" + writeSetting "thirdparty_build" ${thirdparty_build} + writeSetting "thirdparty_prefix" ${thirdparty_prefix} + writeSetting "thirdparty_download" ${thirdparty_download} + writeSetting "thirdparty_packs" ${thirdparty_packs} + + return 0 +} + + +## Build required C++ thirdparty libraries +############################################################################### +buildthirdparty() +{ + if [[ $thirdparty_clean = true || $ipst_compile = true ]]; then + echo "** C++ thirdparty libraries" + + if [ $thirdparty_clean = true ]; then + echo "**** Removing thirdparty install directory (if already exists)." + rm -rf "$thirdparty_prefix" + fi + + if [ $ipst_compile = true ]; then + if [ $thirdparty_build = true ]; then + echo "**** Building the C++ thirdparty libraries" + thirdparty_builddir="${thirdparty_prefix}/build" + cmake -Dprefix="$thirdparty_prefix" -Ddownload="$thirdparty_download" -Dpacks="$thirdparty_packs" -G "Unix Makefiles" -H"$sourceDir/thirdparty" -B"$thirdparty_builddir" || exit $? + make -C "$thirdparty_builddir" || exit $? + + thirdparty_build=false + else + echo "**** Skipping the build of the required thirdparty libraries, assuming a previous build in $thirdparty_prefix" + fi + fi fi -done; +} -buildDir=$sourceDir/build -buildThirdpartyDir=$thirdpartyDir/build +## Build C++ modules +############################################################################### +ipst_cpp() +{ + if [[ $ipst_clean = true || $ipst_compile = true || $ipst_docs = true ]]; then + echo "** iPST C++ modules" -if [ $cleanIPST = true ] ; then - echo "" - echo "** cleaning ipst" - echo "" - mvn -f $sourceDir/pom.xml clean - cr=$? - if [ $cr -ne 0 ] ; then - exit $cr + ipst_builddir=$sourceDir/build + + if [ $ipst_clean = true ]; then + echo "**** Removing build directory (if already exists)." + rm -rf "$ipst_builddir" + fi + + if [[ $ipst_compile = true || $ipst_docs = true ]]; then + # TODO: rename variable + cmake -DCMAKE_INSTALL_PREFIX="$ipst_prefix" -Dthirdparty_prefix="$thirdparty_prefix" -DBUILD_EUROSTAG=$eurostag_build -DEUROSTAG_SDK_HOME="${eurostag_home}" -DBUILD_MATLAB=$matlab_build -DMATLAB_HOME="${matlab_home}" -DBUILD_DYMOLA=$dymola_build -DDYMOLA_HOME="${dymola_home}" -G "Unix Makefiles" -H"$sourceDir" -B"$ipst_builddir" || exit $? + + if [ $ipst_compile = true ]; then + echo "**** Compiling C++ modules" + make -C "$ipst_builddir" || exit $? + fi + + if [ $ipst_docs = true ]; then + echo "**** Generating Doxygen documentation" + make -C "$ipst_builddir" doc || exit $? + fi + fi fi - rm -rf $buildDir +} - echo "" - echo "** cleaned." - echo "" +## Build Java Modules +############################################################################### +ipst_java() +{ + if [[ $ipst_clean = true || $ipst_compile = true || $ipst_docs = true ]]; then + echo "** Building iPST Java modules" - exit 0 -fi + mvn_options="" + [ $ipst_clean = true ] && mvn_options="$mvn_options clean" + [ $ipst_compile = true ] && mvn_options="$mvn_options install" + if [ ! -z "$mvn_options" ]; then + mvn -f "$sourceDir/pom.xml" $mvn_options || exit $? + fi -echo "" -echo "** Building and installing ipst:" -echo "** -----------------------------" -echo "** installDir:" $installDir -echo "** thirdpartyDir:" $thirdpartyDir -echo "** overwriteInstallation:" $overwriteInstallation -echo "** removeThirdpartyBuildDir:" $removeThirdpartyBuildDir -echo "** removeNonJavaBuildDir:" $removeNonJavaBuildDir -echo "** buildMATLAB:" $BUILD_MATLAB -echo "** buildEUROSTAG:" $BUILD_EUROSTAG -echo "** buildDYMOLA:" $BUILD_DYMOLA - -if [ $BUILD_MATLAB = true ] ; then - if [ -z "$MATLABHOME" ] ; then - echo "" - echo "ERROR: to build MATLAB modules, MATLABHOME environment variable is required; MATLABHOME must point to the root of a licensed MATLAB installation (with MATLAB compiler)" - exit 1 - fi -fi + if [ $ipst_docs = true ]; then + echo "**** Generating Javadoc documentation" + mvn -f "$sourceDir/pom.xml" javadoc:javadoc || exit $? + mvn -f "$sourceDir/distribution/pom.xml" install || exit $? + fi + fi +} -if [ $BUILD_EUROSTAG = true ] ; then - if [ -z "$EUROSTAG_SRC_HOME" ] ; then - echo "" - echo "ERROR: to build EUROSTAG modules, EUROSTAG_SRC_HOME environment variable is required. It must point to an EUROSTAG SDK." - exit 1 - fi -fi +## Package iPST +############################################################################### +ipst_package() +{ + if [ $ipst_package = true ]; then + echo "** Packaging iPST" -if [ $BUILD_DYMOLA = true ] ; then - if [ -z "$DYMOLAHOME" ] ; then - echo "" - echo "ERROR: to build DYMOLA modules, DYMOLAHOME environment variable is required. It must point to the root of a DYMOLA installation." - exit 1 - fi -fi + case "$ipst_package_type" in + zip) + [ -f "${ipst_package_name}.zip" ] && rm -f "${ipst_package_name}.zip" + $(cd "$sourceDir/distribution/target/distribution-${ipst_package_version}-full" && zip -rq "$sourceDir/${ipst_package_name}.zip" "itesla") + zip -qT "${ipst_package_name}.zip" > /dev/null 2>&1 || exit $? + ;; -if [ -d $installDir ] && - [ $overwriteInstallation != true ] -then - echo "" - echo "ERROR: installation cannot continue: the target directory '"$installDir"' already exists (to allow overwrite it, set the --overwriteInstallation parameter)." - echo "" - usage; -fi + tar) + [ -f "${ipst_package_name}.tar" ] && rm -f "${ipst_package_name}.tar" + tar -cf "${ipst_package_name}.tar" -C "$sourceDir/distribution/target/distribution-${ipst_package_version}-full" . || exit $? + ;; + tar.gz | tgz) + [ -f "${ipst_package_name}.tar.gz" ] && rm -f "${ipst_package_name}.tar.gz" + [ -f "${ipst_package_name}.tgz" ] && rm -f "${ipst_package_name}.tgz" + tar -czf "${ipst_package_name}.tar.gz" -C "$sourceDir/distribution/target/distribution-${ipst_package_version}-full" . || exit $? + ;; -############################################ -# build required C/C++ thirdparty libraries: -# - boost, build, hdf5, libarchive, log4cpp, matio, protobuf, szip, zlib -# -if [ $BUILD_THIRDPARTY = true ] ; then - echo "" - echo "** Building thirdparty libraries" - echo "" - if [ $removeThirdpartyBuildDir = true ] ; then - echo "" - echo "*** removing third-party build dir (if it already exists). Triggers a clean third-party build." - echo "" - rm -rf $buildThirdpartyDir - fi - cmake -Dthirdparty_prefix=$thirdpartyDir -G "Unix Makefiles" -H$sourceDir/thirdparty -B$buildThirdpartyDir - cr=$? - if [ $cr -ne 0 ] ; then - exit $cr - fi - make -C $buildThirdpartyDir - cr=$? - if [ $cr -ne 0 ] ; then - exit $cr - fi -else - echo "" - echo "** Exclude required thirdparty from build; libraries are assumed to be already available here: "$thirdpartyDir - echo "" -fi + tar.bz2 | tbz) + [ -f "${ipst_package_name}.tar.bz2" ] && rm -f "${ipst_package_name}.tar.bz2" + [ -f "${ipst_package_name}.tbz" ] && rm -f "${ipst_package_name}.tbz" + tar -cjf "${ipst_package_name}.tar.bz2" -C "$sourceDir/distribution/target/distribution-${ipst_package_version}-full" . || exit $? + ;; -########################################################################################### -# build IPST (C/C++ and MATLAB modules, if enabled by the above declared BUILD_MATLAB flag) -# -echo "" -echo "** Building IPST platform: C/C++ and MATLAB (when configured) modules" -echo "" -if [ $removeNonJavaBuildDir = true ] ; then - echo "" - echo "*** removing non java build dir (if it already exists). Triggers a clean build." - echo "" - rm -rf $buildDir -fi -cmake -DCMAKE_INSTALL_PREFIX=$installDir -Dthirdparty_prefix=$thirdpartyDir -DBUILD_EUROSTAG=$BUILD_EUROSTAG -DBUILD_MATLAB=$BUILD_MATLAB -DBUILD_DYMOLA=$BUILD_DYMOLA -G "Unix Makefiles" -H$sourceDir -B$buildDir -cr=$? -if [ $cr -ne 0 ] ; then -exit $cr -fi -make -C $buildDir -cr=$? -if [ $cr -ne 0 ] ; then -exit $cr -fi + *) + echo "Invalid package format: zip, tar, tar.gz, tar.bz2 are supported." + exit 1; + ;; + esac + fi +} +## Install iPST +############################################################################### +ipst_install() +{ + if [ $ipst_install = true ]; then + echo "** Installing iPST" -########################### -# build IPST (Java modules) -# -echo "" -echo "** Building IPST platform: java modules" -echo "" -mvn -f $sourceDir/pom.xml clean install -cr=$? -if [ $cr -ne 0 ] ; then -exit $cr -fi + echo "**** Copying files" + mkdir -p "$ipst_prefix" || exit $? + cp -Rp "$sourceDir/distribution/target/distribution-${ipst_package_version}-full/itesla"/* "$ipst_prefix" || exit $? -################################################ -#install IPST to the target directory: installDir -# -echo "" -echo "** Copying distribution files to "$installDir -echo "" -mkdir -p $installDir -cp -r $sourceDir/distribution/target/distribution-*-full/itesla/* $installDir/ -cr=$? -if [ $cr -ne 0 ] ; then -exit $cr -fi + if [ ! -f "$ipst_prefix/etc/itesla.conf" ]; then + echo "**** Copying configuration files" + mkdir -p "$ipst_prefix/etc" || exit $? + + echo "#itesla_cache_dir=" >> "$ipst_prefix/etc/itesla.conf" + echo "#itesla_config_dir=" >> "$ipst_prefix/etc/itesla.conf" + echo "itesla_config_name=config" >> "$ipst_prefix/etc/itesla.conf" + echo "mpi_tasks=3" >> "$ipst_prefix/etc/itesla.conf" + echo "mpi_hosts=localhost" >> "$ipst_prefix/etc/itesla.conf" + fi + fi +} + +## Parse command line +############################################################################### +ipst_options="prefix:,package-type:" +ipst_cpp_options="with-eurostag::,without-eurostag,with-dymola::,without-dymola,with-matlab::,without-matlab" +thirdparty_options="with-thirdparty,without-thirdparty,thirdparty-prefix:,thirdparty-download,thirdparty-packs:" + +opts=`getopt -o '' --long "help,$ipst_options,$ipst_cpp_options,$thirdparty_options" -n 'install.sh' -- "$@"` +eval set -- "$opts" +while true; do + case "$1" in + # iPST options + --prefix) ipst_prefix=$2 ; shift 2 ;; + --package-type) ipst_package_type=$2 ; shift 2 ;; + + # iPST C++ options + --with-dymola) + case "$2" in + "") dymola_build=true ; dymola_home=${DYMOLA_HOME} ; shift 2 ;; + *) dymola_build=true ; dymola_home=$2 ; shift 2 ;; + esac ;; + --without-dymola) dymola_build=false ; shift ;; + --with-eurostag) + case "$2" in + "") eurostag_build=true ; eurostag_home=${EUROSTAG_SDK_HOME} ; shift 2 ;; + *) eurostag_build=true ; eurostag_home=$2 ; shift 2 ;; + esac ;; + --without-eurostag) eurostag_build=false ; shift ;; + --with-matlab) + case "$2" in + "") matlab_build=true ; matlab_home=${MATLAB_HOME} ; shift 2 ;; + *) matlab_build=true ; matlab_home=$2 ; shift 2 ;; + esac ;; + --without-matlab) matlab_build=false ; shift ;; -mkdir -p $installDir/etc - -###################################################################################### -# create a default configuration file, if a configuration file does not already exist -# -if [ ! -f $installDir/etc/itesla.conf ]; then -echo "" -echo "*** Creating a default itesla.conf file" -echo "" -echo "#itesla_cache_dir=" >> $installDir/etc/itesla.conf -echo "#itesla_config_dir=" >> $installDir/etc/itesla.conf -echo "itesla_config_name=config" >> $installDir/etc/itesla.conf -echo "mpi_tasks=3" >> $installDir/etc/itesla.conf -echo "mpi_hosts=localhost" >> $installDir/etc/itesla.conf + # Third-party options + --with-thirdparty) thirdparty_build=true ; shift ;; + --without-thirdparty) thirdparty_build=false ; shift ;; + --thirdparty-prefix) thirdparty_prefix=$2 ; shift 2 ;; + --thirdparty-download) thirdparty_download=true ; shift ;; + --thirdparty-packs) thirdparty_packs=$2 ; thirdparty_download=false ; shift 2 ;; + + # Help + --help) usage ; exit 0 ;; + + --) shift ; break ;; + *) usage ; exit 1 ;; + esac +done + +if [ $# -ne 0 ]; then + for command in $*; do + case "$command" in + clean) ipst_clean=true ;; + clean-thirdparty) thirdparty_clean=true ; thirdparty_build=true ;; + compile) ipst_compile=true ;; + docs) ipst_docs=true ;; + package) ipst_package=true ; ipst_compile=true ;; + install) ipst_install=true ; ipst_compile=true ;; + help) usage; exit 0 ;; + *) usage ; exit 1 ;; + esac + done else -echo "*** Configuration file " $installDir/etc/itesla.conf " already exists: it will not be replaced." + ipst_compile=true + ipst_install=true fi -echo "" -exit 0 +## Build iPST platform +############################################################################### + +# Build required C++ thirdparty libraries +buildthirdparty + +# Build C++ modules +ipst_cpp + +# Build Java modules +ipst_java + +# Package iPST +ipst_package + +# Install iPST +ipst_install + +# Save settings +writeSettings > "${settings}" diff --git a/mcla/CMakeLists.txt b/mcla/CMakeLists.txt index 15a81e8a..86778ce7 100644 --- a/mcla/CMakeLists.txt +++ b/mcla/CMakeLists.txt @@ -3,503 +3,399 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cmake_minimum_required (VERSION 2.6) +find_package(Matlab REQUIRED) -set(exec_name1 wp5fea_m1) -set(exec_name2 wp5fea_m2) -set(exec_name3 wp5fea_m2_reduce) -set(exec_name4 wp5fea_m3_sampling) -set(exec_name5 wp5mcla) -set(exec_name6 wp5fpf) - -set(matlabhome $ENV{MATLABHOME}) -set(sdir ${CMAKE_CURRENT_SOURCE_DIR}/sources) -set(builddir ${CMAKE_CURRENT_BINARY_DIR}) - -add_custom_command( - COMMENT "Compiling ${exec_name1}" - OUTPUT ${exec_name1} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name1} - -W main:${exec_name1} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -nosplash - -v ${sdir}/FEA_MODULE1_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(MATLAB_INCLUDE_DIRECTORIES + stats ) - -add_custom_command( - COMMENT "Compiling ${exec_name2}" - OUTPUT ${exec_name2} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name2} - -W main:${exec_name2} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/FEA_MODULE2_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(MATLAB_RUNTIME_OPTIONS + -nojvm + -nodisplay + -nosplash ) +set(MATLAB_WARNING_OPTIONS + enable:specified_file_mismatch + enable:repeated_file + enable:switch_ignored + enable:missing_lib_sentinel + enable:demo_license +) -add_custom_command( - COMMENT "Compiling ${exec_name3}" - OUTPUT ${exec_name3} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name3} - -W main:${exec_name3} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/FEA_MODULE2_REDUCE_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(WP5FEA_M1_SOURCES + sources/FEA_MODULE1_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m ) +add_matlab_executable(wp5fea_m1 "${WP5FEA_M1_SOURCES}") +set(WP5FEA_M2_SOURCES + sources/FEA_MODULE2_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m +) +add_matlab_executable(wp5fea_m2 "${WP5FEA_M2_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name4}" - OUTPUT ${exec_name4} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name4} - -W main:${exec_name4} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/SAMPLING_MODULE3_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(WP5FEA_M2_REDUCE_SOURCES + sources/FEA_MODULE2_REDUCE_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m ) +add_matlab_executable(wp5fea_m2_reduce "${WP5FEA_M2_REDUCE_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name5}" - OUTPUT ${exec_name5} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name5} - -W main:${exec_name5} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -nosplash - -v ${sdir}/MCLA_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(WP5FEA_M3_SAMPLING_SOURCES + sources/SAMPLING_MODULE3_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m ) +add_matlab_executable(wp5fea_m3_sampling "${WP5FEA_M3_SAMPLING_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name6}" - OUTPUT ${exec_name6} - DEPENDS ${sdir}/*.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name6} - -W main:${exec_name6} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -nosplash - -v ${sdir}/FPF_HELPER.m - -a ${sdir}/analysis.m - -a ${sdir}/bisection.m - -a ${sdir}/carica_DB.m - -a ${sdir}/check_distrizuione.m - -a ${sdir}/chi_pval.m - -a ${sdir}/closest_corr.m - -a ${sdir}/conditional_samps.m - -a ${sdir}/copulaName.m - -a ${sdir}/copulachoose.m - -a ${sdir}/datacorrige2.m - -a ${sdir}/estract_cdf.m - -a ${sdir}/funzioneB.m - -a ${sdir}/funzione.m - -a ${sdir}/gausmix3.m - -a ${sdir}/gaussian_conditional.m - -a ${sdir}/gaussian_mixture.m - -a ${sdir}/h_gumbel.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/h_inv.m - -a ${sdir}/h.m - -a ${sdir}/h_pit.m - -a ${sdir}/inversion_with_verify2.m - -a ${sdir}/invfunzioneB.m - -a ${sdir}/licols.m - -a ${sdir}/main.m - -a ${sdir}/main_MCLA2PC3.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/MCLA_HELPER.m - -a ${sdir}/mod_data.m - -a ${sdir}/modelSummary.m - -a ${sdir}/modR.m - -a ${sdir}/MODULE0.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2.m - -a ${sdir}/MODULE2_OUTPUT2.m - -a ${sdir}/MODULE2_OUTPUT.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3.m - -a ${sdir}/MODULE3PRE_HELPERS.m - -a ${sdir}/MODULE3_SINGLE.m - -a ${sdir}/modU.m - -a ${sdir}/new_method_imputation4.m - -a ${sdir}/new_method_imputation.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/pictures.m - -a ${sdir}/rand_gen.m - -a ${sdir}/run_module3.m - -a ${sdir}/sQuantile.m - -a ${sdir}/stimaposdef.m - -a ${sdir}/testfilterings2.m - -a ${sdir}/trova_closest.m +set(WP5MCLA_SOURCES + sources/MCLA_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m ) +add_matlab_executable(wp5mcla "${WP5MCLA_SOURCES}") +set(WP5FPF_SOURCES + sources/FPF_HELPER.m + sources/analysis.m + sources/bisection.m + sources/carica_DB.m + sources/check_distrizuione.m + sources/chi_pval.m + sources/closest_corr.m + sources/conditional_samps.m + sources/copulaName.m + sources/copulachoose.m + sources/datacorrige2.m + sources/estract_cdf.m + sources/funzioneB.m + sources/funzione.m + sources/gausmix3.m + sources/gaussian_conditional.m + sources/gaussian_mixture.m + sources/h_gumbel.m + sources/h_inv_ex.m + sources/h_inv.m + sources/h.m + sources/h_pit.m + sources/inversion_with_verify2.m + sources/invfunzioneB.m + sources/licols.m + sources/main.m + sources/main_MCLA2PC3.m + sources/map_ecdf.m + sources/MCLA_HELPER.m + sources/mod_data.m + sources/modelSummary.m + sources/modR.m + sources/MODULE0.m + sources/MODULE1_HELPER.m + sources/MODULE1_HELPERS.m + sources/MODULE1.m + sources/MODULE2_HELPER.m + sources/MODULE2_HELPERS.m + sources/MODULE2.m + sources/MODULE2_OUTPUT2.m + sources/MODULE2_OUTPUT.m + sources/MODULE3_HELPER.m + sources/MODULE3_HELPERS.m + sources/MODULE3.m + sources/MODULE3PRE_HELPERS.m + sources/MODULE3_SINGLE.m + sources/modU.m + sources/new_method_imputation4.m + sources/new_method_imputation.m + sources/NEW_PIT.m + sources/pictures.m + sources/rand_gen.m + sources/run_module3.m + sources/sQuantile.m + sources/stimaposdef.m + sources/testfilterings2.m + sources/trova_closest.m +) +add_matlab_executable(wp5fpf "${WP5FPF_SOURCES}") - add_custom_target(mcla ALL COMMENT "building MCLA matlab binaries to ${EXECUTABLE_OUTPUT_PATH}" - DEPENDS ${exec_name1} ${exec_name2} ${exec_name3} ${exec_name4} ${exec_name5} ${exec_name6} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name1} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name2} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name3} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name4} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name5} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name6} ${EXECUTABLE_OUTPUT_PATH} + DEPENDS wp5fea_m1 wp5fea_m2 wp5fea_m2_reduce wp5fea_m3_sampling wp5mcla wp5fpf + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5fea_m1 ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5fea_m2 ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5fea_m2_reduce ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5fea_m3_sampling ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5mcla ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp5fpf ${EXECUTABLE_OUTPUT_PATH} ) - diff --git a/mcla/compile_matlab_fea.sh b/mcla/compile_matlab_fea.sh deleted file mode 100644 index 6f68f015..00000000 --- a/mcla/compile_matlab_fea.sh +++ /dev/null @@ -1,334 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, Quinary -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp5 matlab fea V1.8 -############################### - -#export MATLABHOME=/adisk03/MATLAB/MATLAB_Production_Server/R2013a/bin -#export MATLABHOME=/home/matlab/R2014a/bin - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - - -exename=wp5fea_m1 -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -nosplash \ - -v \ -FEA_MODULE1_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a MCLA_HELPER.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - -exename=wp5fea_m2 -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ -FEA_MODULE2_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a MCLA_HELPER.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - - - - -exename=wp5fea_m2_reduce -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ -FEA_MODULE2_REDUCE_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a MCLA_HELPER.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - - - -exename=wp5fea_m3_sampling -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ -SAMPLING_MODULE3_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a MCLA_HELPER.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - -cd $cwd diff --git a/mcla/compile_matlab_mcla.sh b/mcla/compile_matlab_mcla.sh deleted file mode 100644 index 9a9130ae..00000000 --- a/mcla/compile_matlab_mcla.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, Quinary -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################################# -#compile wp5 matlab mcla V1.8 -############################################# - -#export MATLABHOME=/adisk03/MATLAB/MATLAB_Production_Server/R2013a/bin -#export MATLABHOME=/home/matlab/R2014a/bin - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -cd sources - -exename=wp5mcla -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -nosplash \ - -v \ - MCLA_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - - -exename=wp5fpf -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -nosplash \ - -v \ - FPF_HELPER.m \ --a analysis.m \ --a bisection.m \ --a carica_DB.m \ --a check_distrizuione.m \ --a chi_pval.m \ --a closest_corr.m \ --a conditional_samps.m \ --a copulaName.m \ --a copulachoose.m \ --a datacorrige2.m \ --a estract_cdf.m \ --a funzioneB.m \ --a funzione.m \ --a gausmix3.m \ --a gaussian_conditional.m \ --a gaussian_mixture.m \ --a h_gumbel.m \ --a h_inv_ex.m \ --a h_inv.m \ --a h.m \ --a h_pit.m \ --a inversion_with_verify2.m \ --a invfunzioneB.m \ --a licols.m \ --a main.m \ --a main_MCLA2PC3.m \ --a map_ecdf.m \ --a mod_data.m \ --a modelSummary.m \ --a modR.m \ --a MODULE0.m \ --a MODULE1_HELPER.m \ --a MODULE1_HELPERS.m \ --a MODULE1.m \ --a MODULE2_HELPER.m \ --a MODULE2_HELPERS.m \ --a MODULE2.m \ --a MODULE2_OUTPUT2.m \ --a MODULE2_OUTPUT.m \ --a MODULE3_HELPER.m \ --a MODULE3_HELPERS.m \ --a MODULE3.m \ --a MODULE3PRE_HELPERS.m \ --a MODULE3_SINGLE.m \ --a modU.m \ --a new_method_imputation4.m \ --a new_method_imputation.m \ --a NEW_PIT.m \ --a pictures.m \ --a rand_gen.m \ --a run_module3.m \ --a sQuantile.m \ --a stimaposdef.m \ --a testfilterings2.m \ --a trova_closest.m - -cd $cwd diff --git a/mpi-communication/CMakeLists.txt b/mpi-communication/CMakeLists.txt index e6cf416c..c3150ebb 100644 --- a/mpi-communication/CMakeLists.txt +++ b/mpi-communication/CMakeLists.txt @@ -8,53 +8,42 @@ cmake_minimum_required(VERSION 2.6) project(mpi) +find_package(MPI REQUIRED) set(CMAKE_CXX_COMPILER mpicxx) -if (DEFINED PROTOBUF_HOME) - message("PROTOBUF_HOME=${PROTOBUF_HOME}") -else() - message(FATAL_ERROR "PROTOBUF_HOME is NOT defined") -endif() -if (DEFINED BOOST_HOME) - message("BOOST_HOME=${BOOST_HOME}") -else() - message(FATAL_ERROR "BOOST_HOME is NOT defined") -endif() -if (DEFINED LOG4CPP_HOME) - message("LOG4CPP_HOME=${LOG4CPP_HOME}") -else() - message(FATAL_ERROR "LOG4CPP_HOME is NOT defined") -endif() -if (DEFINED LIBARCHIVE_HOME) - message("LIBARCHIVE_HOME=${LIBARCHIVE_HOME}") -else() - message(FATAL_ERROR "LIBARCHIVE_HOME is NOT defined") -endif() -if (DEFINED ENV{JAVA_HOME}) - message("JAVA_HOME=$ENV{JAVA_HOME}") -else() - message(FATAL_ERROR "JAVA_HOME is NOT defined") -endif() - -ADD_LIBRARY(boost_filesystem STATIC IMPORTED) -ADD_LIBRARY(boost_system STATIC IMPORTED) -ADD_LIBRARY(boost_iostreams STATIC IMPORTED) -ADD_LIBRARY(boost_program_options STATIC IMPORTED) -ADD_LIBRARY(log4cpp STATIC IMPORTED) -ADD_LIBRARY(protobuf STATIC IMPORTED) -ADD_LIBRARY(archive STATIC IMPORTED) -SET_TARGET_PROPERTIES(boost_filesystem PROPERTIES IMPORTED_LOCATION ${BOOST_HOME}/lib/libboost_filesystem.a) -SET_TARGET_PROPERTIES(boost_system PROPERTIES IMPORTED_LOCATION ${BOOST_HOME}/lib/libboost_system.a) -SET_TARGET_PROPERTIES(boost_iostreams PROPERTIES IMPORTED_LOCATION ${BOOST_HOME}/lib/libboost_iostreams.a) -SET_TARGET_PROPERTIES(boost_program_options PROPERTIES IMPORTED_LOCATION ${BOOST_HOME}/lib/libboost_program_options.a) -SET_TARGET_PROPERTIES(log4cpp PROPERTIES IMPORTED_LOCATION ${LOG4CPP_HOME}/lib/liblog4cpp.a) -SET_TARGET_PROPERTIES(protobuf PROPERTIES IMPORTED_LOCATION ${PROTOBUF_HOME}/lib/libprotobuf.a) -SET_TARGET_PROPERTIES(archive PROPERTIES IMPORTED_LOCATION ${LIBARCHIVE_HOME}/lib/libarchive.a) - -include_directories($ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux ${BOOST_HOME}/include ${PROTOBUF_HOME}/include ${LOG4CPP_HOME}/include ${LIBARCHIVE_HOME}/include) -link_directories(${PROTOBUF_HOME}/lib) -add_library(common src/mpiutil.cpp src/ioutil.cpp src/mpitags.cpp) -add_library(master SHARED src/master.cpp src/jniutil.cpp) -add_executable(slave src/slave.cpp src/messages.pb.cc) -target_link_libraries(master common boost_filesystem boost_system boost_iostreams log4cpp archive) -target_link_libraries(slave common boost_program_options boost_filesystem boost_system boost_iostreams log4cpp archive protobuf z bz2) +find_package(Boost REQUIRED COMPONENTS filesystem system program_options iostreams) +find_package(JNI REQUIRED) +find_package(Log4cpp REQUIRED) +find_package(LibArchive REQUIRED) +find_package(Protobuf REQUIRED) +find_package(ZLIB REQUIRED) + +# common library +set(COMMON_SOURCES + src/ioutil.cpp + src/mpitags.cpp + src/mpiutil.cpp +) +add_library(common ${COMMON_SOURCES}) + +# master library +set(MASTER_SOURCES + src/jniutil.cpp + src/master.cpp +) +add_library(master SHARED ${MASTER_SOURCES}) +target_link_libraries(master ${Boost_SYSTEM_LIBRARY}) + +# slave binary +set(SLAVE_SOURCES + src/messages.pb.cc + src/slave.cpp +) +add_executable(slave ${SLAVE_SOURCES}) +target_link_libraries(slave common ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${Log4cpp_LIBRARIES} ${Protobuf_LIBRARIES} ${ZLIB_LIBRARIES}) + +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${JNI_INCLUDE_DIRS}) +include_directories(${LibArchive_INCLUDE_DIRS}) +include_directories(${Log4cpp_INCLUDE_DIRS}) +include_directories(${Protobuf_INCLUDE_DIRS}) diff --git a/pom.xml b/pom.xml index 435622c3..94360906 100644 --- a/pom.xml +++ b/pom.xml @@ -174,6 +174,7 @@ true cim1* true + true diff --git a/sampling/CMakeLists.txt b/sampling/CMakeLists.txt index 8bd0502c..05251fe8 100644 --- a/sampling/CMakeLists.txt +++ b/sampling/CMakeLists.txt @@ -3,158 +3,76 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cmake_minimum_required (VERSION 2.6) +find_package(Matlab REQUIRED) -set(exec_name1 wp41c_v67_m1) -set(exec_name2 wp41c_v67_m2) -set(exec_name3 wp41c_v67_m3pre) -set(exec_name4 wp41c_v67_m3) -set(exec_name5 wp41c_v67_aggregator) +set(MATLAB_INCLUDE_DIRECTORIES + stats +) + +set(MATLAB_RUNTIME_OPTIONS + -nojvm + -nodisplay + -singleCompThread + -nosplash +) -set(matlabhome $ENV{MATLABHOME}) -set(sdir ${CMAKE_CURRENT_SOURCE_DIR}/sources) -set(builddir ${CMAKE_CURRENT_BINARY_DIR}) +set(MATLAB_WARNING_OPTIONS + enable:specified_file_mismatch + enable:repeated_file + enable:switch_ignored + enable:missing_lib_sentinel + enable:demo_license +) -add_custom_command( - COMMENT "Compiling ${exec_name1}" - OUTPUT ${exec_name1} - DEPENDS ${sdir}/MODULE1_HELPERS.m ${sdir}/MODULE1_HELPER.m ${sdir}/MODULE1.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name1} - -W main:${exec_name1} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/MODULE1_HELPERS.m - -a ${sdir}/MODULE1_HELPER.m - -a ${sdir}/MODULE1.m +set(WP41C_V67_M1_SOURCES + sources/MODULE1_HELPERS.m + sources/MODULE1_HELPER.m + sources/MODULE1.m ) +add_matlab_executable(wp41c_v67_m1 "${WP41C_V67_M1_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name2}" - OUTPUT ${exec_name2} - DEPENDS ${sdir}/MODULE2_HELPERS.m ${sdir}/MODULE2_HELPER.m ${sdir}/MODULE2.m ${sdir}/h.m ${sdir}/NEW_PIT.m ${sdir}/copulachoose.m ${sdir}/map_ecdf.m ${sdir}/copulaName.m ${sdir}/modU.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name2} - -W main:${exec_name2} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/MODULE2_HELPERS.m - -a ${sdir}/MODULE2_HELPER.m - -a ${sdir}/MODULE2.m - -a ${sdir}/h.m - -a ${sdir}/NEW_PIT.m - -a ${sdir}/copulachoose.m - -a ${sdir}/map_ecdf.m - -a ${sdir}/copulaName.m - -a ${sdir}/modU.m +set(WP41C_V67_M2_SOURCES + sources/MODULE2_HELPERS.m + sources/MODULE2_HELPER.m + sources/MODULE2.m + sources/h.m + sources/NEW_PIT.m + sources/copulachoose.m + sources/map_ecdf.m + sources/copulaName.m + sources/modU.m ) +add_matlab_executable(wp41c_v67_m2 "${WP41C_V67_M2_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name3}" - OUTPUT ${exec_name3} - DEPENDS ${sdir}/MODULE3PRE_HELPERS.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name3} - -W main:${exec_name3} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/MODULE3PRE_HELPERS.m +set(WP41C_V67_M3PRE_SOURCES + sources/MODULE3PRE_HELPERS.m ) +add_matlab_executable(wp41c_v67_m3pre "${WP41C_V67_M3PRE_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name4}" - OUTPUT ${exec_name4} - DEPENDS ${sdir}/MODULE3_HELPERS.m ${sdir}/MODULE3_HELPER.m ${sdir}/MODULE3.m ${sdir}/h_inv_ex.m ${sdir}/modU.m ${sdir}/sQuantile.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name4} - -W main:${exec_name4} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/MODULE3_HELPERS.m - -a ${sdir}/MODULE3_HELPER.m - -a ${sdir}/MODULE3.m - -a ${sdir}/h_inv_ex.m - -a ${sdir}/modU.m - -a ${sdir}/sQuantile.m +set(WP41C_V67_M3_SOURCES + sources/MODULE3_HELPERS.m + sources/MODULE3_HELPER.m + sources/MODULE3.m + sources/h_inv_ex.m + sources/modU.m + sources/sQuantile.m ) +add_matlab_executable(wp41c_v67_m3 "${WP41C_V67_M3_SOURCES}") -add_custom_command( - COMMENT "Compiling ${exec_name5}" - OUTPUT ${exec_name5} - DEPENDS ${sdir}/AGGREGATORS.m ${sdir}/AGGREGATOR.m ${sdir}/insert_ind.m - COMMAND ${matlabhome}/bin/mcc - ARGS -o ${exec_name5} - -W main:${exec_name5} - -T link:exe - -d "${builddir}" - -N - -p stats - -w enable:specified_file_mismatch - -w enable:repeated_file - -w enable:switch_ignored - -w enable:missing_lib_sentinel - -w enable:demo_license - -R -nojvm - -R -nodisplay - -R -singleCompThread - -R -nosplash - -v ${sdir}/AGGREGATORS.m - -a ${sdir}/AGGREGATOR.m - -a ${sdir}/insert_ind.m +set(WP41C_V67_AGGREGATOR_SOURCES + sources/AGGREGATORS.m + sources/AGGREGATOR.m + sources/insert_ind.m ) +add_matlab_executable(wp41c_v67_aggregator "${WP41C_V67_AGGREGATOR_SOURCES}") - add_custom_target(sampling ALL COMMENT "building sampling matlab binaries to ${EXECUTABLE_OUTPUT_PATH}" - DEPENDS ${exec_name1} ${exec_name2} ${exec_name3} ${exec_name4} ${exec_name5} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name1} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name2} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name3} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name4} ${EXECUTABLE_OUTPUT_PATH} - COMMAND ${CMAKE_COMMAND} -E copy ${builddir}/${exec_name5} ${EXECUTABLE_OUTPUT_PATH} + DEPENDS wp41c_v67_m1 wp41c_v67_m2 wp41c_v67_m3pre wp41c_v67_m3 wp41c_v67_aggregator + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp41c_v67_m1 ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp41c_v67_m2 ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp41c_v67_m3pre ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp41c_v67_m3 ${EXECUTABLE_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/wp41c_v67_aggregator ${EXECUTABLE_OUTPUT_PATH} ) diff --git a/sampling/compile_matlab.sh b/sampling/compile_matlab.sh deleted file mode 100644 index d6610aa3..00000000 --- a/sampling/compile_matlab.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016, Quinary -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -############################### -#compile wp41 V6.7 matlab modules -############################### - -if [ -z "$MATLABHOME" ]; then - echo "Need to set enviroment variable MATLABHOME" - exit 1 -fi - -export PATH=$MATLABHOME/bin:$PATH - -cwd=$(pwd) -targetfolder="$cwd/bin" -mkdir "$targetfolder" - -#module1 -exename=wp41c_v67_m1 -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - sources/MODULE1_HELPERS.m \ - -a sources/MODULE1_HELPER.m \ - -a sources/module1.m - - -#module2 -exename=wp41c_v67_m2 -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - sources/MODULE2_HELPERS.m \ - -a sources/MODULE2_HELPER.m \ - -a sources/module2.m \ - -a sources/h.m \ - -a sources/NEW_PIT.m \ - -a sources/copulachoose.m \ - -a sources/map_ecdf.m \ - -a sources/copulaName.m \ - -a sources/modU.m - - -#module3pre -exename=wp41c_v67_m3pre -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - sources/MODULE3PRE_HELPERS.m - - -#module3 -exename=wp41c_v67_m3 -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - sources/MODULE3_HELPERS.m \ - -a sources/MODULE3_HELPER.m \ - -a sources/module3.m \ - -a sources/h_inv_ex.m \ - -a sources/modU.m \ - -a sources/sQuantile.m - - -#module3 aggregator -exename=wp41c_v67_aggregator -mcc -o $exename \ - -W main:$exename \ - -T link:exe \ - -d "$targetfolder" \ - -N \ - -p stats \ - -w enable:specified_file_mismatch \ - -w enable:repeated_file \ - -w enable:switch_ignored \ - -w enable:missing_lib_sentinel \ - -w enable:demo_license \ - -R -nojvm \ - -R -nodisplay \ - -R -singleCompThread \ - -R -nosplash \ - -v \ - sources/AGGREGATORS.m \ - -a sources/AGGREGATOR.m \ - -a sources/insert_ind.m diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 54f84eaa..105c222c 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -17,134 +17,141 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) set(CMAKE_VERBOSE_MAKEFILE off) -set(download true) +if (NOT download) + if (NOT DEFINED packs) + set(packs "$ENV{HOME}/itesla_packs") + endif() + + if (NOT IS_DIRECTORY "${packs}") + message(WARNING "${packs} does not exist or is not a directory. External dependencies will be downloaded.") + set(download true) + endif() +endif() -if (DEFINED thirdparty_prefix) - message("thirdparty_prefix=${thirdparty_prefix}") -else() - message(FATAL_ERROR "thirdparty_prefix is NOT defined") +if (NOT DEFINED prefix) + message(FATAL_ERROR "The 'prefix' option is required.") endif() -set(CMAKE_BINARY_DIR ${thirdparty_prefix}/build) +set(CMAKE_BINARY_DIR ${prefix}/build) set(boost_md5 25f9a8ac28beeb5ab84aa98510305299) if (download) - set(protobuf_url https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2) - set(libarchive_url http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz) - set(boost_url http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download) - set(log4cpp_url http://sourceforge.net/projects/log4cpp/files/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.1.tar.gz) - set(szip_url http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz) - set(zlib_url http://www.hdfgroup.org/ftp/lib-external/zlib/zlib-1.2.5.tar.gz) - set(hdf5_url http://www.hdfgroup.org/ftp/HDF5//releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz) - set(matio_url http://downloads.sourceforge.net/project/matio/matio/1.5.2/matio-1.5.2.tar.gz) -# set(openmpi_url http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.3.tar.bz2) + set(protobuf_url https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2) + set(libarchive_url http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz) + set(boost_url http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download) + set(log4cpp_url http://sourceforge.net/projects/log4cpp/files/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.1.tar.gz) + set(szip_url http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz) + set(zlib_url http://www.hdfgroup.org/ftp/lib-external/zlib/zlib-1.2.5.tar.gz) + set(hdf5_url http://www.hdfgroup.org/ftp/HDF5//releases/hdf5-1.8.13/src/hdf5-1.8.13.tar.gz) + set(matio_url http://downloads.sourceforge.net/project/matio/matio/1.5.2/matio-1.5.2.tar.gz) +# set(openmpi_url http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.3.tar.bz2) else() - set(protobuf_url $ENV{HOME}/pack/protobuf-2.5.0.tar.bz2) - set(libarchive_url $ENV{HOME}/pack/libarchive-3.1.2.tar.gz) - set(boost_url $ENV{HOME}/pack/boost_1_57_0.tar.gz) - set(log4cpp_url $ENV{HOME}/pack/log4cpp-1.1.1.tar.gz) - set(szip_url $ENV{HOME}/pack/szip-2.1.tar.gz) - set(zlib_url $ENV{HOME}/pack/zlib-1.2.5.tar.gz) - set(hdf5_url $ENV{HOME}/pack/hdf5-1.8.13.tar.gz) - set(matio_url $ENV{HOME}/pack/matio-1.5.2.tar.gz) -# set(openmpi_url $ENV{HOME}/pack/openmpi-1.8.3.tar.bz2) + set(protobuf_url ${packs}/protobuf-2.5.0.tar.bz2) + set(libarchive_url ${packs}/libarchive-3.1.2.tar.gz) + set(boost_url ${packs}/boost_1_57_0.tar.gz) + set(log4cpp_url ${packs}/log4cpp-1.1.1.tar.gz) + set(szip_url ${packs}/szip-2.1.tar.gz) + set(zlib_url ${packs}/zlib-1.2.5.tar.gz) + set(hdf5_url ${packs}/hdf5-1.8.13.tar.gz) + set(matio_url ${packs}/matio-1.5.2.tar.gz) +# set(openmpi_url ${packs}/openmpi-1.8.3.tar.bz2) endif() # protobuf ExternalProject_Add(protobuf_project - INSTALL_DIR ${thirdparty_prefix}/protobuf - URL ${protobuf_url} - CONFIGURE_COMMAND /configure --prefix= CXXFLAGS=-fPIC LDFLAGS=-fPIC - BUILD_COMMAND make - INSTALL_COMMAND make install + INSTALL_DIR ${prefix}/protobuf + URL ${protobuf_url} + CONFIGURE_COMMAND /configure --prefix= CXXFLAGS=-fPIC LDFLAGS=-fPIC + BUILD_COMMAND make + INSTALL_COMMAND make install ) ExternalProject_Get_Property(protobuf_project install_dir) set(protobuf_install_dir ${install_dir}) # libarchive ExternalProject_Add(libarchive_project - INSTALL_DIR ${thirdparty_prefix}/libarchive - URL ${libarchive_url} - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_C_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC + INSTALL_DIR ${prefix}/libarchive + URL ${libarchive_url} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_C_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC ) ExternalProject_Get_Property(libarchive_project install_dir) set(libarchive_install_dir ${install_dir}) # boost ExternalProject_Add(boost_project - INSTALL_DIR ${thirdparty_prefix}/boost - URL ${boost_url} - URL_MD5 ${boost_md5} - UPDATE_COMMAND "" - CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,filesystem,iostreams,program_options - BUILD_COMMAND ./b2 cxxflags=-fPIC install --prefix= - BUILD_IN_SOURCE 1 - INSTALL_COMMAND "" + INSTALL_DIR ${prefix}/boost + URL ${boost_url} + URL_MD5 ${boost_md5} + UPDATE_COMMAND "" + CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,filesystem,iostreams,program_options + BUILD_COMMAND ./b2 cxxflags=-fPIC install --prefix= + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "" ) ExternalProject_Get_Property(boost_project install_dir) set(boost_install_dir ${install_dir}) # log4cpp ExternalProject_Add(log4cpp_project - INSTALL_DIR ${thirdparty_prefix}/log4cpp - URL ${log4cpp_url} - CONFIGURE_COMMAND /configure --prefix= CXXFLAGS=-fPIC LDFLAGS=-fPIC - BUILD_COMMAND make - INSTALL_COMMAND make install + INSTALL_DIR ${prefix}/log4cpp + URL ${log4cpp_url} + CONFIGURE_COMMAND /configure --prefix= CXXFLAGS=-fPIC LDFLAGS=-fPIC + BUILD_COMMAND make + INSTALL_COMMAND make install ) ExternalProject_Get_Property(log4cpp_project install_dir) set(log4cpp_install_dir ${install_dir}) # szip ExternalProject_Add(szip_project - INSTALL_DIR ${thirdparty_prefix}/szip - URL ${szip_url} - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC + INSTALL_DIR ${prefix}/szip + URL ${szip_url} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC ) ExternalProject_Get_Property(szip_project install_dir) set(szip_install_dir ${install_dir}) # zlib ExternalProject_Add(zlib_project - INSTALL_DIR ${thirdparty_prefix}/zlib - URL ${zlib_url} - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_C_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC + INSTALL_DIR ${prefix}/zlib + URL ${zlib_url} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_C_FLAGS=-fPIC -DCMAKE_LDFLAGS=-fPIC ) ExternalProject_Get_Property(zlib_project install_dir) set(zlib_install_dir ${install_dir}) # HDF5 ExternalProject_Add(hdf5_project - DEPENDS szip_project zlib_project - INSTALL_DIR ${thirdparty_prefix}/hdf5 - URL ${hdf5_url} - CONFIGURE_COMMAND /configure --prefix= --with-zlib=${zlib_install_dir} --with-szlib=${szip_install_dir} CXXFLAGS=-fPIC LDFLAGS=-fPIC - BUILD_COMMAND make - INSTALL_COMMAND make install + DEPENDS szip_project zlib_project + INSTALL_DIR ${prefix}/hdf5 + URL ${hdf5_url} + CONFIGURE_COMMAND /configure --prefix= --with-zlib=${zlib_install_dir} --with-szlib=${szip_install_dir} CXXFLAGS=-fPIC LDFLAGS=-fPIC + BUILD_COMMAND make + INSTALL_COMMAND make install ) ExternalProject_Get_Property(hdf5_project install_dir) set(hdf5_install_dir ${install_dir}) # matio ExternalProject_Add(matio_project - DEPENDS hdf5_project - INSTALL_DIR ${thirdparty_prefix}/matio - URL ${matio_url} - CONFIGURE_COMMAND /configure --prefix= --with-zlib=${zlib_install_dir} --with-hdf5=${hdf5_install_dir} CXXFLAGS=-fPIC LDFLAGS=-fPIC - BUILD_COMMAND make - INSTALL_COMMAND make install + DEPENDS hdf5_project + INSTALL_DIR ${prefix}/matio + URL ${matio_url} + CONFIGURE_COMMAND /configure --prefix= --with-zlib=${zlib_install_dir} --with-hdf5=${hdf5_install_dir} CXXFLAGS=-fPIC LDFLAGS=-fPIC + BUILD_COMMAND make + INSTALL_COMMAND make install ) ExternalProject_Get_Property(matio_project install_dir) set(matio_install_dir ${install_dir}) -# openmpi: is assumbed to be already installed on target OS +# openmpi: is assumed to be already installed on target OS #ExternalProject_Add(openmpi_project -# INSTALL_DIR ${thirdparty_prefix}/openmpi -# URL ${openmpi_url} -# CONFIGURE_COMMAND /configure --prefix= --enable-mpi-thread-multiple -# BUILD_COMMAND make -# INSTALL_COMMAND make install +# INSTALL_DIR ${prefix}/openmpi +# URL ${openmpi_url} +# CONFIGURE_COMMAND /configure --prefix= --enable-mpi-thread-multiple +# BUILD_COMMAND make +# INSTALL_COMMAND make install #) #ExternalProject_Get_Property(openmpi_project install_dir) #set(openmpi_install_dir ${install_dir}) diff --git a/wp43adapter/CMakeLists.txt b/wp43adapter/CMakeLists.txt index 4e3af450..fe3cca9a 100644 --- a/wp43adapter/CMakeLists.txt +++ b/wp43adapter/CMakeLists.txt @@ -4,90 +4,32 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -cmake_minimum_required(VERSION 2.6) - -if (DEFINED LOG4CPP_HOME) - message("LOG4CPP_HOME=${LOG4CPP_HOME}") -else() - message(FATAL_ERROR "LOG4CPP_HOME is NOT defined") -endif() -if (DEFINED BOOST_HOME) - message("BOOST_HOME=${BOOST_HOME}") -else() - message(FATAL_ERROR "BOOST_HOME is NOT defined") -endif() -if (DEFINED ENV{INTEL_HOME}) - message("INTEL_HOME=$ENV{INTEL_HOME}") -else() - message(FATAL_ERROR "INTEL_HOME is NOT defined") -endif() -if (DEFINED ENV{EUROSTAG_SRC_HOME}) - message("EUROSTAG_SRC_HOME=$ENV{EUROSTAG_SRC_HOME}") -else() - message(FATAL_ERROR "EUROSTAG_SRC_HOME is NOT defined") -endif() -if (DEFINED HDF5_HOME) - message("HDF5_HOME=${HDF5_HOME}") -else() - message(FATAL_ERROR "HDF5_HOME is NOT defined") -endif() -if (DEFINED MATIO_HOME) - message("MATIO_HOME=${MATIO_HOME}") -else() - message(FATAL_ERROR "MATIO_HOME is NOT defined") -endif() - -file(GLOB_RECURSE source_files src/*) - -ADD_LIBRARY(eustag_cpt STATIC IMPORTED) -ADD_LIBRARY(eustag_esg STATIC IMPORTED) -ADD_LIBRARY(eustag_a STATIC IMPORTED) -ADD_LIBRARY(light_lib_a_t STATIC IMPORTED) -ADD_LIBRARY(eustag_i STATIC IMPORTED) -ADD_LIBRARY(eustag_s STATIC IMPORTED) -ADD_LIBRARY(light_lib_s STATIC IMPORTED) -ADD_LIBRARY(eustag_lf STATIC IMPORTED) -ADD_LIBRARY(light_lib_t_s STATIC IMPORTED) -ADD_LIBRARY(light_lib_t STATIC IMPORTED) -ADD_LIBRARY(eustag_bld STATIC IMPORTED) -ADD_LIBRARY(util STATIC IMPORTED) -ADD_LIBRARY(klu STATIC IMPORTED) -ADD_LIBRARY(amd STATIC IMPORTED) -ADD_LIBRARY(log4cpp STATIC IMPORTED) -ADD_LIBRARY(hdf5 STATIC IMPORTED) -ADD_LIBRARY(hdf5_z STATIC IMPORTED) -ADD_LIBRARY(hdf5_sz STATIC IMPORTED) -ADD_LIBRARY(matio STATIC IMPORTED) -SET_TARGET_PROPERTIES(eustag_cpt PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/bin/libeustag_cpt.a) -SET_TARGET_PROPERTIES(eustag_esg PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/bin/libeustag_esg.a) -SET_TARGET_PROPERTIES(eustag_a PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaga/bin/libeustag_a.a) -SET_TARGET_PROPERTIES(light_lib_a_t PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaga/bin/liblight_lib_a_t.a) -SET_TARGET_PROPERTIES(eustag_i PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagi/bin/libeustag_i.a) -SET_TARGET_PROPERTIES(eustag_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustags/bin/libeustag_s.a) -SET_TARGET_PROPERTIES(light_lib_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustags/bin/liblight_lib_s.a) -SET_TARGET_PROPERTIES(eustag_lf PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustaglf/bin/libeustag_lf.a) -SET_TARGET_PROPERTIES(light_lib_t_s PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagt/bin/liblight_lib_t_s.a) -SET_TARGET_PROPERTIES(light_lib_t PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagt/bin/liblight_lib_t.a) -SET_TARGET_PROPERTIES(eustag_bld PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/eustagbld/bin/libeustag_bld.a) -SET_TARGET_PROPERTIES(util PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/util/bin/libutil.a) -SET_TARGET_PROPERTIES(klu PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/klu/bin/libklu.a) -SET_TARGET_PROPERTIES(amd PROPERTIES IMPORTED_LOCATION $ENV{EUROSTAG_SRC_HOME}/src/amd/bin/libamd.a) -SET_TARGET_PROPERTIES(log4cpp PROPERTIES IMPORTED_LOCATION ${LOG4CPP_HOME}/lib/liblog4cpp.a) -SET_TARGET_PROPERTIES(hdf5 PROPERTIES IMPORTED_LOCATION ${HDF5_HOME}/lib/libhdf5.a) -SET_TARGET_PROPERTIES(hdf5_z PROPERTIES IMPORTED_LOCATION ${ZLIB_HOME}/lib/libz.a) -SET_TARGET_PROPERTIES(hdf5_sz PROPERTIES IMPORTED_LOCATION ${SZIP_HOME}/lib/libszip.a) -SET_TARGET_PROPERTIES(matio PROPERTIES IMPORTED_LOCATION ${MATIO_HOME}/lib/libmatio.a) +# Find external packages +find_package(Boost REQUIRED) +find_package(Eurostag REQUIRED) +find_package(HDF5) +find_package(IntelFortran REQUIRED COMPONENTS ifcore ifport imf intlc) +find_package(Log4cpp REQUIRED) +find_package(Matio REQUIRED) +find_package(Threads) +find_package(ZLIB REQUIRED) + +# wp43adapter +set(WP43ADAPTER_SOURCES + src/Chameleon.cpp + src/ConfigFile.cpp + src/wp43adapter.cpp +) +add_executable(wp43adapter ${WP43ADAPTER_SOURCES}) +target_link_libraries(wp43adapter ${Eurostag_LIBRARIES} ${IntelFortran_LIBRARIES} ${Log4cpp_LIBRARIES} ${Matio_LIBRARIES} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) -include_directories(${BOOST_HOME}/include $ENV{EUROSTAG_SRC_HOME}/src/eustagcpt/sources ${LOG4CPP_HOME}/include ${MATIO_HOME}/include) -link_directories($ENV{INTEL_HOME}/lib/intel64/) -add_executable(wp43adapter ${source_files}) -target_link_libraries(wp43adapter eustag_esg eustag_cpt eustag_a light_lib_a_t eustag_i eustag_s light_lib_s eustag_lf light_lib_t_s light_lib_t eustag_bld util klu amd ifcore ifport intlc imf irc svml log4cpp matio hdf5 hdf5_z hdf5_sz dl pthread) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${Eurostag_INCLUDE_DIRS}) +include_directories(${Log4cpp_INCLUDE_DIRS}) +include_directories(${Matio_INCLUDE_DIRS}) #add the wp43_eurostag.sh script to the output path add_custom_target(copy_scripts ALL - DEPENDS wp43adapter - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/src/wp43_eurostag.sh ${EXECUTABLE_OUTPUT_PATH} + DEPENDS wp43adapter + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/src/wp43_eurostag.sh ${EXECUTABLE_OUTPUT_PATH} ) - - - diff --git a/wp43adapter/readme.txt b/wp43adapter/readme.txt deleted file mode 100644 index 7809b400..00000000 --- a/wp43adapter/readme.txt +++ /dev/null @@ -1,11 +0,0 @@ -TB completed ..... - -required env variables: -EUROSTAG_SRC_HOME -INTEL_HOME - -SUPPORTLIBS_HOME - - log4cpp/src/.libs - hdf5-1.8.12-linux-x86_64-static/lib - matio-1.5.2/src/.libs