Installation on HPC (commands.cpp)

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
prakash
Posts: 7
Joined: Thu Apr 30, 2015 2:18 am
Location: IIT Bombay

Installation on HPC (commands.cpp)

Post by prakash »

Hi,
I am trying to compile OpenSees on centOS-based HPC machine. Having tried multiple permutations of versions, here is the error that I get each time-

commands.cpp: In function 'int OpenSees_putsCommand(void*, Tcl_Interp*, int, Tcl_Obj* const*)':
commands.cpp:659: warning: unused variable 'chan'
commands.cpp:663: warning: unused variable 'result'
commands.cpp:664: warning: unused variable 'mode'
commands.cpp: In function 'int OpenSeesAppInit(Tcl_Interp*)':
commands.cpp:779: warning: unused variable 'res'
commands.cpp: In function 'int OPS_SourceCmd(void*, Tcl_Interp*, int, Tcl_Obj* const*)':
commands.cpp:1127: error: 'Tcl_FSEvalFileEx' was not declared in this scope
commands.cpp: In function 'int printA(void*, Tcl_Interp*, int, const char**)':
commands.cpp:1996: warning: unused variable 'done'
commands.cpp: In function 'int printB(void*, Tcl_Interp*, int, const char**)':
commands.cpp:2037: warning: unused variable 'done'
commands.cpp: In function 'int specifySOE(void*, Tcl_Interp*, int, const char**)':
commands.cpp:3152: warning: dereferencing type-punned pointer will break strict-aliasing rules
commands.cpp:3123: warning: unused variable 'result'
commands.cpp: In function 'int specifyIntegrator(void*, Tcl_Interp*, int, const char**)':
commands.cpp:5362: warning: dereferencing type-punned pointer will break strict-aliasing rules
commands.cpp:5334: warning: unused variable 'result'
commands.cpp:5430: warning: dereferencing type-punned pointer will break strict-aliasing rules
commands.cpp: In function 'int removeObject(void*, Tcl_Interp*, int, const char**)':
commands.cpp:6028: warning: unused variable 'nodTag'
commands.cpp: In function 'int basicDeformation(void*, Tcl_Interp*, int, const char**)':
commands.cpp:7521: warning: unused variable 'secNum'
commands.cpp: In function 'int basicForce(void*, Tcl_Interp*, int, const char**)':
commands.cpp:7584: warning: unused variable 'secNum'
commands.cpp: In function 'int basicStiffness(void*, Tcl_Interp*, int, const char**)':
commands.cpp:7647: warning: unused variable 'secNum'
commands.cpp: In function 'int setParameter(void*, Tcl_Interp*, int, const char**)':
commands.cpp:9043: warning: unused variable 'objectCount'
commands.cpp: In function 'int maxOpenFiles(void*, Tcl_Interp*, int, const char**)':
commands.cpp:9113: warning: unused variable 'newMax'
commands.cpp: In function 'int printModelGID(void*, Tcl_Interp*, int, const char**)':
commands.cpp:9192: warning: unused variable 'tag'
commands.cpp:9442: warning: unused variable 'myRegion'
commands.cpp:9154: warning: unused variable 'output'
commands.cpp: At global scope:
commands.cpp:2544: warning: 'theExternalAlgorithmCommands' defined but not used
make[2]: *** [commands.o] Error 1
make[2]: Leaving directory `$(HOME)/OpenSees/SRC/tcl'
make[1]: *** [tcl] Error 2
make[1]: Leaving directory `$(HOME)/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2


