OpenSeesMP Makefile

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
reagan
Posts: 42
Joined: Wed Oct 26, 2011 5:54 pm
Location: Stanford University

OpenSeesMP Makefile

Post by reagan »

I've been trying to build OpenSeesMP (rev 5184) without MUMPS on a computer running Linux Mint. I started off with the MAKES/Makefile.def.EC2-UBUNTU file (which was written to build OpenSees), and modified it to build OpenSeesMP instead. The Makefile.def I've been using is listed below. Running "make" creates an OpenSeesMP binary, but I'm having trouble running a basic Tcl script using it. Any idea what I may be doing wrong?

test.tcl contains:
set pid [getPID]
set nump [getNP]
puts $pid/$nump

Running "mpirun -n 2 OpenSeesMP test.tcl" produces the following output:
OpenSees -- Open System For Earthquake Engineering Simulation
Pacific Earthquake Engineering Research Center -- 2.4.0

(c) Copyright 1999,2000 The Regents of the University of California
All Rights Reserved
(Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)




OpenSees -- Open System For Earthquake Engineering Simulation
Pacific Earthquake Engineering Research Center -- 2.4.0

(c) Copyright 1999,2000 The Regents of the University of California
All Rights Reserved
(Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)


0/1
0/1
--------------------------------------------------------------------------
mpirun has exited due to process rank 0 with PID 26904 on
node reagan-blume exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------


Makefile.def listing:
############################################################################
#
# Program: OpenSees
#
# Purpose: A Top-level Makefile to create the libraries needed
# to use the OpenSees framework. Works on Linux version 6.1
# and below.
#
# Written: fmk
# Created: 10/99
#
# Send bug reports, comments or suggestions to fmckenna@ce.berkeley.edu
#
############################################################################

#
# https://help.ubuntu.com/community/EC2StartersGuide
# chmod 'go+rwx' XXX.pem
# ssh -i XXX.pem ubuntu@YYY.amazonaws.com
#

# Instructuction for building OpenSees on Ubuntu (11.x & 12.x)
# using amazon EC-2 instance ami-f197c9b4 us-west-1
# ami-137bcf7a

# sudo in and type the following:
# mkdir lib
# mkdir bin
# sudo apt-get update
# sudo apt-get install subversion
# svn co svn://opensees.berkeley.edu/usr/local/svn/OpenSees/trunk OpenSees
# sudo apt-get install emacs
# sudo apt-get install make
# sudo apt-get install tcl8.5
# sudo apt-get install tcl8.5-dev
# sudo apt-get install gcc
# sudo apt-get install g++
# sudo apt-get install gfortran
# cd OpenSees
# cp ./MAKES/Makefile.def.EC2-UBUNTU ./Makefile.def
# make


# %---------------------------------%
# | SECTION 1: PROGRAM |
# %---------------------------------%
#
# Specify the location and name of the OpenSees interpreter program
# that will be created (if this all works!)

OPERATING_SYSTEM = LINUX
GRAPHICS = NONE
GRAPHIC_FLAG = -D_NOGRAPHICS
DEBUG_MODE = NO_DEBUG
RELIABILITY = NO_RELIABILITY

#PROGRAMMING_MODE = SEQUENTIAL
#PROGRAMMING_MODE = PARALLEL
PROGRAMMING_MODE = PARALLEL_INTERPRETERS

OpenSees_PROGRAM = $(HOME)/bin/OpenSees
PROGRAMMING_FLAG =

ifeq ($(PROGRAMMING_MODE), PARALLEL)
OpenSees_PROGRAM = $(HOME)/bin/OpenSeesSP
PROGRAMMING_FLAG = -D_PARALLEL_PROCESSING
endif

ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS)
OpenSees_PROGRAM = $(HOME)/bin/OpenSeesMP
PROGRAMMING_FLAG = -D_PARALLEL_INTERPRETERS
endif

# %---------------------------------%
# | SECTION 2: PATHS |
# %---------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries or if you have
# any of the libraries already leave the directory location blank AND
# remove the directory from DIRS.

BASE = /usr/local
HOME = /usr/local
FE = $(HOME)/OpenSees/SRC

