Skip to content

Commit

Permalink
Merge branch 'master' into feature/10591_scarf_reconstruction
Browse files Browse the repository at this point in the history
Conflicts:
	Code/Mantid/Framework/Kernel/inc/MantidKernel/InternetHelper.h
	Code/Mantid/Framework/Kernel/src/InternetHelper.cpp

Smallish conflicts after changes in inet helper, re #10591
  • Loading branch information
FedeMPouzols committed Feb 20, 2015
2 parents 400d51e + 14fce0d commit b83a951
Show file tree
Hide file tree
Showing 475 changed files with 20,082 additions and 14,306 deletions.
24 changes: 17 additions & 7 deletions Code/Mantid/Build/CMake/DarwinSetup.cmake
Expand Up @@ -131,20 +131,30 @@ else()
set ( CMAKE_OSX_ARCHITECTURES x86_64 )
set ( CMAKE_OSX_DEPLOYMENT_TARGET 10.8 )
# Follow symlinks so cmake copies the file
set ( PYQT4_PATH /usr/local/lib/python${PY_VER}/site-packages/PyQt4 )
# PYQT4_PATH, SITEPACKAGES_PATH, OPENSSL_ROOT_DIR may be defined externally (cmake -D)
# it would be good do not overwrite them (important for the compilation with macports)
if (NOT PYQT4_PATH)
set ( PYQT4_PATH /usr/local/lib/python${PY_VER}/site-packages/PyQt4 )
endif(NOT PYQT4_PATH)
execute_process(COMMAND readlink ${PYQT4_PATH}/Qt.so OUTPUT_VARIABLE PYQT4_SYMLINK_Qtso)
string(FIND ${PYQT4_SYMLINK_Qtso} "Qt.so" STOPPOS)
string(SUBSTRING ${PYQT4_SYMLINK_Qtso} 0 ${STOPPOS} PYQT4_SYMLINK)
string(FIND "${PYQT4_SYMLINK_Qtso}" "Qt.so" STOPPOS)
string(SUBSTRING "${PYQT4_SYMLINK_Qtso}" 0 ${STOPPOS} PYQT4_SYMLINK)
set ( PYQT4_PYTHONPATH ${PYQT4_PATH}/${PYQT4_SYMLINK} )
string(REGEX REPLACE "/$" "" PYQT4_PYTHONPATH "${PYQT4_PYTHONPATH}")

set ( SITEPACKAGES_PATH /usr/local/lib/python${PY_VER}/site-packages )
if (NOT SITEPACKAGES_PATH)
set ( SITEPACKAGES_PATH /usr/local/lib/python${PY_VER}/site-packages )
endif(NOT SITEPACKAGES_PATH)
execute_process(COMMAND readlink ${SITEPACKAGES_PATH}/sip.so OUTPUT_VARIABLE SITEPACKAGES_SYMLINK_sipso)
string(FIND ${SITEPACKAGES_SYMLINK_sipso} "sip.so" STOPPOS)
string(SUBSTRING ${SITEPACKAGES_SYMLINK_sipso} 0 ${STOPPOS} SITEPACKAGES_SYMLINK)
string(FIND "${SITEPACKAGES_SYMLINK_sipso}" "sip.so" STOPPOS)
string(SUBSTRING "${SITEPACKAGES_SYMLINK_sipso}" 0 ${STOPPOS} SITEPACKAGES_SYMLINK)
set ( SITEPACKAGES ${SITEPACKAGES_PATH}/${SITEPACKAGES_SYMLINK} )
string(REGEX REPLACE "/$" "" SITEPACKAGES "${SITEPACKAGES}")

# use homebrew OpenSSL package
set ( OPENSSL_ROOT_DIR /usr/local/opt/openssl )
if (NOT OPENSSL_ROOT_DIR)
set ( OPENSSL_ROOT_DIR /usr/local/opt/openssl )
endif(NOT OPENSSL_ROOT_DIR)
endif()

# Python packages
Expand Down
4 changes: 4 additions & 0 deletions Code/Mantid/Build/CMake/LinuxPackageScripts.cmake
Expand Up @@ -22,6 +22,10 @@ endif()

