Opened 5 years ago

Closed 5 years ago

#15365 closed defect (fixed)

Let MPIR build without C++ support on Cygwin

Reported by: jpflori Owned by:
Priority: critical Milestone: sage-6.1
Component: packages: standard Keywords: mpir spkg cygwin
Cc: kcrisman, dimpase Merged in:
Authors: Jean-Pierre Flori Reviewers: Travis Scrimshaw
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: u/jpflori/ticket/15365 (Commits) Commit: f09bc424bc19d6f6cc1b1d1c5718d99ce6d739eb
Dependencies: Stopgaps:

Description (last modified by jpflori)

GMP/MPIR used to include a hack to configure faster. This makes GMP/MPIR build badly on cygwin when C++ support is disabled and is not needed anymore anyway. See:

The spkg here backports a fix from:

Use git branch.

Attachments (1)

mpir-2.6.0.p4.diff (10.9 KB) - added by jpflori 5 years ago.
Spkg diff, for review only.

Download all attachments as: .zip

Change History (15)

Changed 5 years ago by jpflori

Spkg diff, for review only.

comment:1 Changed 5 years ago by jpflori

  • Status changed from new to needs_review

comment:2 Changed 5 years ago by jpflori

  • Keywords mpir spkg cygwin added
  • Report Upstream changed from N/A to Fixed upstream, but not in a stable release.

comment:3 follow-up: Changed 5 years ago by jdemeyer

  • Status changed from needs_review to needs_work

configure.in should be patched before configure (i.e. reorder the patches in the patch file).

Last edited 5 years ago by jdemeyer (previous) (diff)

comment:4 Changed 5 years ago by jpflori

  • Description modified (diff)
  • Status changed from needs_work to needs_review

Fixed (in the spkg, no new diff).

comment:5 in reply to: ↑ 3 Changed 5 years ago by dimpase

Replying to jdemeyer:

configure.in should be patched before configure (i.e. reorder the patches in the patch file).

I'd even say configure must be patched after an autoconf run...

comment:6 Changed 5 years ago by jpflori

I more or less patched configure.in and ran autoconf (not autoreconf because even with Jeroen very nice spkg the diff was too large, and might even have failed if I remember correctly, GMP/MPIR autotools scripts are old and quite dirty, but also very smart for other things) to get this.

As this should only be temporary (this will be hopefully in the next MPIR release where a lot of other patches from the spkg, all of them I even think, are integrated), I also removed all superfluous changes made by autoconf (whic sometimes insists on adding a space here and there and so on).

I did not patch both files by hand.

comment:7 Changed 5 years ago by jpflori

  • Branch set to u/jpflori/ticket/15365
  • Commit set to f09bc424bc19d6f6cc1b1d1c5718d99ce6d739eb
  • Description modified (diff)

New commits:

f09bc42Let MPIR build without C++ support on Cygwin.

comment:8 Changed 5 years ago by tscrim

I just tried to compile on cygwin64 with the current branch and it failed with the following:

Travis@Travis-Notebook ~/sage
$ make
cd build && \
"../build/pipestatus" \
        "env SAGE_PARALLEL_SPKG_BUILD='' ./install all 2>&1" \
        "tee -a ../logs/install.log"
*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***
!::=::\
_=/usr/bin/env
ALLUSERSPROFILE=C:\ProgramData
ANDROID_NDK_PATH=C:\Users\Travis\Documents\Android\ndk\android-ndk-r8d
APPDATA=C:\Users\Travis\AppData\Roaming
CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
COMMONPROGRAMFILES=C:\Program Files\Common Files
COMPUTERNAME=TRAVIS-NOTEBOOK
COMSPEC=C:\Windows\system32\cmd.exe
DFSTRACINGON=FALSE
FP_NO_HOST_CHECK=NO
GTK_BASEPATH=C:\Program Files (x86)\GtkSharp\2.12\
HOME=/home/Travis
HOMEDRIVE=C:
HOMEPATH=\Users\Travis
HOSTNAME=Travis-Notebook
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
LANG=en_US.UTF-8
LOCALAPPDATA=C:\Users\Travis\AppData\Local
LOGONSERVER=\\TRAVIS-NOTEBOOK
MAKE=make
MAKEFLAGS=
MAKELEVEL=1
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
MFLAGS=
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PATH=/home/Travis/sage/src/bin:/home/Travis/sage/local/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/MiKTeX 2.9/miktex/bin/x64:/cygdrive/c/Qt/2010.04/mingw/bin:/cygdrive/c/Program Files (x86)/CMake 2.8/bin:/cygdrive/c/Program Files (x86)/LLNL/VisIt 2.1.0:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/PROGRA~2/COMMON~1/ULEADS~1/MPEG:/cygdrive/c/Program Files/Intel/WiFi/bin:/cygdrive/c/Program Files (x86)/Common Files/DivX Shared:/cygdrive/c/altera/91/quartus/bin:/cygdrive/c/Program Files (x86)/Autodesk/Backburner:/cygdrive/c/Program Files/Common Files/Autodesk Shared:/cygdrive/c/Program Files (x86)/TortoiseSVN/bin:/cygdrive/c/Program Files/TortoiseHg:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:/cygdrive/c/Program Files/TortoiseGit/bin:/cygdrive/c/Program Files (x86)/GtkSharp/2.12/bin:/usr/lib/lapack
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PRINTER=Adobe PDF
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramData=C:\ProgramData
ProgramFiles(x86)=C:\Program Files (x86)
PROGRAMFILES=C:\Program Files
PUBLIC=C:\Users\Public
PWD=/home/Travis/sage/build
PYTHONPATH=/home/Travis/sage/local
QTJAVA=C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
QUARTUS_ROOTDIR=c:\altera\91\quartus
SAGE_EXTCODE=/home/Travis/sage/local/share/sage/ext
SAGE_LOCAL=/home/Travis/sage/local
SAGE_LOGS=/home/Travis/sage/logs/pkgs
SAGE_PARALLEL_SPKG_BUILD=
SAGE_ROOT=/home/Travis/sage
SAGE_SPKG_INST=/home/Travis/sage/local/var/lib/sage/installed
SAGE_SRC=/home/Travis/sage/src
SAGE_VERSION=6.1.beta2
SESSIONNAME=Console
SHELL=/bin/bash
SHLVL=4
SYSTEMDRIVE=C:
SYSTEMROOT=C:\Windows
TEMP=/tmp
temp=C:\Users\Travis\AppData\Local\Temp
TERM=xterm
TEXMFCACHE=C:\ProgramData\MiKTeX\2.9
TMP=/tmp
tmp=C:\Users\Travis\AppData\Local\Temp
TRACE_FORMAT_SEARCH_PATH=\\NTREL202.ntdev.corp.microsoft.com\34FB5F65-FFEB-4B61-BF0E-A6A76C450FAA\TraceFormat
TZ=America/Los_Angeles
USER=Travis
USERDOMAIN=Travis-Notebook
USERNAME=Travis
USERPROFILE=C:\Users\Travis
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
WINDIR=C:\Windows
***********************************************
make[1]: Entering directory '/home/Travis/sage/build'
make base
make[2]: Entering directory '/home/Travis/sage/build'
make[2]: Nothing to be done for 'base'.
make[2]: Leaving directory '/home/Travis/sage/build'
env SAGE_BUILD_TOOLCHAIN=yes make toolchain
make[2]: Entering directory '/home/Travis/sage/build'
make[2]: Nothing to be done for 'toolchain'.
make[2]: Leaving directory '/home/Travis/sage/build'
make toolchain-deps
make[2]: Entering directory '/home/Travis/sage/build'
make /home/Travis/sage/local/var/lib/sage/installed/zlib-1.2.8.p0
make[3]: Entering directory '/home/Travis/sage/build'
make[3]: '/home/Travis/sage/local/var/lib/sage/installed/zlib-1.2.8.p0' is up to date.
make[3]: Leaving directory '/home/Travis/sage/build'
make /home/Travis/sage/local/var/lib/sage/installed/mpir-2.6.0.p4
make[3]: Entering directory '/home/Travis/sage/build'
/home/Travis/sage/build/pipestatus "sage-spkg ${SAGE_SPKG_OPTS} mpir-2.6.0.p4 2>&1" "tee -a /home/Travis/sage/logs/pkgs/mpir-2.6.0.p4.log"
Found local metadata for mpir-2.6.0.p4
Found local sources at /home/Travis/sage/upstream/mpir-2.6.0.tar.bz2
Checksum: a9fbfe30db672939abab06d16ce48087ee1b0d01 vs a9fbfe30db672939abab06d16ce48087ee1b0d01
mpir-2.6.0.p4
====================================================
Setting up build directory for mpir-2.6.0.p4
Finished set up
****************************************************
Host system:
CYGWIN_NT-6.0 Travis-Notebook 1.7.27(0.271/5/3) 2013-12-09 11:54 x86_64 Cygwin
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-cygwin/4.8.2/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-1/src/gcc-4.8.2/configure --srcdir=/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-1/src/gcc-4.8.2 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib
Thread model: posix
gcc version 4.8.2 (GCC)
****************************************************
Renaming *,asm files to *.asm...
Applying patches to upstream sources...

