Commit 13d3b897 authored by Ron Rahaman's avatar Ron Rahaman
Browse files

Attempting minimal use of libtool for Nek5000.

This just changes Nek5000/core/make* to use libmesh_LIBTOOL and the
assoicated flags.  This is NOT a substitute for a more extensive
overhaul of the build system.

TODO: Set or discover $LIBTOOLFLAGS as in the MOOSE makefiles.
parent e2197691
...@@ -89,11 +89,11 @@ endif ...@@ -89,11 +89,11 @@ endif
# ============================================================================= # =============================================================================
# These follow automake's naming conventions # These follow automake's naming conventions
# C compiler # C compiler: need to add $LIBS to linker?
LTCOMPILE = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) LINK = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=link $(CC) $(CFLAGS) $(LDFLAGS)
# Need to add defs? # Need to add $DEFS (and $LIBS to linker)?
LTF77COMPILE = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet $(F77) $(INCLUDES) $(FFLAGS) LTF77COMPILE = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet $(F77) $(INCLUDES) $(FFLAGS)
F77LINK = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link $(F77) $(FFLAGS) $(LDFLAGS) F77LINK = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link $(F77) $(FFLAGS) $(LDFLAGS)
......
...@@ -15,6 +15,7 @@ IFNEKNEK= ...@@ -15,6 +15,7 @@ IFNEKNEK=
IFMOAB= IFMOAB=
MOAB_DIR= MOAB_DIR=
F77= F77=
F77LINK=
CC= CC=
P= P=
PPPO= PPPO=
...@@ -27,6 +28,16 @@ IFVISIT= ...@@ -27,6 +28,16 @@ IFVISIT=
VISIT_IFLAGS= VISIT_IFLAGS=
VISIT_LFLAGS= VISIT_LFLAGS=
libmesh_LIBTOOL=
libmesh_F77=
libmesh_CC=
libmesh_INCLUDE=
libmesh_CPPFLAGS=
libmesh_FFLAGS=
libmesh_CFLAGS=
libmesh_LIBS=
libmesh_LDFLAGS=
################################################################################ ################################################################################
lFLAGS = $(USR_LFLAGS) lFLAGS = $(USR_LFLAGS)
......
...@@ -2,18 +2,16 @@ ...@@ -2,18 +2,16 @@
# Nek5000 build config file # Nek5000 build config file
# (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC # (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC
###############################################################################
# VANILLA MAKENEK
###############################################################################
# source path # source path
SOURCE_ROOT=$(dirname $(dirname $(pwd)))/Nek5000 SOURCE_ROOT=$(dirname $(dirname $(pwd)))/Nek5000
SOURCE_ROOT_CORE="$SOURCE_ROOT/core" SOURCE_ROOT_CORE="$SOURCE_ROOT/core"
SOURCE_ROOT_JL="$SOURCE_ROOT/jl" SOURCE_ROOT_JL="$SOURCE_ROOT/jl"
SOURCE_ROOT_CMT="$SOURCE_ROOT/core/cmt" SOURCE_ROOT_CMT="$SOURCE_ROOT/core/cmt"
# Fortran compiler
F77="mpif77 -Wa,-q -Wl,-no_compact_unwind"
# C compiler
CC="mpicc -Wl,-no_compact_unwind"
# pre-processor symbol list # pre-processor symbol list
# (set PPLIST=? to get a list of available symbols) # (set PPLIST=? to get a list of available symbols)
#PPLIST="?" #PPLIST="?"
...@@ -72,6 +70,42 @@ CC="mpicc -Wl,-no_compact_unwind" ...@@ -72,6 +70,42 @@ CC="mpicc -Wl,-no_compact_unwind"
#VISIT_INSTALL="/path/to/visit/current/linux-x86_64/" #VISIT_INSTALL="/path/to/visit/current/linux-x86_64/"
#VISIT_STOP=true #VISIT_STOP=true
###############################################################################
# MOOSE MAKENEK
###############################################################################
# Get variables from env, if they exist. Otherwise, set to specified defaults
MOOSE_DIR=${MOOSE_DIR:-$(dirname $(dirname $(pwd)))/moose} #default: moon/moose
LIBMESH_DIR=${LIBMESH_DIR:-$MOOSE_DIR/libmesh/installed} #default: moon/moose/libmesh/installed
METHOD=${METHOD:-opt} #default: optimized
# libmesh-config and libtool are in different places depending on whether you
# are using "installed" or "uninstalled" libmesh.
libmesh_config=${libmesh_config:-$LIBMESH_DIR/bin/libmesh-config} #installed version
if [ ! -x "$libmesh_config" ]; then
libmesh_config="$LIBMESH_DIR/contrib/bin/libmesh-config" #uninstalled version
fi
libmesh_LIBTOOL=${libmesh_config:-$LIBMESH_DIR/contrib/bin/libtool} #installed version
if [ ! -x "$libmesh_LIBTOOL" ]; then
libmesh_LIBTOOL="$LIBMESH_DIR/libtool" #uninstalled version
fi
# Get compilers and flags
libmesh_F77=$(METHOD="$METHOD" $libmesh_config --fc)
libmesh_CC=$(METHOD="$METHOD" $libmesh_config --cc)
libmesh_INCLUDE=$(METHOD="$METHOD" $libmesh_config --include)
libmesh_CPPFLAGS=$(METHOD="$METHOD" $libmesh_config --cppflags)
libmesh_FFLAGS=$(METHOD="$METHOD" $libmesh_config --cflags)
libmesh_CFLAGS=$(METHOD="$METHOD" $libmesh_config --cflags)
libmesh_LIBS=$(METHOD="$METHOD" $libmesh_config --libs)
libmesh_LDFLAGS=$(METHOD="$METHOD" $libmesh_config --ldflags)
# Set compilers and linker
F77="$libmesh_LIBTOOL --tag=F77 $LIBTOOLFLAGS --mode=compile $libmesh_F77 $libmesh_INCLUDE $libmesh_FFLAGS"
CC="$libmesh_LIBTOOL --tag=CC $LIBTOOLFLAGS --mode=compile $libmesh_CC $libmesh_INCLUDE $libmesh_CPPFLAGS $libmesh_CFLAGS"
F77LINK="$libmesh_LIBTOOL --tag=F77 $(LIBTOOLFLAGS) --mode=link $libmesh_F77 $libmesh_LIBS $libmesh_LDFLAGS"
############################################################################### ###############################################################################
# DONT'T TOUCH WHAT FOLLOWS !!! # DONT'T TOUCH WHAT FOLLOWS !!!
############################################################################### ###############################################################################
......
...@@ -419,6 +419,7 @@ rm -rf makefile.nek 2>/dev/null ...@@ -419,6 +419,7 @@ rm -rf makefile.nek 2>/dev/null
sed -e "s:^F77[ ]*=.*:F77\:=$F77:" \ sed -e "s:^F77[ ]*=.*:F77\:=$F77:" \
-e "s:^CC[ ]*=.*:CC\:=$CC:" \ -e "s:^CC[ ]*=.*:CC\:=$CC:" \
-e "s:^F77LINK[ ]*=.*:F77LINK\:=$F77LINK:" \
-e "s:^G[ ]*=.*:G\:=$G:" \ -e "s:^G[ ]*=.*:G\:=$G:" \
-e "s:^OPT_FLAGS[ ]*=.*:OPT_FLAGS\:=$OPT_FLAGS:" \ -e "s:^OPT_FLAGS[ ]*=.*:OPT_FLAGS\:=$OPT_FLAGS:" \
-e "s/^P[ ]*=.*/P:=$P/" \ -e "s/^P[ ]*=.*/P:=$P/" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment