Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc error in pyzmq-2.1.11.p0.spkg #13313

Closed
seblabbe opened this issue Jul 31, 2012 · 20 comments
Closed

Fix gcc error in pyzmq-2.1.11.p0.spkg #13313

seblabbe opened this issue Jul 31, 2012 · 20 comments

Comments

@seblabbe
Copy link
Contributor

Here is the new proposed spkg:

http://sage.math.washington.edu/home/slabbe/pyzmq-2.1.11.p1.spkg

As reported on sage-devel here, there is an error when installing the optional package pyzmq #12843 (after its dependency zeromq of course!) on OSX 10.5.8 :

gcc version 4.6.3 (GCC)
****************************************************
running configure
******************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       /Users/slabbe/Applications/sage-5.2.rc0/local
gcc -fno-strict-aliasing -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -I/Users/slabbe/Applications/sage-5.2.rc0/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
gcc: erreur: i386: No such file or directory
gcc: erreur: unrecognized option ‘-arch’
Fatal:
    Failed to compile ZMQ test program.  Please check to make sure:

    * You have a C compiler installed
    * A development version of Python is installed (including header files)
    * A development version of ZMQ >= 2.1.4 is installed (including header files)
    * If ZMQ is not in a default location, supply the argument --zmq=<path>
    * If you did recently install ZMQ to a default location,
      try rebuilding the ld cache with `sudo ldconfig`
      or specify zmq's location with `--zmq=/usr/local`
   
error: command 'gcc' failed with exit status 1
******************************************

The reason to this is that Sage's gcc spkg does not build a compiler which understands the option -arch of Apple's clone of gcc.

The following patch applied on the spkg fixes the problem :

pyzmq-2.1.11.p1/patches $ cat buildutils.patch
--- src/buildutils.py    2011-12-19 04:21:14.000000000 -0500
+++ src-patched/buildutils.py    2012-07-27 12:01:07.000000000 -0400
@@ -111,13 +111,7 @@
    
     cpreargs = lpreargs = None
     if sys.platform == 'darwin':
-        # use appropriate arch for comiler
-        if platform.architecture()[0]=='32bit':
-            cpreargs = ['-arch','i386']
-            lpreargs = ['-arch', 'i386', '-undefined', 'dynamic_lookup']
-        else:
-            # allow for missing UB arch, since it will still work:
-            lpreargs = ['-undefined', 'dynamic_lookup']
+        lpreargs = ['-undefined', 'dynamic_lookup']
 
     objs = cc.compile([cfile],extra_preargs=cpreargs)
     cc.link_executable(objs, efile, extra_preargs=lpreargs)

Component: packages: optional

Author: Sébastien Labbé

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/13313

@dimpase
Copy link
Member

dimpase commented Jul 31, 2012

comment:1

Could you create a proper patch and upload it as an attachment?

@dimpase

This comment has been minimized.

@seblabbe
Copy link
Contributor Author

comment:2

Attachment: buildutils.patch.gz

The patch I just attached should go in pyzmq-2.1.11.p?/patches. I never patch/created a package before. If I am doing something wrong, just tell me.

Sébastien

@dimpase
Copy link
Member

dimpase commented Jul 31, 2012

comment:3

Replying to @seblabbe:

The patch I just attached should go in pyzmq-2.1.11.p?/patches. I never patch/created a package before. If I am doing something wrong, just tell me.

in a nutshell:

  • rename the package directory pyzmq-2.1.11.p2
  • put the patch in pyzmq-2.1.11.p2/patches
  • adjust spkg-install so that this patch is applied (assuming your patch is not a change to Sage's patches to the upstream, but a change of the upstream)
  • create pyzmq-2.1.11.p2.spkg by running sage -spkg pyzmq-2.1.11.p2/ in the corresponding directory i.e. SAGEROOT/spkg/optional
  • test it.
  • upload it somewhere and put a link to it into the ticket description.
  • mark the ticket as needing review

(I know, sounds like a lot of work :-))

@seblabbe
Copy link
Contributor Author

comment:4

Ok thanks for the cheering. I also read Patching a spkg in the Developper Guide. Here is my first patch to a package (p0 was the most recent version) :

http://sage.math.washington.edu/home/slabbe/pyzmq-2.1.11.p1.spkg

Needs review!

@vbraun
Copy link
Member

vbraun commented Jul 31, 2012

comment:6

Dima, you reported on the mailinglist that installing pyzmq works if you install zmq first. Can you clarify on that? zmq is a requirement, you can't build pyzmq without. I just want tbo be clear that we aren't patching dead code here.

The patch looks good to me, fwiw.