set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${LIB_DIR};${CMAKE_INSTALL_PREFIX}/${PLUGINS_DIR};${CMAKE_INSTALL_PREFIX}/${PVPLUGINS_DIR} )

# Tell rpm that this package does not own /opt /usr/share/{applications,pixmaps}
# Required for Fedora >= 18 and RHEL >= 7
set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /opt /usr/share/applications /usr/share/pixmaps )

###########################################################################
# LD_PRELOAD TCMalloc
###########################################################################
Expand Down
File renamed without changes.
84 changes: 84 additions & 0 deletions Code/Mantid/Build/Jenkins/jenkins-slave.sh
@@ -0,0 +1,84 @@
#!/bin/sh
#####################################################################
# Starts the Jenkins slave process if it is not already running.
# It also downloads the slave.jar to /tmp if it does not already
# exist.
#
# The settings at the top must be filled in for each slave.
#####################################################################
# Crontab setting should be something like
# 0,30 * * * * /home/builder/jenkins-linode/jenkins-slave.sh nodename secret
# or (on mac)
# 0,30 * * * * /Users/builder/jenkins-linode/jenkins-slave.sh nodename secret
#####################################################################
# User configuration
#####################################################################
# Main url for Jenkins
JENKINS_URL=http://builds.mantidproject.org
# URL for proxy (if required)
PROXY_HOST=${3}
# Port for proxy (if required)
PROXY_PORT=${4}
# Name of the node as it appears on jenkins
NODE_NAME=${1}
# Copy the secret from the command line given at the above URL
SECRET=${2}

#####################################################################
# Constants
#####################################################################
# URL of jnlp file for slave
SLAVE_AGENT_URL="${JENKINS_URL}/computer/${NODE_NAME}/slave-agent.jnlp"
# name of the slave jar - full path is determined later
JAR_FILE=slave.jar

#####################################################################
# Script
#####################################################################
# exit if it is already running
RUNNING=$(ps aux | grep java | grep ${JAR_FILE})
if [ ! -z "${RUNNING}" ]; then
echo "Slave process is already running"
exit 0
else
echo "Slave process is not running"
fi

# error out if there isn't a node name and secret
if [ "$#" -lt 2 ]; then
echo "Usage: `basename ${0}` <NODE_NAME> <SECRET> [PROXY_HOST] [PROXY_PORT]"
exit -1
fi

# setup the proxy
if [ ! -z "${PROXY_HOST}" ]; then
PROXY_ARGS="-Dhttp.proxyHost=${PROXY_HOST} -Dhttp.proxyPort=${PROXY_PORT}"
echo "using proxy ${PROXY_HOST} ${PROXY_PORT}"
# For curl
export http_proxy=http://$PROXY_HOST:$PROXY_PORT
fi

# find the jar file if it exists
if [ -f ${HOME}/jenkins-linode/${JAR_FILE} ]; then
JAR_FILE=${HOME}/jenkins-linode/${JAR_FILE}
elif [ -f ${HOME}/Jenkins/${JAR_FILE} ]; then
JAR_FILE=${HOME}/Jenkins/${JAR_FILE}
else
JAR_FILE=/tmp/${JAR_FILE}
if [ ! -f ${JAR_FILE} ]; then
echo "Downloading slave jar file to ${JAR_FILE}"
if [ $(command -v curl) ]; then
echo "curl -o ${JAR_FILE} ${JENKINS_URL}/jnlpJars/slave.jar"
curl -o ${JAR_FILE} ${JENKINS_URL}/jnlpJars/slave.jar
else
echo "Need curl to download ${JENKINS_URL}/jnlpJars/slave.jar"
exit -1
fi
fi
fi

echo "starting ..."
JAVA=`which java`
JAVA_ARGS="${PROXY_ARGS} -jar ${JAR_FILE} -jnlpUrl ${SLAVE_AGENT_URL} -secret ${SECRET}"
echo "${JAVA} ${JAVA_ARGS}"
${JAVA} ${JAVA_ARGS}
4 changes: 2 additions & 2 deletions Code/Mantid/Build/dev-packages/deb/mantid-developer/README
Expand Up @@ -2,5 +2,5 @@ This directory contains the structure required to build the simple mantid-develo

