Problem compling on Ubuntu

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

Moderators: silvia, selimgunay, Moderators

Post Reply
ranma88m
Posts: 1
Joined: Sat Aug 20, 2011 5:26 am
Location: PADOVA

Problem compling on Ubuntu

Post by ranma88m »

Hello i got a problem when i'll try to compile Opensees :

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

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

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
AMDdir = $(HOME)/OpenSees/OTHER/AMD
SRCdir = $(HOME)/OpenSees/SRC


DIRS = $(BLASdir) $(CBLASdir) $(LAPACKdir) $(AMDdir) \
$(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
AMD_LIBRARY = $(HOME)/lib/libAMD.a
TCL_LIBRARY = /usr/lib/libtk8.5.so /usr/lib/libX11.a /usr/lib/libtcl8.5.so
BLITZ_LIBRARY = $(HOME)/blitz/lib/libblitz.a
GRAPHIC_LIBRARY = -L/usr/X11/R6/lib -lGL -lGLU

# 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) \
$(AMD_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_TCL84 \
$(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_TCL84 \
$(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) \
$(PROGRAMMING_FLAG) -O3 -ffloat-store
CFLAGS = -Wall -O2
FFLAGS = -Wall -O

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

endif


GRAPHIC_FLAG = -D_GLX

# 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) \
$(AMD_LIBRARY) \
$(GRAPHIC_LIBRARY)\
-ldl -lgfortran -lpng

MACHINE_SPECIFIC_LIBS =


make[2]: Leaving directory `/home/OpenSees/SRC/tcl'
/home/OpenSees/SRC/tcl/tclMain.o: In function `g3TclMain(int, char**, int (*)(Tcl_Interp*), int, int)':
tclMain.cpp:(.text+0x1ca): undefined reference to `TclFormatInt'
collect2: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

# %---------------------------------------------------------%
# | 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.5 -I/usr/include/

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








make[2]: Leaving directory `/home/OpenSees/SRC/tcl'
/home/OpenSees/SRC/tcl/tclMain.o: In function `g3TclMain(int, char**, int (*)(Tcl_Interp*), int, int)':
tclMain.cpp:(.text+0x1ca): undefined reference to `TclFormatInt'
collect2: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

can u help me please?

Thanks
gourik
Posts: 69
Joined: Wed Dec 31, 2008 10:07 pm
Location: C-DAC,Pune

Re: Problem compling on Ubuntu

Post by gourik »

Hi,

I got the following error while compiling MP/SP with mpich2.

mpiParameterMain.cpp:(.text+0x2f0): undefined reference to `g3TclMain(int, char**, int (*)(Tcl_Interp*), int, int)'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgssvx_ABglobal.o): In function `pdgssvx_ABglobal':
pdgssvx_ABglobal.c:(.text+0x865): undefined reference to `ompi_mpi_int'
pdgssvx_ABglobal.c:(.text+0x89b): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0x8c0): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0x8e5): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0x90d): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0x935): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0x9d0): undefined reference to `ompi_mpi_int'
pdgssvx_ABglobal.c:(.text+0xa06): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xa2b): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xa50): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xa78): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xaa0): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xdd4): undefined reference to `ompi_mpi_int'
pdgssvx_ABglobal.c:(.text+0xe16): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xe3b): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xe65): undefined reference to `ompi_mpi_int'
pdgssvx_ABglobal.c:(.text+0xe9f): undefined reference to `ompi_mpi_double'
pdgssvx_ABglobal.c:(.text+0xec4): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgsrfs_ABXglobal.o): In function `pdgsrfs_ABXglobal':
pdgsrfs_ABXglobal.c:(.text+0xa30): undefined reference to `ompi_mpi_op_max'
pdgsrfs_ABXglobal.c:(.text+0xa35): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgsrfs_ABXglobal.o): In function `redist_all_to_diag':
pdgsrfs_ABXglobal.c:(.text+0xef9): undefined reference to `ompi_mpi_double'
pdgsrfs_ABXglobal.c:(.text+0xf82): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgsrfs_ABXglobal.o): In function `gather_1rhs_diag_to_all':
pdgsrfs_ABXglobal.c:(.text+0x1139): undefined reference to `ompi_mpi_double'
pdgsrfs_ABXglobal.c:(.text+0x115e): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(util.o): In function `pxgstrs_init':
util.c:(.text+0x1000): undefined reference to `ompi_mpi_int'
util.c:(.text+0x1005): undefined reference to `ompi_mpi_int'
util.c:(.text+0x1445): undefined reference to `ompi_mpi_int'
util.c:(.text+0x144a): undefined reference to `ompi_mpi_int'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(util.o): In function `PStatPrint':
util.c:(.text+0x1a55): undefined reference to `ompi_mpi_op_sum'
util.c:(.text+0x1a5a): undefined reference to `ompi_mpi_float'
util.c:(.text+0x1b33): undefined reference to `ompi_mpi_op_sum'
util.c:(.text+0x1b38): undefined reference to `ompi_mpi_float'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(superlu_grid.o): In function `superlu_gridmap':
superlu_grid.c:(.text+0x1de): undefined reference to `ompi_mpi_datatype_null'
superlu_grid.c:(.text+0x1e8): undefined reference to `ompi_mpi_double'
superlu_grid.c:(.text+0x352): undefined reference to `ompi_mpi_comm_null'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(superlu_grid.o): In function `superlu_gridexit':
superlu_grid.c:(.text+0x4b6): undefined reference to `ompi_mpi_comm_null'
superlu_grid.c:(.text+0x4c7): undefined reference to `ompi_mpi_comm_world'
superlu_grid.c:(.text+0x504): undefined reference to `ompi_mpi_datatype_null'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(superlu_grid.o):(.data+0x0): undefined reference to `ompi_mpi_datatype_null'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(ddistribute.o): In function `ddistribute':
ddistribute.c:(.text+0x30b3): undefined reference to `ompi_mpi_op_max'
ddistribute.c:(.text+0x30b8): undefined reference to `ompi_mpi_int'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrf.o): In function `pdgstrf':
pdgstrf.c:(.text+0x918): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0x96a): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0x9db): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0xa18): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0xc2b): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0xc66): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0xe4f): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0xeab): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0xf42): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0xf74): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0xfcc): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0xffe): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0x1fb1): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0x2030): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0x20df): undefined reference to `ompi_mpi_int'
pdgstrf.c:(.text+0x216f): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0x2ebe): undefined reference to `ompi_mpi_op_min'
pdgstrf.c:(.text+0x2ec3): undefined reference to `ompi_mpi_int'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrf.o): In function `pdgstrf2':
pdgstrf.c:(.text+0x351d): undefined reference to `ompi_mpi_double'
pdgstrf.c:(.text+0x3599): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrs_Bglobal.o): In function `pdgstrs_Bglobal':
pdgstrs_Bglobal.c:(.text+0x986): undefined reference to `ompi_mpi_op_sum'
pdgstrs_Bglobal.c:(.text+0x98b): undefined reference to `ompi_mpi_int'
pdgstrs_Bglobal.c:(.text+0xdb8): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0xf2e): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0x14e8): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0x18ea): undefined reference to `ompi_mpi_op_sum'
pdgstrs_Bglobal.c:(.text+0x18ef): undefined reference to `ompi_mpi_int'
pdgstrs_Bglobal.c:(.text+0x244d): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0x259a): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0x2a78): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrs_Bglobal.o): In function `gather_diag_to_all':
pdgstrs_Bglobal.c:(.text+0x3047): undefined reference to `ompi_mpi_double'
pdgstrs_Bglobal.c:(.text+0x306f): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrs1.o): In function `pdgstrs1':
pdgstrs1.c:(.text+0x7c0): undefined reference to `ompi_mpi_op_sum'
pdgstrs1.c:(.text+0x7c5): undefined reference to `ompi_mpi_int'
pdgstrs1.c:(.text+0xbac): undefined reference to `ompi_mpi_double'
pdgstrs1.c:(.text+0xd25): undefined reference to `ompi_mpi_double'
pdgstrs1.c:(.text+0x129c): undefined reference to `ompi_mpi_double'
pdgstrs1.c:(.text+0x16a1): undefined reference to `ompi_mpi_op_sum'
pdgstrs1.c:(.text+0x16a6): undefined reference to `ompi_mpi_int'
pdgstrs1.c:(.text+0x21c1): undefined reference to `ompi_mpi_double'
pdgstrs1.c:(.text+0x2311): undefined reference to `ompi_mpi_double'
pdgstrs1.c:(.text+0x27af): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrs_lsum.o): In function `dlsum_fmod':
pdgstrs_lsum.c:(.text+0x410): undefined reference to `ompi_mpi_double'
pdgstrs_lsum.c:(.text+0x6ec): undefined reference to `ompi_mpi_double'
/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(pdgstrs_lsum.o):pdgstrs_lsum.c:(.text+0xc97): more undefined references to `ompi_mpi_double' follow
collect2: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/gourik/OpenSees_test/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2



