From 55628355a5e0a77440ecbfb4f24ba08c8dfa17b1 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:14:58 +0200 Subject: [PATCH 01/19] Fix insufficiencies in the cmake dependency search compared to configure - Build RFIO using dpm libraries if castor libraries are not available - Add additional include and library search paths - Add missing glib header path in GFAL module - Search also for globus libraries wouthout the flavour in the name - Add missing io/hdfs/CMakeLists.txt - net/globusauth has no installed headers - remove ROOT_INSTALL_HEADERS() --- cmake/modules/FindDPM.cmake | 23 +++++++++++++++++++++ cmake/modules/FindGFAL.cmake | 11 ++++++---- cmake/modules/FindGlobus.cmake | 4 ++-- cmake/modules/FindOCC.cmake | 2 +- cmake/modules/FindPCRE.cmake | 4 ++-- cmake/modules/Findhdfs.cmake | 2 +- cmake/modules/SearchInstalledSoftware.cmake | 18 ++++++++++++++-- io/hdfs/CMakeLists.txt | 10 +++++++++ io/rfio/CMakeLists.txt | 10 +++++++-- net/globusauth/CMakeLists.txt | 1 - 10 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 cmake/modules/FindDPM.cmake create mode 100644 io/hdfs/CMakeLists.txt diff --git a/cmake/modules/FindDPM.cmake b/cmake/modules/FindDPM.cmake new file mode 100644 index 0000000000000..41b9c5dd6cbb2 --- /dev/null +++ b/cmake/modules/FindDPM.cmake @@ -0,0 +1,23 @@ +# - Locate dpm library +# Defines: +# +# DPM_FOUND +# DPM_INCLUDE_DIR +# DPM_INCLUDE_DIRS (not cached) +# DPM_LIBRARIES + +set(DPM_FOUND FALSE) + +find_path(DPM_INCLUDE_DIR NAMES dpm_api.h HINTS ${DPM_DIR}/include $ENV{DPM_DIR}/include /usr/include PATH_SUFFIXES dpm) +find_library(DPM_dpm_LIBRARY NAMES dpm HINTS ${DPM_DIR}/lib $ENV{DPM_DIR}/lib) +find_library(DPM_lcgdm_LIBRARY NAMES lcgdm HINTS ${DPM_DIR}/lib $ENV{DPM_DIR}/lib) + +set(DPM_INCLUDE_DIRS ${DPM_INCLUDE_DIR}) +set(DPM_LIBRARIES ${DPM_dpm_LIBRARY} ${DPM_lcgdm_LIBRARY}) + +if (DPM_INCLUDE_DIR AND DPM_dpm_LIBRARY AND DPM_lcgdm_LIBRARY) + set(DPM_FOUND TRUE) + message(STATUS "Found DPM at: ${DPM_LIBRARIES}") +endif() + +mark_as_advanced(DPM_FOUND DPM_INCLUDE_DIR DPM_dpm_LIBRARY DPM_lcgdm_LIBRARY) diff --git a/cmake/modules/FindGFAL.cmake b/cmake/modules/FindGFAL.cmake index 277d74b80c70d..11efbd958e04c 100644 --- a/cmake/modules/FindGFAL.cmake +++ b/cmake/modules/FindGFAL.cmake @@ -6,15 +6,18 @@ # GFAL_INCLUDE_DIRS (not cached) # GFAL_LIBRARIES -find_path(GFAL_INCLUDE_DIR NAMES gfal_api.h HINTS ${GFAL_DIR}/include $ENV{GFAL_DIR}/include) +find_path(GFAL_INCLUDE_DIR NAMES gfal_api.h HINTS ${GFAL_DIR}/include $ENV{GFAL_DIR}/include /usr/include/gfal2 /usr/include) find_library(GFAL_LIBRARIES NAMES gfal gfal2 HINTS ${GFAL_DIR}/lib $ENV{GFAL_DIR}/lib) -find_path(SRM_IFCE_INCLUDE_DIR gfal_srm_ifce_types.h HINTS ${SRM_IFCE_DIR}/include $ENV{SRM_IFCE_DIR}/include) +find_path(SRM_IFCE_INCLUDE_DIR gfal_srm_ifce_types.h HINTS ${SRM_IFCE_DIR}/include $ENV{SRM_IFCE_DIR}/include /usr/include) -set(GFAL_INCLUDE_DIRS ${GFAL_INCLUDE_DIR} ${SRM_IFCE_INCLUDE_DIR}) +find_package(PkgConfig) +pkg_check_modules (GLIB2 glib-2.0) + +set(GFAL_INCLUDE_DIRS ${GFAL_INCLUDE_DIR} ${SRM_IFCE_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS}) # handle the QUIETLY and REQUIRED arguments and set GFAL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFAL DEFAULT_MSG GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARIES) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFAL DEFAULT_MSG GFAL_LIBRARIES GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GLIB2_INCLUDE_DIRS) mark_as_advanced(GFAL_FOUND GFAL_INCLUDE_DIR GFAL_LIBRARIES SRM_IFCE_INCLUDE_DIR) diff --git a/cmake/modules/FindGlobus.cmake b/cmake/modules/FindGlobus.cmake index c1013e069d399..8a6945d06e4a2 100644 --- a/cmake/modules/FindGlobus.cmake +++ b/cmake/modules/FindGlobus.cmake @@ -9,7 +9,7 @@ find_path(GLOBUS_INCLUDE_DIR NAMES globus_common.h HINTS ${GLOBUS_DIR}/include $ENV{GLOBUS_LOCATION}/include - /opt/globus/include + /opt/globus/include /usr/include PATH_SUFFIXES gcc32 gcc32dbg gcc32pthr gcc32dbgpthr gcc64 gcc64dbg gcc64pthr gcc64dbgpthr globus) @@ -24,7 +24,7 @@ set(libraries gssapi_gsi gss_assist gsi_credential common gsi_callback proxy_ssl openssl gsi_proxy_core callout) foreach( lib ${libraries}) - find_library(GLOBUS_${lib}_LIBRARY NAMES globus_${lib}_${flavour} HINTS + find_library(GLOBUS_${lib}_LIBRARY NAMES globus_${lib}_${flavour} globus_${lib} HINTS ${GLOBUS_DIR}/lib $ENV{GLOBUS_LOCATION}/lib) if(GLOBUS_${lib}_LIBRARY) set(GLOBUS_${lib}_FOUND 1) diff --git a/cmake/modules/FindOCC.cmake b/cmake/modules/FindOCC.cmake index 29674898ad784..cc10af74fbdf4 100644 --- a/cmake/modules/FindOCC.cmake +++ b/cmake/modules/FindOCC.cmake @@ -11,7 +11,7 @@ set(_occdirs ${CASROOT} ${CASS_DIR} $ENV{CASROOT} /opt/occ) find_path(OCC_INCLUDE_DIR NAMES Standard_Real.hxx - HINTS ${_occdirs} /usr/include/opencascade + HINTS ${_occdirs} /usr/include/opencascade /usr/include/oce PATH_SUFFIXES inc DOC "Specify the directory containing Standard_Real.hxx") diff --git a/cmake/modules/FindPCRE.cmake b/cmake/modules/FindPCRE.cmake index 239dfc54750b2..c45537c62849a 100644 --- a/cmake/modules/FindPCRE.cmake +++ b/cmake/modules/FindPCRE.cmake @@ -2,8 +2,8 @@ # # This module defines # PCRE_INCLUDE_DIR, where to locate PCRE header files -# PCRE_LIBRARIES, the libraries to link against to use Pythia6 -# PCRE_FOUND. If false, you cannot build anything that requires Pythia6. +# PCRE_LIBRARIES, the libraries to link against to use PCRE +# PCRE_FOUND. If false, you cannot build anything that requires PCRE. set(_PCRE_PATHS ${PCRE_DIR} $ENV{PCRE_DIR}) diff --git a/cmake/modules/Findhdfs.cmake b/cmake/modules/Findhdfs.cmake index dc3d4ffeb9037..7fc72205376ce 100644 --- a/cmake/modules/Findhdfs.cmake +++ b/cmake/modules/Findhdfs.cmake @@ -6,7 +6,7 @@ # HDFS_INCLUDE_DIRS (not cached) # HDFS_LIBRARIES -find_path(HDFS_INCLUDE_DIR NAMES hdfs.h HINTS ${HDFS_DIR}/include $ENV{HDFS_DIR}/include) +find_path(HDFS_INCLUDE_DIR NAMES hdfs.h HINTS ${HDFS_DIR}/include $ENV{HDFS_DIR}/include /usr/include/hadoop) find_library(HDFS_LIBRARY NAMES hdfs HINTS ${HDFS_DIR}/lib/native $ENV{HDFS_DIR}/lib/native) set(HDFS_INCLUDE_DIRS ${HDFS_INCLUDE_DIR}) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 67fdab3853989..2fd55d9204720 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -562,15 +562,29 @@ if(ssl OR builtin_openssl) endif() #---Check for Castor------------------------------------------------------------------- -if(castor OR rfio) +if(castor) message(STATUS "Looking for Castor") find_package(Castor) if(NOT CASTOR_FOUND) if(fail-on-missing) message(FATAL_ERROR "Castor libraries not found and they are required (castor option enabled)") else() - message(STATUS "Castor not found. Switching off castor/rfio option") + message(STATUS "Castor not found. Switching off castor option") set(castor OFF CACHE BOOL "" FORCE) + endif() + endif() +endif() + +#---Check for RFIO------------------------------------------------------------------- +if(rfio) + message(STATUS "Looking for RFIO") + find_package(Castor) + find_package(DPM) + if(NOT CASTOR_FOUND AND NOT DPM_FOUND) + if(fail-on-missing) + message(FATAL_ERROR "Castor or DPM libraries not found and one of them is required (rfio option enabled)") + else() + message(STATUS "Castor or DPM not found. Switching off rfio option") set(rfio OFF CACHE BOOL "" FORCE) endif() endif() diff --git a/io/hdfs/CMakeLists.txt b/io/hdfs/CMakeLists.txt new file mode 100644 index 0000000000000..dfeddf0be032c --- /dev/null +++ b/io/hdfs/CMakeLists.txt @@ -0,0 +1,10 @@ +############################################################################ +# CMakeLists.txt file for building ROOT io/hdfs package +############################################################################ + +include_directories(${HDFS_INCLUDE_DIRS}) + +ROOT_GENERATE_DICTIONARY(G__HDFS *.h MODULE HDFS LINKDEF LinkDef.h) + +ROOT_LINKER_LIBRARY(HDFS *.cxx G__HDFS.cxx LIBRARIES Core ${HDFS_LIBRARIES} DEPENDENCIES Net RIO) +ROOT_INSTALL_HEADERS() diff --git a/io/rfio/CMakeLists.txt b/io/rfio/CMakeLists.txt index 1f5e2e6328348..4d9b6919a5d58 100644 --- a/io/rfio/CMakeLists.txt +++ b/io/rfio/CMakeLists.txt @@ -2,12 +2,18 @@ # CMakeLists.txt file for building ROOT io/rfio package ############################################################################ -include_directories(${CASTOR_INCLUDE_DIR}) - ROOT_GENERATE_DICTIONARY(G__RFIO *.h MODULE RFIO LINKDEF LinkDef.h) ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -Wno-shadow) +if(CASTOR_FOUND) +include_directories(${CASTOR_INCLUDE_DIR}) ROOT_LINKER_LIBRARY(RFIO *.cxx G__RFIO.cxx LIBRARIES Core ${CASTOR_LIBRARIES} ${CASTOR_rfio_LIBRARY} ${CASTOR_common_LIBRARY} ${CASTOR_client_LIBRARY} DEPENDENCIES Net RIO) +else() +include_directories(${DPM_INCLUDE_DIR}) +ROOT_LINKER_LIBRARY(RFIO *.cxx G__RFIO.cxx LIBRARIES Core ${DPM_LIBRARIES} + DEPENDENCIES Net RIO) +endif() + ROOT_INSTALL_HEADERS() diff --git a/net/globusauth/CMakeLists.txt b/net/globusauth/CMakeLists.txt index 67779667094c1..53b3580c67444 100644 --- a/net/globusauth/CMakeLists.txt +++ b/net/globusauth/CMakeLists.txt @@ -8,7 +8,6 @@ if(ssl) endif() ROOT_LINKER_LIBRARY(GlobusAuth *.cxx LIBRARIES Core ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS} DEPENDENCIES RootAuth Net) -ROOT_INSTALL_HEADERS() if(builtin_openssl) ROOT_ADD_BUILTIN_DEPENDENCIES(GlobusAuth OPENSSL) From e2e3e49baec3508351804d6ce65713a7c970cbac Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:15:16 +0200 Subject: [PATCH 02/19] Add missing pieces to the cmake config that are built by configure - bin/pq2 - bin/rootd - bin/xpdtest - initd and xinitd start-up scripts - don't install some private headers --- CMakeLists.txt | 6 ++++++ cmake/modules/RootConfiguration.cmake | 30 ++++++++++++++++++++++++++- graf2d/x11/CMakeLists.txt | 7 ++++++- main/CMakeLists.txt | 1 + net/CMakeLists.txt | 1 + net/rootd/CMakeLists.txt | 9 ++++++++ proof/pq2/CMakeLists.txt | 5 ++++- proof/proofd/CMakeLists.txt | 9 +++++--- proof/proofx/CMakeLists.txt | 2 +- 9 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 net/rootd/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e5a844fec257b..95305bf3cd6be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,6 +265,12 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_INSTALL_PREFIX) endif() install(DIRECTORY etc/ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} USE_SOURCE_PERMISSIONS REGEX system.rootrc EXCLUDE + REGEX system.rootauthrc EXCLUDE + REGEX system.rootdaemonrc EXCLUDE + REGEX rootd.rc.d EXCLUDE + REGEX proofd.rc.d EXCLUDE + REGEX rootd.xinetd EXCLUDE + REGEX proofd.xinetd EXCLUDE REGEX root.mimes EXCLUDE) install(DIRECTORY fonts/ DESTINATION ${CMAKE_INSTALL_FONTDIR}) install(DIRECTORY icons/ DESTINATION ${CMAKE_INSTALL_ICONDIR}) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 10f1608c780f1..3cd2187d01474 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -408,7 +408,13 @@ find_program(PERL_EXECUTABLE perl) set(perl ${PERL_EXECUTABLE}) #---RConfigure------------------------------------------------------------------------------------------------- -set(setresuid undef) +CHECK_CXX_SOURCE_COMPILES("#include + int main() { int i = setresuid(0, 0, 0); return 0;}" found_setresuid) +if(found_setresuid) + set(setresuid define) +else() + set(setresuid undef) +endif() if(mathmore) set(hasmathmore define) else() @@ -527,7 +533,16 @@ install(FILES ${CMAKE_BINARY_DIR}/include/RConfigure.h DESTINATION ${CMAKE_INSTA execute_Process(COMMAND hostname OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE ) configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY NEWLINE_STYLE UNIX) +configure_file(${CMAKE_SOURCE_DIR}/config/rootauthrc.in ${CMAKE_BINARY_DIR}/etc/system.rootauthrc @ONLY NEWLINE_STYLE UNIX) +configure_file(${CMAKE_SOURCE_DIR}/config/rootdaemonrc.in ${CMAKE_BINARY_DIR}/etc/system.rootdaemonrc @ONLY NEWLINE_STYLE UNIX) + +configure_file(${CMAKE_SOURCE_DIR}/config/rootd.in ${CMAKE_BINARY_DIR}/etc/daemons/rootd.rc.d @ONLY NEWLINE_STYLE UNIX) +configure_file(${CMAKE_SOURCE_DIR}/config/rootd.xinetd.in ${CMAKE_BINARY_DIR}/etc/daemons/rootd.xinetd @ONLY NEWLINE_STYLE UNIX) +configure_file(${CMAKE_SOURCE_DIR}/config/proofd.in ${CMAKE_BINARY_DIR}/etc/daemons/proofd.rc.d @ONLY NEWLINE_STYLE UNIX) +configure_file(${CMAKE_SOURCE_DIR}/config/proofd.xinetd.in ${CMAKE_BINARY_DIR}/etc/daemons/proofd.xinetd @ONLY NEWLINE_STYLE UNIX) + configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h NEWLINE_STYLE UNIX) + if(ruby) file(APPEND ${CMAKE_BINARY_DIR}/include/RConfigOptions.h "\#define R__RUBY_MAJOR ${RUBY_MAJOR_VERSION}\n\#define R__RUBY_MINOR ${RUBY_MINOR_VERSION}\n") endif() @@ -674,8 +689,21 @@ install(FILES ${CMAKE_BINARY_DIR}/include/RConfigOptions.h install(FILES ${CMAKE_BINARY_DIR}/etc/root.mimes ${CMAKE_BINARY_DIR}/etc/system.rootrc + ${CMAKE_BINARY_DIR}/etc/system.rootauthrc + ${CMAKE_BINARY_DIR}/etc/system.rootdaemonrc DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}) +install(FILES ${CMAKE_BINARY_DIR}/etc/daemons/rootd.rc.d + ${CMAKE_BINARY_DIR}/etc/daemons/proofd.rc.d + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/daemons) + +install(FILES ${CMAKE_BINARY_DIR}/etc/daemons/rootd.xinetd + ${CMAKE_BINARY_DIR}/etc/daemons/proofd.xinetd + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/daemons) + install(FILES ${CMAKE_BINARY_DIR}/root-help.el DESTINATION ${CMAKE_INSTALL_ELISPDIR}) if(NOT gnuinstall) diff --git a/graf2d/x11/CMakeLists.txt b/graf2d/x11/CMakeLists.txt index e13d71122dcc9..662038e590811 100644 --- a/graf2d/x11/CMakeLists.txt +++ b/graf2d/x11/CMakeLists.txt @@ -9,4 +9,9 @@ include_directories(${X11_INCLUDE_DIR}) ROOT_GENERATE_DICTIONARY(G__${libname} T*.h MODULE ${libname} LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM") ROOT_LINKER_LIBRARY(${libname} *.cxx *.c G__${libname}.cxx LIBRARIES Core ${X11_LIBRARIES} ${X11_Xpm_LIB} ${CMAKE_THREAD_LIBS_INIT}) -ROOT_INSTALL_HEADERS() + +if(AIX) + include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/inc) +endif() + +ROOT_INSTALL_HEADERS(OPTIONS REGEX inc/X11 EXCLUDE) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index a4da02686e8fb..9a978a1dfca8d 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -7,6 +7,7 @@ if(NOT WIN32) ROOT_EXECUTABLE(rootn.exe rmain.cxx LIBRARIES New Core MathCore Rint) ROOT_EXECUTABLE(roots.exe roots.cxx LIBRARIES Core MathCore) ROOT_EXECUTABLE(ssh2rpd ssh2rpd.cxx ${CMAKE_SOURCE_DIR}/core/clib/src/strlcpy.c ) + ROOT_EXECUTABLE(xpdtest xpdtest.cxx LIBRARIES Proof Tree Hist RIO Net Thread Matrix MathCore) endif() ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint) ROOT_EXECUTABLE(proofserv.exe pmain.cxx LIBRARIES Core MathCore) diff --git a/net/CMakeLists.txt b/net/CMakeLists.txt index 52e6fe9c0e144..016178262177c 100644 --- a/net/CMakeLists.txt +++ b/net/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(net) add_subdirectory(auth) # special CMakeListst.txt +add_subdirectory(rootd) if(bonjour) add_subdirectory(bonjour) diff --git a/net/rootd/CMakeLists.txt b/net/rootd/CMakeLists.txt new file mode 100644 index 0000000000000..a1d023a22a218 --- /dev/null +++ b/net/rootd/CMakeLists.txt @@ -0,0 +1,9 @@ +############################################################################ +# CMakeLists.txt file for building ROOT net/rootd package +# @author Pere Mato, CERN +############################################################################ + +ROOT_EXECUTABLE(rootd *.cxx ${CMAKE_SOURCE_DIR}/core/clib/src/strlcpy.c + LIBRARIES rpdutil rsa ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTLIBS}) + +ROOT_INSTALL_HEADERS() diff --git a/proof/pq2/CMakeLists.txt b/proof/pq2/CMakeLists.txt index d5b40d8fd1ad4..ac09a628a83c4 100644 --- a/proof/pq2/CMakeLists.txt +++ b/proof/pq2/CMakeLists.txt @@ -3,4 +3,7 @@ # @author Pere Mato, CERN ############################################################################ -ROOT_INSTALL_HEADERS() \ No newline at end of file +ROOT_EXECUTABLE(pq2 *.cxx LIBRARIES Core Proof Hist Matrix Tree + RIO Net Thread MathCore) + +ROOT_INSTALL_HEADERS() diff --git a/proof/proofd/CMakeLists.txt b/proof/proofd/CMakeLists.txt index 51d4a0886d1ae..addfac2281eec 100644 --- a/proof/proofd/CMakeLists.txt +++ b/proof/proofd/CMakeLists.txt @@ -4,6 +4,7 @@ ############################################################################ include_directories(${XROOTD_INCLUDE_DIRS}) +include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/inc) add_definitions(${XROOTD_CFLAGS}) ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -Wno-undefined-bool-conversion) @@ -11,14 +12,16 @@ if(WIN32) ROOT_LINKER_LIBRARY(XrdProofd XProofProtUtils.cxx LIBRARIES ${XROOTD_LIBRARIES}) else() ROOT_EXECUTABLE(proofd proofd.cxx ${CMAKE_SOURCE_DIR}/core/clib/src/strlcat.c - LIBRARIES ${XROOTD_LIBRARIES} rpdutil rsa ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTLIBS} ) + LIBRARIES ${XROOTD_LIBRARIES} rpdutil rsa ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTLIBS}) if (NOT XROOTD_NOMAIN) ROOT_EXECUTABLE(xproofd X*.cxx ${CMAKE_SOURCE_DIR}/net/rpdutils/src/rpdconn.cxx LIBRARIES ${XROOTD_LIBRARIES} ${SYSLIBS}) endif () ROOT_LINKER_LIBRARY(XrdProofd X*.cxx ${CMAKE_SOURCE_DIR}/net/rpdutils/src/rpdconn.cxx LIBRARIES ${XROOTD_LIBRARIES} rpdutil ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) - set_target_properties(XrdProofd PROPERTIES LINK_INTERFACE_LIBRARIES "" ) + set_target_properties(XrdProofd PROPERTIES LINK_INTERFACE_LIBRARIES "") + ROOT_EXECUTABLE(proofexecv proofexecv.cxx ${CMAKE_SOURCE_DIR}/net/rpdutils/src/rpdconn.cxx ${CMAKE_SOURCE_DIR}/net/rpdutils/src/rpdpriv.cxx + LIBRARIES ${SYSLIBS}) endif() if(builtin_xrootd) @@ -38,4 +41,4 @@ if(builtin_openssl) endif() -ROOT_INSTALL_HEADERS() +ROOT_INSTALL_HEADERS(OPTIONS REGEX inc/X EXCLUDE) diff --git a/proof/proofx/CMakeLists.txt b/proof/proofx/CMakeLists.txt index 1bef1c3d6a136..8a3d86ba33287 100644 --- a/proof/proofx/CMakeLists.txt +++ b/proof/proofx/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################ # CMakeLists.txt file for building ROOT proof/proofx package # @author Pere Mato, CERN @@ -14,6 +13,7 @@ else() endif() include_directories(${XROOTD_INCLUDE_DIRS}) +include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/../proofd/inc) link_directories(${XROOTD_LIBRARY_DIR}) add_definitions(${XROOTD_CFLAGS}) From 954be2d7a2d6c45427a545c4d025a4d1568a1448 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:15:26 +0200 Subject: [PATCH 03/19] Fix handling of deprecated options The configure script currently uses a simple grep to determine if an option is deprecated. This causes problems, since the enable-reflex option is deprecated and grepping for enable-r will result in a match. The configure script therefore considers enable-r deprecated too, even though it is not. This commit addresses this issue. --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index fcb72fa9b71b1..d86564c313131 100755 --- a/configure +++ b/configure @@ -206,7 +206,7 @@ if test "x$ENABLEALL" = "xyes"; then enable_unuran=yes enable_vc=yes enable_vdt=yes - #enable_r=yes + enable_r=yes fi # Remove old log file @@ -2303,7 +2303,7 @@ if test $# -gt 0 ; then f=`echo $1 | sed -e 's/--//' -e 's/-/_/g' -e 's/++11/xx11/'` eval prev='$'`echo ${f}` eval prev_expl='$'`echo ${f}_explicit` - if test ! "x`echo ${deprecated_options} | grep ${f}`" = "x"; then + if test ! "x`echo ${deprecated_options}' ' | grep ${f}' '`" = "x"; then echo "WARNING: option $1 is deprecated and ignored"'!' else if test "${prev}:${prev_expl}" = "yes:"; then @@ -2333,7 +2333,7 @@ if test $# -gt 0 ; then f=`echo $1 | sed -e 's/--disable/enable/' -e 's/-/_/g' -e 's/++11/xx11/'` eval prev='$'`echo ${f}` eval prev_expl='$'`echo ${f}_explicit` - if test ! "x`echo ${deprecated_options} | grep ${f}`" = "x"; then + if test ! "x`echo ${deprecated_options}' ' | grep ${f}' '`" = "x"; then echo "WARNING: option $1 is deprecated and ignored"'!' else if test "${prev}:${prev_expl}" = "xno:"; then From 7587055278008b9816ffaa6875a5c008f471147d Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:15:33 +0200 Subject: [PATCH 04/19] Only link to libgfortranbegin.a when it is provided by the compiler It is no longer used in gcc 6 --- config/Makefile.freebsd7 | 2 ++ config/Makefile.hurddeb | 2 ++ config/Makefile.linux | 2 ++ config/Makefile.linuxalphagcc | 2 ++ config/Makefile.linuxarm | 2 ++ config/Makefile.linuxarm64 | 2 ++ config/Makefile.linuxhppa | 2 ++ config/Makefile.linuxia64gcc | 2 ++ config/Makefile.linuxppcgcc | 2 ++ config/Makefile.linuxx32gcc | 2 ++ config/Makefile.linuxx8664gcc | 2 ++ config/Makefile.win32gcc | 2 ++ config/Makefile.win64gcc | 2 ++ 13 files changed, 26 insertions(+) diff --git a/config/Makefile.freebsd7 b/config/Makefile.freebsd7 index 19e9247942bed..db023dd956ea6 100644 --- a/config/Makefile.freebsd7 +++ b/config/Makefile.freebsd7 @@ -49,8 +49,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.hurddeb b/config/Makefile.hurddeb index 185280b14c8a0..2faa872053a08 100644 --- a/config/Makefile.hurddeb +++ b/config/Makefile.hurddeb @@ -42,8 +42,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linux b/config/Makefile.linux index bb3d127a3bd48..f955d316d91a7 100644 --- a/config/Makefile.linux +++ b/config/Makefile.linux @@ -55,8 +55,10 @@ F77LIBS := $(shell $(F77) -m32 -print-file-name=libgfortran.$(SOEXT)) else F77LIBS := $(shell $(F77) -m32 -print-file-name=libgfortran.a) endif +ifneq ($(shell $(F77) -m32 -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -m32 -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxalphagcc b/config/Makefile.linuxalphagcc index 5e4c0f202d10a..f8d13a81d5ffe 100644 --- a/config/Makefile.linuxalphagcc +++ b/config/Makefile.linuxalphagcc @@ -42,8 +42,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxarm b/config/Makefile.linuxarm index 11048baa1f70a..e760c3e14047a 100644 --- a/config/Makefile.linuxarm +++ b/config/Makefile.linuxarm @@ -49,8 +49,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxarm64 b/config/Makefile.linuxarm64 index f6238eb85045d..1f425922ff754 100644 --- a/config/Makefile.linuxarm64 +++ b/config/Makefile.linuxarm64 @@ -53,8 +53,10 @@ F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) else F77LIBS := $(shell $(F77) -print-file-name=libgfortran.a) endif +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxhppa b/config/Makefile.linuxhppa index 2df363e14a026..7470f117c0434 100644 --- a/config/Makefile.linuxhppa +++ b/config/Makefile.linuxhppa @@ -43,8 +43,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxia64gcc b/config/Makefile.linuxia64gcc index 3e2e1804d54d4..fe8ae72fb7a48 100644 --- a/config/Makefile.linuxia64gcc +++ b/config/Makefile.linuxia64gcc @@ -42,8 +42,10 @@ F77 = gfortran endif F77FLAGS = -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.a) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxppcgcc b/config/Makefile.linuxppcgcc index 311df7437d6c9..dbbf762dca4d6 100644 --- a/config/Makefile.linuxppcgcc +++ b/config/Makefile.linuxppcgcc @@ -50,8 +50,10 @@ F77 = gfortran endif F77FLAGS = -m32 -fPIC -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.$(SOEXT)) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) -lnsl endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxx32gcc b/config/Makefile.linuxx32gcc index 99210aee62687..26b299dcb1f9b 100644 --- a/config/Makefile.linuxx32gcc +++ b/config/Makefile.linuxx32gcc @@ -54,8 +54,10 @@ F77LIBS := $(shell $(F77) -mx32 -print-file-name=libgfortran.$(SOEXT)) else F77LIBS := $(shell $(F77) -mx32 -print-file-name=libgfortran.a) endif +ifneq ($(shell $(F77) -mx32 -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -mx32 -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.linuxx8664gcc b/config/Makefile.linuxx8664gcc index 8ecb6a619ba32..b2f8c2a5c6eaf 100644 --- a/config/Makefile.linuxx8664gcc +++ b/config/Makefile.linuxx8664gcc @@ -62,8 +62,10 @@ F77LIBS := $(shell $(F77) -m64 -print-file-name=libgfortran.$(SOEXT)) else F77LIBS := $(shell $(F77) -m64 -print-file-name=libgfortran.a) endif +ifneq ($(shell $(F77) -m64 -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -m64 -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.win32gcc b/config/Makefile.win32gcc index 1a829791deb3a..451fcf8a29088 100644 --- a/config/Makefile.win32gcc +++ b/config/Makefile.win32gcc @@ -55,8 +55,10 @@ F77 = gfortran endif F77FLAGS = -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.a) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) diff --git a/config/Makefile.win64gcc b/config/Makefile.win64gcc index 9f12f24c89da4..723d9ee38ae03 100644 --- a/config/Makefile.win64gcc +++ b/config/Makefile.win64gcc @@ -55,8 +55,10 @@ F77 = gfortran endif F77FLAGS = -std=legacy F77LIBS := $(shell $(F77) -print-file-name=libgfortran.a) +ifneq ($(shell $(F77) -print-file-name=libgfortranbegin.a),libgfortranbegin.a) F77LIBS += $(shell $(F77) -print-file-name=libgfortranbegin.a) endif +endif ifneq ($(findstring g77, $(F77)),) ifeq ($(F77),) From 487e0d939e392434773002550b5f63f17b225121 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:15:43 +0200 Subject: [PATCH 05/19] Be more careful when removing -Werror The old rule also changed e.g. -Werror=format-security to =format-security, which causes the compilation to fail. --- interpreter/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index d444437af165c..d0424aba3f544 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -40,8 +40,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INTERP_ADDITIONAL_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${INTERP_ADDITIONAL_FLAGS}") #---Do not transform warnings in errors------------------------------------------------------------- -string(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -string(REPLACE "-Wshadow" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +string(REPLACE "-Werror " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +string(REPLACE "-Wshadow " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) #---Build LLVM/Clang with symbol visibility=hidden-------------------------------------------------- ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -fvisibility=hidden) From 7f982d697da5b4218ad4486494497e0578c19bd9 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:15:51 +0200 Subject: [PATCH 06/19] Don't remove -Wall without also removing -Werror=* It leads to incompatible options like: $ g++ -Werror=format-security -c a.cxx cc1plus: error: -Wformat-security ignored without -Wformat [-Werror=format-security] Before -Wall was removed -Wall implied -Wformat, and he options were compatible: $ g++ -Wall -Werror=format-security -c a.cxx (no error) This commit makes sure also -Werror=* is removed when -Wall is removed. --- build/unix/compiledata.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/unix/compiledata.sh b/build/unix/compiledata.sh index bc9d43e836a14..a3c8498f09f13 100755 --- a/build/unix/compiledata.sh +++ b/build/unix/compiledata.sh @@ -75,7 +75,7 @@ CXXFLAGS=`echo $CXXFLAGS | sed 's/-Iinclude //' ` # Remove the flags turning warnings into errors or extending # the number of warnings. -CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-Werror //g' -e 's/-Wall //g' -e 's/-Wshadow //g' ` +CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-Werror //g' -e 's/-Werror=\S* //g' -e 's/-Wall //g' -e 's/-Wshadow //g' ` # Determine the compiler version BXX="`basename $CXX`" From 1998899ee6ccd5182dea2463ffb91e3502e40770 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:16:07 +0200 Subject: [PATCH 07/19] Don't overwrite the initial value of CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS is initialized from the FFLAGS environment variable. If the initial value of CMAKE_Fortran_FLAGS is overwritten, comfiguring the build using FFLAGS fails. --- cmake/modules/SetUpLinux.cmake | 6 +++--- cmake/modules/SetUpMacOS.cmake | 8 ++++---- cmake/modules/SetUpWindows.cmake | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/modules/SetUpLinux.cmake b/cmake/modules/SetUpLinux.cmake index 9543bc7949cfd..07a77b50c1e9f 100644 --- a/cmake/modules/SetUpLinux.cmake +++ b/cmake/modules/SetUpLinux.cmake @@ -71,7 +71,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} ${FP_MATH_FLAGS} -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -fPIC") - set(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} ${BIT_ENVIRONMENT} -std=legacy") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BIT_ENVIRONMENT} -std=legacy") set(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") set(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") @@ -108,7 +108,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} ${FP_MATH_FLAGS} -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -fPIC") - set(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} ${BIT_ENVIRONMENT} -std=legacy") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BIT_ENVIRONMENT} -std=legacy") set(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") set(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") @@ -145,7 +145,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Intel) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -wd1476") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -restrict") - set(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} -fPIC") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC") set(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") set(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake index cd40d4f4484ba..709956981d01a 100644 --- a/cmake/modules/SetUpMacOS.cmake +++ b/cmake/modules/SetUpMacOS.cmake @@ -37,12 +37,12 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -m64") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") - SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m64") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64") else(${SYSCTL_OUTPUT} MATCHES 64) MESSAGE(STATUS "Found a 32bit system") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") - SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m32") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32") endif(${SYSCTL_OUTPUT} MATCHES 64) endif() @@ -65,7 +65,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -fsigned-char -fno-common") - SET(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} -std=legacy") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") SET(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION") SET(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION") @@ -101,7 +101,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments") - SET(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} -std=legacy") + SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") SET(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION") SET(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION") diff --git a/cmake/modules/SetUpWindows.cmake b/cmake/modules/SetUpWindows.cmake index 81cf6c16b8e50..82ec44ca497cc 100644 --- a/cmake/modules/SetUpWindows.cmake +++ b/cmake/modules/SetUpWindows.cmake @@ -13,7 +13,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -Wall -W -Woverloaded-virtual -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -W -fPIC") - set(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} -std=legacy") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") set(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") set(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}") From cfd51f6f52b0aa56a0830fc28eeb56d1a6d96883 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:16:19 +0200 Subject: [PATCH 08/19] Implement builtin-unuran option ROOT uses builtin unuran sources, but has no switch to use the system library instead. This adds this missing option. --- cmake/modules/FindUnuran.cmake | 21 +++++++++++ cmake/modules/RootBuildOptions.cmake | 1 + cmake/modules/RootConfiguration.cmake | 5 +++ cmake/modules/SearchInstalledSoftware.cmake | 10 ++++++ config/Makefile.in | 5 +++ configure | 40 +++++++++++++++++++++ math/unuran/CMakeLists.txt | 14 +++++++- math/unuran/Module.mk | 27 ++++++++++---- 8 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 cmake/modules/FindUnuran.cmake diff --git a/cmake/modules/FindUnuran.cmake b/cmake/modules/FindUnuran.cmake new file mode 100644 index 0000000000000..a704769c23769 --- /dev/null +++ b/cmake/modules/FindUnuran.cmake @@ -0,0 +1,21 @@ +# - Locate Unuran library +# Defines: +# +# UNURAN_FOUND +# UNURAN_INCLUDE_DIR +# UNURAN_INCLUDE_DIRS (not cached) +# UNURAN_LIBRARIES + +find_path(UNURAN_INCLUDE_DIR NAMES unuran.h HINTS ${UNURAN_DIR}/include $ENV{UNURAN_DIR}/include /usr/include) +find_library(UNURAN_LIBRARY NAMES unuran HINTS ${UNURAN_DIR}/lib $ENV{UNURAN_DIR}/lib) + +set(UNURAN_INCLUDE_DIRS ${UNURAN_INCLUDE_DIR}) +set(UNURAN_LIBRARIES ${UNURAN_LIBRARY}) + + +# handle the QUIETLY and REQUIRED arguments and set UNURAN_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(UNURAN DEFAULT_MSG UNURAN_LIBRARY UNURAN_INCLUDE_DIR) + +mark_as_advanced(UNURAN_FOUND UNURAN_INCLUDE_DIR UNURAN_LIBRARY) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 88ddbed595994..a901d9fa2e631 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -73,6 +73,7 @@ ROOT_BUILD_OPTION(builtin_freetype OFF "Build included libfreetype, or use syste ROOT_BUILD_OPTION(builtin_glew ON "Build included libGLEW, or use system libGLEW") ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL internally, or use system OpenSSL") ROOT_BUILD_OPTION(builtin_pcre OFF "Build included libpcre, or use system libpcre") +ROOT_BUILD_OPTION(builtin_unuran OFF "Build included libunuran, or use system libunuran") ROOT_BUILD_OPTION(builtin_zlib OFF "Build included libz, or use system libz") ROOT_BUILD_OPTION(builtin_lzma OFF "Build included liblzma, or use system liblzma") ROOT_BUILD_OPTION(builtin_davix OFF "Build the Davix library internally (downloading tarfile from the Web)") diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 3cd2187d01474..63b3d6a4ee471 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -142,6 +142,11 @@ set(zliblibdir ${ZLIB_LIBRARY_DIR}) set(zliblib ${ZLIB_LIBRARY}) set(zlibincdir ${ZLIB_INCLUDE_DIR}) +set(builtinunuran ${value${builtin_unuran}}) +set(unuranlibdir ${UNURAN_LIBRARY_DIR}) +set(unuranlib ${UNURAN_LIBRARY}) +set(unuranincdir ${UNURAN_INCLUDE_DIR}) + set(buildgl ${value${opengl}}) set(opengllibdir ${OPENGL_LIBRARY_DIR}) set(openglulib ${OPENGL_glu_LIBRARY}) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 2fd55d9204720..9348f239ccd01 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -38,6 +38,16 @@ if(builtin_zlib) set(ZLIB_LIBRARY "" CACHE PATH "" FORCE) endif() +#---Check for Unuran ------------------------------------------------------------------ +if(NOT builtin_unuran) + message(STATUS "Looking for Unuran") + find_Package(Unuran) + if(NOT UNURAN_FOUND) + message(STATUS "Unuran not found. Switching on builtin_unuran option") + set(builtin_unuran ON CACHE BOOL "" FORCE) + endif() +endif() + #---Check for Freetype--------------------------------------------------------------- if(NOT builtin_freetype) message(STATUS "Looking for Freetype") diff --git a/config/Makefile.in b/config/Makefile.in index 4231dc640f8c5..e80140338073c 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -122,6 +122,11 @@ BUILTINFREETYPE:= @builtinfreetype@ BUILTINPCRE := @builtinpcre@ +BUILTINUNURAN := @builtinunuran@ +UNURANLIBDIR := @unuranlibdir@ +UNURANLIB := @unuranlib@ +UNURANINCDIR := $(filter-out /usr/include, @unuranincdir@) + BUILTINZLIB := @builtinzlib@ ZLIBLIBDIR := @zliblibdir@ ZLIBCLILIB := @zliblib@ diff --git a/configure b/configure index d86564c313131..327afd4f9e553 100755 --- a/configure +++ b/configure @@ -55,6 +55,7 @@ options=" \ enable_builtin_freetype \ enable_builtin_glew \ enable_builtin_pcre \ + enable_builtin_unuran \ enable_builtin_zlib \ enable_builtin_lzma \ enable_builtin_llvm \ @@ -187,6 +188,7 @@ enable_builtin_freetype=no enable_builtin_ftgl=no enable_builtin_glew=no enable_builtin_pcre=no +enable_builtin_unuran=no enable_builtin_zlib=no enable_builtin_lzma=no enable_builtin_llvm=yes @@ -1709,6 +1711,7 @@ enable/disable options, prefix with either --enable- or --disable- builtin-freetype Build included libfreetype, or use system libfreetype builtin-glew Build included libGLEW, or use system libGLEW builtin-pcre Build included libpcre, or use system libpcre + builtin-unuran Build included libunuran, or use system libunuran builtin-zlib Build included libz, or use system libz builtin-lzma Build included liblzma, or use system liblzma libcxx Build using libc++, required by clang option (MacOS X only, for the time being) @@ -2057,6 +2060,7 @@ win32) enable_builtin_ftgl="yes" enable_builtin_glew="yes" enable_builtin_pcre="yes" + enable_builtin_unuran="yes" enable_builtin_zlib="yes" enable_builtin_lzma="yes" top_builddir=`cygpath -u $top_builddir` @@ -3252,6 +3256,38 @@ fi message "Checking whether to build included libpcre" result "$enable_builtin_pcre" +###################################################################### +# +### echo %%% libunuran (builtin or system) +# +if test "x$enable_builtin_unuran" = "xno" ; then + check_header "unuran.h" "" \ + $UNURAN ${UNURAN:+$UNURAN/include} /usr/include + if test "x$found_dir" = "x" ; then + enable_builtin_unuran=yes + else + unuraninc=$found_hdr + unuranincdir=$found_dir + fi + + check_library "libunuran" "$enable_shared" "" \ + $UNURAN ${UNURAN:+$UNURAN/lib} /usr/lib + if test "x$found_lib" = "x" ; then + unuranlib="" + unuranlibdir="" + enable_builtin_unuran="yes" + else + unuranlib="$found_lib" + unuranlibdir="$found_dir" + fi + + if test "x$unuranincdir" = "x" || test "x$unuranlib" = "x"; then + enable_builtin_unuran="yes" + fi +fi +message "Checking whether to build included unuran" +result "$enable_builtin_unuran" + ###################################################################### # ### echo %%% Use included zLib or use systems @@ -7840,6 +7876,10 @@ sed -e "s|@srcdir@|$ac_srcdir|" \ -e "s|@top_srcdir@|$top_srcdir|" \ -e "s|@ttffontdir@|$fontdir|" \ -e "s|@tutdir@|$tutdir|" \ + -e "s|@builtinunuran@|$enable_builtin_unuran|" \ + -e "s|@unuranincdir@|$unuranincdir|" \ + -e "s|@unuranlib@|$unuranlib|" \ + -e "s|@unuranlibdir@|$unuranlibdir|" \ -e "s|@winrtdebug@|$enable_winrtdebug|" \ -e "s|@xmlincdir@|$xmlincdir|" \ -e "s|@xmllib@|$xmllib|" \ diff --git a/math/unuran/CMakeLists.txt b/math/unuran/CMakeLists.txt index 939eb50265ee7..18c1b48993416 100644 --- a/math/unuran/CMakeLists.txt +++ b/math/unuran/CMakeLists.txt @@ -3,6 +3,9 @@ ############################################################################ #---Define package related variables----------------------------------------------------------------- + +if(builtin_unuran) + set(UNR_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/src) set(UNR_VERSION "1.8.0-root") set(UNR_TARNAME "unuran-${UNR_VERSION}") @@ -62,8 +65,17 @@ set(unrsources ${UNR_UNTARDIR}/src/utils/*.c ${UNR_UNTARDIR}/src/tests/*.c ${UNR_UNTARDIR}/src/uniform/*.c ${UNR_UNTARDIR}/src/urng/*.c ) +set(unrconfig ${UNR_UNTARDIR}/config.h) + +else() + +include_directories(${UNURAN_INCLUDE_DIRS}) +set(unrsources) +set(unrconfig) + +endif() ROOT_GENERATE_DICTIONARY(G__Unuran *.h MODULE Unuran LINKDEF LinkDef.h) -ROOT_LINKER_LIBRARY(Unuran *.cxx ${unrsources} G__Unuran.cxx ${UNR_UNTARDIR}/config.h LIBRARIES Core DEPENDENCIES Hist MathCore) +ROOT_LINKER_LIBRARY(Unuran *.cxx ${unrsources} G__Unuran.cxx ${unrconfig} LIBRARIES Core ${UNURAN_LIBRARIES} DEPENDENCIES Hist MathCore) ROOT_INSTALL_HEADERS() diff --git a/math/unuran/Module.mk b/math/unuran/Module.mk index fd4fca2ce963f..ff8f2c10e5d2b 100644 --- a/math/unuran/Module.mk +++ b/math/unuran/Module.mk @@ -12,6 +12,8 @@ UNURANDIR := $(MODDIR) UNURANDIRS := $(UNURANDIR)/src UNURANDIRI := $(UNURANDIR)/inc +ifeq ($(BUILTINUNURAN),yes) + UNRVERS := unuran-1.8.0-root UNRSRCS := $(MODDIRS)/$(UNRVERS).tar.gz @@ -43,15 +45,18 @@ UNRS := $(filter %.c, \ $(filter $(UNRDIRS)/src/uniform/%,$(UNRTARCONTENT)) \ $(filter $(UNRDIRS)/src/urng/%,$(UNRTARCONTENT))) endif -UNRO := $(UNRS:.c=.o) +UNRFLAGS := -I$(UNRDIRS)/src -ifeq ($(PLATFORM),win32) -UNRLIBS := $(UNRDIRS)/src/.libs/libunuran.lib else -UNRLIBS := $(UNRDIRS)/src/.libs/libunuran.a + +UNURANETAG := +UNRCFG := +UNRS := +UNRFLAGS := $(UNURANINCDIR:%=-I%) + endif -UNRFLAGS := -I$(UNRDIRS)/src +UNRO := $(UNRS:.c=.o) ##### libUnuran ##### UNURANL := $(MODDIRI)/LinkDef.h @@ -84,6 +89,8 @@ INCLUDEFILES += $(UNURANDEP) include/%.h: $(UNURANDIRI)/%.h $(UNURANETAG) cp $< $@ +ifeq ($(BUILTINUNURAN),yes) + $(UNURANDEP): $(UNRCFG) $(UNRS): $(UNURANETAG) @@ -134,12 +141,14 @@ $(UNRCFG): $(UNURANETAG) GNUMAKE=$(MAKE) ./configure CC="$$ACC" \ CFLAGS="$$ACFLAGS"); +endif + $(UNURANLIB): $(UNRCFG) $(UNRO) $(UNURANO) $(UNURANDO) $(ORDER_) \ $(MAINLIBS) $(UNURANLIBDEP) @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \ "$(SOFLAGS)" libUnuran.$(SOEXT) $@ \ "$(UNURANO) $(UNURANDO)" \ - "$(UNURANLIBEXTRA) $(UNRO)" + "$(UNURANLIBEXTRA) $(UNRO) $(UNURANLIBDIR) $(UNURANLIB)" $(call pcmrule,UNURAN) $(noop) @@ -158,16 +167,19 @@ all-$(MODNAME): $(UNURANLIB) clean-$(MODNAME): @rm -f $(UNURANO) $(UNURANDO) +ifeq ($(BUILTINUNURAN),yes) -@(if [ -d $(UNRDIRS) ]; then \ cd $(UNRDIRS); \ $(MAKE) clean; \ fi) +endif clean:: clean-$(MODNAME) distclean-$(MODNAME): clean-$(MODNAME) @rm -f $(UNURANO) $(UNURANDO) $(UNURANETAG) $(UNURANDEP) \ $(UNURANDS) $(UNURANDH) $(UNURANLIB) $(UNURANMAP) +ifeq ($(BUILTINUNURAN),yes) @mv $(UNRSRCS) $(UNRDIR)/-$(UNRVERS).tar.gz ifeq ($(UNURKEEP),yes) @mv $(UNRDIRS) $(UNRDIRS).keep @@ -177,6 +189,7 @@ ifeq ($(UNURKEEP),yes) @mv $(UNRDIRS).keep $(UNRDIRS) endif @mv $(UNRDIR)/-$(UNRVERS).tar.gz $(UNRSRCS) +endif distclean:: distclean-$(MODNAME) @@ -184,6 +197,7 @@ distclean:: distclean-$(MODNAME) $(UNURANO): CXXFLAGS += $(UNRFLAGS) +ifeq ($(BUILTINUNURAN),yes) ifeq ($(PLATFORM),win32) $(UNRO): CFLAGS := $(filter-out -FIsehmap.h,$(filter-out -Iinclude,$(CFLAGS) -I$(UNRDIRS) -I$(UNRDIRS)/src/ -I$(UNRDIRS)/src/utils -DHAVE_CONFIG_H)) else @@ -194,3 +208,4 @@ endif ifeq ($(CC),icc) $(UNRO): CFLAGS += -mp endif +endif From 975f16b1916fcc6c6f50afda8a5d067fbc29d737 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:28:40 +0200 Subject: [PATCH 09/19] Implement builtin-gl2ps option ROOT uses builtin gl2ps sources, but has no switch to use the system library instead. This adds this missing option. --- cmake/modules/Findgl2ps.cmake | 21 +++++++++++ cmake/modules/RootBuildOptions.cmake | 1 + cmake/modules/RootConfiguration.cmake | 5 +++ cmake/modules/SearchInstalledSoftware.cmake | 10 ++++++ config/Makefile.in | 5 +++ configure | 40 +++++++++++++++++++++ graf3d/gl/CMakeLists.txt | 14 ++++++-- graf3d/gl/Module.mk | 17 ++++++--- 8 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 cmake/modules/Findgl2ps.cmake diff --git a/cmake/modules/Findgl2ps.cmake b/cmake/modules/Findgl2ps.cmake new file mode 100644 index 0000000000000..f26107ef92062 --- /dev/null +++ b/cmake/modules/Findgl2ps.cmake @@ -0,0 +1,21 @@ +# - Locate gl2ps library +# Defines: +# +# GL2PS_FOUND +# GL2PS_INCLUDE_DIR +# GL2PS_INCLUDE_DIRS (not cached) +# GL2PS_LIBRARIES + +find_path(GL2PS_INCLUDE_DIR NAMES gl2ps.h HINTS ${GL2PS_DIR}/include $ENV{GL2PS_DIR}/include /usr/include) +find_library(GL2PS_LIBRARY NAMES gl2ps HINTS ${GL2PS_DIR}/lib $ENV{GL2PS_DIR}/lib) + +set(GL2PS_INCLUDE_DIRS ${GL2PS_INCLUDE_DIR}) +set(GL2PS_LIBRARIES ${GL2PS_LIBRARY}) + + +# handle the QUIETLY and REQUIRED arguments and set GL2PS_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GL2PS DEFAULT_MSG GL2PS_LIBRARY GL2PS_INCLUDE_DIR) + +mark_as_advanced(GL2PS_FOUND GL2PS_INCLUDE_DIR GL2PS_LIBRARY) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index a901d9fa2e631..6a5db1aa03b54 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -70,6 +70,7 @@ ROOT_BUILD_OPTION(builtin_afterimage ON "Build included libAfterImage, or use sy ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build the FFTW3 library internally (downloading tarfile from the Web)") ROOT_BUILD_OPTION(builtin_ftgl ON "Build included libFTGL, or use system libftgl") ROOT_BUILD_OPTION(builtin_freetype OFF "Build included libfreetype, or use system libfreetype") +ROOT_BUILD_OPTION(builtin_gl2ps OFF "Build included libgl2ps, or use system libgl2ps") ROOT_BUILD_OPTION(builtin_glew ON "Build included libGLEW, or use system libGLEW") ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL internally, or use system OpenSSL") ROOT_BUILD_OPTION(builtin_pcre OFF "Build included libpcre, or use system libpcre") diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 63b3d6a4ee471..f51bcbec0805d 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -153,6 +153,11 @@ set(openglulib ${OPENGL_glu_LIBRARY}) set(opengllib ${OPENGL_gl_LIBRARY}) set(openglincdir ${OPENGL_INCLUDE_DIR}) +set(builtingl2ps ${value${builtin_gl2ps}}) +set(gl2pslibdir ${GL2PS_LIBRARY_DIR}) +set(gl2pslib ${GL2PS_LIBRARY}) +set(gl2psincdir ${GL2PS_INCLUDE_DIR}) + set(buildldap ${value${ldap}}) set(ldaplibdir ${LDAP_LIBRARY_DIR}) set(ldaplib ${LDAP_LIBRARY}) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 9348f239ccd01..0b052e113bda3 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -450,6 +450,16 @@ if(opengl) endif() endif() +#---Check for gl2ps ------------------------------------------------------------------ +if(NOT builtin_gl2ps) + message(STATUS "Looking for gl2ps") + find_Package(gl2ps) + if(NOT GL2PS_FOUND) + message(STATUS "gl2ps not found. Switching on builtin_gl2ps option") + set(builtin_gl2ps ON CACHE BOOL "" FORCE) + endif() +endif() + #---Check for Graphviz installation------------------------------------------------------- if(gviz) message(STATUS "Looking for Graphviz") diff --git a/config/Makefile.in b/config/Makefile.in index e80140338073c..2e3fdbfac5df9 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -143,6 +143,11 @@ OPENGLULIB := @openglulib@ OPENGLLIB := @opengllib@ OPENGLINCDIR := $(filter-out /usr/include, @openglincdir@) +BUILTINGL2PS := @builtingl2ps@ +GL2PSLIBDIR := @gl2pslibdir@ +GL2PSCLILIB := @gl2pslib@ +GL2PSINCDIR := $(filter-out /usr/include, @gl2psincdir@) + BUILDLDAP := @buildldap@ LDAPLIBDIR := @ldaplibdir@ LDAPCLILIB := @ldaplib@ diff --git a/configure b/configure index 327afd4f9e553..d775fb73f56cd 100755 --- a/configure +++ b/configure @@ -53,6 +53,7 @@ options=" \ enable_builtin_afterimage \ enable_builtin_ftgl \ enable_builtin_freetype \ + enable_builtin_gl2ps \ enable_builtin_glew \ enable_builtin_pcre \ enable_builtin_unuran \ @@ -186,6 +187,7 @@ enable_werror=no enable_winrtdebug= enable_builtin_freetype=no enable_builtin_ftgl=no +enable_builtin_gl2ps=no enable_builtin_glew=no enable_builtin_pcre=no enable_builtin_unuran=no @@ -1709,6 +1711,7 @@ enable/disable options, prefix with either --enable- or --disable- builtin-afterimage Build included libAfterImage, or use system libAfterImage builtin-ftgl Build included libFTGL, or use system libftgl builtin-freetype Build included libfreetype, or use system libfreetype + builtin-gl2ps Build included libgl2ps, or use system libgl2ps builtin-glew Build included libGLEW, or use system libGLEW builtin-pcre Build included libpcre, or use system libpcre builtin-unuran Build included libunuran, or use system libunuran @@ -2058,6 +2061,7 @@ win32) logmsg "Will use by default builtin versions of libraries on Win32" enable_builtin_freetype="yes" enable_builtin_ftgl="yes" + enable_builtin_gl2ps="yes" enable_builtin_glew="yes" enable_builtin_pcre="yes" enable_builtin_unuran="yes" @@ -3222,6 +3226,38 @@ fi message "Checking whether to build included libfreetype6" result "$enable_builtin_freetype" +###################################################################### +# +### echo %%% libgl2ps (builtin or system) +# +if test "x$enable_builtin_gl2ps" = "xno" ; then + check_header "gl2ps.h" "" \ + $GL2PS ${GL2PS:+$GL2PS/include} /usr/include + if test "x$found_dir" = "x" ; then + enable_builtin_gl2ps=yes + else + gl2psinc=$found_hdr + gl2psincdir=$found_dir + fi + + check_library "libgl2ps" "$enable_shared" "" \ + $GL2PS ${GL2PS:+$GL2PS/lib} /usr/lib + if test "x$found_lib" = "x" ; then + gl2pslib="" + gl2pslibdir="" + enable_builtin_gl2ps="yes" + else + gl2pslib="$found_lib" + gl2pslibdir="$found_dir" + fi + + if test "x$gl2psincdir" = "x" || test "x$gl2pslib" = "x"; then + enable_builtin_gl2ps="yes" + fi +fi +message "Checking whether to build included gl2ps" +result "$enable_builtin_gl2ps" + ###################################################################### # ### echo %%% libpcre (builtin or system) - Mandatory lib @@ -7706,6 +7742,10 @@ sed -e "s|@aclocaldir@|$aclocaldir|" \ -e "s|@ftglincdir@|$ftglincdir|" \ -e "s|@ftgllibdir@|$ftgllibdir|" \ -e "s|@ftgllibs@|$ftgllibs|" \ + -e "s|@builtingl2ps@|$enable_builtin_gl2ps|" \ + -e "s|@gl2psincdir@|$gl2psincdir|" \ + -e "s|@gl2pslib@|$gl2pslib|" \ + -e "s|@gl2pslibdir@|$gl2pslibdir|" \ -e "s|@glewincdir@|$glewincdir|" \ -e "s|@glewlibdir@|$glewlibdir|" \ -e "s|@glewlibs@|$glewlibs|" \ diff --git a/graf3d/gl/CMakeLists.txt b/graf3d/gl/CMakeLists.txt index bae1b69493493..0ccb2f9338a81 100644 --- a/graf3d/gl/CMakeLists.txt +++ b/graf3d/gl/CMakeLists.txt @@ -5,14 +5,22 @@ include_directories(${OPENGL_INCLUDE_DIR} ${FTGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) ROOT_GLOB_HEADERS(headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h) -list(REMOVE_ITEM headers CsgOps.h TGLIncludes.h TGLWSIncludes.h +list(REMOVE_ITEM headers gl2ps.h CsgOps.h TGLIncludes.h TGLWSIncludes.h TGLMarchingCubes.h TKDEAdapter.h TGL5DPainter.h TKDEFGT.h TGLIsoMesh.h) +set (installoptions OPTIONS REGEX gl2ps.h EXCLUDE) ROOT_GLOB_SOURCES(sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx) if(WIN32 OR cocoa) list(REMOVE_ITEM headers TX11GL.h) list(REMOVE_ITEM sources TX11GL.cxx) - set(installoptions OPTIONS REGEX "TX11GL" EXCLUDE) + set(installoptions ${installoptions} REGEX TX11GL.h EXCLUDE) +endif() + +if(builtin_gl2ps) + include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/inc) +else() + list(REMOVE_ITEM sources gl2ps.cxx) + include_directories(${GL2PS_INCLUDE_DIRS}) endif() if(WIN32) @@ -32,6 +40,6 @@ set_source_files_properties(src/TGLText.cxx PROPERTIES COMPILE_FLAGS "${FTGL_CFL ROOT_GENERATE_DICTIONARY(G__GL ${headers} MODULE RGL LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM") -ROOT_LINKER_LIBRARY(RGL ${sources} G__GL.cxx LIBRARIES ${gllibs} GLEW ${FTGL_LIBRARIES} DEPENDENCIES Hist Gui Ged) +ROOT_LINKER_LIBRARY(RGL ${sources} G__GL.cxx LIBRARIES ${gllibs} ${GL2PS_LIBRARIES} GLEW ${FTGL_LIBRARIES} DEPENDENCIES Hist Gui Ged) ROOT_INSTALL_HEADERS(${installoptions}) diff --git a/graf3d/gl/Module.mk b/graf3d/gl/Module.mk index de87184e1a36b..401fe8b98d5c9 100644 --- a/graf3d/gl/Module.mk +++ b/graf3d/gl/Module.mk @@ -19,6 +19,7 @@ GLDO := $(GLDS:.cxx=.o) GLDH := $(GLDS:.cxx=.h) GLH := $(filter-out $(MODDIRI)/LinkDef%,$(wildcard $(MODDIRI)/*.h)) +GLH := $(filter-out $(MODDIRI)/gl2ps.h, $(GLH)) GLS := $(filter-out $(MODDIRS)/G__%,$(wildcard $(MODDIRS)/*.cxx)) # Excluded from win32 builds @@ -42,6 +43,13 @@ GLH1 := $(MODDIRI)/CsgOps.h \ # Used by rootcint GLH2 := $(filter-out $(GLH1), $(GLH)) +ifeq ($(BUILTINGL2PS),yes) +GL2PSFLAGS := -I$(MODDIRI) +else() +GLS := $(filter-out $(MODDIRS)/gl2ps.cxx, $(GLS)) +GL2PSFLAGS := $(GL2PSINCDIR:%=-I%) +endif() + ifneq ($(OPENGLLIB),) GLLIBS := $(OPENGLLIBDIR) $(OPENGLULIB) $(OPENGLLIB) \ $(XLIBS) -lm @@ -78,6 +86,7 @@ $(GLLIB): $(GLO) $(GLDO) $(ORDER_) $(MAINLIBS) $(GLLIBDEP) $(FTGLLIB) \ @$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" \ "$(SOFLAGS)" libRGL.$(SOEXT) $@ "$(GLO) $(GLO1) $(GLDO)" \ "$(GLLIBEXTRA) $(FTGLLIBDIR) $(FTGLLIBS) \ + $(GL2PSLIBDIR) $(GL2PSLIBS) \ $(GLEWLIBDIR) $(GLEWLIBS) $(GLLIBS)" $(call pcmrule,GL) @@ -107,12 +116,12 @@ distclean:: distclean-$(MODNAME) ##### extra rules ###### ifeq ($(ARCH),win32) $(GLO) $(GLDO): CXXFLAGS += $(OPENGLINCDIR:%=-I%) -I$(WIN32GDKDIR)/gdk/src \ - $(GDKDIRI:%=-I%) $(GLIBDIRI:%=-I%) + $(GDKDIRI:%=-I%) $(GLIBDIRI:%=-I%) $(GL2PSFLAGS) $(GLDS): CINTFLAGS += $(OPENGLINCDIR:%=-I%) -I$(WIN32GDKDIR)/gdk/src \ - $(GDKDIRI:%=-I%) $(GLIBDIRI:%=-I%) + $(GDKDIRI:%=-I%) $(GLIBDIRI:%=-I%) $(GL2PSFLAGS) else -$(GLO) $(GLDO): CXXFLAGS += $(OPENGLINCDIR:%=-I%) -$(GLDS): CINTFLAGS += $(OPENGLINCDIR:%=-I%) +$(GLO) $(GLDO): CXXFLAGS += $(OPENGLINCDIR:%=-I%) $(GL2PSFLAGS) +$(GLDS): CINTFLAGS += $(OPENGLINCDIR:%=-I%) $(GL2PSFLAGS) endif $(call stripsrc,$(GLDIRS)/TGLText.o): $(FREETYPEDEP) From 9efe7cff51f9d146c92e78d7d263eaa1bd5757a1 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:28:52 +0200 Subject: [PATCH 10/19] Don't use hexfloat constant Hexfloat constants are part of c++17. They can not be used when compileing with -std=c++11 or -std=c++14. Doing so will result in "error: exponent has no digits". It would be possible to use them with GNU extensions enabled (i.e. with -std=gnu++11 or -std=gnu++14), but root compilation is not configured this way. --- math/mathcore/src/mixmax.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/mathcore/src/mixmax.h b/math/mathcore/src/mixmax.h index 934bc9d439085..946f2420b45e7 100644 --- a/math/mathcore/src/mixmax.h +++ b/math/mathcore/src/mixmax.h @@ -129,7 +129,7 @@ void branch_inplace( rng_state_t* Xin, myID_t* ID ); // almost the same as apply #define MOD_REM(k) ((k) % MERSBASE ) // latest Intel CPU is supposed to do this in one CPU cycle, but on my machines it seems to be 20% slower than the best tricks #define MOD_MERSENNE(k) MOD_PAYNE(k) -#define INV_MERSBASE (0x1p-61) +#define INV_MERSBASE (4.336808689942017736029811203479766845703125e-19) // (0x1p-61) // the charpoly is irreducible for the combinations of N and SPECIAL and has maximal period for N=508, 256, half period for 1260, and 1/12 period for 3150 From 413de95ca7b18bcb7aeac5ad6d04b6a5d312e96c Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:28:59 +0200 Subject: [PATCH 11/19] Use the same sonames in cmake as in configure --- cmake/modules/RootNewMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/RootNewMacros.cmake b/cmake/modules/RootNewMacros.cmake index b5dec1bd4ffd6..61ef359d9e890 100644 --- a/cmake/modules/RootNewMacros.cmake +++ b/cmake/modules/RootNewMacros.cmake @@ -39,7 +39,7 @@ endif() if(soversion) set(ROOT_LIBRARY_PROPERTIES ${ROOT_LIBRARY_PROPERTIES} VERSION ${ROOT_VERSION} - SOVERSION ${ROOT_MAJOR_VERSION} + SOVERSION ${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION} SUFFIX ${libsuffix} PREFIX ${libprefix} ) else() From 5fdba3b857c1289d1ca410c9f9a50e07ea916829 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:04 +0200 Subject: [PATCH 12/19] Reduce the needed memory for compilation The linking of rootcling and libCling requires a lot of memory. Since these are linke form mostly the same objects, the build is ready to link them at the same time. If you make a parallel build this means that the two targets that require the most amount of memory are being linked in parallel. This exhausts the available memory, and the computer starts swapping. This adds a dependency of one of the targets to the other. The dependency is not really there since it is not needed for building, but it prevents the two memory consuming targets to be built in parallel. --- core/utils/CMakeLists.txt | 4 +++- core/utils/Module.mk | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/utils/CMakeLists.txt b/core/utils/CMakeLists.txt index 85b621c8a5235..dc538775e44d9 100644 --- a/core/utils/CMakeLists.txt +++ b/core/utils/CMakeLists.txt @@ -36,7 +36,9 @@ ROOT_EXECUTABLE(rootcling src/LinkdefReader.cxx src/DictSelectionReader.cxx ${CLING_LIBRARIES} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${corelinklibs}) -add_dependencies(rootcling CLING LLVMRES) +# The dependency on Cling was added to prevent Cling (libCling) and +# rootcling from being linked in parallel. +add_dependencies(rootcling CLING LLVMRES Cling) ROOT_EXECUTABLE(rlibmap src/rlibmap.cxx) diff --git a/core/utils/Module.mk b/core/utils/Module.mk index 6e35952455bcd..05e8019134594 100644 --- a/core/utils/Module.mk +++ b/core/utils/Module.mk @@ -25,9 +25,11 @@ else # ifneq ($(HOST),) CLINGMETAUTILSO = $(METAUTILSTO) $(METAUTILSOLLVM) ROOTCLINGEXEEXTRAO = $(COREO) $(COREDO) $(IOO) $(IODO) $(THREADO) $(THREADDO) $(METAOLLVM) +# The dependency on $(CLINGLIB) was added to prevent $(CLINGLIB) and +# $(ROOTCLINGEXE) from being linked in parallel. $(ROOTCLINGEXE): $(ROOTCLINGO) $(ROOTCLINGUTILO) $(ROOTCLINGTCLINGO) \ $(CLINGMETAUTILSO) $(SNPRINTFO) $(CLINGO) $(ROOTCLINGEXEEXTRAO) \ - $(PCREDEP) $(CORELIBDEP) + $(PCREDEP) $(CORELIBDEP) $(CLINGLIB) $(LD) $(LDFLAGS) $(OSTHREADLIBDIR) $(OSTHREADLIB) -o $@ $(ROOTCLINGO) $(ROOTCLINGUTILO) \ $(ROOTCLINGTCLINGO) $(CLINGMETAUTILSO) \ $(SNPRINTFO) $(CLINGO) $(ROOTCLINGEXEEXTRAO) $(CLINGLIBEXTRA) \ From 89bc4e19e57204cc208b6e0c7e72d65aeffde0c8 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:09 +0200 Subject: [PATCH 13/19] Allow building for ppc64 as well as ppc64le --- cmake/modules/SetUpLinux.cmake | 4 ++-- config/root-config.in | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cmake/modules/SetUpLinux.cmake b/cmake/modules/SetUpLinux.cmake index 07a77b50c1e9f..a3af6f943072d 100644 --- a/cmake/modules/SetUpLinux.cmake +++ b/cmake/modules/SetUpLinux.cmake @@ -30,8 +30,8 @@ elseif(${SYSCTL_OUTPUT} MATCHES aarch64) else() message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") endif() -elseif(${SYSCTL_OUTPUT} MATCHES ppc64le) - message(STATUS "Found a 64bit ppc64 little endian system") +elseif(${SYSCTL_OUTPUT} MATCHES ppc64) + message(STATUS "Found a 64bit PPC system (ppc64/ppc64le)") set(SPECIAL_CINT_FLAGS "-DG__64BIT") if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Found GNU compiler collection") diff --git a/config/root-config.in b/config/root-config.in index 674e2e7a3d2ae..f1260c37e98e7 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -205,17 +205,12 @@ linuxicc) ;; linuxppcgcc) # PPC Linux with gcc - auxcflags="${cxxversionflag} -Wno-deprecated-declarations -fsigned-char -I/usr/X11/include" + auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m32 -fsigned-char" + auxldflags="-m32" auxlibs="-lm -ldl -rdynamic" ;; linuxppc64gcc) - # PPC64 (64 bit mode) Linux with gcc 3.x - auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m64 -fsigned-char" - auxldflags="-m64" - auxlibs="-lm -ldl -rdynamic" - ;; -ppc64le) - # PPC64 (64 bit mode) little endian + # PPC64/PPC64LE (64 bit mode) Linux with gcc auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m64 -fsigned-char" auxldflags="-m64" auxlibs="-lm -ldl -rdynamic" From 7641a3c6850672918169a8255834ef36e02d8087 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:15 +0200 Subject: [PATCH 14/19] Add build instructions for 32 bit ARM --- cmake/modules/SetUpLinux.cmake | 14 +++++++++++++- interpreter/CMakeLists.txt | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/modules/SetUpLinux.cmake b/cmake/modules/SetUpLinux.cmake index a3af6f943072d..50008fbd781b9 100644 --- a/cmake/modules/SetUpLinux.cmake +++ b/cmake/modules/SetUpLinux.cmake @@ -19,7 +19,7 @@ if(${SYSCTL_OUTPUT} MATCHES x86_64) message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") endif() elseif(${SYSCTL_OUTPUT} MATCHES aarch64) - message(STATUS "Found a 64bit system") + message(STATUS "Found a 64bit ARM system") set(SPECIAL_CINT_FLAGS "-DG__64BIT") if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "Found GNU compiler collection") @@ -42,6 +42,18 @@ elseif(${SYSCTL_OUTPUT} MATCHES ppc64) else() message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") endif() +elseif(${SYSCTL_OUTPUT} MATCHES arm) + message(STATUS "Found a 32bit ARM system") + set(SPECIAL_CINT_FLAGS "") + if(CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "Found GNU compiler collection") + set(ROOT_ARCHITECTURE linuxarm) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + message(STATUS "Found CLANG compiler") + set(ROOT_ARCHITECTURE linuxarm) + else() + message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") + endif() else() message(STATUS "Found a 32bit system") set(BIT_ENVIRONMENT "-m32") diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index d0424aba3f544..85335868e0f4e 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -17,6 +17,8 @@ set(CMAKE_REQUIRED_QUIET 1) # Make the configuration of LLVM quiet if(ROOT_ARCHITECTURE MATCHES linuxarm64) set(ROOT_CLING_TARGET "AArch64") +elseif(ROOT_ARCHITECTURE MATCHES linuxarm) + set(ROOT_CLING_TARGET "ARM") elseif(ROOT_ARCHITECTURE MATCHES linuxppc64gcc) set(ROOT_CLING_TARGET "PowerPC") elseif(ROOT_ARCHITECTURE MATCHES linux) From 8cb6c711031599b8c0e39faf45443e59e68b0f78 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:21 +0200 Subject: [PATCH 15/19] Add build instructions for System Z (s390 and s390x) --- cmake/modules/SetUpLinux.cmake | 26 ++++++++++++++++++++++ config/root-config.in | 12 ++++++++++ core/base/inc/RConfig.h | 13 +++++++++++ interpreter/CMakeLists.txt | 2 ++ interpreter/llvm/src/cmake/config-ix.cmake | 2 ++ 5 files changed, 55 insertions(+) diff --git a/cmake/modules/SetUpLinux.cmake b/cmake/modules/SetUpLinux.cmake index 50008fbd781b9..68ed660523e26 100644 --- a/cmake/modules/SetUpLinux.cmake +++ b/cmake/modules/SetUpLinux.cmake @@ -54,6 +54,32 @@ elseif(${SYSCTL_OUTPUT} MATCHES arm) else() message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") endif() +elseif(${SYSCTL_OUTPUT} MATCHES s390x) + message(STATUS "Found a 64bit system") + set(BIT_ENVIRONMENT "-m64") + set(SPECIAL_CINT_FLAGS "-DG__64BIT") + if(CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "Found GNU compiler collection") + set(ROOT_ARCHITECTURE linuxs390xgcc) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + message(STATUS "Found CLANG compiler") + set(ROOT_ARCHITECTURE linuxs390xgcc) + else() + message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") + endif() +elseif(${SYSCTL_OUTPUT} MATCHES s390) + message(STATUS "Found a 31bit system") + set(BIT_ENVIRONMENT "-m31") + set(SPECIAL_CINT_FLAGS "") + if(CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "Found GNU compiler collection") + set(ROOT_ARCHITECTURE linuxs390gcc) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + message(STATUS "Found CLANG compiler") + set(ROOT_ARCHITECTURE linuxs390gcc) + else() + message(FATAL_ERROR "There is no Setup for this compiler up to now. Don't know what to do. Stop cmake at this point.") + endif() else() message(STATUS "Found a 32bit system") set(BIT_ENVIRONMENT "-m32") diff --git a/config/root-config.in b/config/root-config.in index f1260c37e98e7..a50823df369bd 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -215,6 +215,18 @@ linuxppc64gcc) auxldflags="-m64" auxlibs="-lm -ldl -rdynamic" ;; +linuxs390gcc) + # s390 (31 bit mode) Linux with gcc + auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m31 -fsigned-char" + auxldflags="-m31" + auxlibs="-lm -ldl -rdynamic" + ;; +linuxs390xgcc) + # s390x (64 bit mode) Linux with gcc + auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m64 -fsigned-char" + auxldflags="-m64" + auxlibs="-lm -ldl -rdynamic" + ;; linuxx8664gcc) # AMD Opteron and Intel EM64T (64 bit mode) Linux with gcc 3.x auxcflags="${cxxversionflag} -Wno-deprecated-declarations -m64" diff --git a/core/base/inc/RConfig.h b/core/base/inc/RConfig.h index 1e6a0e147bdd6..2208bead8513a 100644 --- a/core/base/inc/RConfig.h +++ b/core/base/inc/RConfig.h @@ -202,6 +202,19 @@ # define NEED_SIGJMP #endif +#if defined(linux) && defined(__s390__) +# define R__LINUX +# define R__UNIX +# define NEED_SIGJMP +#endif + +#if defined(linux) && defined(__s390x__) +# define R__LINUX +# define R__UNIX +# define R__B64 +# define NEED_SIGJMP +#endif + #if defined(__MACH__) && defined(__i386__) && !defined(__APPLE__) # define R__HURD # define f2cFortran /* cfortran.h does not know HURD - sigh */ diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 85335868e0f4e..2c33bd9c18583 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -21,6 +21,8 @@ elseif(ROOT_ARCHITECTURE MATCHES linuxarm) set(ROOT_CLING_TARGET "ARM") elseif(ROOT_ARCHITECTURE MATCHES linuxppc64gcc) set(ROOT_CLING_TARGET "PowerPC") +elseif(ROOT_ARCHITECTURE MATCHES linuxs390) + set(ROOT_CLING_TARGET "SystemZ") elseif(ROOT_ARCHITECTURE MATCHES linux) set(ROOT_CLING_TARGET "X86") elseif(ROOT_ARCHITECTURE MATCHES macosx) diff --git a/interpreter/llvm/src/cmake/config-ix.cmake b/interpreter/llvm/src/cmake/config-ix.cmake index 035dd676f7387..01684ce35f2c6 100644 --- a/interpreter/llvm/src/cmake/config-ix.cmake +++ b/interpreter/llvm/src/cmake/config-ix.cmake @@ -372,6 +372,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "hexagon") set(LLVM_NATIVE_ARCH Hexagon) elseif (LLVM_NATIVE_ARCH MATCHES "s390x") set(LLVM_NATIVE_ARCH SystemZ) +elseif (LLVM_NATIVE_ARCH MATCHES "s390") + set(LLVM_NATIVE_ARCH SystemZ) else () message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}") endif () From 82c7ac3cd488d050cb703d2e25553f99fd6583b3 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:27 +0200 Subject: [PATCH 16/19] Always build LLVM as static libraries --- interpreter/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 2c33bd9c18583..b26f6fce96110 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -70,6 +70,7 @@ else() endif() endif() set(CMAKE_BUILD_TYPE ${LLVM_BUILD_TYPE}) +set(BUILD_SHARED_LIBS "NO") #--- Do not build cling as part of llvm. set(LLVM_NOCLING "YES") From 08ece650d9e7a860f4306670255eea9e5a492de9 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sun, 10 Apr 2016 18:29:33 +0200 Subject: [PATCH 17/19] Make sure that the roots wrapper can be executed --- config/roots.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 config/roots.in diff --git a/config/roots.in b/config/roots.in old mode 100644 new mode 100755 From abef77f6fde41275f55c0ba665c395e9b7ae9e2c Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Mon, 13 Jun 2016 16:35:13 +0200 Subject: [PATCH 18/19] More inconsistent case variant of CMAKE_Fortran_FLAGS --- cmake/modules/RootConfiguration.cmake | 2 +- cmake/scripts/RootUseFile.cmake.in | 2 +- etc/cmake/RootUseFile.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index f51bcbec0805d..1ee06028c87e8 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -569,7 +569,7 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig-version.cmake.in #---Compiler flags (because user apps are a bit dependent on them...)---------------------------------------- string(REGEX REPLACE "(^|[ ]*)-W[^ ]*" "" __cxxflags "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "(^|[ ]*)-W[^ ]*" "" __cflags "${CMAKE_C_FLAGS}") -string(REGEX REPLACE "(^|[ ]*)-W[^ ]*" "" __fflags "${CMAKE_fortran_FLAGS}") +string(REGEX REPLACE "(^|[ ]*)-W[^ ]*" "" __fflags "${CMAKE_Fortran_FLAGS}") set(ROOT_COMPILER_FLAG_HINTS "# set(ROOT_CXX_FLAGS \"${__cxxflags}\") set(ROOT_C_FLAGS \"${__cflags}\") diff --git a/cmake/scripts/RootUseFile.cmake.in b/cmake/scripts/RootUseFile.cmake.in index 045926d836a79..a4197441819f6 100644 --- a/cmake/scripts/RootUseFile.cmake.in +++ b/cmake/scripts/RootUseFile.cmake.in @@ -9,4 +9,4 @@ link_directories(${ROOT_LIBRARY_DIR}) add_definitions(${ROOT_DEFINITIONS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}") -set(CMAKE_fortran_FLAGS "${CMAKE_fortran_FLAGS} ${ROOT_fortran_FLAGS}") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}") diff --git a/etc/cmake/RootUseFile.cmake b/etc/cmake/RootUseFile.cmake index b9a8e34e822c0..f931ad3384f35 100644 --- a/etc/cmake/RootUseFile.cmake +++ b/etc/cmake/RootUseFile.cmake @@ -6,4 +6,4 @@ link_directories(${ROOT_LIBRARY_DIR}) add_definitions(${ROOT_DEFINITIONS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}") -set(CMAKE_fortran_FLAGS "${CMAKE_fortran_FLAGS} ${ROOT_fortran_FLAGS}") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}") From 7a30b82c336efd922883df1ed1eda52df6cd1460 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Fri, 17 Jun 2016 13:45:57 +0200 Subject: [PATCH 19/19] Move gl2ps.h to its own subdir --- graf3d/gl/CMakeLists.txt | 7 +++---- graf3d/gl/Module.mk | 3 +-- graf3d/gl/src/{ => gl2ps}/gl2ps.h | 0 3 files changed, 4 insertions(+), 6 deletions(-) rename graf3d/gl/src/{ => gl2ps}/gl2ps.h (100%) diff --git a/graf3d/gl/CMakeLists.txt b/graf3d/gl/CMakeLists.txt index 47e71b309f09f..5aeb190a7bdac 100644 --- a/graf3d/gl/CMakeLists.txt +++ b/graf3d/gl/CMakeLists.txt @@ -5,19 +5,18 @@ include_directories(${OPENGL_INCLUDE_DIR} ${FTGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) ROOT_GLOB_HEADERS(headers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h) -list(REMOVE_ITEM headers gl2ps.h CsgOps.h TGLIncludes.h TGLWSIncludes.h +list(REMOVE_ITEM headers CsgOps.h TGLIncludes.h TGLWSIncludes.h TGLMarchingCubes.h TKDEAdapter.h TGL5DPainter.h TKDEFGT.h TGLIsoMesh.h) -set (installoptions OPTIONS REGEX gl2ps.h EXCLUDE) ROOT_GLOB_SOURCES(sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cxx) if(WIN32 OR cocoa) list(REMOVE_ITEM headers TX11GL.h) list(REMOVE_ITEM sources TX11GL.cxx) - set(installoptions ${installoptions} REGEX TX11GL.h EXCLUDE) + set(installoptions OPTIONS REGEX "TX11GL" EXCLUDE) endif() if(builtin_gl2ps) - include_directories(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/inc) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/gl2ps) else() list(REMOVE_ITEM sources gl2ps.cxx) include_directories(${GL2PS_INCLUDE_DIRS}) diff --git a/graf3d/gl/Module.mk b/graf3d/gl/Module.mk index 9b5a28ef43baf..f514c6fda0ef0 100644 --- a/graf3d/gl/Module.mk +++ b/graf3d/gl/Module.mk @@ -19,7 +19,6 @@ GLDO := $(GLDS:.cxx=.o) GLDH := $(GLDS:.cxx=.h) GLH := $(filter-out $(MODDIRI)/LinkDef%,$(wildcard $(MODDIRI)/*.h)) -GLH := $(filter-out $(MODDIRI)/gl2ps.h, $(GLH)) GLS := $(filter-out $(MODDIRS)/G__%,$(wildcard $(MODDIRS)/*.cxx)) # Excluded from win32 builds @@ -44,7 +43,7 @@ GLH1 := $(MODDIRI)/CsgOps.h \ GLH2 := $(filter-out $(GLH1), $(GLH)) ifeq ($(BUILTINGL2PS),yes) -GL2PSFLAGS := -I$(MODDIRI) +GL2PSFLAGS := -I$(MODDIRS)/gl2ps else() GLS := $(filter-out $(MODDIRS)/gl2ps.cxx, $(GLS)) GL2PSFLAGS := $(GL2PSINCDIR:%=-I%) diff --git a/graf3d/gl/src/gl2ps.h b/graf3d/gl/src/gl2ps/gl2ps.h similarity index 100% rename from graf3d/gl/src/gl2ps.h rename to graf3d/gl/src/gl2ps/gl2ps.h