Skip to content

Commit

Permalink
Merge branch 'root_master' into cmaes4root_master
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Benazera committed Mar 9, 2015
2 parents 4e56d84 + 58f8198 commit 021b077
Show file tree
Hide file tree
Showing 248 changed files with 7,314 additions and 4,246 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ endif()
#---Populate the configure arguments returned by 'root-config --config'-------------------------
get_cmake_property(variables CACHE_VARIABLES)
foreach(var ${variables})
if((var MATCHES "_(LIBRARIES|LIBRARY|INCLUDE)") AND (NOT "${${var}}" STREQUAL "") AND
(NOT "${var}" MATCHES "NOTFOUND"))
if((var MATCHES "_(LIBRARIES|LIBRARY|INCLUDE)") AND
(NOT ${${var}} STREQUAL "") AND
(NOT ${var} MATCHES "NOTFOUND"))
if (var MATCHES "^QT_")
# filter out the very long list of Qt libraries and include dirs
if (var MATCHES "(QT_LIBRARY_DIR|QT_QTCORE_INCLUDE_DIR)")
Expand Down
6 changes: 3 additions & 3 deletions bindings/pyroot/cppyy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def _AddressOf( self, obj ):
_builtin_cppyy = False

# load PyROOT C++ extension module, special case for linux and Sun
needsGlobal = ( 0 <= string.find( sys.platform, 'linux' ) ) or\
( 0 <= string.find( sys.platform, 'sunos' ) )
needsGlobal = ( 0 <= sys.platform.find( 'linux' ) ) or\
( 0 <= sys.platform.find( 'sunos' ) )
if needsGlobal:
# change dl flags to load dictionaries from pre-linked .so's
dlflags = sys.getdlopenflags()
Expand Down Expand Up @@ -180,7 +180,7 @@ class short(int): pass
class long_int(int): pass
class unsigned_short(int): pass
class unsigned_int(int): pass
class unsigned_long(long): pass
class unsigned_long(int): pass

#--- Copy over locally defined names ------------------------------------
if _builtin_cppyy:
Expand Down
1 change: 1 addition & 0 deletions bindings/pyroot/src/Converters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Bool_t PyROOT::TLongRefConverter::SetArg(
para.fTypeCode = 'v';
return kTRUE;
#else
(void)para;
PyErr_SetString( PyExc_NotImplementedError, "int pass-by-ref not implemented in p3" );
return kFALSE; // there no longer is a PyIntObject in p3
#endif
Expand Down
2 changes: 1 addition & 1 deletion bindings/pyroot/src/RootModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ namespace {
}
if ( !PyErr_Occurred() ) {
PyObject* str = PyObject_Str( dummy );
if ( str && PyString_Check( str ) )
if ( str && PyROOT_PyUnicode_Check( str ) )
PyErr_Format( PyExc_ValueError, "unknown object %s", PyBytes_AS_STRING( str ) );
else
PyErr_Format( PyExc_ValueError, "unknown object at %p", (void*)dummy );
Expand Down
13 changes: 13 additions & 0 deletions build/win/githeader.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off

rem Generate the header file from the Store info about in which git branch,
rem what SHA1 and at what date/time we executed make.

for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 1}"') do set GIT_BRANCH=%%a
for /f "delims=" %%a in ('powershell.exe -command "& {Get-Content .\etc\gitinfo.txt | select -First 2 | select -Last 1}"') do set GIT_COMMIT=%%a

echo #ifndef ROOT_RGITCOMMIT_H > %1
echo #define ROOT_RGITCOMMIT_H >> %1
echo #define ROOT_GIT_BRANCH "%GIT_BRANCH%" >> %1
echo #define ROOT_GIT_COMMIT "%GIT_COMMIT%" >> %1
echo #endif >> %1
20 changes: 20 additions & 0 deletions build/win/gitinfo.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

rem Store info about in which git branch, what SHA1 and at what date/time we executed make.

set dir=""
set dotgit=".git"
if not "%1"=="" set dotgit="%1\.git"

rem if we don't see the .git directory, just return
if not exist %dotgit% exit /b 0

set OUT=".\etc\gitinfo.txt"

call git.exe --git-dir=%dotgit% describe --all > %OUT%
call git.exe --git-dir=%dotgit% describe --always >> %OUT%

for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set ldt=%ldt:~6,2% %ldt:~4,2% %ldt:~0,4%, %ldt:~8,2%:%ldt:~10,2%:%ldt:~12,2%
echo %ldt%>> %OUT%

18 changes: 18 additions & 0 deletions cmake/modules/CheckCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,24 @@ include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)

