Commit d32b698a authored by Pawel Sznajder's avatar Pawel Sznajder
Browse files

Merge branch 'UpdatedDependencies' into 'master'

Updating code to more recent version of the the dependencies

See merge request !29
parents a6b70256 06a9278b
......@@ -2,3 +2,9 @@
/.settings/
/lib/
/PARTONS.doxyfile.bak
CMakeCache.txt
CMakeFiles/
Makefile
PARTONS_autogen/
cmake_install.cmake
install_manifest.txt
\ No newline at end of file
# BASIC DEFINITIONS ========================================================================
# define minimum version of cmake
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.2)
# define project name and its language
project(PARTONS CXX)
# define c++ standard and issue all the warning demanded by this standard
add_definitions(-std=c++98 -pedantic)
add_definitions(-std=c++11 -pedantic -Wno-vla-extension)
set(CMAKE_CXX_STANDARD 11)
if (NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 0)
endif()
# VERSION ==================================================================================
......@@ -34,11 +39,10 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# FIND LIBRARIES ===========================================================================
# find libraries: Qt4
find_package(Qt4 REQUIRED QtCore QtSql QtXmlPatterns)
# find libraries: Qt
find_package(Qt5 COMPONENTS Core Sql XmlPatterns REQUIRED)
# add some useful macros and variables
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
# find libraries: additional modules
......@@ -56,8 +60,11 @@ find_package(ElementaryUtils REQUIRED)
# find libraries: NumA++
find_package(NumA++ REQUIRED)
# find libraries: GSL
find_package(GSL REQUIRED)
# directories containing headers
include_directories(${QT_INCLUDE_DIRS} ${SFML_INCLUDE_DIR} ${CLN_INCLUDE_DIR} ${ELEMENTARY_UTILS_INCLUDE_DIR} ${NUMA_INCLUDE_DIR})
include_directories(${QT_INCLUDE_DIRS} ${SFML_INCLUDE_DIR} ${CLN_INCLUDE_DIR} ${ElementaryUtils_INCLUDE_DIR} ${NumA++_INCLUDE_DIR})
include_directories(include)
# FINALIZE ==================================================================================
......@@ -72,7 +79,6 @@ file(
src/*
)
# define target library
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
......@@ -92,19 +98,27 @@ target_link_libraries(
${QT_LIBRARIES}
${SFML_LIBRARIES}
${SFML_LIBRARIES}
${CLN_LIBRARIES}
${CLN_LIBRARIES}
${ELEMENTARY_UTILS_LIBRARIES}
${ElementaryUtils_LIBRARIES}
${NUMA_LIBRARIES}
${NumA++_LIBRARIES}
${GSL_LIBRARIES}
Qt5::Core
Qt5::Sql
Qt5::XmlPatterns
)
# install
install(TARGETS PARTONS
RUNTIME DESTINATION bin/PARTONS
LIBRARY DESTINATION lib/PARTONS
ARCHIVE DESTINATION lib/static/PARTONS)
install(DIRECTORY include/ DESTINATION include/PARTONS)
install(DIRECTORY data/ DESTINATION share/PARTONS/)
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
install(DIRECTORY include/ DESTINATION include)
install(DIRECTORY data DESTINATION share)
......@@ -36,10 +36,10 @@ set(CLN_FOUND)
set(CLN_INCLUDE_DIR)
set(CLN_LIBRARIES)
include(FindPkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_cln cln)
endif()
#include(FindPkgConfig)
#if (PKG_CONFIG_FOUND)
# pkg_check_modules(_cln cln)
#endif()
find_path(CLN_INCLUDE_DIR NAMES cln/cln.h
HINTS ${_cln_INCLUDE_DIRS}
......
......@@ -2,18 +2,18 @@
#
# Once done this will define
#
# ELEMENTARY_UTILS_FOUND - system has Elementary_Utils lib
# ELEMENTARY_UTILS_LIBRARIES - the path of the library
# ELEMENTARY_UTILS_INCLUDE_DIR - the include directory
# ElementaryUtils_FOUND - system has Elementary_Utils lib
# ElementaryUtils_LIBRARIES - the path of the library
# ElementaryUtils_INCLUDE_DIR - the include directory
if (ELEMENTARY_UTILS_INCLUDE_DIR AND ELEMENTARY_UTILS_LIBRARIES)
if (ElementaryUtils_INCLUDE_DIR AND ElementaryUtils_LIBRARIES)
# in cache already
set(ELEMENTARY_UTILS_FOUND TRUE)
set(ElementaryUtils_FOUND TRUE)
else (ELEMENTARY_UTILS_INCLUDE_DIR AND ELEMENTARY_UTILS_LIBRARIES)
else (ElementaryUtils_INCLUDE_DIR AND ElementaryUtils_LIBRARIES)
find_path(ELEMENTARY_UTILS_INCLUDE_DIR ElementaryUtils/PropertiesManager.h
find_path(ElementaryUtils_INCLUDE_DIR ElementaryUtils/PropertiesManager.h
PATHS
${CMAKE_INSTALL_PREFIX}
${CMAKE_SOURCE_DIR}/../ElementaryUtils
......@@ -24,7 +24,7 @@ else (ELEMENTARY_UTILS_INCLUDE_DIR AND ELEMENTARY_UTILS_LIBRARIES)
PATH_SUFFIXES include/PARTONS include
)
find_library(ELEMENTARY_UTILS_LIBRARIES
find_library(ElementaryUtils_LIBRARIES
NAMES ElementaryUtils
PATHS
${CMAKE_INSTALL_PREFIX}
......@@ -36,7 +36,7 @@ else (ELEMENTARY_UTILS_INCLUDE_DIR AND ELEMENTARY_UTILS_LIBRARIES)
PATH_SUFFIXES lib/PARTONS lib64/PARTONS bin/PARTONS lib lib64 bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ELEMENTARY_UTILS DEFAULT_MSG ELEMENTARY_UTILS_INCLUDE_DIR ELEMENTARY_UTILS_LIBRARIES)
find_package_handle_standard_args(ElementaryUtils DEFAULT_MSG ElementaryUtils_INCLUDE_DIR ElementaryUtils_LIBRARIES)
endif(ELEMENTARY_UTILS_INCLUDE_DIR AND ELEMENTARY_UTILS_LIBRARIES)
endif(ElementaryUtils_INCLUDE_DIR AND ElementaryUtils_LIBRARIES)
......@@ -2,18 +2,18 @@
#
# Once done this will define
#
# NUMA_FOUND - system has NumA++ lib
# NUMA_LIBRARIES - the path of the library
# NUMA_INCLUDE_DIR - the include directory
# NumA++_FOUND - system has NumA++ lib
# NumA++_LIBRARIES - the path of the library
# NumA++_INCLUDE_DIR - the include directory
if (NUMA_INCLUDE_DIR AND NUMA_LIBRARIES)
if (NumA++_INCLUDE_DIR AND NumA++_LIBRARIES)
# in cache already
set(NUMA_FOUND TRUE)
set(NumA++_FOUND TRUE)
else (NUMA_INCLUDE_DIR AND NUMA_LIBRARIES)
else (NumA++_INCLUDE_DIR AND NumA++_LIBRARIES)
find_path(NUMA_INCLUDE_DIR NAMES NumA/integration/Integrator.h NumA++/integration/Integrator.h
find_path(NumA++_INCLUDE_DIR NAMES NumA/integration/Integrator.h NumA++/integration/Integrator.h
PATHS
${CMAKE_INSTALL_PREFIX}
${CMAKE_SOURCE_DIR}/../numa
......@@ -26,7 +26,7 @@ else (NUMA_INCLUDE_DIR AND NUMA_LIBRARIES)
PATH_SUFFIXES include/PARTONS include
)
find_library(NUMA_LIBRARIES
find_library(NumA++_LIBRARIES
NAMES NumA NumA++
PATHS
${CMAKE_INSTALL_PREFIX}
......@@ -40,7 +40,7 @@ else (NUMA_INCLUDE_DIR AND NUMA_LIBRARIES)
PATH_SUFFIXES lib/PARTONS lib64/PARTONS bin/PARTONS lib lib64 bin)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NUMA DEFAULT_MSG NUMA_INCLUDE_DIR NUMA_LIBRARIES)
find_package_handle_standard_args(NumA++ DEFAULT_MSG NumA++_INCLUDE_DIR NumA++_LIBRARIES)
endif(NUMA_INCLUDE_DIR AND NUMA_LIBRARIES)
endif(NumA++_INCLUDE_DIR AND NumA++_LIBRARIES)
#ifndef BASE_OBJECT_FACTORY_H_
#ifndef BASE_OBJECT_FACTORY_H
#define BASE_OBJECT_FACTORY_H
/**
......
......@@ -78,7 +78,7 @@ private:
// key = computation datetime
// 1st value = computation instantiated object
// 2nd value = counter for know how many system objects refer to it. When counter == 0 mean that Computation object must be free.
std::map<time_t, std::pair<std::auto_ptr<Computation>, unsigned int> > computationList;
std::map<time_t, std::pair<std::unique_ptr<Computation>, unsigned int> > computationList;
};
} /* namespace PARTONS */
......
......@@ -106,7 +106,8 @@ Scenario* ResourceManager::registerScenario(const int indexId,
}
EnvironmentConfiguration* ResourceManager::getEnvironmentConfiguration(
const std::string& hashSum) const {
const std::string&) const {
return NULL;
}
} /* namespace PARTONS */
......@@ -36,9 +36,9 @@ ResultDaoService::ResultDaoService(const std::string &className) :
ElemUtils::StringUtils::EMPTY), m_computationDatabaseFile(
ElemUtils::StringUtils::EMPTY), m_previousComputationId(
std::make_pair<time_t, int>(0, -1)), m_previousScenarioId(
std::make_pair<std::string, int>(ElemUtils::StringUtils::EMPTY,
std::make_pair<std::string, int>(ElemUtils::StringUtils::EMPTY.c_str(),
-1)), m_previousEnvConfId(
std::make_pair<std::string, int>(ElemUtils::StringUtils::EMPTY,
std::make_pair<std::string, int>(ElemUtils::StringUtils::EMPTY.c_str(),
-1)) {
//check if to use tmp file system
......@@ -112,7 +112,7 @@ void ResultDaoService::prepareCommonTablesFromResultInfo(
*(Partons::getInstance()->getEnvironmentConfiguration()));
}
m_previousEnvConfId = std::make_pair<std::string, int>(envConfHashSum,
m_previousEnvConfId = std::make_pair(envConfHashSum.c_str(),
environmentConfigurationId);
}
......@@ -133,7 +133,7 @@ void ResultDaoService::prepareCommonTablesFromResultInfo(
scenarioHashSum)));
}
m_previousScenarioId = std::make_pair<std::string, int>(scenarioHashSum,
m_previousScenarioId = std::make_pair(scenarioHashSum.c_str(),
scenarioId);
}
......@@ -169,7 +169,7 @@ void ResultDaoService::prepareCommonTablesFromResultInfo(
}
m_previousComputationId = std::make_pair<time_t, int>(
m_previousComputationId = std::make_pair(
computationDateTime, computationId);
}
}
......
......@@ -292,28 +292,34 @@ double GPDHM18::evaluate(double x, NumA::FunctionType1D* p_fun0,
//calculate GPD for xi == 0
if (m_xi == 0)
{
if (p_fun0 == 0)
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter() << "Integrand not set.");
else
return integrate(p_fun0, -1 + x, 1 - x, parameters);
}
//calculate GPD for xi <> 0 and x > xi
if (x > fabs(m_xi))
{
if (p_fun == 0)
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter() << "Integrand not set.");
else
return integrate(p_fun, (x - m_xi) / (1 - m_xi),
(x + m_xi) / (1 + m_xi), parameters);
}
//calculate GPD for xi <> 0 and - xi < x < xi
if (x <= fabs(m_xi) && x >= -fabs(m_xi))
{
if (p_fun == 0)
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter() << "Integrand not set.");
else
return integrate(p_fun, 0., (x + m_xi) / (1 + m_xi), parameters);
}
return 0;
}
......
......@@ -83,6 +83,7 @@ DVCSProcessModule::DVCSProcessModule(const DVCSProcessModule& other) :
std::string DVCSProcessModule::toString() const {
ProcessModule<DVCSObservableKinematic, DVCSObservableResult>::toString();
return ProcessModule<DVCSObservableKinematic, DVCSObservableResult>::toString();
}
void DVCSProcessModule::resolveObjectDependencies() {
......
......@@ -81,6 +81,7 @@ TCSProcessModule::TCSProcessModule(const TCSProcessModule& other) :
std::string TCSProcessModule::toString() const {
ProcessModule<TCSObservableKinematic, TCSObservableResult>::toString();
return ProcessModule<TCSObservableKinematic, TCSObservableResult>::toString();
}
void TCSProcessModule::resolveObjectDependencies() {
......
......@@ -74,6 +74,8 @@ void Qt4XMLValidator::myMessageOutput(QtMsgType type, const char* msg) {
ElemUtils::LoggerManager::getInstance()->error("Qt4XMLValidator",
__func__, msg);
break;
default:
break;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment