Skip to content

Commit

Permalink
re #10549 merge master and resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDraper committed Nov 24, 2014
2 parents 6090332 + c8462bd commit e5aa71c
Show file tree
Hide file tree
Showing 141 changed files with 6,152 additions and 2,615 deletions.
4 changes: 3 additions & 1 deletion Code/Mantid/Build/CMake/CommonSetup.cmake
Expand Up @@ -47,14 +47,16 @@ add_definitions ( -DBOOST_ALL_DYN_LINK )
# Need this defined globally for our log time values
add_definitions ( -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG )

find_package ( Poco REQUIRED )
find_package ( Poco 1.4.2 REQUIRED )
include_directories( SYSTEM ${POCO_INCLUDE_DIRS} )

find_package ( Nexus 4.3.0 REQUIRED )
include_directories ( SYSTEM ${NEXUS_INCLUDE_DIR} )

find_package ( MuParser REQUIRED )

find_package ( JsonCPP REQUIRED )

find_package ( Doxygen ) # optional

# Need to change search path to find zlib include on Windows.
Expand Down
33 changes: 33 additions & 0 deletions Code/Mantid/Build/CMake/FindJsonCPP.cmake
@@ -0,0 +1,33 @@
# - Find jsoncpp include dirs and libraries
# Use this module by invoking find_package with the form:
# find_package(JsonCPP [required] [quiet] )
#
# The module sets the following variables
# JSONCPP_FOUND - True if headers and libraries were found
# JSONCPP_INCLUDE_DIR - jsoncpp include directories
# JSONCPP_LIBRARY - library files for linking (optimised version)
# JSONCPP_LIBRARY_DEBUG - library files for linking (debug version)
# JSONCPP_LIBRARIES - All required libraries, including the configuration type

# Headers
find_path ( JSONCPP_INCLUDE_DIR jsoncpp/json/json.h )

# Libraries
find_library ( JSONCPP_LIBRARY NAMES jsoncpp ) # optimized
find_library ( JSONCPP_LIBRARY_DEBUG NAMES jsoncpp_d ) # debug

if ( JSONCPP_LIBRARY AND JSONCPP_LIBRARY_DEBUG )
set ( JSONCPP_LIBRARIES optimized ${JSONCPP_LIBRARY} debug ${JSONCPP_LIBRARY_DEBUG} )
else()
set ( JSONCPP_LIBRARIES ${JSONCPP_LIBRARY} )
endif()

# Handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE if
# all listed variables are TRUE
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( JsonCPP DEFAULT_MSG JSONCPP_INCLUDE_DIR JSONCPP_LIBRARIES )

# Advanced variables
mark_as_advanced ( JSONCPP_INCLUDE_DIR JSONCPP_LIBRARIES )


36 changes: 34 additions & 2 deletions Code/Mantid/Build/CMake/FindPoco.cmake
Expand Up @@ -47,10 +47,42 @@ set ( POCO_LIBRARIES ${POCO_LIB_FOUNDATION}

endif()

# Set a version string by examining either the Poco/Version.h header or
# the Poco/Foundation.h header if Version.h does not exist
if( POCO_INCLUDE_DIR )
if ( EXISTS ${POCO_INCLUDE_DIR}/Poco/Version.h )
set ( VERSION_FILE ${POCO_INCLUDE_DIR}/Poco/Version.h )
else ()
set ( VERSION_FILE ${POCO_INCLUDE_DIR}/Poco/Foundation.h )
endif ()
# regex quantifiers like {8} don't seem to work so we'll stick with + even though
# it's not strictly true
set ( VERS_REGEX "^#define[ \t]+POCO_VERSION[ \t]+0x([0-9]+)$" )
file ( STRINGS ${VERSION_FILE} POCO_VERSION REGEX ${VERS_REGEX} )
# pull out just the part after the 0x
string( REGEX REPLACE ${VERS_REGEX} "\\1" POCO_VERSION ${POCO_VERSION} )
# Pretty format
string( SUBSTRING ${POCO_VERSION} 0 2 POCO_VERSION_MAJOR )
string( REGEX REPLACE "^0" "" POCO_VERSION_MAJOR ${POCO_VERSION_MAJOR} )
string( SUBSTRING ${POCO_VERSION} 2 2 POCO_VERSION_MINOR )
string( REGEX REPLACE "^0" "" POCO_VERSION_MINOR ${POCO_VERSION_MINOR} )
string( SUBSTRING ${POCO_VERSION} 4 2 POCO_VERSION_PATCH )
string( REGEX REPLACE "^0" "" POCO_VERSION_PATCH ${POCO_VERSION_PATCH} )

set ( POCO_VERSION "${POCO_VERSION_MAJOR}.${POCO_VERSION_MINOR}.${POCO_VERSION_PATCH}" )
endif()


# handle the QUIETLY and REQUIRED arguments and set POCO_FOUND to TRUE if
# all listed variables are TRUE
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Poco DEFAULT_MSG POCO_LIBRARIES POCO_INCLUDE_DIR )
if (POCO_VERSION)
find_package_handle_standard_args( Poco REQUIRED_VARS POCO_LIBRARIES POCO_INCLUDE_DIR
VERSION_VAR POCO_VERSION )
else ()
message (status "Failed to determine Poco version: Ignoring requirement")
find_package_handle_standard_args( Poco DEFAULT_MSG POCO_LIBRARIES POCO_INCLUDE_DIR )
endif ()

