Compiling error (tcl packages)

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

Moderators: silvia, selimgunay, Moderators

Post Reply
bug80
Posts: 1
Joined: Sun Dec 07, 2008 8:15 am
Location: University of Bologna

Compiling error (tcl packages)

Post by bug80 »

After some unlucky attempts I managed to compile Opensees 2.0 on Ubuntu 8.10. The program seems to run fine, but I noticed the following issue: Opensees refuses to load tcl packages via the command "package require ***" (I use a lot of them in my scripts) and says "invalid command name 'tclPkgUnknown'". Since tclsh manages to load the same packages I tried to compile version 1.7.5 using the same makefile.def and the so obtained executable can easily load tcl packages. Could someone help me to fix this issue with Opensees 2.0?

While compiling both 1.7.5 and 2.0 I also had to add #include<string.h> to Files.cpp, TzSimple1Gen.cpp and PySimple1Gen.cpp because the compiler could not find some functions like strcmp.

I attached my Makefile.def to this message.

Thank you
Nicola

Code: Select all

############################################################################
#
#  Program:  OpenSees
#
#  Purpose:  Successfully compiled (with GRAPHICS=NONE) on Ubuntu 8.10
#
#  Written: fmk 
#  Created: 10/99
#  Edited: Nicola Buratti 12/08
#  	
#
#  Send bug reports, comments or suggestions to fmckenna@ce.berkeley.edu
#
############################################################################

# %---------------------------------%
# |  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
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		= /usr
HOME		= /home/nicola
FE		= $(HOME)/OpenSees/SRC

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


DIRS  = $(BLASdir) $(CBLASdir) $(LAPACKdir) \
	$(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
ARPACK_LIBRARY  = $(HOME)/lib/libArpack.a
UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a
METIS_LIBRARY   = $(HOME)/lib/libMetis.a
TCL_LIBRARY = /usr/lib/libtk8.4.so /usr/lib/libtcl8.4.so /usr/lib/libX11.a
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a

ifeq ($(GRAPHICS), UsingOpenGL)
	GRAPHIC_LIBRARY =  /usr/lib/libGL.la /usr/lib/libX11.a /usr/lib/libXext.a /usr/lib/libGLU.a
else
	GRAPHIC_LIBRARY = -L/usr/lib/libX11.a
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) \
	    $(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
#



ifeq ($(DEBUG_MODE), DEBUG)
C++FLAGS         = 	-D_LINUX -D_UNIX  -D_TCL84  -D_GLX \
	$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) \
	$(PROGRAMMING_FLAG) -pg -D_COROTATIONAL
CFLAGS          = -Wall -pg $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG)
FFLAGS          = -Wall 

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

else

# -mtune=native -march=native -mmmx -msse4
# modified as optimizaton currently causing problems with Steel01 code
C++FLAGS         =  -Wall -D_LINUX -D_UNIX  -D_TCL84 \
	$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) \
	$(PROGRAMMING_FLAG) -O1 -ffloat-store -D_COROTATIONAL 
CFLAGS          = -Wall -O1
FFLAGS          = -Wall -O1

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

endif


#GRAPHICS = UsingOpenGL, UsingX11
ifeq ($(GRAPHICS), UsingOpenGL)
	GRAPHIC_FLAG = -D_GLX
else
	ifeq ($(GRAPHICS),NONE)
		GRAPHIC_FLAG = -D_NOGRAPHICS	
	else
		GRAPHIC_FLAG = -D_X11
	endif
endif

ifeq ($(PROGRAMMING_MODE), THREADS)
PROGRAMMING_FLAG = -D_THREADS -D_PTHREAD
else
PROGRAMMING_FLAG = 
endif

ifeq ($(DEBUG_MODE), DEBUG)
	DEBUG_FLAG = -D_G3DEBUG
else
	DEBUG_FLAG =
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) \
		$(GRAPHIC_LIBRARY) \
		-ldl -lgfortran -lpng

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/include/tcl8.4 -I/usr/include/

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

fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

Nicola,

I am using the latest code from cvs and have no problems creating & loading packages.

also the changes to include <string.h> have already been made and are in the repository.
Post Reply