compiling error in Linux system

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

Moderators: silvia, selimgunay, Moderators

Post Reply
xzha8132
Posts: 6
Joined: Mon Jul 26, 2010 11:29 pm
Location: Sydney University

compiling error in Linux system

Post by xzha8132 » Tue Mar 29, 2011 11:17 pm

Dear all/Frank
I am trying to install OpenSees in Linux (CentOS) system. I followed the procedure indicated in the forum, and modified $home, TCL_LIBRARY, TCL_INCLUDES accordingly. when compiling, I got following errors:

ContactMaterial3D.cpp:21:21: error: myDebug.h: No such file or directory
.
.
make[1]: Leaving directory `/home/xzhang/op2/OpenSees/OTHER/AMD'
make[1]: Entering directory `/home/xzhang/op2'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory `/home/xzhang/op2'
LIBRARIES BUILT ... NOW LINKING OpenSees PROGRAM
make[1]: Entering directory `/home/xzhang/op2/OpenSees/SRC/tcl'
make[1]: Nothing to be done for `tcl'.
make[1]: Leaving directory `/home/xzhang/op2/OpenSees/SRC/tcl'
make[1]: Entering directory `/home/xzhang/op2/OpenSees/SRC/modelbuilder/tcl'
Makefile:21: warning: overriding commands for target `tcl'
Makefile:13: warning: ignoring old commands for target `tcl'
make[2]: Entering directory `/home/xzhang/op2/OpenSees/SRC/tcl'
make[2]: Nothing to be done for `tcl'.
make[2]: Leaving directory `/home/xzhang/op2/OpenSees/SRC/tcl'
g++: /home/xzhang/op2/lib/libOpenSees.a: No such file or directory
g++: lg2c: No such file or directory
g++: /usr/local/mysql/lib/libmysqlclient.a: No such file or directory
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/xzhang/op2/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2


It seemed that it didn't successfully built libOpenSees.a and libmysqlclient.a, and can not find myDebug.h (which I also can not find through "locate" command). Can any one help me? I am really new in Linux.
Many thanks
Last edited by xzha8132 on Tue Mar 29, 2011 11:35 pm, edited 2 times in total.
Xi Zhang

xzha8132
Posts: 6
Joined: Mon Jul 26, 2010 11:29 pm
Location: Sydney University

Re: compiling error in Linux system

Post by xzha8132 » Tue Mar 29, 2011 11:18 pm

below is my Makefile.def files

############################################################################
#
# Program: OpenSees
#
# Purpose: A Top-level Makefile to create the libraries needed
# to use the OpenSees framework.
#
# version created for Redhat Enterprise LINUX distribution
#
# Written: fmk
# Created: 01/2003
#
#
############################################################################

# %---------------------------------%
# | NOTE: WARNING |
# %---------------------------------%

# on my installation tcl/tk header files were not installed
# by default. IN FACT THEY ARE NOT ON RedHat CD's. They use 3.3.5 anyway,
# kinda obsolete. Suggest you download tcl/tk8.4.6 from
# http://www.tcl.tk/software/tcltk/downloadnow84.tml
# gunzip and untar it, cd into the unix directory and issue the following 3
# commands for (with minor mod tk for tcl in first) in the unix directory:
# ./configure --prefix=/usr/local/tcl (./configure --prefix=/usr/local/tk)
# ./make
# ./make install

# If you use 3.3.5 REMOVE -D_TCL84 from the C++_FLAGS lower down in this file.

# also no MySQL!!!!! .. i got 4.0.20 from
#http://dev.mysql.com/get/Downloads/MySQ ... ck#mirrors

# gunzip, untar and follow instructions in INSTALL-BINARY file.

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

# %---------------------------------%
# | SECTION 2: MAKEFILE CONSTANTS |
# %---------------------------------%
#
# Specify the constants the are used as control structure variables in the Makefiles.

OPERATING_SYSTEM = LINUX
GRAPHICS = UsingOpenGL

#RELIABILITY = YES_RELIABILITY, NO_RELIABILITY
RELIABILITY = NO_RELIABILITY
PROGRAMMING_MODE = SEQUENTIAL


# %---------------------------------%
# | SECTION 3: 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.

# PUT YOUR HOME DIRECTOREY HERE
HOME = /home/xzhang/op2
FE = $(HOME)/OpenSees/SRC
BASE =

BLASdir = $(HOME)/OpenSees/OTHER/BLAS
CBLASdir = $(HOME)/OpenSees/OTHER/CBLAS
LAPACKdir = $(HOME)/OpenSees/OTHER/LAPACK
ARPACKdir = $(HOME)/OpenSees/OTHER/ARPACK
UMFPACKdir = $(HOME)/OpenSees/OTHER/UMFPACK
METISdir = $(HOME)/OpenSees/OTHER/METIS
SRCdir = $(HOME)/OpenSees/SRC
SUPERLUdir = $(HOME)/OpenSees/OTHER/SuperLU_3.0/SRC
AMDdir = $(HOME)/OpenSees/OTHER/AMD

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

# %-------------------------------------------------------%
# | SECTION 4: 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
UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY = $(HOME)/lib/libMetis.a
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
TCL_LIBRARY = /usr/local/lib/libtcl8.5.so /usr/local/lib/libtk8.5.so

GRAPHIC_LIBRARY = -L/usr/X11R6/lib -lX11 -lGL -lGLU


#RELIABILITY_LIBRARY =
AMD_LIBRARY = $(HOME)/lib/libAMD.a

# WATCH OUT .. These libraries are removed when 'make wipe' is invoked.

WIPE_LIBS = $(FE_LIBRARY) \
$(NDARRAY_LIBRARY) \
$(MATMOD_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(ARPACK_LIBRARY) \
$(UMFPACK_LIBRARY) \
$(METIS_LIBRARY) \
$(LAPACK_LIBRARY) \
$(BLAS_LIBRARY) \
$(CBLAS_LIBRARY) \
$(RELIABILITY_LIBRARY)

# %---------------------------------------------------------%
# | SECTION 5: 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++ = g++
CC = gcc
FC = g77
F90 =
LINKER = g++

AR = ar
ARFLAGS = cqls
RANLIB = ranlib
RANLIBFLAGS =

GRAPHIC_FLAG = -D_GLX
PROGRAMMING_FLAG =
RELIABILITY_FLAG =

C++FLAGS = -Wall -D_LINUX -D_UNIX -D_MYSQL -D_TCL84 $(GRAPHIC_FLAG) $(RELIABILITY_FLAG)\
$(DEBUG_FLAG) $(PROGRAMMING_FLAG) -O3 -ffloat-store -D_HTTPS

CFLAGS = -O2 $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG)
FFLAGS = -Wall
LINKFLAGS = -rdynamic



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

# %---------------------------------------------------------%
# | SECTION 6: 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 source files. |
# %-----------------------------------------------%
#

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

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

.c.o:
@$(ECHO) Making $@ from $<
$(CC) $(CFLAGS) -c $< -o $@

.f.o:
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

.f77.o:
@$(ECHO) Making $@ from $<
$(FC) $(FFLAGS) -c $< -o $@

.f90.o:
@$(ECHO) Making $@ from $<
$(FC90) $(FFLAGS) -c $< -o $@

# %---------------------------------------------------------%
# | SECTION 7: 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/usr/share/doc/libgcc-4.1.2 -L$(BASE)/lib \
-L$(HOME)/lib

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

MACHINE_SPECIFIC_LIBS = -ldl -lieee -lm -lc -lg2c -Wl,-rpath,/usr/local/lib \
/usr/local/mysql/lib/libmysqlclient.a\
/usr/lib/gcc/x86_64-redhat-linux/4.1.2

# %---------------------------------------------------------%
# | SECTION 8: 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\
-I/usr/local/BerkeleyDB.4.0/include \
-I/usr/local/mysql/include \
-I$(HOME)/include \
-I$(UMFPACKdir) \
-I$(SUPERLUdir)

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

TCL_INCLUDES = -I/usr/local/include -I/usr/local/include

INCLUDES = $(MACHINE_INCLUDES) $(TCL_INCLUDES) $(FE_INCLUDES)
Xi Zhang

Post Reply