forked from elemental/Elemental
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PMRRR into the CMake automated build system.
- Loading branch information
Showing
86 changed files
with
17,627 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# | ||
# Copyright (c) 2009-2010, Jack Poulson | ||
# All rights reserved. | ||
# | ||
# This file is part of Elemental. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# - Redistributions of source code must retain the above copyright notice, | ||
# this list of conditions and the following disclaimer. | ||
# | ||
# - Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# - Neither the name of the owner nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
cmake_minimum_required(VERSION 2.6) | ||
enable_language(Fortran) | ||
|
||
if(CMAKE_BUILD_TYPE) | ||
message("PMRRR does not use CMAKE_BUILD_TYPE.") | ||
endif(CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "" CACHE INTERNAL "Removing GUI option" FORCE) | ||
|
||
option(HAVE_SPINLOCKS "Enable if pthread lib supports spinlocks" OFF) | ||
option(INCLUDE_LAPACK "Enable if PMRRR should build LAPACK dependencies" ON) | ||
MARK_AS_ADVANCED(HAVE_SPINLOCKS INCLUDE_LAPACK) | ||
|
||
set(CXX_BASE_FLAGS "") | ||
if(NOT HAVE_SPINLOCKS) | ||
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -DNOSPINLOCKS") | ||
endif(NOT HAVE_SPINLOCKS) | ||
|
||
# Grab all of the .c and .h files | ||
file(GLOB_RECURSE PMRRR_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") | ||
file(GLOB_RECURSE PMRRR_H RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") | ||
if(INCLUDE_LAPACK) | ||
file(GLOB_RECURSE PMRRR_F RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.f") | ||
else(INCLUDE_LAPACK) | ||
set(PMRRR_F "SRC/LAPACK/SEQUENTIAL/odscal.f") | ||
endif(INCLUDE_LAPACK) | ||
set(PMRRR_SRC "${PMRRR_C};${PMRRR_H};${PMRRR_F}") | ||
|
||
# Search for the MPI CXX and F77 compilers | ||
if(MPI_C_COMPILER AND NOT EXISTS ${MPI_C_COMPILER}) | ||
message(FATAL_ERROR | ||
"Invalid MPI_C_COMPILER: ${MPI_C_COMPILER} does not exist.") | ||
endif(MPI_C_COMPILER AND NOT EXISTS ${MPI_C_COMPILER}) | ||
if(MPI_F77_COMPILER AND NOT EXISTS ${MPI_F77_COMPILER}) | ||
message(FATAL_ERROR | ||
"Invalid MPI_F77_COMPILER: ${MPI_F77_COMPILER} does not exist.") | ||
endif(MPI_F77_COMPILER AND NOT EXISTS ${MPI_F77_COMPILER}) | ||
if(NOT MPI_C_COMPILER) | ||
find_program(MPI_C_COMPILER mpicc mpixlc mpixlc_r | ||
DOC "Full path to MPI C compiler. If blank, CMake will search for it.") | ||
if(NOT MPI_C_COMPILER) | ||
message(FATAL_ERROR | ||
"Could not find MPI C compiler. Please manually set MPI_C_COMPILER.") | ||
endif(NOT MPI_C_COMPILER) | ||
endif(NOT MPI_C_COMPILER) | ||
if(NOT MPI_F77_COMPILER) | ||
find_program(MPI_F77_COMPILER mpif77 mpixlf77 mpixlf77_r | ||
DOC "Full path to MPI F77 compiler. If blank, CMake will search for it.") | ||
if(NOT MPI_F77_COMPILER) | ||
message(FATAL_ERROR | ||
"Could not find MPI F77 compiler. Please manually set MPI_F77_COMPILER.") | ||
endif(NOT MPI_F77_COMPILER) | ||
endif(NOT MPI_F77_COMPILER) | ||
set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) | ||
set(CMAKE_Fortran_Compiler ${MPI_F77_COMPILER}) | ||
|
||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/INCLUDE") | ||
add_library(pmrrr STATIC ${PMRRR_SRC}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
CC = mpicc | ||
LD = mpicc | ||
|
||
CFLAGS = -Wall -g -pthread | ||
LDFLAGS = -D_THREAD_SAFE=1 -pthread | ||
|
||
# Additional compiler flags for MPI Implementation | ||
# Most MPI Implementations do not require additional | ||
# flags, but e.g. Intel's MPI requieres | ||
# the flag '-mt_mpi' to link to a MPI supporting | ||
# multithreading | ||
MPIFLAGS = | ||
|
||
INCPATH = ../../INCLUDE | ||
LIBPATH = ../../LIB | ||
LIBS = pmrrr gfortran m pthread rt | ||
|
||
|
||
######################## do not edit below ########################### | ||
|
||
|
||
CFLAGS += $(MPIFLAGS) -I$(INCPATH) | ||
LDFLAGS += $(MPIFLAGS) -I$(INCPATH) | ||
|
||
.PHONY: all | ||
|
||
all: main_all.x main_ind.x main_val.x | ||
|
||
# All eigenpairs | ||
main_all.x: main_all.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_all.o: main_all.c | ||
|
||
# Subset of eigenpairs by index | ||
main_ind.x: main_ind.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_ind.o: main_ind.c | ||
|
||
# Subset of eigenpairs by value | ||
main_val.x: main_val.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_val.o: main_val.c | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f main_*.x core.* *__genmod.* *.o *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
CC = mpicc | ||
LD = mpicc | ||
|
||
CFLAGS = -Wall -g -pthread | ||
LDFLAGS = -D_THREAD_SAFE=1 -pthread | ||
|
||
# Additional compiler flags for MPI Implementation | ||
# Most MPI Implementations do not require additional | ||
# flags, but e.g. Intel's MPI requieres | ||
# the flag '-mt_mpi' to link to a MPI supporting | ||
# multithreading | ||
MPIFLAGS = | ||
|
||
INCPATH = ../../INCLUDE | ||
LIBPATH = ../../LIB | ||
LIBS = pmrrr gfortran m pthread rt | ||
|
||
|
||
######################## do not edit below ########################### | ||
|
||
|
||
CFLAGS += $(MPIFLAGS) -I$(INCPATH) | ||
LDFLAGS += $(MPIFLAGS) -I$(INCPATH) | ||
|
||
.PHONY: all | ||
|
||
all: main_all.x main_ind.x main_val.x | ||
|
||
# All eigenpairs | ||
main_all.x: main_all.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_all.o: main_all.c | ||
|
||
# Subset of eigenpairs by index | ||
main_ind.x: main_ind.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_ind.o: main_ind.c | ||
|
||
# Subset of eigenpairs by value | ||
main_val.x: main_val.o | ||
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \ | ||
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@ | ||
|
||
main_val.o: main_val.c | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f main_*.x core.* *__genmod.* *.o *~ |
Oops, something went wrong.