Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8542 closed defect (fixed)

Pynac should use a function pointer table

Reported by: mhansen Owned by: burcin
Priority: major Milestone: sage-4.4.3
Component: porting: Cygwin Keywords: pynac
Cc: Merged in: sage-4.4.3.alpha1
Authors: Mike Hansen Reviewers: Burcin Erocal
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mhansen)

It also needs to be configured to build a DLL in Cygwin. There are some automake macros that will help with this.

Attachments (1)

trac_8542-pynac_pointer_table.patch (15.9 KB) - added by mhansen 10 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 10 years ago by mhansen

It basically comes down to adding the following changes

diff -r 1cf1634d68b0 configure.ac
--- a/configure.ac	Sun Mar 14 20:20:48 2010 -0800
+++ b/configure.ac	Mon Mar 15 00:15:49 2010 -0800
@@ -71,6 +71,7 @@
 AC_PROG_CXXCPP
 AC_PROG_INSTALL
 AM_PROG_LIBTOOL
+AC_LIBTOOL_WIN32_DLL
 
 dnl Check for data types which are needed by the hash function 
 dnl (golden_ratio_hash).
diff -r 1cf1634d68b0 ginac/Makefile.am
--- a/ginac/Makefile.am	Sun Mar 14 20:20:48 2010 -0800
+++ b/ginac/Makefile.am	Mon Mar 15 00:15:49 2010 -0800
@@ -10,7 +10,7 @@
   pseries.cpp print.cpp symbol.cpp symmetry.cpp tensor.cpp \
   utils.cpp wildcard.cpp \
   remember.h tostring.h utils.h compiler.h
-libpynac_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -release $(LT_RELEASE)
+libpynac_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -release $(LT_RELEASE) -no-undefined
 ginacincludedir = $(includedir)/pynac
 ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \
   clifford.h color.h constant.h container.h ex.h expair.h expairseq.h \

and fixing the fallout by making sure that Python gets linked in.

comment:2 Changed 10 years ago by burcin

Shall I include the diff above in the next Pynac release?

I could have done this for the version I just released (#8644) if I had known earlier...

comment:3 Changed 10 years ago by mhansen

No, not quite yet. Basically, we'll also have the stuff to autotools to detect where Python is, etc.

comment:4 Changed 10 years ago by mhansen

  • Authors set to Mike Hansen
  • Description modified (diff)
  • Summary changed from Pynac does not build a DLL on Cygwin to Pynac should use a function pointer table

Changed 10 years ago by mhansen

comment:5 Changed 10 years ago by mhansen

  • Description modified (diff)
  • Milestone set to sage-4.4.2

I'll post the spkg shortly.

comment:6 follow-up: Changed 10 years ago by mhansen

  • Description modified (diff)

There's an spkg at http://sage.math.washington.edu/home/mhansen/pynac-0.13.spkg, but it needs to have changes committed / SPKG.txt made / version number updated.

comment:7 in reply to: ↑ 6 Changed 10 years ago by burcin

Replying to mhansen:

There's an spkg at http://sage.math.washington.edu/home/mhansen/pynac-0.13.spkg, but it needs to have changes committed / SPKG.txt made / version number updated.

I'll take a look at these and merge #8651 as well.

comment:8 Changed 10 years ago by burcin

  • Keywords pynac added
  • Owner changed from tbd to burcin
  • Reviewers set to Burcin Erocal

Both patches, for pynac and Sage, look good to me.

Building the new pynac package fails with the following error:

...
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/../../../../x86_64-pc-linux-gnu/bin/ld: /home/burcin/sage/sage-4.4.1.alpha2-patched/local/lib/python2.6/config/libpython2.6.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/burcin/sage/sage-4.4.1.alpha2-patched/local/lib/python2.6/config/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libpynac.la] Error 1
make[2]: Leaving directory `/home/burcin/sage/sage-4.4.1.alpha2-patched/spkg/build/pynac-0.1.13/src/ginac'
...

Do we have a python package that uses -fPIC?

comment:10 Changed 10 years ago by burcin

It works! I'll put your changes on the latest spkg included in sage (including the patch for #8753), merge some other fixes (#8651, maybe #8775), bump the version to 2.0 and make a new package.

comment:11 Changed 10 years ago by mhansen

I'll test the Python spkg on other systems.

comment:12 Changed 10 years ago by burcin

  • Status changed from new to needs_review

New pynac package containing Mike's function table and autoconf patches is available at #8903 or directly from:

http://sage.math.washington.edu/home/burcin/pynac/pynac-0.2.0.spkg

The package also requires patches from #8651, #8775 and #8688.

comment:13 Changed 10 years ago by burcin

  • Status changed from needs_review to positive_review

Great work Mike! Cygwin, here we come!

comment:14 Changed 10 years ago by was

  • Merged in set to 4.4.3.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:15 Changed 10 years ago by mvngu

  • Merged in changed from 4.4.3.alpha1 to sage-4.4.3.alpha1
Note: See TracTickets for help on using tickets.