#7864: libfplll tries to link 64-bit objects to 32-bit libstdc++.so
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  drkirkby                                
 
       Type:  defect    |      Status:  needs_review                            
 
   Priority:  major     |   Milestone:  sage-4.5                                
 
  Component:  solaris   |    Keywords:                                          
 
     Author:            |    Upstream:  Reported upstream. Little or no 
feedback.
   Reviewer:            |      Merged:                                          
 
Work_issues:            |  
------------------------+---------------------------------------------------
Changes (by drkirkby):

  * status:  new => needs_review


Comment:

 I've found a workaround. It is not ideal, but it is the same as I'm using
 for #7861. Basically this involves adding the directory of the 64-bit GCC
 libraries with -L and -R options to the compiler.

 An assumption is made that the directories containing the binaries (gcc,
 g++ etc) and libraries (libgfortran.so etc) share the same parent
 directory. This is the usual case, although it is possible to install
 these in different places. So if gcc is built with
 --prefix=/usr/local/gcc-4.5.0, then it is assumed that the following
 directories exists

 {{{
 /usr/local/gcc-4.5.0/bin
 /usr/local/gcc-4.5.0/lib (32-bit libraries)
 /usr/local/gcc-4.5.0/lib/amd64 (64-bit libraries on x64 platforms)
 /usr/local/gcc-4.5.0/lib/sparcv9 (64-bit libraries on SPARC platforms)
 }}}


 == Testing on !OpenSolaris x64 with a Sun Ultra 27 ==
 {{{
 libfplll-3.0.12.p1/.hg/branch
 Finished extraction
 ****************************************************
 Host system
 uname -a:
 SunOS hawk 5.11 snv_134 i86pc i386 i86pc
 ****************************************************
 ****************************************************
 CC Version
 gcc -v
 Using built-in specs.
 Target: i386-pc-solaris2.11
 Configured with: /export/home/drkirkby/gcc-4.4.4/configure
 --prefix=/usr/local/gcc-4.4.4-multilib --enable-languages=c,c++,fortran
 --with-gmp=/usr/local/gcc-4.4.4-multilib --with-
 mpfr=/usr/local/gcc-4.4.4-multilib --disable-nls --enable-checking=release
 --enable-werror=no --enable-multilib --with-system-zlib --enable-bootstrap
 --with-gnu-as --with-as=/usr/local/binutils-2.20/bin/as --without-gnu-ld
 --with-ld=/usr/ccs/bin/ld
 Thread model: posix
 gcc version 4.4.4 (GCC)
 ****************************************************
 Patching dpe.h
 Building a 64-bit version of libfplll
 64-bit libraries for GCC are assumed to be in
 /usr/local/gcc-4.4.4-multilib/lib/amd64
 so compiler flags -R/usr/local/gcc-4.4.4-multilib/lib/amd64 and
 -L/usr/local/gcc-4.4.4-multilib/lib/amd64 will be added
 WARNING - these assumptions may be incorrect if GCC was
 configured with options like --bindir=DIR or --libdir=DIR
 but will be fine for most installations of gcc
 Long-term, a better solution needs to be found
 checking for a BSD-compatible install... /usr/bin/ginstall -c
 checking whether build environment is sane... yes

 <SNIP>

 checking for mpfr_fms in -lmpfr... yes
 configure: creating ./config.status
 config.status: creating Makefile
 config.status: creating src/Makefile
 config.status: executing depfiles commands
 Making all in src
 make[1]: Entering directory
 `/export/home/drkirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1/src/src'
 if g++ -DPACKAGE_NAME=\"libfplll\" -DPACKAGE_TARNAME=\"libfplll\"
 -DPACKAGE_VERSION=\"3.0.12\" -DPACKAGE_STRING=\"libfplll\ 3.0.12\"
 -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libfplll\" -DVERSION=\"3.0.12\"
 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DSTDC_HEADERS=1 -DHAVE_FLOAT_H=1
 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1
 -DHAVE_STDBOOL_H=1 -DHAVE_FLOOR=1 -DHAVE_POW=1 -DHAVE_RINT=1 -DHAVE_SQRT=1
 -DHAVE_STRTOL=1 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -I. -I.
 -R/usr/local/gcc-4.4.4-multilib/lib/amd64
 -L/usr/local/gcc-4.4.4-multilib/lib/amd64 -m64
 -I/export/home/drkirkby/sage-4.5.alpha0/local/include/
 -R/usr/local/gcc-4.4.4-multilib/lib/amd64
 -L/usr/local/gcc-4.4.4-multilib/lib/amd64 -m64  -fPIC
 -I/export/home/drkirkby/sage-4.5.alpha0/local/include/
 -L/export/home/drkirkby/sage-4.5.alpha0/local/lib -MT main.o -MD -MP -MF
 ".deps/main.Tpo" -c -o main.o main.cpp; \
         then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f
 ".deps/main.Tpo"; exit 1; fi
 In file included from main.h:27,
                  from main.cpp:22:
 fplll.h:29:1: warning: "NAN" redefined
 In file included from defs.h:36,

 <SNIP>

 real    0m30.225s
 user    0m24.442s
 sys     0m4.708s
 Successfully installed libfplll-3.0.12.p1
 Now cleaning up tmp files.
 rm: Cannot remove any directory in the path of the current working
 directory
 /export/home/drkirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1
 Making Sage/Python scripts relocatable...
 Making script relocatable
 Finished installing libfplll-3.0.12.p1.spkg
 drkir...@hawk:~/sage-4.5.alpha0$
 }}}

 == Testing on Solaris 10 (SPARC) using 't2' with SAGE64=yes ==

 This time, instead of the directory for the libraries have 'amd64' in the
 name, so it has 'sparcv9'.

 {{{
 libfplll-3.0.12.p1/.hg/requires
 libfplll-3.0.12.p1/.hg/branch
 Finished extraction
 ****************************************************
 Host system
 uname -a:
 SunOS t2 5.10 Generic_141414-02 sun4v sparc SUNW,T5240
 ****************************************************
 ****************************************************
 CC Version
 gcc -v
 Using built-in specs.
 Target: sparc-sun-solaris2.10
 Configured with: ../gcc-4.4.1/configure --prefix=/usr/local/gcc-4.4.1-sun-
 linker/ --with-as=/usr/ccs/bin/as --without-gnu-as --with-
 ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,fortran
 --with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib
 --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib
 CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++
 Thread model: posix
 gcc version 4.4.1 (GCC)
 ****************************************************
 Patching dpe.h
 Building a 64-bit version of libfplll
 64-bit libraries for GCC are assumed to be in /usr/local/gcc-4.4.1-sun-
 linker/lib/sparcv9
 so compiler flags -R/usr/local/gcc-4.4.1-sun-linker/lib/sparcv9 and
 -L/usr/local/gcc-4.4.1-sun-linker/lib/sparcv9 will be added
 WARNING - these assumptions may be incorrect if GCC was
 configured with options like --bindir=DIR or --libdir=DIR
 but will be fine for most installations of gcc
 Long-term, a better solution needs to be found
 checking for a BSD-compatible install... ./install-sh -c
 checking whether build environment is sane... yes
 }}}

 Likewise, this builds ok.

 {{{
 ./fplll -m fastearly -f double < example_in > foo
 cat foo example_out | ./llldiff
 rm foo
 ./fplll -m heuristicearly < example_in > foo
 cat foo example_out | ./llldiff
 rm foo
 make[1]: Leaving directory
 `/rootpool2/local/kirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1/src/src'
 make[1]: Entering directory
 `/rootpool2/local/kirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1/src'
 make[1]: Nothing to be done for `check-am'.
 make[1]: Leaving directory
 `/rootpool2/local/kirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1/src'

 real    6m37.010s
 user    5m3.134s
 sys     1m27.456s
 Successfully installed libfplll-3.0.12.p1
 Now cleaning up tmp files.
 rm: Cannot remove any directory in the path of the current working
 directory
 /rootpool2/local/kirkby/sage-4.5.alpha0/spkg/build/libfplll-3.0.12.p1
 Making Sage/Python scripts relocatable...
 Making script relocatable
 Finished installing libfplll-3.0.12.p1.spkg
 kir...@t2:[~/sage-4.5.alpha0] $ echo $SAGE_CHECK
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7864#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to