mark_as_advanced ( POCO_INCLUDE_DIR
POCO_LIB_FOUNDATION POCO_LIB_FOUNDATION_DEBUG
Expand All @@ -59,4 +91,4 @@ mark_as_advanced ( POCO_INCLUDE_DIR
POCO_LIB_NET POCO_LIB_NET_DEBUG
POCO_LIB_CRYPTO POCO_LIB_CRYPTO_DEBUG
POCO_LIB_NETSSL POCO_LIB_NETSSL_DEBUG
)
)
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/WindowsSetup.cmake
Expand Up @@ -82,7 +82,7 @@ set ( PYTHONW_EXECUTABLE "${CMAKE_LIBRARY_PATH}/Python27/pythonw.exe" CACHE FILE
###########################################################################
add_definitions ( -DWIN32 -D_WINDOWS -DMS_VISUAL_STUDIO )
add_definitions ( -D_USE_MATH_DEFINES -DNOMINMAX )
add_definitions ( -DGSL_DLL )
add_definitions ( -DGSL_DLL -DJSON_DLL )
add_definitions ( -DPOCO_NO_UNWINDOWS )
add_definitions ( -D_SCL_SECURE_NO_WARNINGS )
add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
Expand Down
@@ -1,5 +1,5 @@
Name: mantid-developer
Version: 1.4
Version: 1.5
Release: 1%{?dist}
Summary: Meta Package to install dependencies for Mantid Development

Expand All @@ -19,6 +19,7 @@ Requires: git-all
Requires: gsl-devel
Requires: hdf-devel
Requires: hdf5-devel
Requires: jsoncpp-devel
Requires: muParser-devel
Requires: mxml-devel
Requires: nexus >= 4.2
Expand Down
17 changes: 11 additions & 6 deletions Code/Mantid/Build/paraview-deb-packaging/README
@@ -1,14 +1,19 @@
--Author: Owen Arnold
--Date: 06/March/2012
--Date: 06/March/2012, updated 14/Nov/2014

Info:
The bash script in this directory is used to build and package ParaView to Debian packages for Ubuntu platforms.
At the time of writing custom deployment is necessary for these reasons:
At the time of writing custom deployment is necessary for two reasons:

1) Current versions of Ubuntu distribute much older versions of ParaView from their repositories
2) The distributed source version of ParaView 3.10.1 contains bugs which we have fixed in our modified source code. This script can be used with our patched source. Currently available at http://download.mantidproject.org/VatesDownload.psp
3) The default ParaView packaging puts libraries in subdirectories of lib and they therefore cannot be found by Mantid without manually modifying the LD_LIBRARY_PATH. This packaging script will fix that issue.
1) We distribute a slightly modified source version of ParaView 3.98.1. This script can be used with our patched source.
Currently available at http://download.mantidproject.org
2) The default ParaView packaging puts libraries in subdirectories of lib and they therefore cannot be found by Mantid
without manually modifying the LD_LIBRARY_PATH. This packaging script will fix that issue.

Usage:
In order to build the binary packages. Place the *.tar.gz paraview source compressed file from http://download.mantidproject.org/VatesDownload.psp into an empty directory. Copy the accompanying *.sh script associated with this README into the same directory. Run the bash script. The packaged .*Deb binaries will appear in the /paraview/install directory at the end of the process.

- In order to build the binary packages. Place the *.tar.gz paraview source compressed file from
http://download.mantidproject.org into an empty directory.