Makefile is as below

HOME = /home/gourik/OpenSees_test
OpenSees_PROGRAM = $(HOME)/bin/OpenSees
OpenSees_PROGRAM_MPI = $(HOME)/bin/OpenSeesMPI
PROGRAMMING_MODE = PARALLEL_INTERPRETERS


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

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

### additional as per http://opensees.berkeley.edu/wiki/index ... kefile.def

TCLdir = /usr/share/tcl8.5
MPIdir = /home/gourik/usr/local/mpich-install
PARALLELdir=/home/gourik/usr/local

##TCL
TCL_BIN = /usr/bin
TCL_INC = /usr/include
TCL_LIB = -L/usr/lib64/tcl8.5 -ltcl8.5 -ltk8.5
###

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

OPERATING_SYSTEM = LINUX
RELIABILITY = NO_RELIABILITY
GRAPHICS = NONE
DEBUG_MODE = NO_DEBUG

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

BASE =
FE = $(HOME)/OpenSees/SRC
AMDdir = $(HOME)/OpenSees/OTHER/AMD
#BLASdir = $(HOME)/OpenSees/OTHER/BLAS
BLASdir =
CBLASdir = $(HOME)/OpenSees/OTHER/CBLAS
#LAPACKdir = $(HOME)/OpenSees/OTHER/LAPACK
LAPACKdir =
ARPACKdir = $(HOME)/OpenSees/OTHER/ARPACK
UMFPACKdir = $(HOME)/OpenSees/OTHER/UMFPACK
#METISdir = $(HOME)/OpenSees/OTHER/METIS
METISdir =
CSPARSEdir = $(HOME)/OpenSees/OTHER/CSPARSE
ITPACKdir = $(HOME)/OpenSees/OTHER/ITPACK
SRCdir = $(HOME)/OpenSees/SRC
SUPERLUdir = $(HOME)/OpenSees/OTHER/SuperLU_4.1/SRC

