clang build error

30 views
Skip to first unread message

Shivaprashanth H

unread,
Jun 16, 2020, 2:28:27 PM6/16/20
to blis-devel
Hello all,
I am trying to build blis library in msys2 environment using clang compiler.
I am running into below error,

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: * [Makefile:658: lib/haswell/libblis.lib] Error 1
make: * Waiting for unfinished jobs....

I am not able to see any more details for this linker error.
Does anybody have idea whats going wrong here?

Thanks in advance
-Shiva

Isuru Fernando

unread,
Jun 17, 2020, 1:41:53 AM6/17/20
to Shivaprashanth H, blis-devel
Can you run again and send the full output?

Isuru

Disclaimer:This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails.

--
You received this message because you are subscribed to the Google Groups "blis-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blis-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blis-devel/2e5218f6-085b-4707-b491-ad8f4b59ce4co%40googlegroups.com.

Shivaprashanth H

unread,
Jun 17, 2020, 4:08:16 AM6/17/20
to blis-devel
I am building in msys2 64bit environment and passing CC=clang for compilation
I have attached the complete log for configure and make.


On Wednesday, June 17, 2020 at 11:11:53 AM UTC+5:30, Isuru Fernando wrote:
Can you run again and send the full output?

Isuru

On Tue, Jun 16, 2020 at 1:28 PM Shivaprashanth H <shivprashanth.h@globaledgesoft.com> wrote:
Hello all,
I am trying to build blis library in msys2 environment using clang compiler.
I am running into below error,

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: * [Makefile:658: lib/haswell/libblis.lib] Error 1
make: * Waiting for unfinished jobs....

I am not able to see any more details for this linker error.
Does anybody have idea whats going wrong here?

Thanks in advance
-Shiva

Disclaimer:This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails.

--
You received this message because you are subscribed to the Google Groups "blis-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blis-devel+unsubscribe@googlegroups.com.
clang-build-log

Isuru Fernando

unread,
Jun 17, 2020, 9:52:00 AM6/17/20
to Shivaprashanth H, blis-devel
Which clang did you use? Can you run "clang --version" and send the output?

Do you want a MSVC compatible library or a MinGW compatible one?

Isuru

On Wed, Jun 17, 2020 at 8:49 AM Shivaprashanth H <shivpra...@globaledgesoft.com> wrote:

Please find attached

Ran with make V=1 -j8

 

From: Isuru Fernando <isu...@gmail.com>
Sent: 17 June 2020 18:39
To: Shivaprashanth H <shivpra...@globaledgesoft.com>
Subject: Re: [blis-devel] clang build error

 

Thanks. Can you run "make V=1" and send the output?

Isuru.

 

On Wed, Jun 17, 2020 at 3:08 AM Shivaprashanth H <shivpra...@globaledgesoft.com> wrote:

I am building in msys2 64bit environment and passing CC=clang for compilation

I have attached the complete log for configure and make.

On Wednesday, June 17, 2020 at 11:11:53 AM UTC+5:30, Isuru Fernando wrote:

Can you run again and send the full output?

Isuru

 

On Tue, Jun 16, 2020 at 1:28 PM Shivaprashanth H <shivpra...@globaledgesoft.com> wrote:

Hello all,

I am trying to build blis library in msys2 environment using clang compiler.

I am running into below error,

 

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: * [Makefile:658: lib/haswell/libblis.lib] Error 1

make: * Waiting for unfinished jobs....

 

I am not able to see any more details for this linker error.

Does anybody have idea whats going wrong here?

 

Thanks in advance

-Shiva

 

Disclaimer:This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails.

--
You received this message because you are subscribed to the Google Groups "blis-devel" group.

To unsubscribe from this group and stop receiving emails from it, send an email to blis-devel+...@googlegroups.com.

 

Disclaimer:This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails.

--
You received this message because you are subscribed to the Google Groups "blis-devel" group.

