Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Call for testing gmp-pi

  1. #11
    Join Date
    May 2009
    Location
    Hannover, Germany
    Posts
    9

    Default

    Tested it on another box: Ubuntu 9.04 64bit on Intel Core2 6320@stock 1.86Ghz and I ran into the same problem as Aradreth:
    Code:
    Try to setup GMP for Intel Core2 or Xeon, wait....
    : 175: Yes: unexpected operator
    Did not detect Intel Core 2 CPU.  Patch not installed
    Checking build system type... core2-unknown-linux-gnu
    Checking host system type... core2-unknown-linux-gnu
    Checking for a BSD-compatible install... /usr/bin/install -c
    The patch (gmp-4.2.x-core2-port.tar.gz) is downloaded alright. The program correctly detects 2 CPUs and runs them up to 100% each.

    It seems that there is something in the install_gmp_4.2.x_core2_patch.sh script going wrong, since that doesn't detect the CPU correctly. I think it's in the tmp_is_core2_cpu.c, but I'm not very skilled at reading C. Compiling that code gives me:
    Code:
    gcc -m64 tmp_is_core2_cpu.c -o tmp_is_core2_cpu -v
    Using built-in specs.
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) 
    COLLECT_GCC_OPTIONS='-m64' '-o' 'tmp_is_core2_cpu' '-v' '-mtune=generic'
     /usr/lib/gcc/x86_64-linux-gnu/4.3.3/cc1 -quiet -v tmp_is_core2_cpu.c -D_FORTIFY_SOURCE=2 -quiet -dumpbase tmp_is_core2_cpu.c -m64 -mtune=generic -auxbase tmp_is_core2_cpu -version -fstack-protector -o /tmp/ccZoYZJD.s
    ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
    ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../x86_64-linux-gnu/include"
    ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
    #include "..." search starts here:
    #include <...> search starts here:
     /usr/local/include
     /usr/lib/gcc/x86_64-linux-gnu/4.3.3/include
     /usr/lib/gcc/x86_64-linux-gnu/4.3.3/include-fixed
     /usr/include
    End of search list.
    GNU C (Ubuntu 4.3.3-5ubuntu4) version 4.3.3 (x86_64-linux-gnu)
    	compiled by GNU C version 4.3.3, GMP version 4.2.4, MPFR version 2.4.0.
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    Compiler executable checksum: 67d7a81bea2b3850275b5f3aed53a5bf
    COLLECT_GCC_OPTIONS='-m64' '-o' 'tmp_is_core2_cpu' '-v' '-mtune=generic'
     as -V -Qy --64 -o /tmp/ccgs7G4d.o /tmp/ccZoYZJD.s
    GNU assembler version 2.19.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.19.1
    COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/
    LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../:/lib/:/usr/lib/
    COLLECT_GCC_OPTIONS='-m64' '-o' 'tmp_is_core2_cpu' '-v' '-mtune=generic'
     /usr/lib/gcc/x86_64-linux-gnu/4.3.3/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o tmp_is_core2_cpu -z relro /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../.. /tmp/ccgs7G4d.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crtn.o
    Anything odd in there?

  2. #12
    Join Date
    May 2009
    Location
    Hannover, Germany
    Posts
    9

    Default SOLVED: Core2 not correctly identified on Ubuntu

    I did some more digging: In the 'install_gmp_4.2.x_core2_patch.sh' script, the 'tmp_is_core2.c' is properly identifying the core2 processor, meaning that IS_CORE2_CPU is set to 'Yes' in my case. The script fails here:
    Code:
    123: if [ $IS_CORE2_CPU == "Yes" ]; then
    124:    echo "Detected Intel Core 2 CPU"
    The conditional fails on Ubuntu because Ubuntu has dash aliased to /bin/sh, not bash

    Further more looks like it's a bug in their script, based on the (technically) incorrect but usually safe assumption that /bin/sh is just an alias of bash, Ubuntu is one of two distributions (ubuntu and debian) that use the more sh compliant dash by default. You could edit the first line from:
    Code:
    #!/bin/sh
    to
    Code:
    #!/bin/bash
    That indeed works. Changing that in install_gmp_4.2.x_core2_patch.sh gives:
    Code:
    Detected Intel Core 2 CPU
    Found GMP at /home/mhb/software/gmp-pi/gmp-4.2.2
    Version 4.2.x of GMP found.
    Copying patch files:
    amd64call.asm     --> /home/mhb/software/gmp-pi/gmp-4.2.2/tests
    lahf_sahf_test.sh --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    add_n.asm         --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    sub_n.asm         --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    addmul_1.asm      --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    submul_1.asm      --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    mul_1.asm         --> /home/mhb/software/gmp-pi/gmp-4.2.2/mpn/x86_64
    And for time differences:
    Ubuntu 9.04 64bit Intel Core2 6320 @ 1.86Ghz

    without optimizations: Time: 833.346 sec
    with optimizations:Time: 553.875 (+/-) 12.8 sec

    Considerable optimization, I'd say.

    Code:
    bash install.sh
    Optimizing and Compiling GMP
    Compiling gmp-chudnovsky
    mt-bbp.c: In function ‘thread_func’:
    mt-bbp.c:115: warning: unknown conversion type character ‘(’ in format
    mt-bbp.c:115: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘time_t’
    Cleaning up...
    Finished
    Aradreth, could you confirm that changing
    Code:
    16: # run patch
    17: cd gmp-4.2.x-core2-port
    18: ./install_gmp_4.2.x_core2_patch.sh ../gmp-4.2.2
    to
    Code:
    16: # run patch
    17: cd gmp-4.2.x-core2-port
    18: bash ./install_gmp_4.2.x_core2_patch.sh ../gmp-4.2.2
    correctly identifies your CPU now?

  3. #13
    Join Date
    Aug 2007
    Posts
    6,615

    Default

    @Dewni

    Debian does not use dash as sh, but most scripts are prepared for that. You could try this, which fixes some major bashisms:

    sed -i 's/==/=/;s/pushd/cd/;s/popd//;s/echo\s\+-e/printf "%b\n"/' problematic-script

  4. #14
    Join Date
    Jan 2009
    Posts
    515

    Default

    Hmm it doesn't detect my c2d with arch 64 bit.

    Code:
    CPU is Intel(R)
    Try to setup GMP for Intel Core2 or Xeon, wait....
    Did not detect Intel Core 2 CPU.  Patch not installed
    checking build system type... pentium3-unknown-linux-gnu
    checking host system type... pentium3-unknown-linux-gn
    And the script already have the #!/bin/bash statement.

    EDIT:
    Actually its when their script is trying to compile tmp_is_core2_cpu.c in line 113. When it never creates a tmp_is_core2_cpu file, the script doesn't think I got a c2d.

    Tried to compile the sourcecode myself, and get this:
    Code:
    $ gcc -m64 tmp_is_core2_cpu.c -o tmp_is_core2_cpu
    /tmp/cc60oGZn.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
    collect2: ld returned endingcode 1
    I am using gcc version 4.4.0?

    EDIT2:

    Okay I got it to compile, but now the compiled tmp_is_core2_cpu doesn't think I got a core2duo either :P

    Code:
    $ ./tmp_is_core2_cpu
    No
    Wtf? :|
    Last edited by tball; 05-19-2009 at 12:20 PM.

  5. #15
    Join Date
    May 2008
    Location
    UK
    Posts
    465

    Default

    Quote Originally Posted by Dewni View Post
    Aradreth, could you confirm that changing
    Code:
    16: # run patch
    17: cd gmp-4.2.x-core2-port
    18: ./install_gmp_4.2.x_core2_patch.sh ../gmp-4.2.2
    to
    Code:
    16: # run patch
    17: cd gmp-4.2.x-core2-port
    18: bash ./install_gmp_4.2.x_core2_patch.sh ../gmp-4.2.2
    correctly identifies your CPU now?
    Archlinux links sh to bash, so there would be no change.

  6. #16
    Join Date
    Oct 2007
    Posts
    3

    Default

    http://h2np.net/pi/pi_quick_start.tar.gz
    Has anyone tried this? It's now updated for gmp 4.3.0.
    Last edited by zhuqin; 05-26-2009 at 03:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •