lapack problem?

130 views
Skip to first unread message

Dave Mazzoni

unread,
Mar 22, 2016, 6:14:14 PM3/22/16
to gonu...@googlegroups.com
Hello all,
  I've been happily going along developing code that used blas, gonum packages, etc. until yesterday when my machine crashed.

  So I'm trying to rebuild my development environment using all my previous notes (and help from you all). BUT, I cannot get around a persistent link error:

Here's what I do (after installing all the packages and building openblas):

CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS -lopenblas" go build zgeev.go

to which I get tons of errors that end with:

/tmp/go-build020010110/github.com/gonum/lapack/cgo/clapack/_obj/clapack.cgo2.o: In function `_cgo_88e828dded3d_Cfunc_LAPACKE_zupmtr':
../Projects/Golang/src/github.com/gonum/lapack/cgo/clapack/clapack.go:25567: undefined reference to `LAPACKE_zupmtr'
collect2: error: ld returned 1 exit status

If I ldconfig -p | grep openblas I see the openblas libs are there...

Any hints? I'm at my whits end...

Dave

Brendan Tracey

unread,
Mar 22, 2016, 6:17:41 PM3/22/16
to Dave Mazzoni, gonu...@googlegroups.com
Did you build OpenBLAS from source?

cd OpenBLAS
make


--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Kortschak

unread,
Mar 22, 2016, 6:25:40 PM3/22/16
to Dave Mazzoni, gonu...@googlegroups.com
On Tue, 2016-03-22 at 18:14 -0400, Dave Mazzoni wrote:
> Here's what I do (after installing all the packages and building
> openblas):
>
> CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS -lopenblas" go build
> zgeev.go
>
Can you post your commands to build OpenBLAS? Particularly the `make
PREFIX=... install' line.

Dan Kortschak

unread,
Mar 23, 2016, 8:17:48 PM3/23/16
to Dave Mazzoni, gonu...@googlegroups.com
We've fallen off the list.

Were you able to build the C code I sent?


On Wed, 2016-03-23 at 20:08 -0400, Dave Mazzoni wrote:
> Does it make sense that I always get link error:
> CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS -lopenblas" go build
> zgeev.go
> # github.com/gonum/lapack/cgo/clapack
> /tmp/go-build716688644/github.com/gonum/lapack/cgo/clapack/_obj/clapack.cgo2.o: In function `_cgo_88e828dded3d_Cfunc_LAPACKE_cbbcsd':
> ../../../../github.com/gonum/lapack/cgo/clapack/clapack.go:81:
> undefined reference to `LAPACKE_cbbcsd'
>
>
> I've checked that the linker can find the lib (ldconfig -p | grep
> openblas shows that it's there). I've built OpenBLAS from the develop
> chain. It's driving me nuts that I had all this working and now I keep
> getting this link error...
>
> On Tue, Mar 22, 2016 at 11:43 PM, Dan Kortschak
> <dan.ko...@adelaide.edu.au> wrote:
> On Tue, 2016-03-22 at 19:08 -0400, Dave Mazzoni wrote:
> > I may not be using the develop branch. Please give me the
> link?
> >
> The default branch of OpenBLAS is develop, so git clone
> https://github.com/xianyi/OpenBLAS.git will get that for you.
> Don't git
> checkout master. Current tip is 53bfc83.



Dan Kortschak

unread,
Mar 24, 2016, 3:47:35 PM3/24/16
to Dave Mazzoni, gonu...@googlegroups.com
That is expected given your previous problem. The first program is pure Go, the cgo-dependent.

Please, I can't help if you don't answer my questions. Were you able to build the C code I sent? Also, please keep this on the list.

On 25/03/2016, at 1:39 AM, "Dave Mazzoni" <dav...@gmail.com> wrote:

Hi Dan,
  OK. I think I've narrowed it down somewhat. I can build this w/o errors:
------------------------------------------------------
package main

import (
"fmt"
"log"

)

func main() {
m := mat64.NewDense(2, 3, []float64{
3, 1, 1,
-1, 3, 1,
})
fmt.Printf("m =\n   %0.4v\n", mat64.Formatted(m, mat64.Prefix("   ")))
var u mat64.Dense
var svd mat64.SVD
if ok := svd.Factorize(m, matrix.SVDFull); !ok {
log.Fatalf("SVD factorization of 'm' failed")
}
u.UFromSVD(&svd)
fmt.Printf("U =\n   %0.4v\n", mat64.Formatted(&u, mat64.Prefix("   ")))
var v mat64.Dense
v.VFromSVD(&svd)
fmt.Printf("V =\n   %0.4v\n", mat64.Formatted(&v, mat64.Prefix("   ")))
values := svd.Values(nil)
for i := range values {
fmt.Printf("\nEigenvalue %d: %4.2f\n", i, values[i])
}
}
------------------------------------------------------
But here's the kicker: if I try to build this program:
------------------------------------------------------
package main

import (
"fmt"
"math/cmplx"
"math/rand"
"time"

)

func main() {
ran := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
const N = 4 // Square matrix dimension
rans := make([]complex128, N*N)
for i := 0; i < len(rans); i++ {
rans[i] = complex(ran.NormFloat64(), ran.NormFloat64())
}
jobvl := lapack.Job('V')
jobvr := lapack.Job('V')
n, lda, ldvl, lvdr := N, N, N, N
a := make([]complex128, N*N)
for i := 0; i < len(rans); i++ {
a[i] = rans[i]
}
showMatrix("Working matrix", a, N)
w := make([]complex128, N)
vl := make([]complex128, N*N)
vr := make([]complex128, N*N)
clapack.Zgeev(jobvl, jobvr, n, a, lda, w, vl, ldvl, vr, lvdr)
showMatrix("Left Eigenvectors", vl, N)
showMatrix("Right Eigenvectors", vr, N)
showMatrix("Eigenvalues", w, N)
fmt.Println("\nAbs[eigenvalues]:")
for i := range w {
fmt.Printf("%4.2g\t", cmplx.Abs(w[i]))
}
fmt.Println()
}

func showMatrix(label string, m []complex128, cols int) {
fmt.Printf("\n%s:\n", label)
for i := range m {
fmt.Printf("%4.2g\t", m[i])
if (i+1)%cols == 0 {
fmt.Printf("\n")
}
}
}
------------------------------------------------------
Using this command line:
CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS -lopenblas" go build -x zgeev.go 
I get this:
------------------------------------------------------
WORK=/tmp/go-build785391885
cd /home/dmazzoni/Projects/Golang/src/github.com/gonum/lapack/cgo/clapack
CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS" "-lopenblas" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/gonum/lapack/cgo/clapack/_obj/ -importpath github.com/gonum/lapack/cgo/clapack -- -I $WORK/github.com/gonum/lapack/cgo/clapack/_obj/ -g -O2 clapack.go
/tmp/go-build785391885/github.com/gonum/lapack/cgo/clapack/_obj/clapack.cgo2.o: In function `_cgo_88e828dded3d_Cfunc_LAPACKE_cbbcsd':
../../github.com/gonum/lapack/cgo/clapack/clapack.go:81: undefined reference to `LAPACKE_cbbcsd'
...
...
/tmp/go-build785391885/github.com/gonum/lapack/cgo/clapack/_obj/clapack.cgo2.o: In function `_cgo_88e828dded3d_Cfunc_LAPACKE_zupmtr':
../../github.com/gonum/lapack/cgo/clapack/clapack.go:25567: undefined reference to `LAPACKE_zupmtr'
collect2: error: ld returned 1 exit status
------------------------------------------------------

Dan Kortschak

unread,
Mar 24, 2016, 3:49:05 PM3/24/16
to Dan Kortschak, Dave Mazzoni, gonu...@googlegroups.com
*The second is cgo-dependent.

Dave Mazzoni

unread,
Mar 24, 2016, 4:00:29 PM3/24/16
to gonum-dev
Your code compile results:
 gcc -I /home/dmazzoni/Projects/Golang/src/github.com/gonum/lapack/cgo/clapack -L ./OpenBLAS -lopenblas blasTest.c -o blas
/tmp/ccvctcCf.o: In function `main':
blasTest.c:(.text+0xb9): undefined reference to `LAPACKE_dlansy'
collect2: error: ld returned 1 exit status


Dan Kortschak

unread,
Mar 24, 2016, 4:15:12 PM3/24/16
to Dave Mazzoni, gonum-dev
So, ld doesn't know where to find your lib. Can you install the lib in a standard location? otherwise set LD_LIBRARY_PATH so that ld can find it.

Jonathan Lawlor

unread,
Mar 24, 2016, 4:17:40 PM3/24/16
to gonum-dev
I think you are missing the cblas lib. Try something like

# fetch cblas reference lib
curl http://www.netlib.org/blas/blast-forum/cblas.tgz | tar -zx

# make and install cblas
pushd CBLAS
sudo mv Makefile.LINUX Makefile.in
sudo BLLIB=/usr/lib/libopenblas.a make alllib
sudo mv lib/cblas_LINUX.a /usr/lib/libcblas.a
popd
popd

Dave Mazzoni

unread,
Mar 24, 2016, 4:35:00 PM3/24/16
to gonum-dev
gcc -I /home/dmazzoni/Projects/Golang/src/github.com/gonum/lapack/cgo/clapack -L ./OpenBLAS -lopenblas -LD_LIBRARY_PATH="/home/dmazzoni/Downloads/OpenBLAS" blasTest.c -o blas
/tmp/ccFQF5Qn.o: In function `main':
blasTest.c:(.text+0xb9): undefined reference to `LAPACKE_dlansy'
collect2: error: ld returned 1 exit status

or another way:
 gcc -I /home/dmazzoni/Projects/Golang/src/github.com/gonum/lapack/cgo/clapack -Wl,-rpath,/home/dmazzoni/Downloads/OpenBLAS -L ./OpenBLAS -lopenblas  blasTest.c -o blas
/tmp/ccvIuddQ.o: In function `main':
blasTest.c:(.text+0xb9): undefined reference to `LAPACKE_dlansy'
collect2: error: ld returned 1 exit status

On Tuesday, March 22, 2016 at 6:14:14 PM UTC-4, Dave Mazzoni wrote:

Dave Mazzoni

unread,
Mar 24, 2016, 4:38:30 PM3/24/16
to gonum-dev
I get gfortran errors when trying this (I can hunt that down).

BUT, it is possible I didn't install the results of the OpenBLAS make in a standard directory? Should I do a sudo PREFIX=... make install ?

Dan Kortschak

unread,
Mar 24, 2016, 4:38:37 PM3/24/16
to Dave Mazzoni, gonum-dev
LD_LIBRARY_PATH="/home/dmazzoni/Downloads/OpenBLAS" gcc -I /home/dmazzoni/Projects/Golang/src/github.com/gonum/lapack/cgo/clapack -L ./OpenBLAS -lopenblas blasTest.c -o blas

But is there a reason you can't install OpenBLAS system-wide?

Jonathan Lawlor

unread,
Mar 24, 2016, 4:42:53 PM3/24/16
to gonum-dev
Oh, I think it should have actually been
# fetch cblas reference lib
curl
http://www.netlib.org/blas/blast-forum/cblas.tgz | tar -zx

# make and install cblas
pushd CBLAS
sudo mv
Makefile.LINUX Makefile.in

sudo BLLIB
=/home/dmazzoni/Downloads/OpenBLAS/libopenblas.a make alllib
sudo mv lib
/cblas_LINUX.a /home/dmazzoni/Downloads/OpenBLAS/libcblas.a
popd



Also I am not sure that you need sudo at all; that is taken from the travis build scripts.

Dave Mazzoni

unread,
Mar 24, 2016, 5:00:40 PM3/24/16
to Jonathan Lawlor, gonum-dev
I've installed gfortran and executed your commands above (without sudo -- it didn't seem to be an issue).
I now have a libcblas.a in my OpenBLAS directory.
Should that do it?

--
You received this message because you are subscribed to a topic in the Google Groups "gonum-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gonum-dev/tVIq2dTXoNM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gonum-dev+...@googlegroups.com.

Jonathan Lawlor

unread,
Mar 24, 2016, 5:03:46 PM3/24/16
to gonum-dev, jonatha...@gmail.com
I think so?

Dave Mazzoni

unread,
Mar 24, 2016, 5:05:16 PM3/24/16
to gonum-dev, dav...@gmail.com
No, I just need to get the command right. If I have OpenBLAS in my Downloads directory. What would you type to make and install it system wide?

Dan Kortschak

unread,
Mar 24, 2016, 5:14:10 PM3/24/16
to Dave Mazzoni, gonum-dev, dav...@gmail.com
sudo make PREFIX=/usr/local install

Dan Kortschak

unread,
Mar 24, 2016, 5:43:51 PM3/24/16
to Dan Kortschak, Dave Mazzoni, gonum-dev
Obvioiusly this needs to be preceeded with make, both invoked in the OpenBLAS root directory.
> --
> You received this message because you are subscribed to the Google Groups "gonum-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.

Dave Mazzoni

unread,
Mar 24, 2016, 6:29:08 PM3/24/16
to gonum-dev, dan.ko...@adelaide.edu.au, dav...@gmail.com
Yes, of course.
But still no joy. I'm wondering if you know the exact library I need to link to. I've been gcc ... --verbose so everything should be easier to locate.
I'd like to try something like
gcc -I OpenBLAS -L OpenBLAS <critical lib with LAPACKE_dlansy in it>.o --verbose testProg.c -o blas 
to just see if I can literally link the library I need manually.

Dave Mazzoni

unread,
Mar 24, 2016, 7:14:37 PM3/24/16
to gonum-dev, dan.ko...@adelaide.edu.au, dav...@gmail.com
Well, this is a bit strange, but believe it or not, it worked!
cd OpenBLAS
make clean
make
sudo make PREFIX=/usr/local install
ls /usr/local/lib   (libraries are there)
gcc blasTest.c -lopenblas --verbose -o blas
./blas
dlansy res=225.000000

I'm still not out of the woods, but at least I can show that YOUR code works...

Dave Mazzoni

unread,
Mar 24, 2016, 7:23:43 PM3/24/16
to gonum-dev, dan.ko...@adelaide.edu.au, dav...@gmail.com
By George, I think I've finally got it. This looks encouraging:
-------------------------------------------- rand_zgeev.go ---------------------------------------
// Simple Eigenvalue calculation using LAPACK/CGO functions
// Built with:
// CGO_LDFLAGS="-L/home/dmazzoni/Downloads/OpenBLAS -lopenblas" go build cgeev.go
-------------------------------------------------------------------
CGO_LDFLAGS="-L/usr/local/lib -lopenblas" go build rand_zgeev.go
./rand_zgeev 

Working matrix:
(0.93+0.19i) (0.54+1.6i) (-0.6  -1i) (0.31+0.26i)
(-0.38+0.43i) (-1.7-0.34i) (-0.73+0.091i) (-0.5-0.23i)
(-0.69+0.68i) (-0.98+0.59i) (-0.69-0.97i) (-1.6-1.1i)
(   1-0.17i) (-0.18-2.5i) (0.24+0.15i) (-1.3-0.81i)

Left Eigenvectors:
(0.77  +0i) (0.34-0.056i) (-0.2-0.051i) (-0.066+0.031i)
(0.38-0.067i) (0.77  +0i) (0.73  +0i) ( 0.8  +0i)
(-0.39+0.12i) (0.011-0.38i) (-0.54+0.0053i) (0.16+0.16i)
(0.26-0.15i) (-0.37-0.023i) ( 0.1-0.36i) ( 0.5+0.23i)

Right Eigenvectors:
(0.85  +0i) (-0.25+0.06i) (0.52+0.036i) (-0.1+0.075i)
(-0.079+0.04i) (-0.43+0.024i) (-0.22-0.15i) (0.32-0.33i)
(-0.31+0.31i) (-0.37+0.43i) (0.65  +0i) (0.59-0.057i)
(0.28-0.08i) (0.65  +0i) (-0.011+0.48i) (0.65  +0i)

Eigenvalues:
( 1.5+0.28i) (-1.7+1.1i) (0.029-1.6i) (-2.6-1.7i)

Abs[eigenvalues]:
 1.6   2 1.6 3.1


Thanks a million for all your help!

Dan Kortschak

unread,
Mar 24, 2016, 7:29:14 PM3/24/16
to Dave Mazzoni, gonum-dev
No worries. Can you explain what you did different this time for others
that might have the same problem.

Dave Mazzoni

unread,
Mar 24, 2016, 7:45:31 PM3/24/16
to Dan Kortschak, gonum-dev
I was wondering the same thing. Since I had tried deleting the OpenBLAS directory and starting from scratch it's the same as make clean -- so that's confusing.
I think the key was in 
sudo make PREFIX=/usr/local install
which simplified the command line?
I've got to reproduce this on another workstation, so I'll follow the same steps there and see if it just works. Probably stupid fat fingering something?
I'll post more details here once I've got everything stabilized. I'm actually using Dave Cheney's fantastic 'gb' build tool. I was trying to be a purist gopher, but building the OpenBLAS library each time took me over the edge.
Now I just do 
CGO_LDFLAGS="-L/usr/local/lib -lopenblas" gb build
after changing any of the go code. It keeps the previous/intermediate files so all I'm recompiling is go code.

Dave Mazzoni

unread,
Mar 24, 2016, 8:33:04 PM3/24/16
to gonum-dev, dan.ko...@adelaide.edu.au
Like I said before, I had to do the build on another workstation. Well, it wasn't working. It was because I hadn't installed a gfortran compiler on it (as suggested by you all -- THANKS!).  I went to the beginning of the make and found this smoking gun:
make
OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS.
make[1]: Entering directory `/home/dmazzoni/Downloads/OpenBLAS/interface'
make[1]: warning: -jN forced in submake: disabling jobserver mode.
gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=8 -DASMNAME=saxpy -DASMFNAME=saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME=\"saxpy_\" -DCHAR_CNAME=\"saxpy\" -DNO_AFFINITY -I.. -I. -UDOUBLE  -UCOMPLEX -c axpy.c -o saxpy.o