- Copy the accompanying *.sh script associated with this README into the same directory. Run the bash script.
The packaged .*Deb binaries will appear in the /paraview/install directory at the end of the process.
4 changes: 2 additions & 2 deletions Code/Mantid/Build/paraview-deb-packaging/build_and_package.sh
Expand Up @@ -9,9 +9,9 @@ PV_LOC=paraview

PV_PKG=ParaView

PV_VER=3.10.1
PV_VER=3.98.1

PV_NAME=${PV_PKG}-${PV_VER}-patched
PV_NAME=${PV_PKG}-${PV_VER}-source

PV_SRC=${PV_NAME}.tar.gz

Expand Down
17 changes: 7 additions & 10 deletions Code/Mantid/CMakeLists.txt
Expand Up @@ -186,12 +186,8 @@ if ( ENABLE_CPACK )

# rhel requirements
set ( CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.34.1,qt4 >= 4.2,nexus,nexus-python,gsl,glibc,qwtplot3d-qt4,muParser,numpy" )
# OpenCASCADE changed names when packaged for Fedora 20 and RHEL7
if( "${UNIX_CODENAME}" MATCHES "Heisenbug" OR "${UNIX_CODENAME}" MATCHES "Maipo" )
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},OCE-devel" )
else()
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},OpenCASCADE-libs-modelling >= 6.3.0,OpenCASCADE-libs-foundation >= 6.3.0,OpenCASCADE-libs-visualization >= 6.3.0,OpenCASCADE-libs-ocaf >= 6.3.0,OpenCASCADE-libs-ocaf-lite >= 6.3.0" )
endif()
# OCE
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization")
# Qwt is qwt5-qt4 in RHEL7
if( "${UNIX_CODENAME}" MATCHES "Maipo" )
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},qwt5-qt4" )
Expand Down Expand Up @@ -224,25 +220,26 @@ if ( ENABLE_CPACK )
set ( DEPENDS_LIST "libboost-date-time${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION},"
"libboost-regex${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION},"
"libboost-python${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION},"
"libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9,"
"libnexus0 (>= 4.3),libgsl0ldbl,libqtcore4 (>= 4.2),libqtgui4 (>= 4.2),libqt4-opengl (>= 4.2),"
"libqt4-xml (>= 4.2),libqt4-svg (>= 4.2),libqt4-qt3support (>= 4.2),qt4-dev-tools,"
"libqwt5-qt4,libqwtplot3d-qt4-0,python-numpy,python-sip,python-qt4" )
set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools0 (>= 1.7)" )
if( "${UNIX_CODENAME}" MATCHES "lucid" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-5,"
"libopencascade-foundation-6.3.0 (>= 6.3.0),libopencascade-modeling-6.3.0 (>= 6.3.0),"
"libmuparser0" )
"libmuparser0,libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9" )
elseif( "${UNIX_CODENAME}" MATCHES "precise" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-8,"
"libopencascade-foundation-6.5.0 (>= 6.5.0),libopencascade-modeling-6.5.0 (>= 6.5.0),"
"libmuparser0debian1,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy" )
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,"
"libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9")
elseif( "${UNIX_CODENAME}" STREQUAL "trusty" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-11,"
"liboce-foundation8,liboce-modeling8,"
"libmuparser2,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy" )
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,"
"libpocofoundation11,libpocoutil11,libpoconet11,libpoconetssl11,libpococrypto11,libpocoxml11")
set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools4 (>= 1.7)" )
else()
message( WARNING "Mantid does not support packaging of this Ubuntu version: ${UNIX_CODENAME}")
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/LogManager.h
Expand Up @@ -150,6 +150,8 @@ namespace Mantid
virtual void saveNexus(::NeXus::File * file, const std::string & group,bool keepOpen=false) const;
/// Load the run from a NeXus file with a given group name
virtual void loadNexus(::NeXus::File * file, const std::string & group,bool keepOpen=false);
/// Clear the logs
void clearLogs();

protected:
/// A pointer to a property manager
Expand Down
38 changes: 0 additions & 38 deletions Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceValidators.h
Expand Up @@ -369,44 +369,6 @@ class DLLExport IncreasingAxisValidator : public MatrixWorkspaceValidator
}
};