To build the package:
* Switch to the directory containing this file
* Run "dpkg --build mantid-developer-1.2.3"
* A file called mantid-developer-1.2.3.deb will appear in the current directory.
* Run "dpkg --build mantid-developer-1.2.4"
* A file called mantid-developer-1.2.4.deb will appear in the current directory.
Expand Up @@ -3,7 +3,7 @@ Version: 1.2.3
Section: main
Priority: optional
Architecture: all
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive,texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive, texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil, python-sphinx-bootstrap-theme
Installed-Size: 0
Maintainer: Mantid Project <mantid-help@mantidproject.org>
Description: Installs all packages required for a Mantid developer
Expand Down
@@ -0,0 +1,13 @@
Package: mantid-developer
Version: 1.2.4
Section: main
Priority: optional
Architecture: all
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive,texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil, python-sphinx-bootstrap-theme, graphviz
Installed-Size: 0
Maintainer: Mantid Project <mantid-help@mantidproject.org>
Description: Installs all packages required for a Mantid developer
A metapackage which requires all the dependencies and tools that are
required for Mantid development. It works for Ubuntu version 14.04, 14.10
Some packages (poco) must be newer than those in the Ubuntu repository. Please
follow instructions at http://www.mantidproject.org/Mantid_Prerequisites#Repositories
@@ -1,5 +1,5 @@
Name: mantid-developer
Version: 1.7
Version: 1.9
Release: 1%{?dist}
Summary: Meta Package to install dependencies for Mantid Development

Expand Down Expand Up @@ -64,6 +64,7 @@ Requires: scl-utils
Requires: qt-devel
Requires: qtwebkit-devel
%endif
Requires: graphviz

BuildArch: noarch

Expand All @@ -86,6 +87,9 @@ required for Mantid development.
%files

%changelog
* Thu Feb 12 2015 Harry Jeffery <henry.jeffery@stfc.ac.uk>
- Added graphviz dependency

* Wed Aug 13 2014 Peter Peterson <petersonpf@ornl.gov>
- Merged all three distribution spec files into one

Expand Down
5 changes: 3 additions & 2 deletions Code/Mantid/Framework/API/inc/MantidAPI/IPeak.h
Expand Up @@ -7,6 +7,7 @@
#include "MantidKernel/Matrix.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/PhysicalConstants.h"
#include <boost/optional.hpp>

