Skip to content

Commit

Permalink
Merge branch 'master' into feature/9782_add_autodiff_function
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Oct 13, 2014
2 parents ad174be + 70a9b70 commit 6da9545
Show file tree
Hide file tree
Showing 1,637 changed files with 220,837 additions and 113,234 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,8 @@ Desktop.ini
# Mac OS X Finder
.DS_Store

# Ctags index files
.tags
.tags_sorted_by_file

Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h
5 changes: 5 additions & 0 deletions Code/Mantid/Build/CMake/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ endif ()
###########################################################################
include ( CppCheckSetup )

###########################################################################
# Setup pylint
###########################################################################
include ( PylintSetup )

###########################################################################
# Set up the unit tests target
###########################################################################
Expand Down
7 changes: 7 additions & 0 deletions Code/Mantid/Build/CMake/DarwinSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ endif ()
###########################################################################
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++0x" )

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register" )
set ( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS "-Wno-deprecated-register")
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
endif()

if( ${CMAKE_C_COMPILER} MATCHES "icc.*$" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-intel-extensions" )
Expand Down
40 changes: 40 additions & 0 deletions Code/Mantid/Build/CMake/FindPylint.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# - Find Pylint
# Find the Pylint executable and extract the version number
#
# OUTPUT Variables
#
# PYLINT_FOUND
# True if the pylint package was found
# PYLINT_EXECUTABLE
# The pylint executable location
# PYLINT_VERSION
# A string denoting the version of pylint that has been found
# PYLINT_RUNNER_SCRIPT
# Location of python script that will actually run pylint
# PYLINT_CFG_FILE
# Location of configuration file
#

#=============================================================
# main()
#=============================================================

find_program ( PYLINT_EXECUTABLE pylint PATHS /usr/bin )

if ( PYLINT_EXECUTABLE )
execute_process ( COMMAND ${PYLINT_EXECUTABLE} --version OUTPUT_VARIABLE PYLINT_VERSION_RAW ERROR_QUIET )
if (PYLINT_VERSION_RAW)
string ( REGEX REPLACE "^pylint ([0-9]+.[0-9]+.[0-9]+),.*" "\\1" PYLINT_VERSION ${PYLINT_VERSION_RAW})
else ()
set ( PYLINT_VERSION "unknown" )
endif()
# Script to find all .py files and execute pylint
set ( PYLINT_RUNNER_SCRIPT ${CMAKE_SOURCE_DIR}/../Tools/Pylint/run_pylint.py )
# Configuration file
set ( PYLINT_CFG_FILE ${CMAKE_SOURCE_DIR}/../Tools/Pylint/pylint.cfg )
endif ()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS ( Pylint DEFAULT_MSG PYLINT_EXECUTABLE )

mark_as_advanced ( PYLINT_EXECUTABLE PYLINT_VERSION )
61 changes: 25 additions & 36 deletions Code/Mantid/Build/CMake/FindQwt.cmake
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
###############################################################################
# - Attempt to find Qwt libraries and include files.
# QWT_INCLUDE_DIR where to find qwt_plot.h, etc.
# QWT_LIBRARIES libraries to link against
# QWT_FOUND If false, do not try to use Qwt
# QWT_VERSION Sets a string containing the version number parsed from
# qwt_global.h
# Attempt to find Qwt libraries and include files.
# Set
# QWT_INCLUDE_DIR: where to find qwt_plot.h, etc.
# QWT_LIBRARIES: libraries to link against
# QWT_VERSION: a string containing the version number
###############################################################################

find_path ( QWT_INCLUDE_DIR qwt.h PATHS
/usr/local/include
/usr/include/qwt-qt4
/usr/include/qwt
/usr/include/qwt5
/usr/include/qwt5-qt4
${CMAKE_INCLUDE_PATH}/qwt
)
find_library ( QWT_LIBRARY NAMES qwt-qt4 qwt qwt5-qt4 )
find_path ( QWT_INCLUDE_DIR qwt.h
PATHS /opt/include /usr/local/include /usr/include ${CMAKE_INCLUDE_PATH}
PATH_SUFFIXES qwt5 qwt5-qt4 qwt-qt4 qwt )
find_library ( QWT_LIBRARY NAMES qwt5-qt4 qwt-qt4 qwt )
find_library ( QWT_LIBRARY_DEBUG qwtd )

# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
# all listed variables are TRUE
# in REQUIRED mode: terminate if one of the above find commands failed
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR )

if ( QWT_INCLUDE_DIR )
# Look for line in qwt_global.h containing version string
file ( STRINGS ${QWT_INCLUDE_DIR}/qwt_global.h QWT_VERSION
REGEX "^#define[ \t]+QWT_VERSION_STR[ \t]+\"[0-9]+.[0-9]+.[0-9]+\"$" )
if ( NOT QWT_VERSION )
message ( WARNING "Unrecognized Qwt version, cannot find QWT_VERSION_STR in qwt_global.h" )
set ( QWT_VERSION "0.0.0" )
else()
# Hack off the portion up to and including the first double quote
string( REGEX REPLACE "^#define[ \t]+QWT_VERSION_STR[ \t]+\"" "" QWT_VERSION ${QWT_VERSION} )
# Hack off the portion from the second double quote to the end of the line
string( REGEX REPLACE "\"$" "" QWT_VERSION ${QWT_VERSION} )
endif()

if ( QWT_LIBRARY_DEBUG )
set( QWT_LIBRARIES optimized ${QWT_LIBRARY} debug ${QWT_LIBRARY_DEBUG} )
else ()
set( QWT_LIBRARIES ${QWT_LIBRARY} )
endif ()
# Parse version string from qwt_global.h
file ( STRINGS ${QWT_INCLUDE_DIR}/qwt_global.h QWT_VERSION
REGEX "^#define[ \t]+QWT_VERSION_STR[ \t]+\"[0-9]+.[0-9]+.[0-9]+\"$" )
if ( NOT QWT_VERSION )
message ( FATAL_ERROR "Unrecognized Qwt version (cannot find QWT_VERSION_STR in qwt_global.h)" )
endif()
# hack off the portion up to and including the first double quote
string( REGEX REPLACE "^#define[ \t]+QWT_VERSION_STR[ \t]+\"" "" QWT_VERSION ${QWT_VERSION} )
# hack off the portion from the second double quote to the end of the line
string( REGEX REPLACE "\"$" "" QWT_VERSION ${QWT_VERSION} )

if ( QWT_LIBRARY_DEBUG )
set( QWT_LIBRARIES optimized ${QWT_LIBRARY} debug ${QWT_LIBRARY_DEBUG} )
else ()
set( QWT_LIBRARIES ${QWT_LIBRARY} )
endif ()

mark_as_advanced ( QWT_INCLUDE_DIR QWT_LIBRARY QWT_LIBRARY_DEBUG )
26 changes: 26 additions & 0 deletions Code/Mantid/Build/CMake/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,39 @@
# set:
# SPHINX_FOUND
# SPHINX_EXECUTABLE
#
#=============================================================
# main()
#=============================================================

find_program( SPHINX_EXECUTABLE NAME sphinx-build
PATHS ${CMAKE_LIBRARY_PATH}/Python27/Scripts
PATH_SUFFIXES bin
DOC "Sphinx documentation generator"
)

if (SPHINX_EXECUTABLE)
# run sphinx-build to attempt to get the version
execute_process (COMMAND ${SPHINX_EXECUTABLE} --version
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE version_string
ERROR_VARIABLE version_error_string
ERROR_STRIP_TRAILING_WHITESPACE)

# if it wasn't successful it is hiding in stderr
if (NOT version_string)
if ( version_error_string )
string (REGEX REPLACE "\n" ";" version_string ${version_error_string})
list (GET version_string 0 version_string)
else ( version_error_string )
set ( version_string "1.1.0" )
endif ( version_error_string )
endif (NOT version_string)