So the rest follows...

Dan Kortschak

unread,
Mar 24, 2016, 8:34:43 PM3/24/16
to Dave Mazzoni, gonum-dev
Thanks for the follow-up.

On Thu, 2016-03-24 at 17:33 -0700, Dave Mazzoni wrote:
> Like I said before, I had to do the build on another workstation.
> Well, it
> wasn't working. It was because I hadn't installed a gfortran compiler
> on it
> (as suggested by you all -- THANKS!). I went to the beginning of the
> make
> and found this smoking gun:
> make
> *OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK.
> Only
> compile BLAS.*

Dave Mazzoni

unread,
Sep 19, 2016, 2:04:16 PM9/19/16
to gonum-dev, dav...@gmail.com
Revisiting the problem from a different angle. Now I need to get the openBLAS library cross-compiled for an ARM7. I've checked that the openBLAS build is good (using a small C test program and statically linking in libopenblas). Now I need it to work with Go.
If I do this however, 
FC=arm-linux-gnueabihf-gfortran CC=arm-linux-gnueabihf-gcc  CGO_ENABLED=1 GOARCH=arm GOARM=7 CGO_FLAGS="-L /usr/local/lib -l openblas" go install github.com/gonum/lapack/cgo

I get a blast of error messages similar to this:
/tmp/go-build766207742/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o: In function `_cgo_74fa1666bbb4_Cfunc_LAPACKE_zunmtr_work':
/opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke/lapacke.go:27497: undefined reference to `LAPACKE_zunmtr_work'
/tmp/go-build766207742/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o: In function `_cgo_74fa1666bbb4_Cfunc_LAPACKE_zupgtr_work':
/opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke/lapacke.go:27522: undefined reference to `LAPACKE_zupgtr_work'
/tmp/go-build766207742/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o: In function `_cgo_74fa1666bbb4_Cfunc_LAPACKE_zupmtr_work':
/opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke/lapacke.go:27550: undefined reference to `LAPACKE_zupmtr_work'

