Bug 159129 - math/arpack should not be linked with math/lapack
Summary: math/arpack should not be linked with math/lapack
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brendan Fabeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-23 05:50 UTC by Stephen Montgomery-Smith
Modified: 2011-09-28 19:10 UTC (History)
0 users

See Also:


Attachments
file.diff (8.76 KB, patch)
2011-07-23 05:50 UTC, Stephen Montgomery-Smith
no flags Details | Diff
arpack_patch.txt (1.50 KB, text/plain)
2011-09-25 13:20 UTC, Eijiro Shibusawa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Montgomery-Smith freebsd_committer 2011-07-23 05:50:09 UTC
math/arpack needs to use lapack version 2 functions for its operation.  However math/lapack is at version 3.  So math/arpack provides its own lapack functions in its source code.

However this can create problems when linking a program with arpack and lapack together.  This is described at http://mathema.tician.de/node/373, and there he provides a patch so that the function "second" is not duplicated in both libraries.

But Pedro F. Giffuni, the original creator of the math/arpack port, pointed out that there still may be problems linking arpack and lapack together, because of the common names used for the version 2 and version 3 lapack functions.

Fix: I have added a perl script that mangles the version 2 lapack function names.  This is invoked, along with the patch described at http://mathema.tician.de/node/373, by the MANGLE_LAPACK_NAMES option, which is off by default.

None of this seems to affect any of the other ports that use arpack, and they seem to build equally well whether or not the MANGLE_LAPACK_NAMES option is off or on.

I know I am the maintainer of this port and a committer.  But I am submitting it as a PR, because my solution method is a bit unusual, and I want to give an opportunity for people to comment on my proposed solution.

How-To-Repeat: See ports/147487.
Comment 1 Edwin Groothuis freebsd_committer 2011-07-23 05:50:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stephen

Submitter is maintainer and has GNATS access (via the GNATS Auto Assign 
Tool)
Comment 2 Stephen Montgomery-Smith freebsd_committer 2011-07-23 05:51:28 UTC
State Changed
From-To: open->feedback

Maintainer/committer would like to wait a week or two to solicit comments.
Comment 3 Brendan Fabeny freebsd_committer 2011-08-12 04:15:32 UTC
Responsible Changed
From-To: stephen->bf

I'll take it.
Comment 4 dfilter service freebsd_committer 2011-08-24 11:41:48 UTC
bf          2011-08-24 10:41:39 UTC

  FreeBSD ports repository

  Modified files:
    math/arpack          Makefile distinfo pkg-descr pkg-plist 
    math/arpack/files    arpack.h patch-UTIL+second.f 
  Log:
  rename the lapack symbols in arpack to avoid conflicts
  with other lapack libraries [1]; respect LDFLAGS when
  linking; wrap long lines; trim pkg-descr
  
  PR:             159129 [1]
  Submitted by:   stephen (original version) [1]
  
  Revision  Changes    Path
  1.25      +73 -18    ports/math/arpack/Makefile
  1.8       +0 -2      ports/math/arpack/distinfo
  1.2       +177 -171  ports/math/arpack/files/arpack.h
  1.3       +2 -2      ports/math/arpack/files/patch-UTIL+second.f
  1.4       +7 -22     ports/math/arpack/pkg-descr
  1.7       +2 -0      ports/math/arpack/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Brendan Fabeny freebsd_committer 2011-08-24 11:45:10 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!
Comment 6 Eijiro Shibusawa 2011-09-25 13:20:17 UTC
Hi, Mr. b.f.,

Thank you so much for your careful work.
However objcopy command does not seem to work as expected
because symbols in "rename" file lack suffix underscore.

% nm /usr/local/lib/libarpack.a | grep 'T second_'

I think it is needed for mangling the lapack symbols
(e.g, second_ -> arpack_second_).

I don't know whether the attached patch is appropriate or not,
so please review it.

Thanks in advance,
Comment 7 dfilter service freebsd_committer 2011-09-28 19:00:38 UTC
bf          2011-09-28 18:00:24 UTC

  FreeBSD ports repository

  Modified files:
    math/arpack          Makefile 
  Log:
  fix the objcopy renaming by adding a forgotten correction
  to account for gfortran*'s default use of -funderscoring [1];
  fix the check for math/atlas* shared libraries
  
  PR:             159129 [1]
  Submitted by:   E. Shibusawa (slightly different patch) [1]
  
  Revision  Changes    Path
  1.26      +3 -3      ports/math/arpack/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"