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

When building Skylake AVX Lib or dll get build error #268

Open
zakelwe opened this issue Feb 25, 2019 · 7 comments
Open

When building Skylake AVX Lib or dll get build error #268

zakelwe opened this issue Feb 25, 2019 · 7 comments

Comments

@zakelwe
Copy link

zakelwe commented Feb 25, 2019

Hello, firstly MPIR is great. I have it working fine for the mpir_gc and my program using it works fine. I compiled it as the recommended way after installing YASM etc and no issues. However I always had an issue with Skylake AVX being built on VS17, the solution is noted here and kindly raised with Microsoft by Brian and a solution found ==>
#229

So I went through the steps listed,downloading the master mpir zip again, used python config to give me the skylake option(s) and it appeared in the VS17 mpir.sln. I selected for build the skylake lib or dll option and I get

1>------ Build started: Project: lib_mpir_skylake_avx, Configuration: Release x64 ------
1>building MPIR for skylake\avx (x64) from directory mpn\x86_64w\skylake\avx
1>creating mpir.h for x64
1>creating config.h from vs17\cdata\mpn\x86_64w\skylake\avx\

1>Assembling add_err1_n.asm ==> x64\Release\add_err1_n.obj
1>C:\mpir\msvc\vsyasm.targets(81,5): error MSB3721: The command ""C:\Program Files\yasm"vsyasm.exe -Xvc -f x64 -g cv8 -i "......\mpn\x86_64w\" -o "x64\Release\mpn\add_err1_n.obj" -rnasm -pnasm ......\mpn\x86_64w\skylake\avx\add_err1_n.asm" exited with code 1.****

1>Done building project "lib_mpir_skylake_avx.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have YASM in the default directory, and I assume from January it is the latest version. it works well for the mpir_gc I used before, and I am not sure where I am going wrong.

As an aside, if Skylake is only 1 or 2 % quicker than the generic code that currently works, then perhaps not to worry about this, it would be nice to have a speedup though "for free".

Apologies if this is user error or RTFM. This is the first programming I have done since the mid 90's using Borland Turbo C, so a bit rusty !

Many thanks for any tips.

Andy

@puzzleking2000
Copy link

I am also having problems integrating VSYASM with MPIR. I have two computers with Windows 10 Professional, one using VS2015CE and the other using VS2017CE. I am using MPIR 3.0.0 on both computers and I started by following section 2.4 of its documentation to build the dll_mpir_gc project. This went very smoothly and the program linked to the library and ran well on both machines.

My VS2017CE machine has a sandy bridge processor and my VS2015CE machine has a skylake AVX processor, so I am naturally interested in building assembler optimised libraries for them. On the VS2017CE machine I got the error described in Issue #229. whichever assembler optimised project I tried to build and I haven't been able to resolve this. On the VS2015CE machine I managed to build the dll_mpir_core2 project and my program linked to the library and ran without any problems, but when I tried to build the dll_mpir_skylake_avx project I got almost identical error messages.

I would really like to know which versions of MPIR and VSYASM are fully compatible with each other and where I can download them.

@zakelwe
Copy link
Author

zakelwe commented Mar 9, 2019

Hello Puzzleking2000,

Thanks for advising you also got a similar issue, so it is not just me. While I wait a reply could you advise what percentage gain you got on the core2 compared to generic MPIR? Of course this depends on you project, but it would be nice to know the benefits of these bespoke files.

Many thanks

Andy

@puzzleking2000
Copy link

puzzleking2000 commented Mar 9, 2019 via email

@zakelwe
Copy link
Author

zakelwe commented Mar 9, 2019 via email

@KevinHake
Copy link

@zakelwe and @puzzleking2000 - a little while back I also had some issues building with the latest Visual
Studio, and found Brian had fixes ready but that hadn't been cleanly merged to trunk (the wbhart repo). I merged those build changes here, and I've had no problems since. Perhaps it will work for you: https://github.com/KevinHake/mpir

As for the speedups you will see with different optimizations, it will vary a lot. For my latest project, the optimized version was 3x - 4x faster than gc! Also interesting to note, is that across several modern cpus (Ryzen, Skylake, Coffee Lake), for my particular case the /Haswell/ AVX build performed better than the Skylake AVX build (about ~3% difference). I haven't investigated it, I just use the older optimizations.

@puzzleking2000
Copy link

puzzleking2000 commented Mar 18, 2019 via email

@wjblanke
Copy link

Make sure you install the Microsoft Visual C++ 2010 Redistributable Package. vsyasm won't run without it, and being so old, most folks don't have it installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants