[torqueusers] xpbs build on x86_64

Martin Siegert siegert at sfu.ca
Mon Mar 21 17:46:36 MST 2005


On Tue, Mar 22, 2005 at 11:28:02AM +1100, Chris Samuel wrote:
> On Tue, 22 Mar 2005 10:54 am, Chris Samuel wrote:
> 
> > We get the same on both FC3 on Opteron and SuSE SLES9 on Power5.
> 
> Not quite the same on SLES9, sorry about that.
> 
> It fails if you don't specify the --with-tclx=/usr, but if you do specify that 
> then configure works.
> 
> Make then bombs out because it tries to link using -ltclx not -ltcl8.4 (which 
> is how SuSE specifies it).  It's fixable by editing the Makefile.
> 
> However, I then hit the terminal problem that SLES9 doesn't ship a tkx library 
> from what I can see, which isn't Torque's problem.
> 
> One note I will make is that I had to build Torque in 32-bit mode to get that 
> far as SLES9 doesn't come with a 64-bit version of tclx. :-(

The attached spec file will build a 64-bit version of tclx on SLES9
(I compiled it on PPC970).

I also use a wrapper script around gcc (/usr/local/bin/gcc):

#!/bin/bash
# wrapper script for gcc to that sets the default architecture to 64 bit
ARCH=''
for arg in "@$"; do
   if [ "$arg" = '-m32' ]; then
      ARCH='-m32'
   elif [ "$arg" = '-m64' ]; then
      ARCH='-m64'
   fi
done
if [ -z "$ARCH" ]; then
   /usr/bin/gcc64 -m64 "$@"
else
   /usr/bin/gcc "$@"
fi

and have /usr/local/bin at the beginning of the PATH.

Martin

-- 
Martin Siegert
Head, HPC at SFU
WestGrid Site Manager
Academic Computing Services                        phone: (604) 291-4691
Simon Fraser University                            fax:   (604) 291-4242
Burnaby, British Columbia                          email: siegert at sfu.ca
Canada  V5A 1S6
-------------- next part --------------
#
# spec file for package tclx (Version 8.4)
#
# Copyright (c) 2004 SUSE LINUX AG, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

# norootforbuild
# neededforbuild  tcl tcl-devel

BuildRequires: aaa_base acl attr bash bind-utils bison bzip2 coreutils cpio cpp cracklib cvs cyrus-sasl db devs diffutils e2fsprogs file filesystem fillup findutils flex gawk gdbm-devel glibc glibc-devel glibc-locale gpm grep groff gzip info insserv kbd less libacl libattr libgcc libselinux libstdc++ libxcrypt m4 make man mktemp module-init-tools ncurses ncurses-devel net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt procinfo procps psmisc pwdutils rcs readline sed strace syslogd sysvinit tar tcpd texinfo timezone unzip util-linux vim zlib zlib-devel autoconf automake binutils gcc gdbm gettext libtool perl rpm tcl tcl-devel

Name:         tclx-64bit
%define realname tclx
%define THREADS --disable-threads
%define RUN_TESTS 1
Version:      8.4
Release:      326.1
Group:        Development/Languages/Tcl
Summary:      TclX - Extended Tcl
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
License:      Other License(s), see package, BSD
Autoreqprov:  on
Source0:      %realname%version-20021126.tar.bz2
Patch0:       %realname.patch
Patch1:       tclx-64bit-tclstub.patch
Patch2:       tclx-64bit-Makefile.patch

%description 
Extended Tcl is a superset of standard Tcl. Extended Tcl has three
basic functional areas: A set of new commands, a Tcl shell (a Unix
shell-style command line and interactive environment), and a
user-extensible library of useful Tcl procedures, any of which can be
automatically loaded on the first attempt to execute it.

In addition, a detailed help system is available for Tcl/Tk: tclhelp.



Authors:
--------
    Karl Lehenbauer and Mark Diekhan <info at NeoSoft.com>

%prep
# touch NO_STATIC_LIBS to speedup manual builds
%define BUILD_STATIC_LIBS %(test -f %_sourcedir/NO_STATIC_LIBS; echo $?)
%ifarch armv4l
%define BUILD_DYNAMIC_LIBS 0
%else
%define BUILD_DYNAMIC_LIBS 1
%endif
%setup -q -n %realname%version
%patch0
#%patch1 -p1

%build
export LANG=en_US
export CFLAGS="$RPM_OPT_FLAGS"
CONFIGURE () {
    TYPE=$1
    shift
    test "$TYPE" = STATIC && LIBTYPE=--disable-shared
    test "$TYPE" = DYNAMIC && LIBTYPE=--enable-shared
    %configure \
	$LIBTYPE \
        --enable-64bit \
	--with-tcl=/usr/lib \
	--with-help \
	%THREADS \
	"$@"
}
BUILD () {
    for A in "$@"; do
	case $A in
	    STATIC)  test %BUILD_STATIC_LIBS  = 1 || return 0 ;;
	    DYNAMIC) test %BUILD_DYNAMIC_LIBS = 1 || return 0 ;;
	esac
    done
    pushd $1
    shift
    find -name configure -exec chmod u+w {} \;
    %{?suse_update_config:%{suse_update_config -f tclconfig}}
    autoconf
    if [ "$1" = "-n" ]; then
	N=0
	shift
    else
	N=1
	mkdir $1
	pushd $1
	ln -s ../configure
    fi
    CONFIGURE $@
    if [ "$1" = 'DYNAMIC' ]; then
       patch -p2 < %{PATCH2}
    fi
    make CFLAGS_OPTIMIZE= CFLAGS_DEFAULT="$CFLAGS"
	#  "CFLAGS=$CFLAGS" "CFLAGS_WARNING=-Wall -Wno-implicit-int"
    test "$N" = 1 && popd
    popd
}
###############
# Build TclX
#
#    autoreconf --force --localdir=../../%TCL/unix
export CC=/usr/local/bin/gcc
cp /usr/share/libtool/config.sub tclconfig
BUILD . STATIC
BUILD . DYNAMIC
%if 0
SU=bash
if [ "$UID" = "0" ]; then 
    chown -R nobody .
    SU="su nobody"
fi
TESTDIR=%TCLX/DYNAMIC
test -d $TESTDIR || TESTDIR=%TCLX/unix/STATIC
$SU -c "/usr/bin/make -C $TESTDIR \"CFLAGS=$CFLAGS\" \"CFLAGS_WARNING=-Wall -Wno-implicit-int\" test"
test "$UID" = "0" && chown -R root .
%endif

%install
export LANG=en_US
#################
# install tclX
#
%if %BUILD_STATIC_LIBS
    pushd STATIC
      make DESTDIR=%buildroot install    
    popd
%endif
%if %BUILD_DYNAMIC_LIBS
    pushd DYNAMIC
      make DESTDIR=%buildroot install
    popd
%endif
(cd %buildroot; rm -rf usr/include usr/lib64/tclx8.4 usr/share/doc/packages/tclx-64bit usr/share/man/man3 usr/share/man/mann)

%post
%run_ldconfig

%postun
%run_ldconfig

%files
%defattr(-,root,root)
%_libdir/*

%changelog -n tclx-64bit
* Mon Feb 28 2005 - Martin Siegert <siegert at sfu.ca>
- first build using SuSE's 32bit package as starting point


More information about the torqueusers mailing list