Hi Vlad,

Looking through your report, I'd say that the MinGW64/sandybridge
combination is not supported yet. The final failure you have is likely
due to a tuning issue with the FFT. Unfortunately it isn't possible to
fix this by calling make tune. (When we finish putting the new FFT in,
which isn't too far away but still a few weeks work, it should be
possible to run make tune and have it give appropriate values on
MinGW.)

In the mean time, it is probably necessary to force a build with a
slightly detuned processor selection. It may also be necessary to
stick with MPIR-2.5.0 which it is reported had fewer problems with
MinGW64.

Sorry for the delay in replying. I have only just noticed that this
report went relatively unanswered, possibly due to the computer
problems Jason has been having. If he doesn't reemerge in the next
week or two, I'll take a look at this myself.

Bill.

On 12 April 2012 08:58, Jason <ja...@thecodecavern.co.uk> wrote:
> Hello all,
>
> I got issues configuring and building mpir from svn under Msys mingw64, on 
> windows 7 x86_64, SP1.
>
>
> Details about my system:
> Windows 7 SP1 x86-64
> $ uname -a
> MINGW32_NT-6.1 CLAMPINEW 1.0.17(0.48/3/2) 2011-04-24 23:39 i686 Msys
> $ mpir-svn/config.guess
> sandybridge-pc-mingw32
> $ mpir-svn/configfsf.guess
> i686-pc-mingw32
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=c:/sdks/win32/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.6.3/lto-wrapper.exe
> Target: x86_64-w64-mingw32
> Configured with: /home/ruben/mingw-w64/toolchain/src/gcc/configure 
> --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu 
> --target=x86_64-w64-mingw32 
> --with-sysroot=/home/ruben/mingw-w64/toolchain/mingw64mingw64/mingw64 
> --prefix=/home/ruben/mingw-w64/toolchain/mingw64mingw64/mingw64 
> --with-libiconv-prefix=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>  --with-gmp=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install 
> --with-mpfr=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install 
> --with-mpc=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install 
> --with-ppl=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install 
> --with-cloog=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install 
> --enable-cloog-backend=isl --with-host-libstdcxx='-lstdc++ -lm -lgcc_eh' 
> --enable-shared --enable-static --enable-threads=posix --disable-multilib 
> --enable-languages=c,lto,c++,fortran,objc,obj-c++,java --enable-libgomp
>  --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls 
> --disable-werror --enable-checking=release --disable-win32-registry 
> --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 
> -fomit-frame-pointer -momit-leaf-frame-pointer -fgraphite-identity 
> -floop-interchange -floop-block -floop-parallelize-all' LDFLAGS=
> Thread model: posix
> gcc version 4.6.3 20111027 (prerelease) (GCC)
>
>
>
> Preparation steps:
> 1) svn co http://boxen.math.washington.edu/svn/mpir/mpir/trunk mpir-svn
> 2) convert to Unix LF all *.c, *.cc, *.cpp, *.cxx, *.h, *.s, *.asm, *.as, 
> *.m4, Makefile.in, Makefile.am, config.in, configure.in and all shell scripts 
> (not just those with .sh extension).
>
>
> Here are the issues encountered:
> 1) Configure does not figure out for itself that is should pick the windows 
> ABI. It does however figure out the ISA (sandybridge). The end result is a 
> library that cannot be used and which not passes the test due to crashes. The 
> crashes are due to the mismatch in calling convention of the asm code. 
> (attached no-host&no-abi.zip)
> 2) If I pass in an explicit
> ABI=64 ../mpir-svn/configure --host=sandybridge-w64-mingw32 
> --build=sandybridge-w64-mingw32 <other configure flags>
> it will correctly link to mpn/x86_64w/... , but it fails to detect the 
> assembler functions. Thus link fails due to duplicated symbols (attached 
> host&abi.zip).
> 2.1) Patching all the asm files in mpn/x86_64w/sandybridge/*.asm and 
> configure.in, followed by running following commands resulted in a working 
> library that passes the all tests.
>
> _SRC_DIR=mpir-svn
> _BOOTSTRAP_LOG=mpir_bootstrap.log
> _MSYS_ABSOLUTE_BUILD_START=`pwd`
> cd ${_SRC_DIR}
> # Make a backup copy of config.guess and config.sub
> mv -f config.guess config.guess.boostrap_backup
> mv -f configfsf.guess configfsf.guess.boostrap_backup
> mv -f configfsf.sub configfsf.sub.boostrap_backup
> mv -f config.sub config.sub.boostrap_backup
> mv -f INSTALL INSTALL.boostrap_backup
> mv -f yasm/config/config.sub yasm/config/config.sub.boostrap_backup
> WANT_AUTOMAKE=1.11 autoreconf -fvi 2>&1 | tee -a 
> ${_MSYS_ABSOLUTE_BUILD_START}/${_BOOTSTRAP_LOG}
> find . \( -name autom4te.cache \) -print | xargs rm -rf
> find . \( -name '*~' \) -print | xargs rm -rf
> #Restore backups
> mv -f config.guess.boostrap_backup config.guess
> mv -f configfsf.guess.boostrap_backup configfsf.guess
> mv -f configfsf.sub.boostrap_backup configfsf.sub
> mv -f config.sub.boostrap_backup config.sub
> mv -f INSTALL.boostrap_backup INSTALL
> # Patch yasm/config/config.sub such that will not throw-up @ 
> <processor>-w64-mingw32
> sed '1200,1300 s/*-unknown)/*-unknown | *-pc | *-apple | *-w64)/' 
> yasm/config/config.sub > yasm/config/configfsf.sub
> mv -f yasm/config/configfsf.sub yasm/config/config.sub
> cd ..
> Note:
>    I did backup the configfsf.guess and configfsf.sub from svn, as they are 
> newer than what I have in auto*tools from msys. Did not done the same for 
> yasm/ as they are older.
>
> Attached mpir-svn-mingw64_asm.patch and host&abi&patch.zip.
> Note regarding the patch: I am not a sed guru, thus the changes work only for 
> sandybrige processor. I could've changed only configure.in such that sed 
> would look after "LEAF_PROC <function name>", "WIN64_GCC_PROC <function 
> name>, <number>, frame"and similar constructs. However, this is above my 
> knowledge of mpir internals and sed.
>
> 3) Building a "fat" library fails @ link time due to duplicated symbols. Root 
> cause is the same as issue (2) (attached host&abi&fat.zip)
> 4) Trying to "tune"the library fails when making dll only. This seems to be 
> expected, but not documented into http://www.mpir.org/mpir-2.5.1.pdf @ 
> Chapter 2.6. Also, to be successful, "make tuneup" should be "make 
> tuneup.exe". Even if built, tuneup will crash like this:
> Parameters for ../mpir-svn/mpn/x86_64w/sandybridge/gmp-mparam.h
> The system cannot find the path specified.
> The system cannot find the path specified.
> The system cannot find the path specified.
> Using: CPU cycle counter
> speed_precision 1000000, speed_unittime 1 cycle, CPU freq unknown
> DEFAULT_MAX_SIZE 1000, fft_max_size 50000
>
> /* Generated by tuneup.c, 2012-04-10, gcc 4.6 */
>
> #define MUL_KARATSUBA_THRESHOLD           4
> #define MUL_TOOM3_THRESHOLD              17
> #define MUL_TOOM4_THRESHOLD              32
> #define MUL_TOOM8H_THRESHOLD             86
>
> #define SQR_BASECASE_THRESHOLD            0  /* always */
> #define SQR_KARATSUBA_THRESHOLD           4
> #define SQR_TOOM3_THRESHOLD              17
> #define SQR_TOOM4_THRESHOLD              32
> #define SQR_TOOM8_THRESHOLD              58
>
> #define POWM_THRESHOLD                  984
>
> #define HGCD_THRESHOLD                   30
> #define GCD_DC_THRESHOLD                 30
> #define GCDEXT_DC_THRESHOLD              30
> #define JACOBI_BASE_METHOD                3
>
> #define DIVREM_1_NORM_THRESHOLD       MP_SIZE_T_MAX  /* never */
> #define DIVREM_1_UNNORM_THRESHOLD     MP_SIZE_T_MAX  /* never */
> #define MOD_1_NORM_THRESHOLD          MP_SIZE_T_MAX  /* never */
> #define MOD_1_UNNORM_THRESHOLD        MP_SIZE_T_MAX  /* never */
> #define USE_PREINV_DIVREM_1               1
> #define USE_PREINV_MOD_1                  0
> #define DIVREM_2_THRESHOLD            MP_SIZE_T_MAX  /* never */
> #define DIVEXACT_1_THRESHOLD          MP_SIZE_T_MAX  /* never */
> #define MODEXACT_1_ODD_THRESHOLD      MP_SIZE_T_MAX  /* never */
> #define MOD_1_1_THRESHOLD                 3
> #define MOD_1_2_THRESHOLD                 4
> #define MOD_1_3_THRESHOLD                 5
> #define DIVREM_HENSEL_QR_1_THRESHOLD    996
> #define RSH_DIVREM_HENSEL_QR_1_THRESHOLD      3
> #define DIVREM_EUCLID_HENSEL_THRESHOLD      8
>
> #define ROOTREM_THRESHOLD             
> ../../mpir-svn/mpn/generic/mul_fft.c:2276: GNU MP assertion failed: a > 0
>
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
>
> Stack trace at the moment of assertion:
> #0  __gmp_assert_fail (filename=0x4bac88 
> "../../mpir-svn/mpn/generic/mul_fft.c", linenum=2276, expr=0x4bb5ce "a > 0") 
> at ../mpir-svn/assert.c:49
> #1  0x00000000004158c8 in mpn_mul_fft_full_a (op=0x22c790, n=0x22ccd0, nl=8, 
> m=0x22cbe0, ml=4, a=0) at ../../mpir-svn/mpn/generic/mul_fft.c:2276
> #2  0x0000000000415dc7 in __gmpn_mul_fft_full (op=0x22c790, n=0x22ccd0, nl=8, 
> m=0x22cbe0, ml=4) at ../../mpir-svn/mpn/generic/mul_fft.c:2365
> #3  0x00000000004166c2 in __gmpn_mul (prodp=0x22c790, up=0x22ccd0, un=8, 
> vp=0x22cbe0, vn=4) at ../../mpir-svn/mpn/generic/mul.c:143
> #4  0x0000000000419bfb in __gmpn_tdiv_qr (qp=0x22cbe0, rp=0x22ccd0, qxn=0, 
> np=0x22da80, nn=16, dp=0x22ccd0, dn=13) at 
> ../../mpir-svn/mpn/generic/tdiv_qr.c:355
> #5  0x000000000048d8d7 in __gmpn_rootrem_basecase (rootp=0x22d080, 
> remp=0x22cfc0, up=0x22da80, un=16, nth=5) at rootrem_basecase.c:160
> #6  0x000000000042eb7e in __gmpn_rootrem (rootp=0x22d080, remp=0x22cfc0, 
> up=0x22da80, un=16, k=5) at ../../mpir-svn/mpn/generic/rootrem.c:99
> #7  0x000000000045ef0e in speed_mpn_rootrem (s=0x4da540) at 
> ../../mpir-svn/tune/common.c:1362
> #8  0x0000000000440719 in speed_measure (fun=0x45ece8 <speed_mpn_rootrem>, 
> s=0x4da540) at ../../mpir-svn/tune/common.c:156
> #9  0x0000000000401f23 in tuneup_measure (fun=0x45ece8 <speed_mpn_rootrem>, 
> rands=0x22fe10, param=0x4d9320, s=0x4da540) at 
> ../../mpir-svn/tune/tuneup.c:435
> #10 0x0000000000402511 in one (threshold=0x4b8198, rands=0x22fe10, 
> param=0x4d9320) at ../../mpir-svn/tune/tuneup.c:586
> #11 0x0000000000403446 in tune_rootrem (rands=0x22fe10) at 
> ../../mpir-svn/tune/tuneup.c:993
> #12 0x0000000000405537 in all (rands=0x22fe10) at 
> ../../mpir-svn/tune/tuneup.c:2046
> #13 0x000000000040575b in main (argc=1, argv=0x1862190) at 
> ../../mpir-svn/tune/tuneup.c:2121
> Attached host&abi&tune.zip
>
> Note: I enabled assertions in order to debug, otherwise tuneup just crashes 
> in the middle of output.
>
> Best Regards,
> Gabriel
>
> --------------------------------
>
> Hi , thanks for the report , my main machine died last week , so I'll give it 
> a look this weekend
>
> Jason
>
> --
> You received this message because you are subscribed to the Google Groups 
> "mpir-devel" group.
> To post to this group, send email to mpir-devel@googlegroups.com.
> To unsubscribe from this group, send email to 
> mpir-devel+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/mpir-devel?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to