Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using this command line:
/permissive- /MP /GS- /Qpar /GL /W4 /wd"4530" /Gy /Zc:wchar_t /I"C:\oTemplates\oLib\oLib\src" /I"C:\oTemplates\oLib\oLib\inc" /Gm- /Ox /Fd"C:\oTemplates\oLib\oLib\tmp\64aRavx2\vc142" /fp:precise /Zp1 /D "AMD" /D "NDEBUG" /D "_CONSOLE" /fp:except- /errorReport:none /GF- /WX- /Zc:forScope /GR- /arch:AVX2 /Gv /Oi /MD /FC /Fa"C:\oTemplates\oLib\oLib\asm\64aRavx2\" /nologo /Fo"C:\oTemplates\oLib\oLib\tmp\64aRavx2\" /FAcs /Ot /diagnostics:column /Ob3 /favor:AMD64
to compile LIB project in VS 2019 and
"C:\oTemplates\oLib\oLib\asm\64aRavx2\"
stays empty. But it's being created during compile time.

If I switch to Debug settings:
/JMC /permissive- /MP /GS- /W4 /wd"4530" /Zc:wchar_t /I"C:\oTemplates\oLib\oLib\src" /I"C:\oTemplates\oLib\oLib\inc" /ZI /Gm- /Od /Fd"C:\oTemplates\oLib\oLib\tmp\64aDavx2\vc142" /fp:precise /Zp1 /D "AMD" /D "_DEBUG" /D "_CONSOLE" /fp:except- /errorReport:none /GF- /WX- /Zc:forScope /RTC1 /GR- /arch:AVX2 /Gv /MDd /FC /Fa"C:\oTemplates\oLib\oLib\asm\64aDavx2\" /nologo /Fo"C:\oTemplates\oLib\oLib\tmp\64aDavx2\" /FAcs /diagnostics:column /Ob3 /favor:AMD64 
or, if I'm switching project type from LIB to EXE, correspondig folder being filled with ".asm" files as usual.
Compiler won't generate asm files only for Static Library Release versions of the same code.

What I'm doing wrong or how to determine what's the problem is in?

What I have tried:

BTW, output produces no errors in any of the ways:
1>------ Rebuild All started: Project: oLib, Configuration: Release - AVX2 64 AMD ------
1>lib.cpp
1>oLib.vcxproj -> C:\oTemplates\oLib\oLib\bin\oLib64aRavx2.lib
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Posted
Updated 30-Nov-19 3:28am
v2

For LIB projects, it's required to remove /GL option ("Configuration Properties"->"C/C++"->"Optimization"->"Whole Program Optimization") to produce .asm files.
 
Share this answer
 
I've seen recently a note saying that MSVC compiler does not support inline assembly for x86 64-bits CPU family.
This was in a project called angelscript.
Angelscript - Copile the library - Considerations for specific platforms[^]
For 64-bits builds, there is a pre-build event setup which takes care of inline assembly generation. Maybe you can study how they solved this issue?
 
Share this answer
 
Comments
Ovodus 28-Nov-19 7:12am    
It's not about it. It's about any project's:
"Configuration Properties"->"C/C++"->"Output Files"->"Assembler Output" & "Configuration Properties"->"C/C++"->"Output Files"->"ASM List Location".
Hope it's more clear now. It's a good feature, which helps to understand the way the compiler works with your code.

BTW: "Assembler Inlining" is not supported, indeed. But no one denies you to use MASM in your project. Long story short, it's required now to keep asm code in separated files.
Create a DLL project and in Visual Studio, add all the existing files from the static Lib project to DLL project. Make sure you do not copy the source files to DLL project folder to avoid source code duplication: The DLL project can access the source files from static Lib project folder just fine.

Build the DLL with asm generation. There you have your assembly code.
 
Share this answer
 
Comments
Ovodus 30-Nov-19 9:36am    
Unfortunately, it's not an option for me. I need to build an automated compilation system to benchmark different algorithms under different CPUs in lots of different conditions. Manual project modifications will cost me tons of time and will make my reports invalid due to probable mistakes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900