# chop out the version number
string (REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" SPHINX_VERSION ${version_string})
endif (SPHINX_EXECUTABLE)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE )
Expand Down
10 changes: 8 additions & 2 deletions Code/Mantid/Build/CMake/LinuxSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" )
" ln -s $RPM_INSTALL_PREFIX0/${BIN_DIR}/launch_mantidplot.sh $RPM_INSTALL_PREFIX0/${BIN_DIR}/MantidPlot\n"
"fi\n"
)
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/launch_mantidplot.sh "#!/bin/sh\n"
"scl enable mantidlibs \"${CMAKE_INSTALL_PREFIX}/${BIN_DIR}/MantidPlot_exe $*\" \n"
if ( "${UNIX_CODENAME}" MATCHES "Santiago" ) # el6
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/launch_mantidplot.sh "#!/bin/sh\n"
"scl enable mantidlibs \"${CMAKE_INSTALL_PREFIX}/${BIN_DIR}/MantidPlot_exe $*\" \n"
)
else ()
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/launch_mantidplot.sh "#!/bin/sh\n"
"LD_LIBRARY_PATH=/usr/lib64/paraview:${LD_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/${BIN_DIR}/MantidPlot_exe $* \n"
)
endif()

install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/launch_mantidplot.sh
DESTINATION ${BIN_DIR}
Expand Down
50 changes: 50 additions & 0 deletions Code/Mantid/Build/CMake/PylintSetup.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
########################################################
# Setup target to run pylint checking if it is available
########################################################
find_package ( Pylint )

if ( PYLINT_FOUND AND PYLINT_VERSION VERSION_LESS "1.0.0" )
message ( STATUS "pylint found but version is < 1.0.0 (${PYLINT_VERSION}): no target generated." )
set ( PYLINT_FOUND FALSE )
endif()

if ( PYLINT_FOUND )
message ( STATUS "pylint version: ${PYLINT_VERSION}" )

# Output format options
if ( NOT PYLINT_OUTPUT_FORMAT )
# Use msvs for MSVC generator, colorized for everything else. The buildservers can
# set it to parseable for Jenkins
if ( MSVC )
set ( DEFAULT_FORMAT "msvs" )
else ()
set ( DEFAULT_FORMAT "colorized" )
endif ()
set ( PYLINT_OUTPUT_FORMAT ${DEFAULT_FORMAT} CACHE STRING "Desired pylint output format" )

# There are a limited set of allowed options
set_property( CACHE PYLINT_OUTPUT_FORMAT PROPERTY STRINGS "text" "html" "msvs" "parseable" "colorized" )
endif()

# add a pylint-check target to run pylint on the required files and directories
# relative to the root source directory
set ( BASE_DIR ${CMAKE_SOURCE_DIR} )
set ( PYLINT_INCLUDES
Framework/PythonInterface/plugins
scripts
)
set ( PYLINT_EXCLUDES
scripts/lib1to2
scripts/test
)
add_custom_target ( pylintcheck
COMMAND ${PYTHON_EXECUTABLE} ${PYLINT_RUNNER_SCRIPT} --format=${PYLINT_OUTPUT_FORMAT}
--rcfile=${PYLINT_CFG_FILE}
--mantidpath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
--basedir=${BASE_DIR} --nofail
--exclude="${PYLINT_EXCLUDES}"
${PYLINT_INCLUDES}
COMMENT "Running pylint on selected python files"
)
set_target_properties ( pylintcheck PROPERTIES EXCLUDE_FROM_ALL TRUE )
endif ()
36 changes: 21 additions & 15 deletions Code/Mantid/Build/Jenkins/buildscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,30 @@
# Print out the versions of things we are using
###############################################################################
cmake --version
echo "SHA1=${sha1}"