#---Check for cxx11 option------------------------------------------------------------
if(cxx11 AND cxx14)
message(STATUS "c++11 mode requested but superseded by request for c++14 mode")
set(cxx11 OFF CACHE BOOL "" FORCE)
endif()
if(cxx11)
CHECK_CXX_COMPILER_FLAG("-std=c++11" HAS_CXX11)
if(NOT HAS_CXX11)
message(STATUS "Current compiler does not suppport -std=c++11 option. Switching OFF cxx11 option")
set(cxx11 OFF CACHE BOOL "" FORCE)
endif()
endif()
if(cxx14)
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CXX14)
if(NOT HAS_CXX14)
message(STATUS "Current compiler does not suppport -std=c++14 option. Switching OFF cxx14 option")
set(cxx14 OFF CACHE BOOL "" FORCE)
endif()
endif()

#---Check for libcxx option------------------------------------------------------------
if(libcxx)
Expand Down Expand Up @@ -117,6 +128,13 @@ if(cxx11)
endif()
endif()

if(cxx14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
endif()

if(libcxx)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ ROOT_BUILD_OPTION(builtin_cfitsio OFF "Built the FITSIO library internally (down
ROOT_BUILD_OPTION(builtin_xrootd OFF "Built the XROOTD internally (downloading tarfile from the Web)")
ROOT_BUILD_OPTION(builtin_llvm ON "Built the LLVM internally")
ROOT_BUILD_OPTION(cxx11 ON "Build using C++11 compatible mode, requires gcc > 4.7.x or clang")
ROOT_BUILD_OPTION(cxx14 OFF "Build using C++14 compatible mode, requires gcc > 4.9.x or clang")
ROOT_BUILD_OPTION(libcxx OFF "Build using libc++, requires cxx11 option (MacOS X only, for the time being)")
ROOT_BUILD_OPTION(castor ON "CASTOR support, requires libshift from CASTOR >= 1.5.2")
ROOT_BUILD_OPTION(chirp ON "Chirp support (Condor remote I/O), requires libchirp_client")
Expand Down
5 changes: 5 additions & 0 deletions cmake/modules/RootConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ if(cxx11)
else()
set(usec++11 undef)
endif()
if(cxx14)
set(usec++14 define)
else()
set(usec++14 undef)
endif()
if(libcxx)
set(uselibc++ define)
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ if(cling)

set(CLING_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/interpreter/cling/include)
if(MSVC)
set(CLING_CXXFLAGS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNOMINMAX")
set(CLING_CXXFLAGS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNOMINMAX -D_XKEYCHECK_H")
else()
set(CLING_CXXFLAGS "-fvisibility-inlines-hidden -fno-strict-aliasing -Wno-unused-parameter -Wwrite-strings -Wno-long-long -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SetUpWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ elseif(MSVC)
endif()

if(CMAKE_PROJECT_NAME STREQUAL ROOT)
set(CMAKE_CXX_FLAGS "-nologo -I${CMAKE_SOURCE_DIR}/build/win -FIw32pragma.h -FIsehmap.h ${BLDCXXFLAGS} -EHsc- -W3 -wd4244 -D_WIN32")
set(CMAKE_CXX_FLAGS "-nologo -I${CMAKE_SOURCE_DIR}/build/win -FIw32pragma.h -FIsehmap.h ${BLDCXXFLAGS} -EHsc- -W3 -wd4244 -D_WIN32 -D_XKEYCHECK_H")
set(CMAKE_C_FLAGS "-nologo -I${CMAKE_SOURCE_DIR}/build/win -FIw32pragma.h -FIsehmap.h ${BLDCFLAGS} -EHsc- -W3 -D_WIN32")
install(FILES ${CMAKE_SOURCE_DIR}/build/win/w32pragma.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
install(FILES ${CMAKE_SOURCE_DIR}/build/win/sehmap.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
Expand Down
1 change: 1 addition & 0 deletions config/RConfigure.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#@hascocoa@ R__HAS_COCOA /**/
#@hasvc@ R__HAS_VC /**/
#@usec++11@ R__USE_CXX11 /**/
#@usec++14@ R__USE_CXX14 /**/
#@uselibc++@ R__USE_LIBCXX /**/
#@hasllvm@ R__EXTERN_LLVMDIR @llvmdir@

Expand Down
3 changes: 3 additions & 0 deletions config/rootrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ WinNT.*.Editor: notepad
# Default Fitter (current choices are Minuit and Fumili).
Root.Fitter: Minuit

# Enable (default) or disable the RooFit banner printing.
# RooFit.Banner: yes

# Specify list of file endings which TTabCom (TAB completion) should ignore.
#TabCom.FileIgnore: .cpp:.h:.cmz

Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ enable/disable options, prefix with either --enable- or --disable-
pgsql PostgreSQL support, requires libpq
pythia6 Pythia6 EG support, requires libPythia6
pythia8 Pythia8 EG support, requires libPythia8 >= 8180
python Python ROOT bindings, requires python >= 2.5
python Python ROOT bindings, requires python >= 2.7
qt Qt graphics backend, requires libqt >= 4.8
qtgsi GSI's Qt integration, requires libqt >= 4.8
rfio RFIO support, requires libshift from CASTOR >= 1.5.2
Expand Down Expand Up @@ -2719,7 +2719,7 @@ fi
#
### echo %%% Check for Python version (required by LLVM/Clang)
#
message "Checking for Python version >= 2.5"
message "Checking for Python version >= 2.7"

if test "x$pythonexe" = "x"; then
pythonexe=`$cwhich python 2> /dev/null`
Expand All @@ -2736,11 +2736,11 @@ pythonvers_minor=`echo $pythonvers | cut -d'.' -f2`

if test "$pythonvers_major" -gt "2" || \
(test "$pythonvers_major" -eq "2" && \
test "$pythonvers_minor" -ge "5") ; then
test "$pythonvers_minor" -ge "7") ; then
result yes
else
result "no"
result "`basename $0`: Python >= 2.5 MUST be installed"
result "`basename $0`: Python >= 2.7 MUST be installed"
result "See http://root.cern.ch/drupal/content/build-prerequisites"
exit 1
fi
Expand Down
21 changes: 15 additions & 6 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/include/RGitCommit.h
COMMENT ""
DEPENDS ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
COMMAND ${CMAKE_SOURCE_DIR}/build/unix/gitinfo.sh ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_SOURCE_DIR}/build/unix/githeader.sh RGitCommit.h.tmp
COMMENT "Recording the git revision now"
DEPENDS ${dep_objects}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
if(WIN32)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
COMMAND ${CMAKE_SOURCE_DIR}/build/win/gitinfo.bat ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_SOURCE_DIR}/build/win/githeader.bat RGitCommit.h.tmp
COMMENT "Recording the git revision now"
DEPENDS ${dep_objects}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
else()
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp
COMMAND ${CMAKE_SOURCE_DIR}/build/unix/gitinfo.sh ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_SOURCE_DIR}/build/unix/githeader.sh RGitCommit.h.tmp
COMMENT "Recording the git revision now"
DEPENDS ${dep_objects}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
add_custom_target(gitcommit ALL DEPENDS ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp)
set_source_files_properties(${CMAKE_BINARY_DIR}/RGitCommit.h.tmp PROPERTIES GENERATED TRUE)
add_dependencies(gitcommit ${dep_targets})
Expand Down
1 change: 1 addition & 0 deletions core/base/inc/RConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
# define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
# define R__PLACEMENTDELETE /* supports overloading placement delete */
# define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
# define R__NULLPTR
# if _MSC_VER >= 1400
# define DONTNEED_VSNPRINTF
# endif
Expand Down
8 changes: 8 additions & 0 deletions core/base/inc/Rtypeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ using std::type_info;

#include <typeinfo>

#elif defined(R__WIN32)

// only has ::type_info without _HAS_EXCEPTIONS!
#include <typeinfo>
#if ! _HAS_EXCEPTIONS
namespace std { using ::type_info; }
#endif

#else

#include <typeinfo>
Expand Down
8 changes: 5 additions & 3 deletions core/base/inc/TROOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ friend TROOT *ROOT::GetROOT2();
TROOT& operator=(const TROOT&); //Not implemented

protected:
typedef std::atomic<TListOfEnums*> AListOfEnums_t;

TString fConfigOptions; //ROOT ./configure set build options
TString fConfigFeatures; //ROOT ./configure detected build features
TString fVersion; //ROOT version (from CMZ VERSQQ) ex 0.05/01
Expand All @@ -98,7 +100,7 @@ friend TROOT *ROOT::GetROOT2();
TString fGitBranch; //Git branch
TString fGitDate; //Date and time when make was run
Int_t fTimer; //Timer flag
std::atomic<TApplication*> fApplication; //Pointer to current application
std::atomic<TApplication*> fApplication; //Pointer to current application
TInterpreter *fInterpreter; //Command interpreter
Bool_t fBatch; //True if session without graphics
Bool_t fEditHistograms; //True if histograms can be edited with the mouse
Expand Down Expand Up @@ -137,7 +139,7 @@ friend TROOT *ROOT::GetROOT2();
TSeqCollection *fProofs; //List of proof sessions
TSeqCollection *fClipboard; //List of clipbard objects
TSeqCollection *fDataSets; //List of data sets (TDSet or TChain)
TCollection *fEnums; //List of enum types
AListOfEnums_t fEnums; //List of enum types
TProcessUUID *fUUIDs; //Pointer to TProcessID managing TUUIDs
TFolder *fRootFolder; //top level folder //root
TList *fBrowsables; //List of browsables
Expand Down Expand Up @@ -227,7 +229,7 @@ friend TROOT *ROOT::GetROOT2();
TSeqCollection *GetListOfProofs() const { return fProofs; }
TSeqCollection *GetClipboard() const { return fClipboard; }
TSeqCollection *GetListOfDataSets() const { return fDataSets; }
TCollection *GetListOfEnums();
TCollection *GetListOfEnums(Bool_t load = kFALSE);
TCollection *GetListOfFunctionTemplates();
TList *GetListOfBrowsables() const { return fBrowsables; }
TDataType *GetType(const char *name, Bool_t load = kFALSE) const;
Expand Down
7 changes: 7 additions & 0 deletions core/base/inc/TTimeStamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@

#include <ctime>

#ifdef R__WIN32
struct timespec {
time_t tv_sec; // seconds
long tv_nsec; // nanoseconds
};
#endif

// For backward compatibility
typedef struct timespec timespec_t;
typedef struct tm tm_t;
Expand Down
7 changes: 5 additions & 2 deletions core/base/inc/TVirtualMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TLockGuard {
public:
TLockGuard(TVirtualMutex *mutex)
: fMutex(mutex) { if (fMutex) fMutex->Lock(); }
Int_t UnLock() {
Int_t UnLock() {
if (!fMutex) return 0;
auto tmp = fMutex;
fMutex = 0;
Expand All @@ -90,8 +90,8 @@ class TLockGuard {

// Zero overhead macros in case not compiled with thread support
#if defined (_REENTRANT) || defined (WIN32)

#define R__LOCKGUARD(mutex) TLockGuard _R__UNIQUE_(R__guard)(mutex)
#define R__LOCKGUARD_NAMED(name,mutex) TLockGuard name(mutex)
#define R__LOCKGUARD2(mutex) \
if (gGlobalMutex && !mutex) { \
gGlobalMutex->Lock(); \
Expand All @@ -100,10 +100,13 @@ class TLockGuard {
gGlobalMutex->UnLock(); \
} \
R__LOCKGUARD(mutex)
#define R__LOCKGUARD_NAMED(name,mutex) TLockGuard _NAME2_(R__guard,name)(mutex)
#define R__LOCKGUARD_UNLOCK(name) _NAME2_(R__guard,name).UnLock()
#else
#define R__LOCKGUARD(mutex) if (mutex) { }
#define R__LOCKGUARD_NAMED(name,mutex) if (mutex) { }
#define R__LOCKGUARD2(mutex) if (mutex) { }
#define R__LOCKGUARD_UNLOCK(name) { }
#endif

#endif
4 changes: 3 additions & 1 deletion core/base/inc/Windows4Root.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@

#ifndef __CINT__

#ifdef __CLING__
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>


#undef OpenSemaphore

#undef RemoveDirectory
Expand Down
7 changes: 7 additions & 0 deletions core/base/src/TListOfTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ static bool NameExistsElsewhere(const char* name){
// We have a scope
const auto enName = lastPos + 1;
const auto scopeNameSize = ((Long64_t)lastPos - (Long64_t)name) / sizeof(decltype(*lastPos)) - 1;
#ifdef R__WIN32
char *scopeName = new char[scopeNameSize + 1];
#else
char scopeName[scopeNameSize + 1]; // on the stack, +1 for the terminating character '\0'
#endif
strncpy(scopeName, name, scopeNameSize);
scopeName[scopeNameSize] = '\0';
// We have now an enum name and a scope name
Expand All @@ -82,6 +86,9 @@ static bool NameExistsElsewhere(const char* name){
theEnum = listOfEnums->THashList::FindObject(enName);
}
}
#ifdef R__WIN32
delete [] scopeName;
#endif
} else { // Here we look in the global scope
theEnum = ((TListOfEnums*)gROOT->GetListOfEnums())->THashList::FindObject(name);
}
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TPluginManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ TPluginHandler::TPluginHandler(const char *base, const char *regexp,
if (validMacro && gROOT->LoadMacro(fPlugin, 0, kTRUE) == 0)
fIsMacro = kTRUE;

if (fCtor.Contains("::")) {
if (fCtor.BeginsWith("::")) {
fIsGlobal = kTRUE;
fCtor = fCtor.Strip(TString::kLeading, ':');
}
Expand Down
Loading

0 comments on commit 021b077

Please sign in to comment.