You all have been critically helpful last time -- any suggestions?

Dan Kortschak

unread,
Sep 19, 2016, 11:28:36 PM9/19/16
to Dave Mazzoni, gonum-dev, Dave Mazzoni

Can you get the C program to compile when you dynamically link and make calls to the LAPACKE _work functions?

Dave Mazzoni

unread,
Sep 20, 2016, 10:11:46 AM9/20/16
to gonum-dev, dav...@gmail.com
Here's what I did. I first used your lapacke test code listed here:
-------------------------------------------------------------------------------------
#include <stdio.h>
#include <lapacke.h>

int row_major = 101;

int main() {
    int norm='O', uplo='U', n=3, lda=3;
    double a[9]= {
        89, 59, 77,
         0,107, 59,
         0,  0, 89
    };

    double res;
    res = LAPACKE_dlansy(row_major, norm, uplo, n, a, lda);
    printf("dlansy res=%f\n", res);
}
---------------------------------------------------------------------------------
Then I compiled and linked with this command line:

arm-linux-gnueabihf-gcc lapacke.c --static -I ../ -I /usr/local/include -l openblas -lm -pthread

That compiled and linked w/o errors. I copied the output file to the target and it worked:
 ./a.out
dlansy res=225.000000

So I'm stumped with the go code. Everything seems to work with straight C code linking to the cross-compiled library.

Dave Mazzoni

unread,
Sep 20, 2016, 10:20:26 AM9/20/16
to gonum-dev, dav...@gmail.com
I'm going to include the debug information that I get with the go get command. It might help. So here's the very beginning of the 'get':
--------------------------------------------------------------------------------------
 FC=arm-linux-gnueabihf-gfortran CC=arm-linux-gnueabihf-gcc  CGO_ENABLED=1 GOARCH=arm GOARM=7 CGO_FLAGS="--static -L /usr/local/lib -l openblas" go get -x github.com/gonum/lapack/cgo
WORK=/tmp/go-build051644061
cd /opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke
CGO_LDFLAGS="-g" "-O2" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/ -importpath github.com/gonum/lapack/cgo/lapacke -- -I $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/ -g -O2 lapacke.go
cd $WORK
arm-linux-gnueabihf-gcc -fdebug-prefix-map=a=b -c trivial.c
arm-linux-gnueabihf-gcc -gno-record-gcc-switches -c trivial.c
cd /opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke
arm-linux-gnueabihf-gcc -I . -fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/ -g -O2 -g -O2 -o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_main.o -c $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_main.c
arm-linux-gnueabihf-gcc -I . -fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/ -g -O2 -g -O2 -o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_export.o -c $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_export.c
arm-linux-gnueabihf-gcc -I . -fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/ -g -O2 -g -O2 -o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o -c $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.c
arm-linux-gnueabihf-gcc -I . -fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_.o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_main.o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/_cgo_export.o $WORK/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o -g -O2 -pie
/tmp/go-build051644061/github.com/gonum/lapack/cgo/lapacke/_obj/lapacke.cgo2.o: In function `_cgo_74fa1666bbb4_Cfunc_LAPACKE_cbbcsd_work':
/opt/Projects/Golang/src/github.com/gonum/lapack/cgo/lapacke/lapacke.go:86: undefined reference to `LAPACKE_cbbcsd_work'
... etc. 
--------------------------------------------------------------------------------------

Dan Kortschak

unread,
Sep 20, 2016, 4:29:35 PM9/20/16
to Dave Mazzoni, gonum-dev, Dave Mazzoni

Please try with LAPACKE_dlansy replaced with LAPACKE_dlansy_work (the call will need to be adjusted - see how it is called in the lapacke package). We don't use calls to the non-work functions anymore, so it would be nice to know that you can get an identical situation C to work.

--
Reply all
Reply to author
Forward
0 new messages