###############################################################################
# OS X setup steps
###############################################################################
if [[ $(uname) == 'Darwin' ]]; then
cd $WORKSPACE/Code
./fetch_Third_Party.sh
cd $WORKSPACE
# Setup environment variables
source /opt/intel/bin/iccvars.sh intel64
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$WORKSPACE/Code/Third_Party/lib/mac64:/Library/Frameworks
# Make sure we pick up the Intel compiler
export CC=icc
export CXX=icpc
if [[ ${JOB_NAME} == *clang* ]]; then
# Assuming we are using the clang compiler
echo "Using clang/llvm compiler."
clang --version
else
# Assuming we are using the Intel compiler
cd $WORKSPACE/Code
./fetch_Third_Party.sh
cd $WORKSPACE
# Setup environment variables
source /opt/intel/bin/iccvars.sh intel64
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$WORKSPACE/Code/Third_Party/lib/mac64:/Library/Frameworks
# Make sure we pick up the Intel compiler
export CC=icc
export CXX=icpc
echo "Using Intel compiler."
icpc --version
fi
fi

###############################################################################
Expand Down Expand Up @@ -102,14 +112,10 @@ $SCL_ON_RHEL6 "ctest --output-on-failure -R MantidPlot"

###############################################################################
# Documentation
# Only run tests on RHEL6 incremental but have to build html on all platforms
# for a clean build so that it can be packaged
# Build Qt help on all platforms for a clean build so that it can be packaged
###############################################################################
if [[ "$ON_RHEL6" == true ]]; then
$SCL_ON_RHEL6 "make docs-test"
fi
if [[ "$CLEANBUILD" == true ]]; then
# Workaround so that the html target can find the properties file
# Workaround so that the target can find the properties file
# CMake doesn't easily allow environment variables on custom targets
if [[ $(uname) == 'Darwin' ]]; then
export MANTIDPATH=$PWD/bin
Expand Down
31 changes: 16 additions & 15 deletions Code/Mantid/Build/Jenkins/buildscript.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" --version
echo %sha1%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Check the required build configuration
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set BUILD_CONFIG=
if not "%JOB_NAME%"=="%JOB_NAME:debug=%" (
set BUILD_CONFIG=Debug
) else (
if not "%JOB_NAME%"=="%JOB_NAME:relwithdbg=%" (
set BUILD_CONFIG=RelWithDbg
) else (
set BUILD_CONFIG=Release
))

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Get or update the third party dependencies
Expand All @@ -16,7 +30,7 @@ cd %WORKSPACE%\Code
call fetch_Third_Party win64
cd %WORKSPACE%

set PATH=%WORKSPACE%\Code\Third_Party\lib\win64;%WORKSPACE%\Code\Third_Party\lib\win64\Python27;%PARAVIEW_DIR%\bin\Release;%PATH%
set PATH=%WORKSPACE%\Code\Third_Party\lib\win64;%WORKSPACE%\Code\Third_Party\lib\win64\Python27;%PARAVIEW_DIR%\bin\%BUILD_CONFIG%;%PATH%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Check whether this is a clean build (must have 'clean' in the job name)
Expand All @@ -42,19 +56,6 @@ cd %WORKSPACE%\build
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "Visual Studio 11 Win64" -DCONSOLE=OFF -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=%PARAVIEW_DIR% -DUSE_PRECOMPILED_HEADERS=ON %PACKAGE_DOCS% ..\Code\Mantid
if ERRORLEVEL 1 exit /B %ERRORLEVEL%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Check the required build configuration
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set BUILD_CONFIG=
if not "%JOB_NAME%"=="%JOB_NAME:debug=%" (
set BUILD_CONFIG=Debug
) else (
if not "%JOB_NAME%"=="%JOB_NAME:relwithdbg=%" (
set BUILD_CONFIG=RelWithDbg
) else (
set BUILD_CONFIG=Release
))

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build step
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -68,7 +69,7 @@ if ERRORLEVEL 1 exit /B %ERRORLEVEL%
"C:\Program Files (x86)\CMake 2.8\bin\ctest.exe" -C %BUILD_CONFIG% -j%BUILD_THREADS% --schedule-random --output-on-failure -E MantidPlot
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
:: Run GUI tests serially
ctest -C Release --output-on-failure -R MantidPlot
ctest -C %BUILD_CONFIG% --output-on-failure -R MantidPlot
if ERRORLEVEL 1 exit /B %ERRORLEVEL%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down

0 comments on commit 6da9545

Please sign in to comment.