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

Library annotations in LAPACK #719

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 11 comments
Closed

Library annotations in LAPACK #719

modelica-trac-importer opened this issue Jan 14, 2017 · 11 comments
Assignees
Labels
bug Critical/severe issue L: Math Issue addresses Modelica.Math
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by jmattsson on 29 Mar 2012 13:54 UTC
All the external functions in Modelica.Math.Matrices.LAPACK have the annotation Library={"Lapack"} (or Library="Lapack"). The LAPACK library is usually included using -llapack (with a lowercase "L"). To be able to locate the correct library file for the external function on Linux, it has to be in a file named libLapack.a, not liblapack.a as is usually the case.

I suggest that all those annotations are changed to refer to "lapack" with a lowercase "L" to make it easier to use a Lapack implementation that is not shipped with the tool.


Migrated-From: https://trac.modelica.org/Modelica/ticket/719

@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Math Issue addresses Modelica.Math labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by jmattsson on 29 Mar 2012 13:57 UTC
Note that the case of the library name doesn't matter on Windows.

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 29 Mar 2012 20:01 UTC
Changing it to "lapack" would help Linux users, but Windows has more issues. These are the libraries needed on Windows:

{"-llapack-mingw", "-ltmglib-mingw", "-lblas-mingw", "-lf2c"}

@modelica-trac-importer
Copy link
Author

Comment by jmattsson on 30 Mar 2012 08:27 UTC
Replying to [comment:2 sjoelund.se]:

Changing it to "lapack" would help Linux users, but Windows has more issues. These are the libraries needed on Windows:

{"-llapack-mingw", "-ltmglib-mingw", "-lblas-mingw", "-lf2c"}

Not really, that is clearly a MinGW issue rather than a Windows issue.

There is nothing preventing that a library file named "lapack.lib" is used on Windows, and it is not as straightforward for the user to get a separate Lapack installation on Windows. On the other hand, there is a general convention that library names are lowercase. Also, many Linux distributions has packages that installs lapack as "liblapack.a".

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 30 Mar 2012 08:54 UTC
Still, the problem is that if the system Lapack is a static library (.lib/.a), all dependencies (blas/fortran) need to be explicitly linked as well.

For dynamically linked objects, it is enough to link in the entry points:

$ ldd /usr/lib/liblapack.so
	libblas.so.3gf => /usr/lib/libblas.so.3gf
	libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3
...

I agree that, yes "Lapack" should be "lapack" as it helps with dynamically linked libraries. But Modelica tools will still need to have special rules for it, especially since there exists many different Lapack implementations.

@modelica-trac-importer
Copy link
Author

Comment by jmattsson on 30 Mar 2012 09:16 UTC
Open question: If I were to make this change, would it create problems for any tool vendors?

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 30 Mar 2012 09:22 UTC
It would cause a minor issue for OpenModelica. We would need to match one more pattern (Lapack|lapack) on Windows platforms.

@modelica-trac-importer
Copy link
Author

Comment by jmattsson on 20 Nov 2012 15:47 UTC
Since no one else has said anything, I'll assume OpenModelica is the only tool that would have problems with the change.

If no one protests within a week, I'll make the change. That should give you plenty of time to make the needed update of your code.

@modelica-trac-importer
Copy link
Author

Changelog removed by jmattsson on 20 Nov 2012 15:47 UTC

@modelica-trac-importer
Copy link
Author

Comment by jmattsson on 20 Nov 2012 15:52 UTC
Replying to [comment:7 jmattsson]:

If no one protests

Ehm, I mean objects. Bad translation from Swedish.

@modelica-trac-importer
Copy link
Author

Comment by otter on 28 Mar 2013 13:39 UTC
Fixed in 5197125:
In MSL, there have been 25 definitions of "Lapack" and 17 definitions of "lapack" in library definitions. Changed all of them to "lapack" as suggested in the ticket.

@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 28 Mar 2013 13:48 UTC

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.1 milestone Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Math Issue addresses Modelica.Math
Projects
None yet
Development

No branches or pull requests

2 participants