Here is the elusive Makefile.def. I picked MAKES/*.EC2- FEDORA4 file, since that is the closest to centOS.


############################################################################
#
# 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
#
############################################################################



# Following are commands to build OpenSees
# on EC2 FEDORA 64 bit machine (ami-b22e5cdb running Fedora 19)

# sudo yum install gcc.x86_64
# sudo yum install gcc-c++.x86_64
# sudo yum install gcc-gfortran.x86_64
# sudo yum install tcl.x86_64
# sudo yum install tcl-devel.x86_64
# sudo yum install svn
# sudo yum install emacs
# mkdir bin
# mkdir lib
# svn co svn://opensees.berkeley.edu:/usr/local/svn/OpenSees/trunk OpenSees
# cd OpenSees
# cp ./MAKES/Makefile.def.EC2-FEDORA4 ./Makefile.def
# make

# END of commands to build OpenSees.


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

OpenSees_PROGRAM = $(HOME)/bin/OpenSees

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


# %---------------------------------%
# | 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 = $(HOME)/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
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)

# %-------------------------------------------------------%
# | 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
CSPARSE_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
TCL_LIBRARY = $(HOME)/ActiveTCL/lib/libtcl8.5.so
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
GRAPHIC_LIBRARY =

# 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) \
$(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
CC++ = /usr/bin/g++
CC = /usr/bin/gcc
FC = /usr/bin/gfortran

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) \
$(LAPACK_LIBRARY) $(BLAS_LIBRARY) $(CBLAS_LIBRARY) $(CSPARSE_LIBRARY) \
$(AMD_LIBRARY) $(GRAPHIC_LIBRARY)\
-ldl -lgfortran

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$(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

INCLUDES = $(TCL_INCLUDES) $(FE_INCLUDES) $(MACHINE_INCLUDES)
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Installation on HPC (commands.cpp)

Post by fmk »

the problem lies with the tcl version installed on your machine. what is it?
prakash
Posts: 7
Joined: Thu Apr 30, 2015 2:18 am
Location: IIT Bombay

Re: Installation on HPC (commands.cpp)

Post by prakash »

Hi Frank, thanks for your reply.

I confirmed the version of tcl/tk. And it is 8.5.18 as required by the latest OpenSees.

Update (20th July)- I tried to build using the latest svn (rev 6059). But it throws the same error.
prakash
Posts: 7
Joined: Thu Apr 30, 2015 2:18 am
Location: IIT Bombay

Re: Installation on HPC (commands.cpp)

Post by prakash »

Frank, anything else I can try?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Installation on HPC (commands.cpp)

Post by fmk »

go to SRC and type make .. the cause of the error's are not showing up in what you posted.
prakash
Posts: 7
Joined: Thu Apr 30, 2015 2:18 am
Location: IIT Bombay

Re: Installation on HPC (commands.cpp)

Post by prakash »

typing Make in SRC went through smoothly (I eliminated many errors by changing Makefile.def and by creating couple of soft links).
Here is the new error that I get-

################# MANY SUCCESSFUL MAKE MESSAGES ##########################

LIBRARIES BUILT ... NOW LINKING OpenSees PROGRAM
make[1]: Entering directory `/home/prakash/OpenSees/SRC/tcl'
make[1]: Nothing to be done for `tcl'.
make[1]: Leaving directory `/home/prakash/OpenSees/SRC/tcl'
make[1]: Entering directory `/home/prakash/OpenSees/SRC/modelbuilder/tcl'
make[2]: Entering directory `/home/prakash/OpenSees/SRC/tcl'
make[2]: Nothing to be done for `tcl'.
make[2]: Leaving directory `/home/prakash/OpenSees/SRC/tcl'
/home/prakash/OpenSees/SRC/domain/pattern/TclPatternCommand.o: In function `TclPatternCommand(void*, Tcl_Interp*, int, char const**, Domain*)':

TclSeriesCommand.cpp:(.text+0x179): undefined reference to `OPS_NewPulseSeries()'
TclSeriesCommand.cpp:(.text+0x1b2): undefined reference to `OPS_NewTriangleSeries()'
TclSeriesCommand.cpp:(.text+0x4cd): undefined reference to `OPS_NewPeerMotion()'
TclSeriesCommand.cpp:(.text+0x54b): undefined reference to `PeerMotion::getDt()'

######################## COUPLE OF SIMILAR LINES ########################

TclElementCommands.cpp:(.text+0x4a3): undefined reference to `OPS_ZeroLengthImpact3D()'
TclElementCommands.cpp:(.text+0x522): undefined reference to `OPS_ModElasticBeam2d()'
TclElementCommands.cpp:(.text+0x630): undefined reference to `OPS_PY_Macro2D'
TclElementCommands.cpp:(.text+0x6b9): undefined reference to `OPS_SimpleContact2D()'
TclElementCommands.cpp:(.text+0x727): undefined reference to `OPS_N4BiaxialTruss()'

######################## MANY SIMILAR LINES ########################

TclModelBuilderUniaxialMaterialCommand.cpp:(.text+0x8379): undefined reference to `SelfCenteringMaterial::SelfCenteringMaterial(int, double, double, double, double, double, double, double)'
TclModelBuilderUniaxialMaterialCommand.cpp:(.text+0x84c2): undefined reference to `SelfCenteringMaterial::SelfCenteringMaterial(int, double, double, double, double, double, double, double)'
TclModelBuilderUniaxialMaterialCommand.cpp:(.text+0x863a): undefined reference to `SelfCenteringMaterial::SelfCenteringMaterial(int, double, double, double, double, double, double, double)'
TclModelBuilderUniaxialMaterialCommand.cpp:(.text+0x86f5): undefined reference to `Concrete01WithSITC::Concrete01WithSITC(int, double, double, double, double, double)'
TclModelBuilderUniaxialMaterialCommand.cpp:(.text+0x8793): undefined reference to `Concrete01WithSITC::Concrete01WithSITC(int, double, double, double, double, double)'

######################## MANY MANY SIMILAR LINES ########################

TclSnapMaterialCommand.cpp:(.text+0x3eb): undefined reference to `Bilinear::Bilinear(int, Vector, DamageModel*, DamageModel*, DamageModel*)'
TclSnapMaterialCommand.cpp:(.text+0x4e9): undefined reference to `Clough::Clough(int, Vector)'
TclSnapMaterialCommand.cpp:(.text+0x501): undefined reference to `OPS_getDamageModel(int)'
TclSnapMaterialCommand.cpp:(.text+0x955): undefined reference to `OPS_getDamageModel(int)'

######################## MANY SIMILAR LINES ########################

elementAPI_TCL.cpp:(.text+0x4e0): undefined reference to `WrapperLimitCurve::WrapperLimitCurve(char const*, limCrvObject*)'
/home/prakash/OpenSees/SRC/api/elementAPI_TCL.o: In function `Tcl_addWrapperNDMaterial(matObject*, void*, Tcl_Interp*, int, char const**, TclModelBuilder*)':
elementAPI_TCL.cpp:(.text+0x62f): undefined reference to `WrapperNDMaterial::WrapperNDMaterial(char const*, matObject*, int)'
/home/prakash/OpenSees/SRC/api/elementAPI_TCL.o: In function `Tcl_addWrapperUniaxialMaterial(matObject*, void*, Tcl_Interp*, int, char const**)':
elementAPI_TCL.cpp:(.text+0x76f): undefined reference to `WrapperUniaxialMaterial::WrapperUniaxialMaterial(char const*, matObject*)'
/home/prakash/OpenSees/SRC/api/elementAPI_TCL.o: In function `Tcl_addWrapperElement(eleObject*, void*, Tcl_Interp*, int, char const**, Domain*, TclModelBuilder*)':
elementAPI_TCL.cpp:(.text+0x90c): undefined reference to `WrapperElement::WrapperElement(char const*, eleObject*)'
/home/prakash/OpenSees/SRC/api/elementAPI_TCL.o: In function `OPS_GetLimitCurve(int)':
elementAPI_TCL.cpp:(.text+0x391): undefined reference to `OPS_getLimitCurve(int)'
collect2: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/prakash/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

I tried 'make wipe' in SRC and then 'make' again. But that didn't change anything. I'm using 64 bit tcl 8.5.18 and I have included openmpi-1.8.8 libraries as following.

MPILIB = -L/home/prakash/local/openmpi-1.8.8/lib -lmpi -lmpi_cxx
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Installation on HPC (commands.cpp)

Post by fmk »

you are not in the SRC directory .. cd SRC and type make
prakash
Posts: 7
Joined: Thu Apr 30, 2015 2:18 am
Location: IIT Bombay

Re: Installation on HPC (commands.cpp)

Post by prakash »

I typed make in SRC and it completed the process without any error.

I suppose next, I should type make in OpenSees directory. Which is where I saw the errors in above thread.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Installation on HPC (commands.cpp)

Post by fmk »

not sure what is up but the missing symbols are: a) not in the library you have created (libOpenSees) b) you are not linking with it, c) the compiler is getting lost in the linking phase due to size of code (which does happen and is why the libs are ordered differently in a lot of the Makefiles). starting point would be to check and see if the missing symbols are defined in libOpenSees.a
Post Reply