Opened 7 years ago

Closed 7 years ago

#14022 closed defect (fixed)

Get scipy fortran objects be built with -fPIC again

Reported by: fbissey Owned by: tbd
Priority: blocker Milestone: sage-5.7
Component: packages: standard Keywords:
Cc: Merged in: sage-5.7.beta2
Authors: François Bissey Reviewers: Jeroen Demeyer, Stephen Montgomery-Smith
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by fbissey)

This is a follow up to #13985. After that ticket was merged FC/F90/F77 are not set to something that includes -fPIC. This leads to problems like the one reported by Stephen Montgomery-Smith working on the BSD port.

/usr/home/stephen/sage-devel/work/sage-5.7.beta1/local/bin/gfortran
-Wall -shared
-Wl,-rpath=/usr/home/stephen/sage-devel/work/sage-5.7.beta1/local/lib
-Wl,-rpath=/usr/local/lib/gcc46
build/temp.freebsd-8.3-STABLE-amd64-2.7/build/src.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/_fftpackmodule.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/zfft.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/drfft.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/zrfft.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/zfftnd.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/build/src.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/dct.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/build/src.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/src/dst.o
build/temp.freebsd-8.3-STABLE-amd64-2.7/build/src.freebsd-8.3-STABLE-amd64-2.7/fortranobject.o
-L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd8.3/4.6.3
-Lbuild/temp.freebsd-8.3-STABLE-amd64-2.7 -ldfftpack -lfftpack
-lpython2.7 -lgfortran -o
build/lib.freebsd-8.3-STABLE-amd64-2.7/scipy/fftpack/_fftpack.so
/usr/local/bin/ld:
build/temp.freebsd-8.3-STABLE-amd64-2.7/libdfftpack.a(dffti1.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a
shared object; recompile with -fPIC
build/temp.freebsd-8.3-STABLE-amd64-2.7/libdfftpack.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status
/usr/local/bin/ld:
build/temp.freebsd-8.3-STABLE-amd64-2.7/libdfftpack.a(dffti1.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a
shared object; recompile with -fPIC
build/temp.freebsd-8.3-STABLE-amd64-2.7/libdfftpack.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status

{F,FC}FLAGS should be set to append "-fPIC" when compiling scipy.

  • new spkg:

http://spkg-upload.googlecode.com/files/scipy-0.11.0.p1.spkg

Attachments (1)

scipy-0.11.0.p0.log (424.7 KB) - added by jdemeyer 7 years ago.
Log of failed FreeBSD build

Download all attachments as: .zip

Change History (18)

comment:1 Changed 7 years ago by jdemeyer

  • Component changed from PLEASE CHANGE to packages
  • Priority changed from major to blocker
  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 7 years ago by jdemeyer

Before jumping to conclusions, I'd like to see the full logfile of the failed build first. Because on other systems, I am seeing in the SciPy logs

building 'dfftpack' library
compiling Fortran sources
Fortran f77 compiler: gfortran -Wall -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: gfortran -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: gfortran -Wall -ffixed-form -fno-second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops

comment:3 follow-up: Changed 7 years ago by fbissey

OK, but I have the spkg ready just in case.

comment:4 follow-up: Changed 7 years ago by fbissey

Actually I am not sure why you asked for the ATLAS log. Does scipy takes some cues from ATLAS (if it is the cblas/lapack of choice)?

comment:5 in reply to: ↑ 4 Changed 7 years ago by jdemeyer

Replying to fbissey:

Does scipy takes some cues from ATLAS (if it is the cblas/lapack of choice)?

I don't know but SciPy at least mentions the ATLAS build flags:

ATLAS version 3.8.4 built by buildbot on Sat Jan 26 08:53:30 SGT 2013:
   UNAME    : Linux arando 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux
   INSTFLG  : -1 0 -a 1
   ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_Corei2 -DATL_CPUMHZ=3301 -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_GAS_x8632
   F2CDEFS  : -DAdd_ -DF77_INTEGER=int -DStringSunStyle
   CACHEEDGE: 0
   F77      : sage_fortran, version GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   F77FLAGS : -O -fPIC -m32
   SMC      : gcc, version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   SMCFLAGS : -fomit-frame-pointer -mfpmath=sse -mavx -O2 -fno-schedule-insns2 -fPIC -m32
   SKC      : gcc, version gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   SKCFLAGS : -fomit-frame-pointer -mfpmath=sse -mavx -O2 -fno-schedule-insns2 -fPIC -m32

Changed 7 years ago by jdemeyer

Log of failed FreeBSD build

comment:6 Changed 7 years ago by jdemeyer

At least it's clear now that -fPIC isn't added on FreeBSD. But I would still really like to know where SciPy (or SCons) gets the flags from:

Fortran f77 compiler: gfortran -Wall -ffixed-form -fno-second-underscore -pipe -Wl,-rpath=/usr/home/stephen/sage-devel/work/sage-5.7.beta1/local/lib -Wl,-rpath=/usr/local/lib/gcc46 -O3 -funroll-loops
Fortran f90 compiler: gfortran -Wall -fno-second-underscore -pipe -Wl,-rpath=/usr/home/stephen/sage-devel/work/sage-5.7.beta1/local/lib -Wl,-rpath=/usr/local/lib/gcc46 -O3 -funroll-loops
Fortran fix compiler: gfortran -Wall -ffixed-form -fno-second-underscore -Wall -fno-second-underscore -pipe -Wl,-rpath=/usr/home/stephen/sage-devel/work/sage-5.7.beta1/local/lib -Wl,-rpath=/usr/local/lib/gcc46 -O3 -funroll-loops

comment:7 in reply to: ↑ 3 Changed 7 years ago by jdemeyer

Replying to fbissey:

OK, but I have the spkg ready just in case.

Care to put it up?

comment:8 Changed 7 years ago by fbissey

Sure. It will take a few minutes. Also, I don't think Stephen has a trac account so we cannot add him to the ticket so he could see your question. The presence of all those -Wl,-rpath= make me think he has set some of the fortran flags manually but it would be nice to have confirmation. My other thought was libgfortan.spec but that wouldn't show up.

Last edited 7 years ago by fbissey (previous) (diff)

comment:9 Changed 7 years ago by fbissey

  • Description modified (diff)

New spkg available in ticket description.

comment:10 Changed 7 years ago by jdemeyer

  • Authors set to François Bissey
  • Reviewers set to Jeroen Demeyer

Looks good to me if you remove scipy-0.11.0.p1-review.diff

But we should let Stephen test it before putting positive review.

comment:11 Changed 7 years ago by stephen

I can confirm that scipy-0.11.0.p1 builds on FreeBSD. (And I do have a trac account.)

comment:12 Changed 7 years ago by fbissey

Sorry, I didn't see your name on the wiki front page and I didn't search any further. I'll do the clean up, which shouldn't be too hard as the file is not tracked.

comment:13 Changed 7 years ago by stephen

No problem.

comment:14 Changed 7 years ago by fbissey

spkg updated. Your comment reminded me to do it.

Last edited 7 years ago by fbissey (previous) (diff)

comment:15 Changed 7 years ago by jdemeyer

  • Status changed from new to needs_review

comment:16 Changed 7 years ago by jdemeyer

  • Reviewers changed from Jeroen Demeyer to Jeroen Demeyer, Stephen Montgomery-Smith
  • Status changed from needs_review to positive_review

comment:17 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.7.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.