//===============================================================================================
/**
* A validator which checks whether data in each spectrum of the input workspace are monotonically increasing.
*/
class DLLExport IncreasingDataValidator : public MatrixWorkspaceValidator
{
public:
///Gets the type of the validator
std::string getType() const { return "increasingdata"; }
/// Clone the current state
Kernel::IValidator_sptr clone() const { return boost::make_shared<IncreasingDataValidator>(*this); }

private:
/** Validate a workspace.
* @param value :: The workspace to test
* @return A message for users with negative results, otherwise ""
*/
std::string checkValidity( const MatrixWorkspace_sptr& value ) const
{
if ( value->blocksize() < 2 )
{
return "Spectra must have two or more data points (bins).";
}
for(size_t spec = 0; spec < value->getNumberHistograms(); ++spec)
{
auto &Y = value->readY( spec );
double y = Y.front();
for(auto it = Y.begin() + 1; it != Y.end(); ++it)
{
if ( y > *it ) return "Data in the workspace must monotonically increase.";
y = *it;
}
}
return "";
}

};

} // namespace API
} // namespace Mantid

Expand Down
20 changes: 20 additions & 0 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -1055,15 +1055,35 @@ namespace Mantid
// Loop over the output workspaces
for (outWS = outputWorkspaces.begin(); outWS != outputWorkspaces.end(); ++outWS)
{
WorkspaceGroup_sptr wsGroup = boost::dynamic_pointer_cast<WorkspaceGroup>(*outWS);

// Loop over the input workspaces, making the call that copies their history to the output ones
// (Protection against copy to self is in WorkspaceHistory::copyAlgorithmHistory)
for (inWS = inputWorkspaces.begin(); inWS != inputWorkspaces.end(); ++inWS)
{
(*outWS)->history().addHistory( (*inWS)->getHistory() );

// Add history to each child of output workspace group
if(wsGroup)
{
for(size_t i = 0; i < wsGroup->size(); i++)
{
wsGroup->getItem(i)->history().addHistory( (*inWS)->getHistory() );
}
}
}

// Add the history for the current algorithm to all the output workspaces
(*outWS)->history().addHistory(m_history);

// Add history to each child of output workspace group
if(wsGroup)
{
for(size_t i = 0; i < wsGroup->size(); i++)
{
wsGroup->getItem(i)->history().addHistory(m_history);
}
}
}
}
//this is a child algorithm, but we still want to keep the history.
Expand Down
11 changes: 10 additions & 1 deletion Code/Mantid/Framework/API/src/LogManager.cpp
Expand Up @@ -434,13 +434,22 @@ using namespace Kernel;
if (prop)
{
if (m_manager.existsProperty(prop->name() ))
{
m_manager.removeProperty(prop->name() );
}
m_manager.declareProperty(prop);
}
}
}
if (!(group.empty()||keepOpen))file->closeGroup();

}

/**
* Clear the logs.
*/
void LogManager::clearLogs()
{
m_manager.clear();
}

//-----------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
Expand Up @@ -84,6 +84,10 @@ namespace Mantid
os << "\n"
<< "Y axis: " << YUnitLabel() << "\n";

os << "Distribution: "
<< (isDistribution()? "True" : "False")
<< "\n";

os << ExperimentInfo::toString();
return os.str();
}
Expand Down
17 changes: 9 additions & 8 deletions Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
Expand Up @@ -76,14 +76,15 @@ class MatrixWorkspaceTest : public CxxTest::TestSuite
testWS->setYUnitLabel("Counts");

std::string expected = \
"WorkspaceTester\n"
"Title: A test run\n"
"Histograms: 1\n"
"Bins: 1\n"
"Histogram\n"
"X axis: Time-of-flight / microsecond\n"
"Y axis: Counts\n"
"Instrument: (1990-Jan-01 to 1990-Jan-01)\n";
"WorkspaceTester\n"
"Title: A test run\n"
"Histograms: 1\n"
"Bins: 1\n"
"Histogram\n"
"X axis: Time-of-flight / microsecond\n"
"Y axis: Counts\n"
"Distribution: False\n"
"Instrument: (1990-Jan-01 to 1990-Jan-01)\n";

TS_ASSERT_EQUALS(expected, testWS->toString());
}
Expand Down
6 changes: 6 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/GeneratePythonScript.cpp
Expand Up @@ -11,6 +11,11 @@
using namespace Mantid::Kernel;
using namespace Mantid::API;

namespace
{
Mantid::Kernel::Logger g_log("GeneratePythonScript");
}

namespace Mantid
{
namespace Algorithms
Expand Down Expand Up @@ -61,6 +66,7 @@ void GeneratePythonScript::exec()

// Get the algorithm histories of the workspace.
const WorkspaceHistory wsHistory = ws->getHistory();
g_log.information() << "Number of history items: " << wsHistory.size() << std::endl;

auto view = wsHistory.createView();

Expand Down

0 comments on commit e5aa71c

Please sign in to comment.