namespace Mantid {
namespace API {
Expand Down Expand Up @@ -50,9 +51,9 @@ class MANTID_API_DLL IPeak {
virtual bool findDetector() = 0;

virtual void setQSampleFrame(Mantid::Kernel::V3D QSampleFrame,
double detectorDistance = 1.0) = 0;
boost::optional<double> detectorDistance) = 0;
virtual void setQLabFrame(Mantid::Kernel::V3D QLabFrame,
double detectorDistance = 1.0) = 0;
boost::optional<double> detectorDistance) = 0;

virtual void setWavelength(double wavelength) = 0;
virtual double getWavelength() const = 0;
Expand Down
15 changes: 12 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/IPeaksWorkspace.h
Expand Up @@ -7,6 +7,7 @@
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/ExperimentInfo.h"
#include "MantidKernel/SpecialCoordinateSystem.h"
#include <boost/optional.hpp>

namespace Mantid {

Expand Down Expand Up @@ -98,12 +99,20 @@ class MANTID_API_DLL IPeaksWorkspace : public ITableWorkspace,

//---------------------------------------------------------------------------------------------
/** Create an instance of a Peak
* @param QLabFrame :: Q of the center of the peak, in reciprocal space
* @param detectorDistance :: distance between the sample and the detector.
* @param QLabFrame :: Q of the center of the peak in the lab frame, in reciprocal space
* @param detectorDistance :: Optional distance between the sample and the detector. Calculated if not provided.
* @return a pointer to a new Peak object.
*/
virtual IPeak *createPeak(Mantid::Kernel::V3D QLabFrame,
double detectorDistance = 1.0) const = 0;
boost::optional<double> detectorDistance) const = 0;


/**
* Create an instance of a peak using a V3D
* @param HKL V3D
* @return a pointer to a new Peak object.
*/
virtual IPeak *createPeakHKL(Mantid::Kernel::V3D HKL) const = 0;

//---------------------------------------------------------------------------------------------
/** Determine if the workspace has been integrated using a peaks integration
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -1164,7 +1164,7 @@ bool Algorithm::checkGroups() {
// Workspace groups are NOT returned by IWP->getWorkspace() most of the time
// because WorkspaceProperty is templated by <MatrixWorkspace>
// and WorkspaceGroup does not subclass <MatrixWorkspace>
if (!wsGroup && !prop->value().empty()) {
if (!wsGroup && prop && !prop->value().empty()) {
// So try to use the name in the AnalysisDataService
try {
wsGroup = AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
Expand Down
43 changes: 24 additions & 19 deletions Code/Mantid/Framework/API/src/MultiDomainFunction.cpp
Expand Up @@ -141,27 +141,32 @@ void MultiDomainFunction::functionDeriv(const FunctionDomain &domain,
throw std::invalid_argument(
"Non-CompositeDomain passed to MultiDomainFunction.");
}
const CompositeDomain &cd = dynamic_cast<const CompositeDomain &>(domain);
// domain must not have less parts than m_maxIndex
if (cd.getNParts() < m_maxIndex) {
throw std::invalid_argument(
"CompositeDomain has too few parts (" +
boost::lexical_cast<std::string>(cd.getNParts()) +
") for MultiDomainFunction (max index " +
boost::lexical_cast<std::string>(m_maxIndex) + ").");
}

countValueOffsets(cd);
// evaluate member functions derivatives
for (size_t iFun = 0; iFun < nFunctions(); ++iFun) {
// find the domains member function must be applied to
std::vector<size_t> domains;
getDomainIndices(iFun, cd.getNParts(), domains);
if (getAttribute("NumDeriv").asBool()) {
calNumericalDeriv(domain, jacobian);
} else {
const CompositeDomain &cd = dynamic_cast<const CompositeDomain &>(domain);
// domain must not have less parts than m_maxIndex
if (cd.getNParts() < m_maxIndex) {
throw std::invalid_argument(
"CompositeDomain has too few parts (" +
boost::lexical_cast<std::string>(cd.getNParts()) +
") for MultiDomainFunction (max index " +
boost::lexical_cast<std::string>(m_maxIndex) + ").");
}

for (auto i = domains.begin(); i != domains.end(); ++i) {
const FunctionDomain &d = cd.getDomain(*i);
PartialJacobian J(&jacobian, m_valueOffsets[*i], paramOffset(iFun));
getFunction(iFun)->functionDeriv(d, J);
countValueOffsets(cd);
// evaluate member functions derivatives
for (size_t iFun = 0; iFun < nFunctions(); ++iFun) {
// find the domains member function must be applied to
std::vector<size_t> domains;
getDomainIndices(iFun, cd.getNParts(), domains);

for (auto i = domains.begin(); i != domains.end(); ++i) {
const FunctionDomain &d = cd.getDomain(*i);
PartialJacobian J(&jacobian, m_valueOffsets[*i], paramOffset(iFun));
getFunction(iFun)->functionDeriv(d, J);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/src/PropertyNexus.cpp
Expand Up @@ -193,7 +193,9 @@ Property *loadProperty(::NeXus::File *file, const std::string &group) {
file->closeData();
file->closeGroup();
// add units
retVal->setUnits(unitsStr);
if (retVal)
retVal->setUnits(unitsStr);

return retVal;
}

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/test/MockObjects.h
Expand Up @@ -103,9 +103,9 @@ namespace
MOCK_METHOD0(findDetector,
bool());
MOCK_METHOD2(setQSampleFrame,
void(Mantid::Kernel::V3D QSampleFrame, double detectorDistance));
void(Mantid::Kernel::V3D QSampleFrame, boost::optional<double> detectorDistance));
MOCK_METHOD2(setQLabFrame,
void(Mantid::Kernel::V3D QLabFrame, double detectorDistance));
void(Mantid::Kernel::V3D QLabFrame, boost::optional<double> detectorDistance));
MOCK_METHOD1(setWavelength,
void(double wavelength));
MOCK_CONST_METHOD0(getWavelength,
Expand Down

0 comments on commit b83a951

Please sign in to comment.