@dimpase
Copy link
Member

dimpase commented Aug 1, 2012

comment:7

Replying to @vbraun:

Dima, you reported on the mailinglist that installing pyzmq works if you install zmq first. Can you clarify on that? zmq is a requirement, you can't build pyzmq without. I just want tbo be clear that we aren't patching dead code here.

Hi Volker,

well, it was a (brain)dead response by me, the code is alive.
Later I was able to reproduce the bug on another installation.

@sagetrac-jtremblay
Copy link
Mannequin

sagetrac-jtremblay mannequin commented Aug 2, 2012

comment:8

The patch worked for me.

@seblabbe
Copy link
Contributor Author

seblabbe commented Aug 2, 2012

comment:9

Replying to @sagetrac-jtremblay:

The patch worked for me.

The patch or the spkg ? On which machine ?

@sagetrac-jtremblay
Copy link
Mannequin

sagetrac-jtremblay mannequin commented Aug 2, 2012

comment:10

The spkg, on OSX 10.7.3 with Sage 5.2 binaries.

@seblabbe
Copy link
Contributor Author

seblabbe commented Aug 2, 2012

comment:11

Replying to @sagetrac-jtremblay:

The spkg, on OSX 10.7.3 with Sage 5.2 binaries.

And were you obtaining the same problem as me while installing pyzmq-2.1.11.p0.spkg ?

@sagetrac-jtremblay
Copy link
Mannequin

sagetrac-jtremblay mannequin commented Aug 2, 2012

comment:12

Apparently not, zmq was not installed when I tried installing pyzmq :

Extracting package /Library/sage/spkg/optional/pyzmq-2.1.11.p0.spkg
-rw-r--r--  1 tremblayj  wheel  464755  2 Aug 10:02 /Library/sage/spkg/optional/pyzmq-2.1.11.p0.spkg
Finished extraction
****************************************************
Host system:
Darwin jerometremblayportable.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
****************************************************
C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/Library/sage/local/bin/../libexec/gcc/x86_64-apple-darwin10.8.0/4.6.3/lto-wrapper
Target: x86_64-apple-darwin10.8.0
Configured with: ../src/configure --prefix=/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-5.2/local --with-local-prefix=/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-5.2/local --with-gmp=/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-5.2/local --with-mpfr=/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-5.2/local --with-mpc=/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-5.2/local --with-system-zlib --disable-multilib  
Thread model: posix
gcc version 4.6.3 (GCC) 
****************************************************
running configure
******************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       /Library/sage/local
gcc -fno-strict-aliasing -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/sage/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
detect/vers.c:3:17: fatal error: zmq.h: No such file or directory
compilation terminated.
Fatal: 
    Failed to compile ZMQ test program.  Please check to make sure:

    * You have a C compiler installed
    * A development version of Python is installed (including header files)
    * A development version of ZMQ >= 2.1.4 is installed (including header files)
    * If ZMQ is not in a default location, supply the argument --zmq=<path>
    * If you did recently install ZMQ to a default location, 
      try rebuilding the ld cache with `sudo ldconfig`
      or specify zmq's location with `--zmq=/usr/local`
    
error: command 'gcc' failed with exit status 1

@seblabbe
Copy link
Contributor Author

comment:13

Replying to @sagetrac-jtremblay:

Apparently not, zmq was not installed when I tried installing pyzmq :

Yes, but this was not my question: zeromq needs to be installed before pyzmq.

To summarize:

  • The pyzmq-2.1.11.p0.spkg is broken on OSX 10.5.8.
  • The pyzmq-2.1.11.p1.spkg fixes the bug at least for OSX 10.5.8.
  • The pyzmq-2.1.11.p1.spkg also work on OSX 10.7.3.
  • And we do not know if pyzmq-2.1.11.p0.spkg was broken on OSX 10.7.3 also (which was my previous question).

#12719 will be merged soon, so it would be nice if this ticket could be reviewed, no?

@seblabbe

This comment has been minimized.

@seblabbe seblabbe changed the title gcc error while installing optionnal package pyzmq-2.1.11.p0 Fix gcc error in pyzmq-2.1.11.p0.spkg Jan 25, 2013
@seblabbe

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented Jan 25, 2013

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented Jan 25, 2013

Author: Sebastien Labbe

@vbraun
Copy link
Member

vbraun commented Jan 25, 2013

comment:16

Looks good to me.

@haraldschilly
Copy link
Member

comment:17

spkg is on its way to the servers!

@seblabbe
Copy link
Contributor Author

Changed author from Sebastien Labbe to Sébastien Labbé

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants