diff --git a/third-party/MUMPS_4.10.0_make.inc.cmake b/third-party/MUMPS_4.10.0_make.inc.cmake index 539c84cd8..74f85401e 100644 --- a/third-party/MUMPS_4.10.0_make.inc.cmake +++ b/third-party/MUMPS_4.10.0_make.inc.cmake @@ -1,168 +1,84 @@ -# -# This file is part of MUMPS 4.9.2, built on Thu Nov 5 07:05:08 UTC 2009 -# -################################################################################ -# -# Makefile.inc.generic -# -# This defines some parameters dependent on your platform; you should -# look for the approriate file in the directory ./Make.inc/ and copy it -# into a file called Makefile.inc. For example, from the MUMPS root -# directory, use -# "cp Make.inc/Makefile.inc.generic ./Makefile.inc" -# (see the main README file for details) -# -# If you do not find any suitable Makefile in Makefile.inc, use this file: -# "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according -# to the comments given below. If you manage to build MUMPS on a new platform, -# and think that this could be useful to others, you may want to send us -# the corresponding Makefile.inc file. -# -################################################################################ - -# CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION. MUMPS_TYPE = @MUMPS_TYPE@ - -# PLAT : use it to add a default suffix to the generated libraries -PLAT = @MUMPS_PREFIX@ +PLAT = @MUMPS_PREFIX@ LIBEXT = @CMAKE_STATIC_LIBRARY_SUFFIX@ SHLIBEXT = @CMAKE_SHARED_LIBRARY_SUFFIX@ OUTC = -o OUTF = -o - - -######################################################################## -#Begin orderings -# -# NOTE that PORD is distributed within MUMPS by default. If you would like to -# use other orderings, you need to obtain the corresponding package and modify -# the variables below accordingly. -# For example, to have Metis available within MUMPS: -# 1/ download Metis and compile it -# 2/ uncomment (suppress # in first column) lines -# starting with LMETISDIR, LMETIS -# 3/ add -Dmetis in line ORDERINGSF -# ORDERINGSF = -Dpord -Dmetis -# 4/ Compile and install MUMPS -# make clean; make (to clean up previous installation) -# -# Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 5.1 and later) orderings are now available for MUMPS. -# - ISCOTCH = -I@SCOTCH_INCLUDE_DIR@ -# You have to choose one among the following two lines depending on -# the type of analysis you want to perform. If you want to perform only -# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF -# variable below); for both parallel and sequential analysis choose the second -# line (remember to add -Dptscotch in the ORDERINGSF variable below) LSCOTCH = @MUMPS_SCOTCH_LIBRARIES@ - LPORDDIR = $(topdir)/PORD/lib/ IPORD = -I$(topdir)/PORD/include/ LPORD = -L$(LPORDDIR) -lpord$(PLAT) - -#LMETISDIR = /local/metis/ -#IMETIS = # Metis doesn't need include files (Fortran interface avail.) - -# You have to choose one among the following two lines depending on -# the type of analysis you want to perform. If you want to perform only -# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF -# variable below); for both parallel and sequential analysis choose the second -# line (remember to add -Dparmetis in the ORDERINGSF variable below) - -#LMETIS = -L$(LMETISDIR) -lmetis -#LMETIS = -L$(LMETISDIR) -lparmetis -lmetis - -# The following variables will be used in the compilation process. -# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively. -#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis ORDERINGSF = -Dpord -Dscotch ORDERINGSC = $(ORDERINGSF) - LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH) IORDERINGSF = $(ISCOTCH) IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH) - -#End orderings -######################################################################## -# DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC... - -# RM : remove files RM = @CMAKE_COMMAND@ -E remove -f MKDIR = @CMAKE_COMMAND@ -E make_directory CP = cp -af ifeq ($(MUMPS_TYPE),seq) # CC : C compiler CC = @CMAKE_C_COMPILER@ # FC : Fortran 90 compiler FC = @CMAKE_Fortran_COMPILER@ # FL : Fortran linker FL = @CMAKE_Fortran_COMPILER@ else # CC : C compiler CC = @MPI_C_COMPILER@ # FC : Fortran 90 compiler FC = @MPI_Fortran_COMPILER@ # FL : Fortran linker FL = @MPI_Fortran_COMPILER@ endif # AR : Archive object in a library AR = @CMAKE_AR@ vr # RANLIB : generate index of an archive file -# (optionnal use "RANLIB = echo" in case of problem) RANLIB = @CMAKE_RANLIB@ - # SCALAP should define the SCALAPACK and BLACS libraries. SCALAP = @SCALAPACK_LIBRARIES@ -# INCLUDE DIRECTORY FOR MPI INCPAR = - -# LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI LIBPAR = $(SCALAP) # The parallel version is not concerned by the next two lines. # They are related to the sequential library provided by MUMPS, # to use instead of ScaLAPACK and MPI. INCSEQ = -I$(topdir)/libseq LIBSEQ = -L$(topdir)/libseq -lmpiseq$(PLAT) - -# DEFINE HERE YOUR BLAS LIBRARY LIBBLAS = @MUMPS_BLAS_LIBRARIES@ - -# DEFINE YOUR PTHREAD LIBRARY LIBOTHERS = -lpthread # FORTRAN/C COMPATIBILITY: # Use: # -DAdd_ if your Fortran compiler adds an underscore at the end # of symbols, # -DAdd__ if your Fortran compiler adds 2 underscores, # # -DUPPER if your Fortran compiler uses uppercase symbols # # leave empty if your Fortran compiler does not change the symbols. # CDEFS = -DAdd_ - #COMPILER OPTIONS OPTF = -O -w -fPIC OPTC = -O -I. -fPIC OPTL = -O -fPIC - #Sequential: ifeq ($(MUMPS_TYPE),seq) INCS = $(INCSEQ) LIBS = $(LIBSEQ) LIBSEQNEEDED = libseqneeded endif #Parallel: ifeq ($(MUMPS_TYPE),par) INCS = $(INCPAR) LIBS = $(LIBPAR) LIBSEQNEEDED = endif +prefix = ${INSTALL_DIR} \ No newline at end of file diff --git a/third-party/cmake/mumps.cmake b/third-party/cmake/mumps.cmake index 0ba142984..03fd62c1a 100644 --- a/third-party/cmake/mumps.cmake +++ b/third-party/cmake/mumps.cmake @@ -1,142 +1,148 @@ #=============================================================================== # @file mumps.cmake # # @author Nicolas Richart # # @date creation: Mon Nov 21 2011 # @date last modification: Mon Sep 15 2014 # # @brief compilation of the third-party MUMPS # # @section LICENSE # # Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # Akantu is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # Akantu is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with Akantu. If not, see . # #=============================================================================== enable_language(Fortran) set(MUMPS_VERSION ${AKANTU_USE_MUMPS_VERSION}) set(MUMPS_ARCHIVE "${PROJECT_SOURCE_DIR}/third-party/MUMPS_${MUMPS_VERSION}.tar.gz") set(MUMPS_ARCHIVE_HASH_4.9.2 "MD5=d0b8f139a4acf29b76dbae69ade8ac54") set(MUMPS_ARCHIVE_HASH_4.10.0 "MD5=959e9981b606cd574f713b8422ef0d9f") set(MUMPS_ARCHIVE_HASH_5.0.0 "MD5=3c6aeab847e9d775ca160194a9db2b75") if(NOT EXISTS ${MUMPS_ARCHIVE}) message(FATAL_ERROR "To be able to compile MUMPS please download it from " "http://mumps.enseeiht.fr/ or http://graal.ens-lyon.fr/MUMPS and place it " "in the directory: ${PROJECT_SOURCE_DIR}/third-party and in cmake set the " "variable AKANTU_MUMPS_VERSION to the corresponding version " "\n" "Supported version for automated compilation in Akantu are 4.9.2, 4.10.0 " "and 5.0.0") endif() package_get_option_name(MPI _mpi_option) if(${_mpi_option}) unset(MUMPS_PREFIX) else() set(MUMPS_PREFIX _seq) endif() package_get_option_name(Scotch _scotch_option) package_use_system(Scotch _scotch_use_system) if(NOT _scotch_use_system AND ${_scotch_option}) list(APPEND MUMPS_DEPENDS Scotch) endif() package_get_option_name(ScaLAPACK _scalapack_option) package_use_system(ScaLAPACK _scalapack_use_system) if(NOT _scalapack_use_system AND ${_scalapack_option}) list(APPEND MUMPS_DEPENDS ScaLAPACK) endif() include(AkantuMacros) package_get_libraries(Scotch _scotch_libraries) string(REPLACE ";" " " MUMPS_SCOTCH_LIBRARIES "${_scotch_libraries};${SCOTCH_LIBRARY_ESMUMPS}") package_get_libraries(BLAS _blas_libraries) foreach(_blas_lib ${_blas_libraries}) if("${_blas_lib}" MATCHES ".*\\.framework") get_filename_component(_blas_framework "${_blas_lib}" NAME_WE) set(MUMPS_BLAS_LIBRARIES "${MUMPS_BLAS_LIBRARIES} -framework ${_blas_framework}") else() set(MUMPS_BLAS_LIBRARIES "${MUMPS_BLAS_LIBRARIES} ${_blas_lib}") endif() endforeach() if("${MUMPS_TYPE}" STREQUAL "seq") set_third_party_shared_libirary_name(MUMPS_LIBRARY_MPI mpiseq${MUMPS_PREFIX}) mark_as_advanced(MUMPS_LIBRARY_MPI) else() set(MUMPS_LIBRARY_MPI "") endif() +if(CMAKE_C_COMPILER_ID STREQUAL "Intel") + set(MUMPS_EXTRA_Fortran_FLAGS "-nofor_main") +else() + set(MUMPS_EXTRA_Fortran_FLAGS "") +endif() + configure_file(${PROJECT_SOURCE_DIR}/third-party/MUMPS_${MUMPS_VERSION}_make.inc.cmake ${PROJECT_BINARY_DIR}/third-party/MUMPSmake.inc) if(CMAKE_VERSION VERSION_GREATER 3.1) set(_extra_options UPDATE_DISCONNECTED 1 DOWNLOAD_NO_PROGRESS 1 EXCLUDE_FROM_ALL 1 ) endif() ExternalProject_Add(MUMPS DEPENDS ${MUMPS_DEPENDS} PREFIX ${PROJECT_BINARY_DIR}/third-party URL ${MUMPS_ARCHIVE} URL_HASH ${MUMPS_ARCHIVE_HASH_${MUMPS_VERSION}} ${_extra_options} BUILD_IN_SOURCE 1 PATCH_COMMAND patch -p2 < ${PROJECT_SOURCE_DIR}/third-party/MUMPS_${MUMPS_VERSION}.patch CONFIGURE_COMMAND cmake -E copy ${PROJECT_BINARY_DIR}/third-party/MUMPSmake.inc Makefile.inc BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} d INSTALL_COMMAND prefix= ${CMAKE_MAKE_PROGRAM} install LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 ) set_third_party_shared_libirary_name(MUMPS_LIBRARY_DMUMPS dmumps${MUMPS_PREFIX}) set_third_party_shared_libirary_name(MUMPS_LIBRARY_COMMON mumps_common${MUMPS_PREFIX}) set_third_party_shared_libirary_name(MUMPS_LIBRARY_PORD pord${MUMPS_PREFIX}) mark_as_advanced( MUMPS_LIBRARY_COMMON MUMPS_LIBRARY_DMUMPS MUMPS_LIBRARY_PORD MUMPS_LIBRARY_MPI MUMPS_INCLUDE_DIR ) set(MUMPS_LIBRARIES_ALL ${MPI_Fortran_LIBRARIES} ${MUMPS_LIBRARY_COMMON} ${MUMPS_LIBRARY_DMUMPS} ${MUMPS_LIBRARY_PORD} ${MUMPS_LIBRARY_MPI}) set(MUMPS_INCLUDE_DIR ${PROJECT_BINARY_DIR}/third-party/include CACHE PATH "" FORCE) set(MUMPS_LIBRARIES ${MUMPS_LIBRARIES_ALL} CACHE INTERNAL "Libraries for MUMPS" FORCE) package_add_extra_dependency(Mumps MUMPS) diff --git a/third-party/cmake/scotch.cmake b/third-party/cmake/scotch.cmake index b2f869e0f..c38401d03 100644 --- a/third-party/cmake/scotch.cmake +++ b/third-party/cmake/scotch.cmake @@ -1,77 +1,78 @@ if(TARGET Scotch) return() endif() if(NOT EXISTS ${PROJECT_SOURCE_DIR}/third-party/${SCOTCH_ARCHIVE}) set(_scotch_download_command URL ${SCOTCH_URL} - URL_HASH ${SCOTCH_ARCHIVE_HASH} - TLS_VERIFY FALSE) +# URL_HASH ${SCOTCH_ARCHIVE_HASH} + TLS_VERIFY FALSE + ) else() set(_scotch_download_command URL ${PROJECT_SOURCE_DIR}/third-party/${SCOTCH_ARCHIVE} URL_HASH ${SCOTCH_ARCHIVE_HASH}) endif() if(CMAKE_VERSION VERSION_GREATER 3.1) set(_extra_options UPDATE_DISCONNECTED 1 DOWNLOAD_NO_PROGRESS 1 EXCLUDE_FROM_ALL 1 ) endif() find_package(BISON REQUIRED) find_package(FLEX REQUIRED) find_package(ZLIB REQUIRED) if (AKANTU_USE_OBSOLETE_GETTIMEOFDAY) set (SCOTCH_TIMMING_OPTION -DCOMMON_TIMING_OLD) endif() if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(SCOTCH_ARCHITECTURE -DIDXSIZE64) else() set(SCOTCH_ARCHITECTURE) endif() set(SCOTCH_DIR ${PROJECT_BINARY_DIR}/third-party) configure_file( ${PROJECT_SOURCE_DIR}/third-party/scotch_${SCOTCH_VERSION}_make.inc.cmake ${SCOTCH_DIR}/scotch_make.inc) include(ExternalProject) ExternalProject_Add(Scotch PREFIX ${SCOTCH_DIR} ${_scotch_download_command} ${_extra_options} PATCH_COMMAND patch -p1 < ${PROJECT_SOURCE_DIR}/third-party/scotch_${SCOTCH_VERSION}.patch CONFIGURE_COMMAND cmake -E copy ${SCOTCH_DIR}/scotch_make.inc src/Makefile.inc BUILD_IN_SOURCE 1 BUILD_COMMAND MPICH_CC=${CMAKE_C_COMPILER} ${CMAKE_MAKE_PROGRAM} -C src INSTALL_COMMAND prefix= ${CMAKE_MAKE_PROGRAM} -C src install LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 ) set_third_party_shared_libirary_name(SCOTCH_LIBRARY scotch) set_third_party_shared_libirary_name(SCOTCH_LIBRARY_ERR scotcherr) set_third_party_shared_libirary_name(SCOTCH_LIBRARY_ERREXIT scotcherrexit) set_third_party_shared_libirary_name(SCOTCH_LIBRARY_ESMUMPS esmumps) set(SCOTCH_INCLUDE_DIR ${SCOTCH_DIR}/include CACHE PATH "" FORCE) mark_as_advanced( SCOTCH_LIBRARY SCOTCH_LIBRARY_ERR SCOTCH_LIBRARY_ERREXIT SCOTCH_LIBRARY_ESMUMPS SCOTCH_INCLUDE_DIR) set(SCOTCH_LIBRARIES_ALL ${SCOTCH_LIBRARY} ${SCOTCH_LIBRARY_ERR}) set(SCOTCH_LIBRARIES ${SCOTCH_LIBRARIES_ALL} CACHE INTERNAL "Libraries for scotch" FORCE) package_add_extra_dependency(Scotch Scotch)