To unsubscribe from this group and stop receiving emails from it, send an email to blis-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blis-devel/b7419499-e26e-4b5f-a158-128aad407c26o%40googlegroups.com.

Shivaprashanth H

unread,
Jun 17, 2020, 9:54:04 AM6/17/20
to Isuru Fernando, blis-devel

I am looking for msvc compatible library

 

$ clang --version

clang version 10.0.0 (https://github.com/msys2/MINGW-packages.git 7211ffb882cc3b7e7583c518aad45a22b278bc81)

Target: x86_64-w64-windows-gnu

Thread model: posix

InstalledDir: C:\msys64\mingw64\bin

 

I understand my mistake here. I guess I am using wrong one.

Isuru Fernando

unread,
Jun 17, 2020, 10:22:00 AM6/17/20
to Shivaprashanth H, blis-devel
Ah, you can use the same compiler, but you need to add `--target=x86_64-pc-windows-msvc` to CFLAGS by doing,

    export CFLAGS="--target=x86_64-pc-windows-msvc"

because the clang compiler you are using is configured to build a MinGW DLL by default.

Isuru

Shivaprashanth H

unread,
Jun 17, 2020, 11:55:40 AM6/17/20
to Isuru Fernando, blis-devel

This worked!

The original linker issue is resolved

Now I think I am facing genuine compilation errors,

 

In file included from kernels/haswell/3/bli_gemm_haswell_asm_d6x8.c:36:

include/haswell\blis.h:32:10: fatal error: 'stdio.h' file not found

 

I see below headers part of clang installation,

stdalign.h    

stdarg.h      

stdatomic.h   

stdbool.h     

stddef.h      

stdint.h      

stdnoreturn.h

(paths is /mingw64/lib/clang/10.0.0/include)

However it seems stdio.h is not part of clang builtin headers.

Isuru Fernando

unread,
Jun 17, 2020, 12:19:09 PM6/17/20
to Shivaprashanth H, blis-devel
Looks like clang can't find the VS environment.
Did you start the msys2 shell from a Visual Studio environment (Developer Command Prompt for Visual Studio) ?

Isuru

Isuru Fernando

unread,
Jun 17, 2020, 2:38:12 PM6/17/20
to Shivaprashanth H, blis-devel
Ah, you need to add "--target=x86_64-pc-windows-msvc" to LDFLAGS as well. (then run configure and make)

Isuru

On Wed, Jun 17, 2020 at 1:31 PM Shivaprashanth H <shivpra...@globaledgesoft.com> wrote:

Just for your info attaching the latest log

 

From: Shivaprashanth H
Sent: 17 June 2020 23:59
To: 'Isuru Fernando' <isu...@gmail.com>
Subject: RE: [blis-devel] clang build error

 

The msys2 env is behaving strangely.

Previously I was not sure if my msys2 was started from within VS cmd prompt.

So I closed it and started msys2 from VS cmd,

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>C:\msys64\mingw64.exe

Then tried to configure and build.

But even with export CFLAGS="--target=x86_64-pc-windows-msvc",  I am again facing same linker error which was resolved earlier.

 

C:\msys64\mingw64\bin\ld: unrecognised option: -implib:lib/haswell/libblis.lib

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [Makefile:648: lib/haswell/libblis.lib] Error 1

make: *** Waiting for unfinished jobs....

echo lib/haswell/libblis.a

lib/haswell/libblis.a

 

I am investigating why its behaving differently

Shivaprashanth H

unread,
Jun 17, 2020, 3:29:38 PM6/17/20
to Isuru Fernando, blis-devel

After doing export for LDFLAGS with "--target=x86_64-pc-windows-msvc”

Below new linker error I am getting,

 

Dynamically linking lib/haswell/libblis.lib

libcmt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

clang: error: linker command failed with exit code 1112 (use -v to see invocation)

make: *** [Makefile:658: lib/haswell/libblis.lib] Error 88

make: *** Waiting for unfinished jobs....

lib/haswell/libblis.a

 

This is understandable as we are modifying the LDFLAG

I tried passing -fuse-ld=ld-link.exe in the configure command but it has no effect it seems

Shivaprashanth H

unread,
Jun 17, 2020, 3:42:32 PM6/17/20
to Isuru Fernando, blis-devel

Found the fix. We need to initialize x64 env by executing vcvars64.bat

 

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>VC\Auxiliary\Build\vcvars64.bat

**********************************************************************

** Visual Studio 2019 Developer Command Prompt v16.6.2

** Copyright (c) 2020 Microsoft Corporation

**********************************************************************

[vcvarsall.bat] Environment initialized for: 'x64'

 

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>C:\msys64\mingw64.exe

 

Below lib files are built successfully now,

-rwxr-xr-x 1 sysadmin None 4.8M Jun 18 01:10 libblis.3.dll

-rw-r--r-- 1 sysadmin None  17M Jun 18 01:10 libblis.a

-rw-r--r-- 1 sysadmin None 155K Jun 18 01:10 libblis.exp

-rw-r--r-- 1 sysadmin None 260K Jun 18 01:10 libblis.lib

Devin Matthews

unread,
Jun 17, 2020, 3:57:33 PM6/17/20
to blis-...@googlegroups.com
Once this is all working, can someone summarize this process? This would be great to include in the documentation.

Devin
Disclaimer: "This message is intended only for the designated recipient(s). It may contain confidential or proprietary information and may be subject to other confidentiality protections. If you are not a designated recipient, you may not review, copy or distribute this message. Please notify the sender by e-mail and delete this message. GlobalEdge does not accept any liability for virus infected mails." --
You received this message because you are subscribed to the Google Groups "blis-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blis-devel+...@googlegroups.com.

Shivaprashanth H

unread,
Jun 17, 2020, 3:59:17 PM6/17/20
to Devin Matthews, blis-...@googlegroups.com

Below are the steps I followed. Hope it helps,

 

  1. Open development command prompt for VS2019
  2. C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>VC\Auxiliary\Build\vcvars64.bat (this sets up 64bit env)
  3. C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>C:\msys64\mingw64.exe (start the msys2 from within this cmd prompt so that it inherits the VS headers, libs etc)
  4. export CFLAGS="--target=x86_64-pc-windows-msvc"
  5. export LDLAGS="--target=x86_64-pc-windows-msvc"
  6. ./configure -d DEBUG AR=llvm-ar AS=llvm-as RANLIB=echo CC=clang.exe auto
  7. After configure open config.mk and verify CFLAGS and LDFLAGS are updated properly
  8. Make -j8

Field G. Van Zee

unread,
Jun 17, 2020, 4:18:45 PM6/17/20
to blis-...@googlegroups.com, Isuru Fernando
Shiva,

Thank you for this summary. I'm glad you were able to perform your build
on Windows (with Isuru's great help).

Isuru: Can you suggest a place in our documentation for these steps to
go? I was thinking in the FAQ, but I'll let you comment.

Field

On 6/17/20 2:59 PM, Shivaprashanth H wrote:
> Below are the steps I followed. Hope it helps,
>
> 1. Open development command prompt for VS2019
> 2. C:\Program Files (x86)\Microsoft Visual
> Studio\2019\Professional>VC\Auxiliary\Build\vcvars64.bat (this sets
> up 64bit env)
> 3. C:\Program Files (x86)\Microsoft Visual
> Studio\2019\Professional>C:\msys64\mingw64.exe (start the msys2 from
> within this cmd prompt so that it inherits the VS headers, libs etc)
> 4. export CFLAGS="--target=x86_64-pc-windows-msvc"
> 5. export LDLAGS="--target=x86_64-pc-windows-msvc"
> 6. ./configure -d DEBUG AR=llvm-ar AS=llvm-as RANLIB=echo CC=clang.exe auto
> 7. After configure open config.mk and verify CFLAGS and LDFLAGS are
> updated properly
> 8. Make -j8
>

Reply all
Reply to author
Forward
0 new messages