From 57cb484587cd7f778f29fc021b8976f57f33ef79 Mon Sep 17 00:00:00 2001 From: maier Date: Sat, 22 Sep 2012 08:55:51 +0000 Subject: [PATCH] Bugfix: Move the library information in Make.global_options.in to LIBS git-svn-id: https://svn.dealii.org/branches/branch_cmake@26627 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/configure/configure_1_tbb.cmake | 8 + deal.II/config/CMakeLists.txt | 31 ++-- deal.II/config/Make.global_options.in | 166 ++++++++++++------ .../tbb/tbb30_104oss/src/CMakeLists.txt | 13 +- 4 files changed, 150 insertions(+), 68 deletions(-) diff --git a/deal.II/cmake/configure/configure_1_tbb.cmake b/deal.II/cmake/configure/configure_1_tbb.cmake index 27f2e530e5..8804386f8e 100644 --- a/deal.II/cmake/configure/configure_1_tbb.cmake +++ b/deal.II/cmake/configure/configure_1_tbb.cmake @@ -101,6 +101,7 @@ MACRO(FEATURE_TBB_CONFIGURE_EXTERNAL var) IF (CMAKE_BUILD_TYPE MATCHES "Debug") IF(TBB_DEBUG_FOUND) LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${TBB_DEBUG_LIBRARY}) + ADD_DEFINITIONS("-DTBB_USE_DEBUG=1" "-DTBB_DO_ASSERT=1") ELSE() MESSAGE(WARNING "\n" "deal.II was configured with CMAKE_BUILD_TYPE=Debug but no debug tbb\n" @@ -138,6 +139,13 @@ MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var) ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-parentheses") ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-long") + # + # Add some definitions to use the header files in debug mode: + # + IF (CMAKE_BUILD_TYPE MATCHES "Debug") + ADD_DEFINITIONS("-DTBB_DO_DEBUG=1" "-DTBB_DO_ASSERT=1") + ENDIF() + INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/include ) diff --git a/deal.II/config/CMakeLists.txt b/deal.II/config/CMakeLists.txt index 0bd9b84bfb..7517c25a4f 100644 --- a/deal.II/config/CMakeLists.txt +++ b/deal.II/config/CMakeLists.txt @@ -48,34 +48,37 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) # actually understands: # - TO_STRING(MAKEFILE_LIBRARIES - ${DEAL_II_EXTERNAL_LIBRARIES} - ${DEAL_II_LIBRARIES} - ) - TO_STRING(MAKEFILE_DEFINITIONS ${DEAL_II_EXTERNAL_DEFINITIONS} ) - TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS - "${CMAKE_INCLUDE_FLAG_C}" + TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_C}" ${DEAL_II_EXTERNAL_INCLUDE_DIRS} ${DEAL_II_INCLUDE_DIRS} ) - # - # Add an rpath directive so that libraries outside of the default search - # directories will be found by the runtime dynamic linker: + # Add an rpath directive inf front of each library, so that libraries + # outside of the default search directories will be found by the runtime + # dynamic linker: # FOREACH(lib ${DEAL_II_EXTERNAL_LIBRARIES} ${DEAL_II_LIBRARIES}) GET_FILENAME_COMPONENT(path ${lib} PATH) - LIST(APPEND MAKEFILE_RPATHFLAGS "-Wl,-rpath -Wl,${path}") + LIST(APPEND MAKEFILE_LIBS "-Wl,-rpath -Wl,${path}") + # + # Change this into the canonical -L -l format: + # + LIST(APPEND MAKEFILE_LIBS ${lib}) ENDFOREACH() - LIST(REMOVE_DUPLICATES MAKEFILE_RPATHFLAGS) - TO_STRING(MAKEFILE_RPATHFLAGS ${MAKEFILE_RPATHFLAGS}) + TO_STRING(MAKEFILE_LIBS ${MAKEFILE_LIBS}) + + # + # Put our linker flags directly in front of this string: + # + SET(MAKEFILE_LIBS + "${CMAKE_SHARED_LINKER_FLAGS} ${MAKEFILE_LIBS}" + ) - SET(MAKEFILE_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in diff --git a/deal.II/config/Make.global_options.in b/deal.II/config/Make.global_options.in index 407ca83e74..adab5e3851 100644 --- a/deal.II/config/Make.global_options.in +++ b/deal.II/config/Make.global_options.in @@ -4,40 +4,63 @@ # Compatibility Make.global_options file # -# TODO: Update the old comment and put it back again -# -# - Setup OBJEXT and EXEEXT in a way this makefile expects them +############################################################################### +## Please note: +## +## This is a compatibility Make.global_options file generated by cmake +## from the ./config/Make.global_options.in file. +## +## This file exports several variables. They are documented in +## the file doc/development/makefiles.html. If you add a new +## variable, make sure it is documented in +## doc/development/makefiles.1.html and listed in +## doc/development/Makefile. +############################################################################### + + +###################################################################### +# Since most of our makefiles at some point use bash features, choose +# bash as default shell here once and for all +SHELL=/bin/bash + # # *** ISSUES *** # -# - What is LIBS for? There is this other mechanism for specifying -# full paths of necessary libraries. We know all the libraries with full -# path, so we just use the latter mechanism and leave LIBS empty for now. -# # - The link line "$(CXX) -o $@ $(LIBS) $(LDFLAGS)" # of the examples is broken. LDFLAGS should be in front. +# So, we specify just one big blobb of ldflags and libraries (including +# deal.II) with corresponding RPATH flags in the LIBS variable # -# TODO: Move all the target libraries to the LIBS variable. +# *** TODO *** # -# TODO: Set up the other configuration variables that are currently -# removed... +# - Update the online documentation # +###################################################### +# the following lines will be replaced by cmake +# D = @CMAKE_INSTALL_PREFIX@ CXX = @CMAKE_CXX_COMPILER@ CXX-ID = @CMAKE_CXX_COMPILER_ID@ CXX-VERSION = @CMAKE_CXX_COMPILER_VERSION@ +#GXX-VERSION +#GXX-VERSION-DETAILED CC = @CMAKE_C_COMPILER@ CC-ID = @CMAKE_C_COMPILER_ID@ -CC-VERSION = @CMAKE_C_COMPILER_VERSION@ +CC-VERSION = @CMAKE_C_COMPILER_VERSION@ #changed +#SHLIBLD +#SHLIBFLAGS AR = @CMAKE_AR@ RANLIB = @CMAKE_RANLIB@ -LDFLAGS = @MAKEFILE_LDFLAGS@ @MAKEFILE_RPATHFLAGS@ -LIBS = #Empty - +LDFLAGS = # intentionally left empty and specified in LIBS +#F77 +#F77-VERSION +#F77LIBS +LIBS = @MAKEFILE_LIBS@ LIBDIR = @CMAKE_INSTALL_PREFIX@/@DEAL_II_LIBRARY_RELDIR@ - +#PERL +#QMAKE enable-threads = @MAKEFILE_enablethreads@ enable-shared = @MAKEFILE_enableshared@ enable-parser = @MAKEFILE_enableparser@ @@ -45,9 +68,70 @@ DEAL_II_VERSION = @VERSION@ DEAL_II_MAJOR = @DEAL_II_MAJOR@ DEAL_II_MINOR = @DEAL_II_MINOR@ -DEAL_II_USE_MPI = @DEAL_II_WITH_MPI@ +# +# TODO: Reenable or remove +# -#TARGET = @target@ # TODO +#USE_CONTRIB_PETSC = @USE_CONTRIB_PETSC@ +#DEAL_II_PETSC_DIR = @DEAL_II_PETSC_DIR@ +#DEAL_II_PETSC_ARCH = @DEAL_II_PETSC_ARCH@ +#DEAL_II_PETSC_VERSION_MAJOR = @DEAL_II_PETSC_VERSION_MAJOR@ +#DEAL_II_PETSC_VERSION_MINOR = @DEAL_II_PETSC_VERSION_MINOR@ +#DEAL_II_PETSC_VERSION_SUBMINOR = @DEAL_II_PETSC_VERSION_SUBMINOR@ +#DEAL_II_PETSC_VERSION_DEV = @DEAL_II_PETSC_VERSION_DEV@ +#DEAL_II_PETSC_MPIUNI_LIB = @DEAL_II_PETSC_MPIUNI_LIB@ + +#USE_CONTRIB_SLEPC = @USE_CONTRIB_SLEPC@ +#DEAL_II_SLEPC_DIR = @DEAL_II_SLEPC_DIR@ +#DEAL_II_SLEPC_VERSION_MAJOR = @DEAL_II_SLEPC_VERSION_MAJOR@ +#DEAL_II_SLEPC_VERSION_MINOR = @DEAL_II_SLEPC_VERSION_MINOR@ +#DEAL_II_SLEPC_VERSION_SUBMINOR = @DEAL_II_SLEPC_VERSION_SUBMINOR@ + +#USE_CONTRIB_TRILINOS = @USE_CONTRIB_TRILINOS@ +#DEAL_II_TRILINOS_INCDIR = @DEAL_II_TRILINOS_INCDIR@ +#DEAL_II_TRILINOS_LIBDIR = @DEAL_II_TRILINOS_LIBDIR@ +#DEAL_II_TRILINOS_SHARED = @DEAL_II_TRILINOS_SHARED@ +#DEAL_II_TRILINOS_STATIC = @DEAL_II_TRILINOS_STATIC@ +#DEAL_II_TRILINOS_VERSION_MAJOR = @DEAL_II_TRILINOS_VERSION_MAJOR@ +#DEAL_II_TRILINOS_VERSION_MINOR = @DEAL_II_TRILINOS_VERSION_MINOR@ +#DEAL_II_TRILINOS_VERSION_SUBMINOR = @DEAL_II_TRILINOS_VERSION_SUBMINOR@ +#DEAL_II_TRILINOS_LIBPREFIX = @DEAL_II_TRILINOS_LIBPREFIX@ + +#USE_CONTRIB_HDF5 = @USE_CONTRIB_HDF5@ +#DEAL_II_HDF5_VERSION = @DEAL_II_HDF5_VERSION@ +#DEAL_II_HDF5_CFLAGS = @DEAL_II_HDF5_CFLAGS@ +#DEAL_II_HDF5_CPPFLAGS = @DEAL_II_HDF5_CPPFLAGS@ +#DEAL_II_HDF5_LDFLAGS = @DEAL_II_HDF5_LDFLAGS@ +#DEAL_II_HDF5_INCDIR = @DEAL_II_HDF5_INCDIR@ + +#USE_CONTRIB_BLAS = @USE_CONTRIB_BLAS@ +#USE_CONTRIB_LAPACK = @USE_CONTRIB_LAPACK@ + +#USE_CONTRIB_MUMPS = @USE_CONTRIB_MUMPS@ +#DEAL_II_MUMPS_DIR = @DEAL_II_MUMPS_DIR@ +#DEAL_II_SCALAPACK_DIR = @DEAL_II_SCALAPACK_DIR@ +#DEAL_II_BLACS_DIR = @DEAL_II_BLACS_DIR@ +#DEAL_II_BLACS_ARCH = @DEAL_II_BLACS_ARCH@ + +#USE_CONTRIB_ARPACK = @USE_CONTRIB_ARPACK@ +#DEAL_II_ARPACK_DIR = @DEAL_II_ARPACK_DIR@ +#DEAL_II_ARPACK_ARCH = @DEAL_II_ARPACK_ARCH@ + +#USE_CONTRIB_METIS = @USE_CONTRIB_METIS@ +#DEAL_II_METIS_DIR = @DEAL_II_METIS_DIR@ +#DEAL_II_METIS_LIBDIR = @DEAL_II_METIS_LIBDIR@ +#DEAL_II_METIS_INCDIR = @DEAL_II_METIS_INCDIR@ + +#USE_CONTRIB_HSL = @USE_CONTRIB_HSL@ +#USE_CONTRIB_UMFPACK = @USE_CONTRIB_UMFPACK@ + +#USE_CONTRIB_P4EST = @USE_CONTRIB_P4EST@ +#DEAL_II_P4EST_DIR = @DEAL_II_P4EST_DIR@ +#DEAL_II_P4EST_LIBDIR_NAME = @DEAL_II_P4EST_LIBDIR_NAME@ + +DEAL_II_USE_MPI = @MAKEFILE_MPI@ + +TARGET = # TODO: Well, yes. ###################################################### # now configuration for compiler flags, paths, etc @@ -56,59 +140,43 @@ DEAL_II_USE_MPI = @DEAL_II_WITH_MPI@ LIBPATH += $(addprefix -L,$(LIBDIR)) -static-lib-suffix = @CMAKE_STATIC_LIBRARY_SUFFIX@ -shared-lib-suffix = @CMAKE_SHARED_LIBRARY_SUFFIX@ - -ifeq ($(enable-shared),yes) - lib-suffix = $(shared-lib-suffix) -else - lib-suffix = $(static-lib-suffix) -endif # add search path for libraries to make dependencies -vpath %@static_lib_suffix@ $(LIBDIR) -vpath %@shared_lib_suffix@ $(LIBDIR) +vpath %@CMAKE_STATIC_LIBRARY_SUFFIX@ $(LIBDIR) +vpath %@CMAKE_SHARED_LIBRARY_SUFFIX@ $(LIBDIR) OBJEXT = o # TODO: @CMAKE_CXX_OUTPUT_EXTENSION@ :-* -EXEEXT = @EXEEXT@ # TODO +EXEEXT = # TODO # set paths to all the libraries we need: -lib-deal2.o = ${MAKEFILE_LIBRARIES} -lib-deal2.g = ${MAKEFILE_LIBRARIES} +lib-deal2.o = ${DEAL_II_LIBRARIES} +lib-deal2.g = ${DEAL_II_LIBRARIES} -# necessary includes: +# include paths as command line flags. while compilers allow a space between +# the '-I' and the actual path, we also send these flags to the +# make_dependencies program that doesn't support the extra space. +# INCLUDE = ${MAKEFILE_INCLUDE_DIRS} # compiler flags for debug and optimized mode -CXXFLAGS.g = @CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_DEBUG@ @MAKEFILE_DEFINITIONS@ $(INCLUDE) -CXXFLAGS.o = @CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_RELEASE@ @MAKEFILE_DEFINITIONS@ $(INCLUDE) +CXXFLAGS.g = @CMAKE_CXX_FLAGS@ ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} @MAKEFILE_DEFINITIONS@ $(INCLUDE) +CXXFLAGS.o = $(CXXFLAGS.g) +#F77FLAGS.g +#F77FLAGS.o # compile flags for C compiler -CFLAGS.g = @CMAKE_C_FLAGS@ @CMAKE_C_FLAGS_DEBUG@ @MAKEFILE_DEFINITIONS@ -CFLAGS.o = @CMAKE_C_FLAGS@ @CMAKE_C_FLAGS_RELEASE@ @MAKEFILE_DEFINITIONS@ +CFLAGS.g = @CMAKE_C_FLAGS@ ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} @MAKEFILE_DEFINITIONS@ +CFLAGS.o = $(CFLAGS.g) -ifneq ($(enable-threads),no) +ifeq ($(enable-threads),yes) MT = MT else MT = == endif - -ifeq ($(BUILDTEST),yes) -print-summary: - @svn info .. | perl -ne 'print "dealii-feature: revision=$$_\n" if s/Revision: //; print "dealii-feature: branch=$$1\n" if m/svn\/dealii\/(.+)\/deal.II/;' - @echo "dealii-feature: user=$(USER)" - @echo "dealii-feature: host=`hostname`" - @echo "dealii-feature: target=$(TARGET)" - @echo "dealii-feature: compiler=$(GXX-VERSION-DETAILED)" - @echo "dealii-feature: multithreading=$(enable-threads)" - @echo "dealii-feature: shared_libs=$(enable-shared)" - @echo "dealii-feature: METIS=$(subst no,,$(USE_CONTRIB_METIS))" - @cd $D/common/scripts ; make report_features && ./report_features -endif diff --git a/deal.II/contrib/tbb/tbb30_104oss/src/CMakeLists.txt b/deal.II/contrib/tbb/tbb30_104oss/src/CMakeLists.txt index df41682ec5..2cf4b27877 100644 --- a/deal.II/contrib/tbb/tbb30_104oss/src/CMakeLists.txt +++ b/deal.II/contrib/tbb/tbb30_104oss/src/CMakeLists.txt @@ -49,6 +49,11 @@ SET(src_tbb ADD_LIBRARY(obj_tbb OBJECT ${src_tbb}) +# +# For debug build -DTBB_USE_DEBUG and -DTBB_DO_ASSERT=1 will be defined +# globally by the configure script specified. +# + # # Add necessary definitions: # @@ -56,10 +61,6 @@ IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DDO_ITT_NOTIFY") ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") - ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DTBB_USE_DEBUG") -ENDIF() - IF(DEAL_II_USE_MT_POSIX) ADD_FLAGS(obj_tbb_COMPILE_FLAGS "-DUSE_PTHREAD") ENDIF() @@ -69,5 +70,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows") ENDIF() SET_TARGET_PROPERTIES(obj_tbb PROPERTIES - COMPILE_FLAGS ${obj_tbb_COMPILE_FLAGS}) + COMPILE_FLAGS ${obj_tbb_COMPILE_FLAGS} + ) + -- 2.39.5