SUPERLU_DISTdir = $(HOME)/OpenSees/OTHER/SuperLU_DIST_2.5/SRC

DIRS = $(AMDdir) $(CBLASdir) $(CSPARSEdir) $(ITPACKdir)\
$(SUPERLUdir) $(SUPERLU_DISTdir) $(ARPACKdir) $(UMFPACKdir) $(FE) $(SRCdir)


# %-------------------------------------------------------%
# | 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
LAPACK_LIBRARY = $(PARALLELdir)/lapack-3.4.1/liblapack.a
BLAS_LIBRARY = $(PARALLELdir)/BLAS/blas.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
METIS_LIBRARY = $(PARALLELdir)/ParMetis-3.2.0/libmetis.a
CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a
ITPACK_LIBRARY = $(HOME)/lib/libItpack.a
DISTRIBUTED_SUPERLU_LIBRARY = $(HOME)/lib/libDistributedSuperLU.a

TCL_LIBRARY = /usr/lib64/libtk8.5.so \
/usr/lib64/libtcl8.5.so

## additional added library
BLITZ_LIBRARY = /usr/local/lib/libblitz.a

ifeq ($(RELIABILITY), YES_RELIABILITY)
RELIABILITY_LIBRARY = $(HOME)/lib/libReliability.a
else
RELIABILITY_LIBRARY =
endif

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

WIPE_LIBS = $(FE_LIBRARY) \
$(CBLAS_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(DISTRIBUTED_SUPERLU_LIBRARY) \
$(ARPACK_LIBRARY) \
$(UMFPACK_LIBRARY) \
$(NDARRAY_LIBRARY) \
$(MATMOD_LIBRARY) \
$(ITPACK_LIBRARY)\
$(AMD_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
# ###################################################
MPI_BIN = $(MPIdir)/bin
MPI_INC = -I$(MPIdir)/include
MPI_LIB = -L$(MPIdir)/lib

CC++ = $(MPI_BIN)/mpicxx
CC = $(MPI_BIN)/mpicc
FC = $(MPI_BIN)/mpif90
FC90 = $(MPI_BIN)/mpif90
FC77 = $(MPI_BIN)/mpif90
FORTRAN = $(FC)
LINKER = $(CC++)

AR = ar
ARFLAGS = cqls
ARCH = ar
ARCHFLAGS = cqls
RANLIB = ranlib
RANLIBFLAGS =


ifeq ($(GRAPHICS), UsinOpenGl)
GRAPHIC_FLAG = -D_GLX
GRAPHIC_LIBRARY = -L/usr/X11/R6/lib -lGL -lGLU
else
GRAPHIC_FLAG = -D_NOGRAPHICS
GRAPHIC_LIBRARY =
endif

ifeq ($(RELIABILITY), YES_RELIABILITY)
RELIABILITY_FLAG = -D_RELIABILITY
else
RELIABILITY_FLAG =
endif

ifeq ($(DEBUG_MODE), DEBUG)
DEBUG_FLAG = -D_G3DEBUG
else
DEBUG_FLAG =
endif

## added ##
ifeq ($(PROGRAMMING_MODE), PARALLEL)
PROGRAMMING_FLAG = -D_PARALLEL_PROCESSING
endif

ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS)
PROGRAMMING_FLAG = -D_PARALLEL_INTERPRETERS
endif
## end of added part ##


CFLAGS = -Wall $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(PROGRAMMING_FLAG)
C++FLAGS = -Wall -O2 -D_LINUX -D_UNIX -D_TCL85 -D_BLAS -ffloat-store $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(PROGRAMMING_FLAG) $(MUMPS_FLAG)
FFLAGS = -Wall -O2
#LINKFLAGS = -rdynamic
LINKFLAGS = -Wl,-rpath
# 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 $< -o $@

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

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

.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 = $(MPI_LIB)\
-L$(BASE)/lib \
-L$(HOME)/lib \
-L/usr/lib64 \
-L/usr/lib64 -ldl -lm\
/usr/lib64/libgfortran.so.3


# PETSC
HAVEPETSC = NO
PETSCINC =
PETSC_LIB =

#############################################

HAVEMUMPS = YES
MUMPSdir = $(PARALLELdir)/MUMPS_4.10.0
MUMPSLIB = $(MUMPSdir)/lib
MUMPS_INC = $(MUMPSdir)/include
MUMPS_INCLUDE = $(MUMPSdir)/include
MUMPS_LIB = $(MUMPSdir)/lib

ifeq ($(PROGRAMMMING_MODE), SEQUENTIAL)
HAVEMUMPS = NO
endif

ifeq ($(HAVEMUMPS), YES)

MUMPS = YES
MUMPS_FLAG = -D_MUMPS
#MUMPS_FLAG = -D_MUMPS

#BLAS
BLAS_LIB = $(PARALLELdir)/BLAS/blas.a

#XBLAS
XBLAS_LIB = $(PARALLELdir)/xblas-1.0.248/libxblas.a

#SCALAPACK
SCALAPACK_LIB =$(PARALLELdir)/scalapack-2.0.2/libscalapack.a
#BLACS
BLACSdir = $(PARALLELdir)/BLACS
BLACS_LIB = -L$(BLACSdir)/LIB

#LAPACK
LAPACK_LIB = $(PARALLELdir)/lapack-3.4.1/liblapack.a

#ParMETIS
parmetis_lib = $(PARALLELdir)/ParMetis-3.2.0/libparmetis.a
metis_lib = $(PARALLELdir)/ParMetis-3.2.0/libmetis.a
metis_inc = -I$(PARALLELdir)/ParMetis-3.2.0

#SCALAP = $(SCALAPACK_LIB) \
$(BLACSdir)/LIB/blacsF77init.a \
$(BLACSdir)/LIB/blacs.a \
$(BLACSdir)/LIB/blacsCinit.a \
$(LAPACKdir)/liblapack.a \
$(XBLAS_LIB) \
$(BLASdir)/blas.a

SCALAP = -L/home/gourik/usr/local/scalapack-2.0.2 -lscalapack \
/home/gourik/usr/local/BLACS/LIB/blacs_MPI-LINUX-1.a \
/home/gourik/usr/local/BLACS/LIB/blacsCinit_MPI-LINUX-1.a \
/home/gourik/usr/local/BLACS/LIB/blacs_MPI-LINUX-1.a \
/home/gourik/usr/local/BLACS/LIB/blacsF77init_MPI-LINUX-1.a\
/home/gourik/usr/local/BLACS/LIB/blacs_MPI-LINUX-1.a \
$(PARALLELdir)/scalapack-2.0.2/libscalapack.a \
$(PARALLELdir)/BLAS/blas.a

PLAT = LINUX

MUMPS_LIB = $(FE)/system_of_eqn/linearSOE/mumps/MumpsSOE.o \
$(FE)/system_of_eqn/linearSOE/mumps/MumpsSolver.o \
$(FE)/system_of_eqn/linearSOE/mumps/MumpsParallelSOE.o \
$(FE)/system_of_eqn/linearSOE/mumps/MumpsParallelSolver.o \
$(SCALAP) \
-L/home/gourik/usr/local/MUMPS_4.10.0/lib -lcmumps -ldmumps -lmumps_common -lpord -lsmumps -lzmumps \
-lmumps_common -lpord \
$(parmetis_lib) $(metis_lib) \
$(SCALAP) /usr/lib64/libgfortran.so.3 \
/usr/lib64/libdl.so

MUMPS_INCLUDE = -I$(MUMPS_INC)

endif

PARALLEL_LIB = $(DISTRIBUTED_SUPERLU_LIBRARY) \
$(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSuperLU.o \
$(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSparseGenColLinSOE.o \

HPM_LIB =

############################################

MACHINE_NUMERICAL_LIBS =/usr/lib64/libgfortran.so.3 \
-L/usr/lib64 \
-L/usr/lib64 -ldl -lm\
$(ARPACK_LIBRARY) \
$(AMD_LIBRARY) \
$(DISTRIBUTED_SUPERLU_LIBRARY) \
$(SUPERLU_LIBRARY) \
$(UMFPACK_LIBRARY) \
$(LAPACK_LIBRARY) \
$(BLAS_LIBRARY) \
$(CBLAS_LIBRARY) \
$(GRAPHIC_LIBRARY)\
$(METIS_LIBRARY)\
$(CSPARSE_LIBRARY)\
$(RELIABILITY_LIBRARY)\
$(PETSC_LIB)\
$(SCALAP) $(parmetis_lib) $(metis_lib) $(SCALAP) \
$(MUMPS_LIB) -ldl -lgfortran -lssl -lcrypto


#MPICC = /usr/lib64/openmpi/bin/mpicc
#MPILIB = -L/usr/lib64/openmpi/lib


MACHINE_SPECIFIC_LIBS = -ldl -lieee -lm -lc -lgfortran -Wl,-rpath,/usr/lib64 -lpng $(MPI_LIB)


# %---------------------------------------------------------%
# | SECTION 8: INCLUDE FILES |
# | |
# | The following macros specify include files needed for |
# | compilation. |
# %---------------------------------------------------------%


MACHINE_INCLUDES =-I$(MPI_INC)\
-I/usr/include \
-I/usr/include/mysql \
-I$(HOME)/include \
-I$(UMFPACKdir) \
-I$(FE)/system_of_eqn/linearSOE/sparseGEN \
-I$(SUPERLUdir) \
-I$(SUPERLU_DISTdir) \
$(MUMPS_INCLUDE) \
$(metis_inc)\
-I/usr/local/include/blitz
# -I$(SUPERLU_DISTdir)

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

TCL_INCLUDES = -I/usr/include/tcl-private/generic \
-I/usr/include/tk-private/generic

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



.
Thanks And Regards,

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

Re: Problem compling on Ubuntu

Post by fmk »

that is a linker problem .. you need to find the dir containing the libraries for the mpi compiler you are using .. then fgrep some of those missing symbols to see which libraries might contain the missing symbols and then add these to the LINKLIBS .. NOTE i have found sadly that on Linux machines sometimes (actually a lot) the order of the libs matters and you have to move things around .. sometimes needing to include the same lib multiple times on the LINK line .. if all libs are there and the message still pops up try repeating the lib containing the missing symbol right after the lib file or .o where it is says it is missing.
gourik
Posts: 69
Joined: Wed Dec 31, 2008 10:07 pm
Location: C-DAC,Pune

Re: Problem compling on Ubuntu

Post by gourik »

above error resolved with addition of lmpi flag to mpilib. Now facing another error regarding metis

/home/gourik/OpenSees_test/lib/libDistributedSuperLU.a(get_perm_c.o): In function `get_metis':
get_perm_c.c:(.text+0xfa): undefined reference to `METIS_NodeND'
collect2: ld returned 1 exit status
make[1]: *** [tcl] Error 1
make[1]: Leaving directory `/home/gourik/OpenSees_test/OpenSees/SRC/modelbuilder/tcl'
make: *** [all] Error 2

Please help me regarding this.
Thanks And Regards,

Gouri
Post Reply