AMDdir = $(HOME)/OpenSees/OTHER/AMD
BLASdir = $(HOME)/OpenSees/OTHER/BLAS
CBLASdir = $(HOME)/OpenSees/OTHER/CBLAS
LAPACKdir = $(HOME)/OpenSees/OTHER/LAPACK
SUPERLUdir = $(HOME)/OpenSees/OTHER/SuperLU_4.1/SRC
SUPERLU_DISTdir = $(HOME)/OpenSees/OTHER/SuperLU_DIST_2.5/SRC
ARPACKdir = $(HOME)/OpenSees/OTHER/ARPACK
UMFPACKdir = $(HOME)/OpenSees/OTHER/UMFPACK
METISdir = $(HOME)/OpenSees/OTHER/METIS
CSPARSEdir = $(HOME)/OpenSees/OTHER/CSPARSE
SRCdir = $(HOME)/OpenSees/SRC


DIRS = $(BLASdir) $(CBLASdir) $(LAPACKdir) $(AMDdir) $(CSPARSEdir) \
$(SUPERLUdir) $(ARPACKdir) $(UMFPACKdir) $(SRCdir) $(METISdir) $(SUPERLU_DISTdir)

# %-------------------------------------------------------%
# | SECTION 3: LIBRARIES |
# | |
# | The following section defines the libraries that will |
# | be created and/or linked with when the libraries are |
# | being created or linked with. |
# %-------------------------------------------------------%
#
# Note: if vendor supplied BLAS and LAPACK libraries leave the
# libraries blank. You have to get your own copy of the tcl/tk
# library!!
#
# Note: For libraries that will be created (any in DIRS above)
# make sure the directory exsists where you want the library to go!

FE_LIBRARY = $(HOME)/lib/libOpenSees.a
NDARRAY_LIBRARY = $(HOME)/lib/libndarray.a # BJ_UCD jeremic@ucdavis.edu
MATMOD_LIBRARY = $(HOME)/lib/libmatmod.a # BJ_UCD jeremic@ucdavis.edu
BJMISC_LIBRARY = $(HOME)/lib/libBJmisc.a # BJ_UCD jeremic@ucdavis.edu
LAPACK_LIBRARY = $(HOME)/lib/libLapack.a
BLAS_LIBRARY = $(HOME)/lib/libBlas.a
SUPERLU_LIBRARY = $(HOME)/lib/libSuperLU.a
CBLAS_LIBRARY = $(HOME)/lib/libCBlas.a
ARPACK_LIBRARY = $(HOME)/lib/libArpack.a
AMD_LIBRARY = $(HOME)/lib/libAMD.a
UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY = $(HOME)/lib/libMetis.a
CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a
TCL_LIBRARY = /usr/lib/x86_64-linux-gnu/libtcl8.5.so
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
GRAPHIC_LIBRARY =

DISTRIBUTED_SUPERLU_LIBRARY = $(HOME)/lib/libDistributedSuperLU.a

ifeq ($(PROGRAMMING_MODE), SEQUENTIAL)
DISTRIBUTED_SUPERLU_LIBRARY =
endif

# WATCH OUT .. These libraries are removed when 'make wipe' is invoked.
WIPE_LIBS = $(FE_LIBRARY) \
$(LAPACK_LIBRARY) \
$(BLAS_LIBRARY) \
$(CBLAS_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(ARPACK_LIBRARY) \
$(UMFPACK_LIBRARY) \
$(CSPARSE_LIBRARY) \
$(METIS_LIBRARY)

# %---------------------------------------------------------%
# | SECTION 4: COMPILERS |
# | |
# | The following macros specify compilers, linker/loaders, |
# | the archiver, and their options. You need to make sure |
# | these are correct for your system. |
# %---------------------------------------------------------%

# Compilers
ifeq ($(PROGRAMMING_MODE), SEQUENTIAL)

CC++ = /usr/bin/g++
CC = /usr/bin/gcc
FC = /usr/bin/gfortran

else

CC++ = mpicxx
CC = mpicc
FC = mpif90
F90 = mpif90
FORTRAN = $(FC)

LINKER = $(CC++)

endif

AR = ar
ARFLAGS = cqls
RANLIB = ranlib
RANLIBFLAGS =

# Compiler Flags
#
# NOTES:
# C++ FLAGS TAKE need _UNIX or _WIN32 for preprocessor dircetives
# - the _WIN32 for the Windows95/98 or NT operating system.
# C FLAGS used -DUSE_VENDOR_BLAS (needed in SuperLU) if UNIX in C++ FLAGS
#

# modified as optimizaton currently causing problems with Steeln01 code
ifeq ($(DEBUG_MODE), DEBUG)

C++FLAGS = -Wall -D_LINUX -D_UNIX -D_TCL85 \
$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG) \
-g -pg


CFLAGS = -Wall -pg $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG)
FFLAGS = -Wall

# Linker
LINKER = $(CC++)
LINKFLAGS = -g -pg

else

C++FLAGS = -Wall -D_LINUX -D_UNIX -D_TCL85 \
$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) \
$(PROGRAMMING_FLAG) -O3 -ffloat-store
CFLAGS = -Wall -O2
FFLAGS = -Wall -O

# Linker
LINKER = $(CC++)
LINKFLAGS = -rdynamic

endif


# Misc
MAKE = make
CD = cd
ECHO = echo
RM = rm
RMFLAGS = -f
SHELL = /bin/sh

# %---------------------------------------------------------%
# | SECTION 5: COMPILATION |
# | |
# | The following macros specify the macros used in |
# | to compile the source code into object code. |
# %---------------------------------------------------------%

.SUFFIXES:
.SUFFIXES: .C .c .f .f90 .cpp .o .cpp

#
# %------------------%
# | Default command. |
# %------------------%
#
.DEFAULT:
@$(ECHO) "Unknown target $@, try: make help"
#
# %-------------------------------------------%
# | Command to build .o files from .f files. |
# %-------------------------------------------%
#

.cpp.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@

.C.o:
@$(ECHO) Making $@ from $<
$(CC++) $(C++FLAGS) $(INCLUDES) -c $< -o $@
.c.o:
@$(ECHO) Making $@ from $<
$(CC) $(CFLAGS) -c $< -o $@
.f.o:
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

# %---------------------------------------------------------%
# | SECTION 6: OTHER LIBRARIES |
# | |
# | The following macros specify other libraries that must |
# | be linked with when creating executables. These are |
# | platform specific and typically order does matter!! |
# %---------------------------------------------------------%
MACHINE_LINKLIBS = -L$(BASE)/lib \
-L$(HOME)/lib

MACHINE_NUMERICAL_LIBS = -lm \
$(ARPACK_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(UMFPACK_LIBRARY) $(CSPARSE_LIBRARY) \
$(LAPACK_LIBRARY) $(BLAS_LIBRARY) $(CBLAS_LIBRARY) \
$(AMD_LIBRARY) $(GRAPHIC_LIBRARY) $(DISTRIBUTED_SUPERLU_LIBRARY) \
-ldl -lgfortran

MUMPS_LIB =

ifeq ($(PROGRAMMING_MODE), SEQUENTIAL)

PARALLEL_LIB =

endif

ifeq ($(PROGRAMMING_MODE), PARALLEL)

PARALLEL_LIB = $(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSparseGenColLinSOE.o \
$(FE)/system_of_eqn/linearSOE/sparseGEN/SparseGenColLinSolver.o \
$(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSuperLU.o \
$(METIS_LIBRARY) $(HOME)/OpenSees/OTHER/METIS/frename.o $(METIS_LIBRARY) $(MUMPS_LIB) -lmpi -lmpi_f77

endif

ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS)

PARALLEL_LIB = $(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSparseGenColLinSOE.o \
$(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSuperLU.o \
$(METIS_LIBRARY) $(HOME)/OpenSees/OTHER/METIS/frename.o $(METIS_LIBRARY) $(MUMPS_LIB) -lmpi -lmpi_f77

endif

MACHINE_SPECIFIC_LIBS =



# %---------------------------------------------------------%
# | SECTION 7: INCLUDE FILES |
# | |
# | The following macros specify include files needed for |
# | compilation. |
# %---------------------------------------------------------%
MACHINE_INCLUDES = -I/usr/include \
-I$(BASE)/include \
-I/usr/include/cxx \
-I$(SUPERLU_DISTdir) \
-I$(HOME)/include -I$(HOME)/blitz

# this file contains all the OpenSees/SRC includes
include $(FE)/Makefile.incl

#TCL_INCLUDES = -I/usr/includes/tcl-private/generic
TCL_INCLUDES = -I/usr/include/tcl8.5

INCLUDES = $(TCL_INCLUDES) $(FE_INCLUDES) $(MACHINE_INCLUDES)
reagan
Posts: 42
Joined: Wed Oct 26, 2011 5:54 pm
Location: Stanford University

Re: OpenSeesMP Makefile

Post by reagan »

Okay, just fixed it by rebuilding from scratch.
Post Reply