... applying patches ...

Building MPIR with the C++ interface and (only) shared libraries.
Checking what CFLAGS MPIR would use if they were empty...
checking build system type... penryn-unknown-cygwin
checking host system type... penryn-unknown-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=32
checking compiler gcc -m32 -O2 -fomit-frame-pointer ... no
checking compiler gcc -O2 -fomit-frame-pointer ... yes
checking compiler gcc -O2 -fomit-frame-pointer has sizeof(long)==4... no
configure: error: could not find a working compiler, see config.log for details
Error configuring MPIR (with CFLAGS unset).
Consult /home/Travis/sage/local/var/tmp/sage/build/mpir-2.6.0.p4/src/config.log for for details.

real    0m19.935s
user    0m3.299s
sys     0m9.106s
************************************************************************
Error installing package mpir-2.6.0.p4
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the relevant part of the log file
  /home/Travis/sage/logs/pkgs/mpir-2.6.0.p4.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/Travis/sage/local/var/tmp/sage/build/mpir-2.6.0.p4 and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/home/Travis/sage/local/var/tmp/sage/build/mpir-2.6.0.p4' && '/home/Travis/sage/sage' --sh)
When you are done debugging, you can type "exit" to leave the subshell.
************************************************************************
Makefile:558: recipe for target '/home/Travis/sage/local/var/lib/sage/installed/mpir-2.6.0.p4' failed
make[3]: *** [/home/Travis/sage/local/var/lib/sage/installed/mpir-2.6.0.p4] Error 1
make[3]: Leaving directory '/home/Travis/sage/build'
Makefile:482: recipe for target 'toolchain-deps' failed
make[2]: *** [toolchain-deps] Error 2
make[2]: Leaving directory '/home/Travis/sage/build'
Makefile:375: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/Travis/sage/build'

real    0m37.622s
user    0m5.586s
sys     0m13.318s
***************************************************************
Error building Sage.

The following package(s) may have failed to build:

package: mpir-2.6.0.p4
log file: /home/Travis/sage/logs/pkgs/mpir-2.6.0.p4.log
build directory: /home/Travis/sage/local/var/tmp/sage/build/mpir-2.6.0.p4

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

Makefile:18: recipe for target 'build' failed
make: *** [build] Error 1

Any ideas? Thanks.

comment:9 Changed 5 years ago by jpflori

Yes, a bunch of ideas :) It's not expected to work anyway, adding support is not that hard, but was not the point of this ticket, the few steps for Cygwin64 support are:

  • updated the configfsf.* scripts,
  • tweak the ABI stuff in spkg-install.

I think that's all. A priori, all needed fixed are in MPIR master git branchn bt I've not tested it lately.

comment:10 Changed 5 years ago by tscrim

This worked for me on Cygwin32, and I'll (try to remember to) try this on my ubuntu machine tonight.

For Cygwin64, the configfsf.* is #14648, but where is the ABI stuff I need to change documented? Thanks for walking me through this.

comment:11 Changed 5 years ago by tscrim

Works for me on Ubuntu, now to see if I can get this to work on Cygwin64...

comment:12 Changed 5 years ago by jpflori

Please add Cygwin64 in other tickets: basically #14648 for the configfsf.* update and potentially a different one for modifying the spkg-install script.

comment:13 Changed 5 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Works on Cygwin64 with #14648 and #15651, so I'm going to stop daddling and set this to positive review. Thanks Jean-Pierre.

comment:14 Changed 5 years ago by vbraun

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.