Skip to content
Commits on Source (42)
......@@ -237,6 +237,8 @@ function( atlas_add_test testName )
endif()
set( POST_EXEC_SCRIPT "if type post.sh >/dev/null 2>&1; then
post.sh ${testName} ${PARAMS}
else
exit $testStatus
fi" )
endif()
......
......@@ -275,11 +275,11 @@ function( lcg_setup_release lcgReleaseDir )
# Construct the file name to load:
set( _file ${lcgReleaseDir}/LCG_${_component}_${LCG_PLATFORM}.txt )
if( NOT EXISTS ${_file} )
message( SEND_ERROR
message( WARNING
"LCG component \"${_component}\" not available for platform: "
"${LCG_PLATFORM}" )
set( LCG_FOUND FALSE CACHE BOOL
"Flag showing whether LCG was found or not" FORCE )
"Flag showing whether LCG was found or not" FORCE )
continue()
endif()
......
......@@ -17,7 +17,7 @@ include( LCGFunctions )
# Declare the external module:
lcg_external_module( NAME Davix
INCLUDE_SUFFIXES include/davix INCLUDE_NAMES davix.hpp
LIBRARY_SUFFIXES lib64
LIBRARY_SUFFIXES lib lib32 lib64
COMPULSORY_COMPONENTS davix )
# Handle the standard find_package arguments:
......
......@@ -45,7 +45,7 @@ ExternalProject_Add( Acts
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
STAMP_DIR ${_stampDir}
GIT_REPOSITORY https://gitlab.cern.ch/acts/acts-core.git
GIT_TAG "v0.12.01"
GIT_TAG "v0.18.00"
${_patchCommand}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
......@@ -54,6 +54,9 @@ ExternalProject_Add( Acts
-DEIGEN_INCLUDE_DIR_HINTS:PATH=${EIGEN_INCLUDE_DIR}
-DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENTIONS}
-DACTS_BUILD_JSON_PLUGIN:BOOL=ON
-DACTS_USE_BUNDLED_NLOHMANN_JSON:BOOL=OFF # do not build separately
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
${_extraOptions}
LOG_CONFIGURE 1 )
ExternalProject_Add_Step( Acts cleansource
......@@ -83,6 +86,7 @@ ExternalProject_Add_Step( Acts buildinstall
COMMENT "Installing Acts into the build area"
DEPENDEES install )
add_dependencies( Package_Acts Acts )
add_dependencies ( Acts nlohmann_json ) # Make sure nlohmann::json is built before this
# And now install it:
install( DIRECTORY ${_buildDir}/
......
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
/**
* @file CxxUtils/checker_macros.h
* @author scott snyder <snyder@bnl.gov>
......@@ -88,7 +87,7 @@
* class ATLAS_CHECK_THREAD_SAFETY C { ... }
@endcode
*/
#define ATLAS_CHECK_THREAD_SAFETY [[gnu::check_thread_safety]]
#define ATLAS_CHECK_THREAD_SAFETY [[ATLAS::check_thread_safety]]
/**
......@@ -113,7 +112,7 @@
* int* yy ATLAS_THREAD_SAFE = const_cast<int*> (y);
@endcode
*/
#define ATLAS_THREAD_SAFE [[gnu::thread_safe]]
#define ATLAS_THREAD_SAFE [[ATLAS::thread_safe]]
/**
......@@ -129,7 +128,25 @@
* A function calling an ATLAS_NOT_THREAD_SAFE function must also be marked
* ATLAS_NOT_THREAD_SAFE.
*/
#define ATLAS_NOT_THREAD_SAFE [[gnu::not_thread_safe]]
#define ATLAS_NOT_THREAD_SAFE [[ATLAS::not_thread_safe]]
/**
* @brief Mark that a constructor or destructor is not thread-safe.
*
* Usage:
*
* Add after the declaration of a constructor or destructor to mark
* it as not-thread-safe.
*
* A function calling a function marked as not thread-safe must also be marked
* as not thread-safe.
*/
// This should in principle be the same as ATLAS_NOT_THREAD_SAFE;
// however, in gcc versions prior to 10, we can't use a c++11-style attribute
// with a constructor or destructor. So we work around in this way.
#define ATLAS_CTORDTOR_NOT_THREAD_SAFE __attribute__ ((ATLAS_not_thread_safe))
/**
......@@ -145,7 +162,7 @@
* A function passing a const static object to a function declared
* ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE should be declared ATLAS_NOT_REENTRANT.
*/
#define ATLAS_NOT_REENTRANT [[gnu::not_reentrant]]
#define ATLAS_NOT_REENTRANT [[ATLAS::not_reentrant]]
/**
......@@ -163,7 +180,7 @@
* A const member function calling an ATLAS_NOT_CONST_THREAD_SAFE member
* function on the same object must also be marked ATLAS_NOT_CONST_THREAD_SAFE.
*/
#define ATLAS_NOT_CONST_THREAD_SAFE [[gnu::not_const_thread_safe]]
#define ATLAS_NOT_CONST_THREAD_SAFE [[ATLAS::not_const_thread_safe]]
/**
......@@ -185,7 +202,7 @@
* ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE function must also be marked
* ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE.
*/
#define ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE [[gnu::argument_not_const_thread_safe]]
#define ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE [[ATLAS::argument_not_const_thread_safe]]
#else // not ATLAS_GCC_CHECKERS
......@@ -196,6 +213,7 @@
#define ATLAS_CHECK_THREAD_SAFETY
#define ATLAS_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
#define ATLAS_CTORDTOR_NOT_THREAD_SAFE
#define ATLAS_NOT_REENTRANT
#define ATLAS_NOT_CONST_THREAD_SAFE
#define ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
......
......@@ -855,8 +855,10 @@ x.cc:7:16: note: Overridden function declared here:
^~
```
As an exception, `Algorithm::start()` and `Algorithm::stop()` may be
overridden with an `ATLAS_NOT_THREAD_SAFE` attribute.
As an exception, the `initialize()' and `finalize()' methods
of algorithms, services, and tools, and the `start()' and `stop()'
methods of algorithms may be overridden
with an `ATLAS_NOT_THREAD_SAFE` attribute.
* If a threading attribute is present on a function's definition,
......@@ -1030,6 +1032,17 @@ int* f ATLAS_NOT_THREAD_SAFE (const* x)
```
#### `ATLAS_CTORDTOR_NOT_THREAD_SAFE`
Similar to `ATLAS_NOT_THREAD_SAFE', but for use with constructors
and destructors. This should come _after_ the argument list, not before.
```
Foo::Foo (int x) ATLAS_NOT_THREAD_SAFE
{
```
#### `ATLAS_NOT_REENTRANT`
Mark that a function uses static data in a non-thread-safe manner.
......
......@@ -25,12 +25,30 @@
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:18:16: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
virtual void f3 [[ATLAS::not_const_thread_safe]] ();
^~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:33:15: warning: 'virtual' function 'virtual int T::foo()' within class 'struct T' has attribute 'not_thread_safe', but overrides 'virtual int Gaudi::Algorithm::foo()' which does not
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:48:15: warning: 'virtual' function 'virtual int TestAlg::foo()' within class 'struct TestAlg' has attribute 'not_thread_safe', but overrides 'virtual int Gaudi::Algorithm::foo()' which does not
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:25:15: note: Overridden function declared here:
virtual int foo();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:33:15: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:48:15: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:56:15: warning: 'virtual' function 'virtual int TestService::foo()' within class 'struct TestService' has attribute 'not_thread_safe', but overrides 'virtual int Service::foo()' which does not
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:31:15: note: Overridden function declared here:
virtual int foo();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:56:15: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:64:15: warning: 'virtual' function 'virtual int TestAlgTool::foo()' within class 'struct TestAlgTool' has attribute 'not_thread_safe', but overrides 'virtual int AlgTool::foo()' which does not
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:36:15: note: Overridden function declared here:
virtual int foo();
^~~
/home/sss/atlas/rootaccess/../test/thread16_test.cxx:64:15: note: See <https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins#thread_plugin>.
virtual int foo [[ATLAS::not_thread_safe]]();
^~~
......@@ -16,7 +16,7 @@
* If a decl has the attribute check_thread_safety_debug, then a diagnostic
* will be printed saying if that decl has thread-safety checking enabled.
*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
......@@ -223,11 +223,21 @@ bool check_thread_safety_p (tree decl)
attribs = TYPE_ATTRIBUTES (TREE_TYPE (decl));
}
// A similar deal for constructors and destructors.
else if (attribs == NULL_TREE && (DECL_CXX_DESTRUCTOR_P (decl) ||
DECL_CXX_CONSTRUCTOR_P (decl)))
{
attribs = TYPE_ATTRIBUTES (TREE_TYPE (decl));
}
// Check if attributes are present directly.
if (lookup_attribute ("not_thread_safe", attribs))
return false;
if (lookup_attribute ("check_thread_safety", attribs))
return true;
// Workaround for gcc versions prior to 10.
if (lookup_attribute ("ATLAS_not_thread_safe", attribs))
return false;
// If it's a function or class, check the containing function or class.
if (TREE_CODE (decl) == FUNCTION_DECL ||
......
......@@ -4,7 +4,7 @@
* @date Aug, 2014
* @brief Framework for running checker plugins in gcc.
*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
......@@ -177,6 +177,11 @@ attribute_spec attribs[] =
ATTRIB("check_thread_safety_debug"),
ATTRIB(nullptr),
};
// For gcc versions prior to 10, we cannot attach a c++11-style attribute
// to a constructor or destructor. Work around by adding a
// non-scoped synonym that we can use with the __attribute__ syntax.
static attribute_spec ants_attrib ATTRIB("ATLAS_not_thread_safe");
#undef ATTRIB
......@@ -189,6 +194,7 @@ register_checker_attributes (void* /*event_data*/, void* /*data*/)
// This was fixed in gcc7.
register_scoped_attributes (attribs, "gnu");
register_scoped_attributes (attribs, "ATLAS");
register_attribute (&ants_attrib);
}
......
......@@ -232,6 +232,10 @@ Attributes_t get_attributes (tree t)
mask |= (1 << i);
}
}
// Workaround for gcc versions prior to 10.
if (lookup_attribute ("ATLAS_not_thread_safe", attrlist)) {
mask |= (1 << ATTR_NOT_THREAD_SAFE);
}
}
return mask;
}
......@@ -1580,8 +1584,9 @@ void find_overridden_functions (tree type,
{
tree basetype = BINFO_TYPE (base_binfo);
if (TYPE_POLYMORPHIC_P (basetype))
if (TYPE_POLYMORPHIC_P (basetype)) {
find_overridden_functions_r (basetype, fndecl, basedecls);
}
}
}
......@@ -1643,7 +1648,14 @@ void check_virtual_overrides (tree type)
for (tree basedecl : basedecls) {
std::string fnname = decl_as_string (basedecl, TFF_SCOPE + TFF_NO_FUNCTION_ARGUMENTS);
if (fnname != "Gaudi::Algorithm::stop" &&
fnname != "Gaudi::Algorithm::start")
fnname != "Gaudi::Algorithm::start" &&
fnname != "Gaudi::Algorithm::initialize" &&
fnname != "Service::initialize" &&
fnname != "AlgTool::initialize" &&
fnname != "IAlgTool::initialize" &&
fnname != "Gaudi::Algorithm::finalize" &&
fnname != "Service::finalize" &&
fnname != "AlgTool::finalize")
{
check_attrib_match (type, meth, basedecl, "not_thread_safe");
}
......@@ -1651,7 +1663,13 @@ void check_virtual_overrides (tree type)
check_attrib_match (type, meth, basedecl, "not_reentrant");
check_attrib_match (type, meth, basedecl, "thread_safe");
check_attrib_match (type, meth, basedecl, "argument_not_const_thread_safe");
check_attrib_match (type, meth, basedecl, "not_const_thread_safe");
// Skip checking for Gaudi types that we don't want to change.
if (fnname != "IRegistry::object" &&
fnname != "IMessageSvc::defaultStream")
{
check_attrib_match (type, meth, basedecl, "not_const_thread_safe");
}
}
}
}
......
......@@ -23,12 +23,45 @@ class Algorithm {
virtual int start();
virtual int stop();
virtual int foo();
virtual int initialize();
virtual int finalize();
};
}
class Service {
virtual int foo();
virtual int initialize();
virtual int finalize();
};
class AlgTool {
virtual int foo();
virtual int initialize();
virtual int finalize();
};
class AthService: public Service {};
class AthAlgTool: public AlgTool {};
struct T : public Gaudi::Algorithm
struct TestAlg : public Gaudi::Algorithm
{
virtual int start [[ATLAS::not_thread_safe]]();
virtual int stop [[ATLAS::not_thread_safe]]();
virtual int foo [[ATLAS::not_thread_safe]]();
virtual int initialize [[ATLAS::not_thread_safe]]();
virtual int finalize [[ATLAS::not_thread_safe]]();
};
struct TestService : public AthService
{
virtual int foo [[ATLAS::not_thread_safe]]();
virtual int initialize [[ATLAS::not_thread_safe]]();
virtual int finalize [[ATLAS::not_thread_safe]]();
};
struct TestAlgTool : public AthAlgTool
{
virtual int foo [[ATLAS::not_thread_safe]]();
virtual int initialize [[ATLAS::not_thread_safe]]();
virtual int finalize [[ATLAS::not_thread_safe]]();
};
......@@ -7,6 +7,8 @@
class KitManager {
public:
static void instance [[ATLAS::not_thread_safe]] ();
KitManager() __attribute__((ATLAS_not_thread_safe));
~KitManager() __attribute__((ATLAS_not_thread_safe));
};
......@@ -16,3 +18,17 @@ namespace {
return true;
} ) ();
}
KitManager::KitManager()
{
instance();
}
KitManager::~KitManager()
{
instance();
}
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Package building GeoModelCore Kernel for ATLAS.
#
......@@ -39,22 +39,29 @@ set( _buildDir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/GeoModelCoreB
# Set up the build of GeoModelCore:
ExternalProject_Add( GeoModelCore
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
GIT_REPOSITORY https://gitlab.cern.ch/GeoModelDev/GeoModelCore.git
GIT_TAG 2.0.0
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_PREFIX:PATH=${_buildDir}
-DEIGEN3_INCLUDE_DIR:PATH=${EIGEN_INCLUDE_DIRS}
${_extraOptions}
LOG_CONFIGURE 1
)
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
GIT_REPOSITORY https://gitlab.cern.ch/GeoModelDev/GeoModelCore.git
GIT_TAG 3.1.1
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_PREFIX:PATH=${_buildDir}
-DEIGEN3_INCLUDE_DIR:PATH=${EIGEN_INCLUDE_DIRS}
${_extraOptions}
LOG_CONFIGURE 1
)
ExternalProject_Add_Step( GeoModelCore buildinstall
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR>
COMMENT "Installing GeoModelCore into the build area"
DEPENDEES install )
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR>
COMMENT "Installing GeoModelCore into the build area"
DEPENDEES install )
ExternalProject_Add_Step( GeoModelCore purgebuild
COMMAND ${CMAKE_COMMAND} -E echo "Removing previous build results for GeoModelCore"
COMMAND ${CMAKE_COMMAND} -E remove_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E make_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${_buildDir}"
DEPENDEES download
DEPENDERS patch )
add_dependencies( Package_GeoModelCore GeoModelCore )
if( ATLAS_BUILD_EIGEN )
add_dependencies ( GeoModelCore Eigen )
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Package building GeoModelIO Kernel for ATLAS.
#
......@@ -40,22 +40,30 @@ set( _prefixPaths ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
# Set up the build of GeoModelIO:
ExternalProject_Add( GeoModelIO
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
GIT_REPOSITORY https://gitlab.cern.ch/GeoModelDev/GeoModelIO.git
GIT_TAG 2.0.1
CMAKE_CACHE_ARGS
-DCMAKE_PREFIX_PATH:PATH=${_prefixPaths}
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_PREFIX:PATH=${_buildDir}
${_extraOptions}
LOG_CONFIGURE 1
)
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
GIT_REPOSITORY https://gitlab.cern.ch/GeoModelDev/GeoModelIO.git
GIT_TAG 3.1.1
CMAKE_CACHE_ARGS
-DCMAKE_PREFIX_PATH:PATH=${_prefixPaths}
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_PREFIX:PATH=${_buildDir}
${_extraOptions}
LOG_CONFIGURE 1
)
ExternalProject_Add_Step( GeoModelIO buildinstall
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR>
COMMENT "Installing GeoModelIO into the build area"
DEPENDEES install )
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR>
COMMENT "Installing GeoModelIO into the build area"
DEPENDEES install )
ExternalProject_Add_Step( GeoModelIO purgebuild
COMMAND ${CMAKE_COMMAND} -E echo "Removing previous build results for GeoModelIO"
COMMAND ${CMAKE_COMMAND} -E remove_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E make_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${_buildDir}"
DEPENDEES download
DEPENDERS patch )
add_dependencies( GeoModelIO GeoModelCore )
add_dependencies( Package_GeoModelIO GeoModelIO )
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Package building GeoModelTools Kernel for ATLAS.
#
# Set a minimum required CMake version to use.
cmake_minimum_required( VERSION 3.7 )
# Make sure that all _ROOT variables *are* used when they are set.
if( POLICY CMP0074 )
cmake_policy( SET CMP0074 NEW )
endif()
# The name of the package:
atlas_subdir( GeoModelTools )
# In release recompilation mode finish here:
if( ATLAS_RELEASE_MODE )
return()
endif()
# External dependencies.
find_package( Qt5 COMPONENTS Core Sql REQUIRED ) # FIXME: the Qt5 is instroduced by GeoModelIO, it should be not.
# Directory for the temporary build results:
set( _buildDir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/GeoModelToolsBuild )
# Extra configuration parameters.
set( _extraOptions )
if( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "" )
list( APPEND _extraOptions -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} )
endif()
if( "${CMAKE_CXX_STANDARD}" GREATER_EQUAL 11 )
list( APPEND _extraOptions -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} )
endif()
# List of paths given to CMAKE_PREFIX_PATH.
set( _prefixPaths ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
$ENV{CMAKE_PREFIX_PATH} ${QT5_LCGROOT} )
if( ( NOT ATLAS_BUILD_EIGEN ) AND EIGEN_LCGROOT )
find_package( Eigen )
list( APPEND _prefixPaths ${EIGEN_LCGROOT} )
endif()
if( ( NOT ATLAS_BUILD_XERCESC ) AND XERCESC_LCGROOT )
find_package( XercesC )
list( APPEND _prefixPaths ${XERCESC_LCGROOT} )
endif()
# Set up the build of GeoModelTools:
ExternalProject_Add( GeoModelTools
PREFIX ${CMAKE_BINARY_DIR}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
GIT_REPOSITORY https://gitlab.cern.ch/GeoModelDev/GeoModelTools.git
GIT_TAG 3.1.2
CMAKE_CACHE_ARGS
-DCMAKE_PREFIX_PATH:PATH=${_prefixPaths}
-DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_PREFIX:PATH=${_buildDir}
${_extraOptions}
LOG_CONFIGURE 1
)
ExternalProject_Add_Step( GeoModelTools buildinstall
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR>
COMMENT "Installing GeoModelTools into the build area"
DEPENDEES install )
ExternalProject_Add_Step( GeoModelTools purgebuild
COMMAND ${CMAKE_COMMAND} -E echo "Removing previous build results for GeoModelTools"
COMMAND ${CMAKE_COMMAND} -E remove_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E make_directory "<BINARY_DIR>"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${_buildDir}"
DEPENDEES download
DEPENDERS patch )
add_dependencies( GeoModelTools GeoModelCore GeoModelIO nlohmann_json )
if( ATLAS_BUILD_EIGEN )
add_dependencies( GeoModelTools Eigen )
endif()
if( ATLAS_BUILD_XERCESC )
add_dependencies( GeoModelTools XercesC )
endif()
add_dependencies( Package_GeoModelTools GeoModelTools )
# Install GeoModelTools:
install( DIRECTORY ${_buildDir}/
DESTINATION . USE_SOURCE_PERMISSIONS OPTIONAL )
# Install its find-module:
install( FILES cmake/FindGeoModelTools.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/modules )
GeoModel Tools Library
======================
This package builds the GeoModel Tools library for the offline software of ATLAS.
The library's sources are taken from https://gitlab.cern.ch/GeoModelDev/GeoModelTools
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Locate the GeoModelTools external package.
#
# Defines:
# GEOMODELTOOLS_FOUND
# GEOMODELTOOLS_INCLUDE_DIR
# GEOMODELTOOLS_INCLUDE_DIRS
# GEOMODELTOOLS_<component>_FOUND
# GEOMODELTOOLS_<component>_LIBRARY
# GEOMODELTOOLS_LIBRARIES
# GEOMODELTOOLS_LIBRARY_DIRS
#
# The user can set GEOMODELTOOLS_ATROOT to guide the script.
#
# Include the helper code:
include( AtlasInternals )
# Declare the module:
atlas_external_module( NAME GeoModelTools
INCLUDE_SUFFIXES include
INCLUDE_NAMES XMLParser/XMLHandler.h
ExpressionEvaluator/ExpressionEvaluator.h
LIBRARY_SUFFIXES lib
DEFAULT_COMPONENTS ExpressionEvaluator GMCAT JSONParser XMLParser )
# Handle the standard find_package arguments:
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( GeoModelTools DEFAULT_MSG GEOMODELTOOLS_INCLUDE_DIR
GEOMODELTOOLS_INCLUDE_DIRS GEOMODELTOOLS_LIBRARIES )
mark_as_advanced( GEOMODELTOOLS_FOUND GEOMODELTOOLS_INCLUDE_DIR GEOMODELTOOLS_INCLUDE_DIRS
GEOMODELTOOLS_LIBRARIES GEOMODELTOOLS_LIBRARY_DIRS )
......@@ -23,10 +23,9 @@ endif()
# ...and Python:
if( ATLAS_BUILD_PYTHON )
list( APPEND extra_flags "PYTHON=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python" )
set( Python_EXECUTABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/python )
else()
find_package( Python COMPONENTS Interpreter Development REQUIRED )
list( APPEND extra_flags "PYTHON=${Python_EXECUTABLE}" )
endif()
# The source code of Lhapdf:
......@@ -37,16 +36,35 @@ set( _lhapdfMd5 "9e05567d538fdb4862d4781cd076d7db" )
# Temporary directory for the build results:
set( _buildDir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LhapdfBuild )
# Get the OS name.
atlas_os_id( _os _isValid )
# Extra environment options for the configuration.
set( _cflags )
set( _ldflags )
if( _isValid AND "${_os}" STREQUAL "mac1015" )
list( APPEND _cflags -isysroot ${CMAKE_OSX_SYSROOT}
-I${CMAKE_OSX_SYSROOT}/usr/include )
list( APPEND _ldflags -isysroot ${CMAKE_OSX_SYSROOT} )
endif()
# Massage the options to make them usable in the configuration script.
string( REPLACE ";" " " _cflags "${_cflags}" )
string( REPLACE ";" " " _ldflags "${_ldflags}" )
# Create the helper script(s).
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure.sh.in
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/configure.sh
@ONLY )
# Set up the build of LHAPDF:
ExternalProject_Add( Lhapdf
PREFIX ${CMAKE_BINARY_DIR}
URL ${_lhapdfSource}
URL_MD5 ${_lhapdfMd5}
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env
CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
<SOURCE_DIR>/configure
--prefix=${_buildDir} --disable-static ${extra_flags}
CONFIGURE_COMMAND
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/configure.sh
BUILD_IN_SOURCE 1
INSTALL_COMMAND make install
COMMAND ${CMAKE_COMMAND} -E copy_directory
......
#!/bin/bash
#
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
#
# Script configuring the build of LHAPDF.
#
# Set up the compiler.
export CC=@CMAKE_C_COMPILER@
export CXX=@CMAKE_CXX_COMPILER@
# Set up the compiler and linker flags to use.
export CFLAGS="@_cflags@"
export CXXFLAGS="@_cflags@"
export LDFLAGS="@_ldflags@"
export PYTHON=@Python_EXECUTABLE@
# Configure the build.
@CMAKE_BINARY_DIR@/src/Lhapdf/configure --prefix=@_buildDir@ --disable-static \
@extra_flags@
......@@ -27,16 +27,40 @@ set( _md5 "f1a2ace631068444831d01485466ece0" )
# Temporary directory for the build results:
set( _buildDir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PythonBuild )
# Extra environment options for the build:
set( _extraEnv
CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} )
# Get the OS name.
atlas_os_id( _os _isValid )
# Extra environment options for the configuration.
set( _compilerSetup )
set( _cflags )
set( _ldflags )
if( NOT APPLE )
list( APPEND _extraEnv LDFLAGS=-Wl,-rpath,'$$ORIGIN/../lib' )
set( _compilerSetup "export CC=${CMAKE_C_COMPILER}\n" )
set( _compilerSetup "${_compilerSetup}export CXX=${CMAKE_CXX_COMPILER}" )
list( APPEND _ldflags -Wl,-rpath,'\\$\\$ORIGIN/../lib' )
endif()
if( _isValid AND "${_os}" STREQUAL "mac1015" )
list( APPEND _cflags -isysroot ${CMAKE_OSX_SYSROOT}
-I${CMAKE_OSX_SYSROOT}/usr/include )
list( APPEND _ldflags -isysroot ${CMAKE_OSX_SYSROOT} )
endif()
# Create the script that will sanitize python-config after the build:
# Extra configuration parameters for the build.
set( _extraArgs )
if( _isValid AND "${_os}" STREQUAL "mac1015" )
list( APPEND _extraArgs --without-gcc )
endif()
# Massage the options to make them usable in the configuration script.
string( REPLACE ";" " " _cflags "${_cflags}" )
string( REPLACE ";" " " _ldflags "${_ldflags}" )
string( REPLACE ";" " " _extraArgs "${_extraArgs}" )
# Create the scripts used in the build.
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sanitizeConfig.sh.in
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/sanitizeConfig.sh @ONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure.sh.in
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/configure.sh @ONLY )
# Set up the build of Python in the build directory:
ExternalProject_Add( Python
......@@ -44,9 +68,8 @@ ExternalProject_Add( Python
INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
URL ${_source}
URL_MD5 ${_md5}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${_extraEnv}
<SOURCE_DIR>/configure --prefix=${_buildDir} --enable-shared
--enable-unicode=ucs4 --enable-ipv6
CONFIGURE_COMMAND
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/configure.sh
INSTALL_COMMAND make install
COMMAND ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/sanitizeConfig.sh
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir}/ <INSTALL_DIR> )
......@@ -70,4 +93,7 @@ install( DIRECTORY ${_buildDir}/
unset( _source )
unset( _md5 )
unset( _buildDir )
unset( _extraEnv )
unset( _compilerSetup )
unset( _cflags )
unset( _ldflags )
unset( _extraArgs )