Can't create a static Linux executable when using hmatrix

Hi Cafe, I am trying to build a static exec to be run on another machine, and I failed probably due to hmatrix. How can I fix this? Thanks! Test code: import Numeric.LinearAlgebra.Data main = print (fromLists [[2,3,3], [2,3,3]] :: Matrix Double) When complied with "ghc -O2 -static -optc-static -optl-static test.hs -optl-pthread", gave me lots of errors: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0xbc4): undefined reference to `dcopy_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0xed9): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0x1304): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_': (.text+0x1377): undefined reference to `dswap_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0xf9a): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0xfd4): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x1022): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x103b): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x109c): undefined reference to `idamax_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x1125): undefined reference to `drot_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x12aa): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x12e4): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x1332): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x134b): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x13ac): undefined reference to `idamax_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x143d): undefined reference to `drot_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x148e): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x14bc): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x14fe): undefined reference to `dnrm2_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_': (.text+0x152c): undefined reference to `dscal_' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgehrd.o): In function `dgehrd_': (.text+0x65d): undefined reference to `dtrmm_' . . .

The error says all, you need to install blas / lapack on the target system
OR static link those same libs. Adding ransom flags that use the word
static wont do that :-)
On Sep 5, 2014 5:03 PM, "Kai Zhang"
Hi Cafe,
I am trying to build a static exec to be run on another machine, and I failed probably due to hmatrix. How can I fix this? Thanks!
Test code:
import Numeric.LinearAlgebra.Data
main = print (fromLists [[2,3,3], [2,3,3]] :: Matrix Double)
When complied with "ghc -O2 -static -optc-static -optl-static test.hs -optl-pthread", gave me lots of errors:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0xbc4): undefined reference to `dcopy_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0xed9): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0x1304): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0x1377): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0xf9a): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0xfd4): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1022): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x103b): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x109c): undefined reference to `idamax_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1125): undefined reference to `drot_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x12aa): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x12e4): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1332): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x134b): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x13ac): undefined reference to `idamax_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x143d): undefined reference to `drot_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x148e): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x14bc): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x14fe): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x152c): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgehrd.o): In function `dgehrd_':
(.text+0x65d): undefined reference to `dtrmm_'
.
.
.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I'm just landing after 12-14 hours of travel or I'd probably have q more
actionable suggestion.
On Sep 7, 2014 8:41 PM, "Carter Schonwald"
The error says all, you need to install blas / lapack on the target system OR static link those same libs. Adding ransom flags that use the word static wont do that :-) On Sep 5, 2014 5:03 PM, "Kai Zhang"
wrote: Hi Cafe,
I am trying to build a static exec to be run on another machine, and I failed probably due to hmatrix. How can I fix this? Thanks!
Test code:
import Numeric.LinearAlgebra.Data
main = print (fromLists [[2,3,3], [2,3,3]] :: Matrix Double)
When complied with "ghc -O2 -static -optc-static -optl-static test.hs -optl-pthread", gave me lots of errors:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0xbc4): undefined reference to `dcopy_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0xed9): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0x1304): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgees.o): In function `dgees_':
(.text+0x1377): undefined reference to `dswap_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0xf9a): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0xfd4): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1022): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x103b): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x109c): undefined reference to `idamax_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1125): undefined reference to `drot_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x12aa): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x12e4): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x1332): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x134b): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x13ac): undefined reference to `idamax_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x143d): undefined reference to `drot_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x148e): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x14bc): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x14fe): undefined reference to `dnrm2_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgeev.o): In function `dgeev_':
(.text+0x152c): undefined reference to `dscal_'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblapack.a(dgehrd.o): In function `dgehrd_':
(.text+0x65d): undefined reference to `dtrmm_'
.
.
.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Sun, Sep 7, 2014 at 8:41 PM, Carter Schonwald wrote: The error says all, you need to install blas / lapack on the target system
OR static link those same libs. Adding ransom flags that use the word
static wont do that :-) More to the point, lapack is static there but the missing functions are
provided by the blas library, which either wasn't included in the link or
isn't available on your system as a static library.
--
brandon s allbery kf8nh sine nomine associates
allbery.b@gmail.com ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

I have both libblas.a and liblapck.a.
locate libblas.a
/etc/alternatives/libblas.a
/usr/lib/libblas.a
/usr/lib/libblas/libblas.a
On Sun, Sep 7, 2014 at 5:44 PM, Brandon Allbery
On Sun, Sep 7, 2014 at 8:41 PM, Carter Schonwald < carter.schonwald@gmail.com> wrote:
The error says all, you need to install blas / lapack on the target system OR static link those same libs. Adding ransom flags that use the word static wont do that :-)
More to the point, lapack is static there but the missing functions are provided by the blas library, which either wasn't included in the link or isn't available on your system as a static library.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

When I messed around with hmatrix I remember doing sudo apt-get install libblas-dev libatlas-dev liblapack-dev libgsl0-dev though that might have been an overkill.

I have all these libraries installed, and I have no problem install hmatrix
and use it in regular haskell programs. But I would like to run my
executable on another computer which do not have lapack and some other
libraries. Currently I have to resort to setting up a virtual machine
matching the target system where I compile my program, and then move it and
shared libraries to the system.
On Sun, Sep 7, 2014 at 11:20 PM, Mikolaj Konarski
When I messed around with hmatrix I remember doing
sudo apt-get install libblas-dev libatlas-dev liblapack-dev libgsl0-dev
though that might have been an overkill.

On Mon, Sep 8, 2014 at 12:06 PM, Kai Zhang
I have all these libraries installed, and I have no problem install hmatrix and use it in regular haskell programs. But I would like to run my executable on another computer which do not have lapack and some other libraries. Currently I have to resort to setting up a virtual machine matching the target system where I compile my program, and then move it and shared libraries to the system.
Then you need to find out why either BLAS is not being linked or its static library is missing those functions. "cabal install -v3" might help, as might inspecting config.log if it is using configure. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (4)
-
Brandon Allbery
-
Carter Schonwald
-
Kai Zhang
-
Mikolaj Konarski