oh, bad news... I was expecting this to be fixed in 1.7... On Wed, Jun 22, 2016 at 10:33 PM <saurabh.deo...@gmail.com> wrote:
> I am having the same issues with go1.6.2... I also tried go1.7beta2 with > no luck. > C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 > > c:/program files/mingw-w64/x86_64-4.8.1-posix-seh-rt_v3-rev2/mingw64/bin > /../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib > /../lib/libntdll.a(dmads01971.o):(.idata$5+0x0): multiple definition of > `__imp_sqrt' > c:/program > files/mingw-w64/x86_64-4.8.1-posix-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/../lib/libmsvcrt.a(dygcs01179.o):(.idata$5+0x0): > first defined here > > > > On Wednesday, April 20, 2016 at 7:06:28 PM UTC-7, Dorival Pedroso wrote: >> >> Hi, >> >> I'm just wondering what is the cause of the following error (multiple >> definition of __something)? >> C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 >> C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libntdll.a(dyyls01966.o):(.idata$5+0x0): >> multiple definition of `__imp_pow' >> >> This only happens on Windows10 but on Ubuntu/Linux. >> >> The Go code makes a call to LAPACK via a C interface as follows: >> package main >> >> /* >> #cgo CFLAGS: -O3 >> #cgo linux LDFLAGS: -lm -llapack -lgfortran -lblas >> #cgo windows LDFLAGS: -lm -llapack -lgfortran -lblas -LC:/GoslDeps/lib >> >> #include <stdlib.h> >> >> void dgesvd_(const char* jobu, const char* jobvt, const int* M, const >> int* N, double* A, const int* lda, double* S, double* U, const int* ldu, >> double* VT, const int* ldvt, double* work,const int* lwork, const int* >> info); >> >> int lapack_svd(double *U, double *S, double *Vt, long m_long, double *A) { >> int m = (int)(m_long); >> int info = 0; >> char job = 'A'; >> int lwork = 10*m; >> double* work = (double*)malloc(lwork*sizeof(double)); >> dgesvd_(&job, // JOBU >> &job, // JOBVT >> &m, // M >> &m, // N >> A, // A >> &m, // LDA >> S, // S >> U, // U >> &m, // LDU >> Vt, // VT >> &m, // LDVT >> work, // WORK >> &lwork, // LWORK >> &info); // INFO >> free(work); >> return info; >> } >> */ >> import "C" >> >> import ( >> "fmt" >> "math" >> "unsafe" >> ) >> >> func main() { >> A := []float64{1, 2, 3, 2, -4, -9, 3, 6, -3} // col-major format >> m := int(math.Sqrt(float64(len(A)))) >> I := func(i, j int) int { return j*m + i } >> printmat(m, A, "A") >> U := make([]float64, len(A)) >> S := make([]float64, len(A)) >> Vt := make([]float64, len(A)) >> info := C.lapack_svd( >> (*C.double)(unsafe.Pointer(&U[0])), >> (*C.double)(unsafe.Pointer(&S[0])), >> (*C.double)(unsafe.Pointer(&Vt[0])), >> (C.long)(m), >> (*C.double)(unsafe.Pointer(&A[0])), >> ) >> fmt.Printf("SVD: info = %d\n", info) >> USVt := make([]float64, len(A)) >> for i := 0; i < m; i++ { >> for j := 0; j < m; j++ { >> for k := 0; k < m; k++ { >> USVt[I(i, j)] += U[I(i, k)] * S[k] * Vt[I(k, j)] >> } >> } >> } >> printmat(m, USVt, "U*S*Vt") >> } >> >> func printmat(m int, M []float64, msg string) { >> fmt.Printf("%s =\n", msg) >> for i := 0; i < m; i++ { >> for j := 0; j < m; j++ { >> fmt.Printf("%13.8f", M[j*m+i]) >> } >> fmt.Println() >> } >> } >> >> Any help is much appreciated. >> >> Cheers. >> Dorival >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/fW4KZQ05G_8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Dorival Pedroso PhD +61 0420411142 www.cpmech.com Brisbane Australia -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.