HiGHS icon indicating copy to clipboard operation
HiGHS copied to clipboard

nameclash on Windows for .pdb files

Open lkapelevich opened this issue 2 years ago • 7 comments

When building with MSVC the .pdb file for the .dll (which is needed for the debugger) is overwritten by the .pbd file for the executable. This happens because both are named highs.pdb. When I put an "if(NOT MSVC)" clause around this line we generate a libhighs.pdb, so the issue is resolved.

Perhaps a better fix would be to check whether the system is not Windows for the same clause, or rename the executable instead.

lkapelevich avatar Apr 12 '23 19:04 lkapelevich

Hi @lkapelevich, I see where you have added the fix.

Would you please try to use the CMake flag FAST_BUILD=ON when you are building and let me know if you still get issues? The flag will be on by default very soon and updates the CMake build.

galabovaa avatar Apr 21 '23 13:04 galabovaa

Hi @galabovaa. That works, no issues.

I still think it's strange that the shared library and executable get a .pdb with the same name. FWIW, I just found this flag https://cmake.org/cmake/help/latest/prop_tgt/PDB_NAME.html, and PDB_NAME libhighs in the same clause also works for me.

lkapelevich avatar Apr 21 '23 16:04 lkapelevich

Has this issue been resolved? @lkapelevich @galabovaa

jajhall avatar Apr 25 '23 21:04 jajhall

I think adding PDB_NAME would resolve this fully. An analogous issue/fix in another repo: https://github.com/eclipse/mosquitto/issues/2714

lkapelevich avatar Apr 25 '23 22:04 lkapelevich

Thanks again Lea, I have just finished the big cmake refactoring we needed for python and looked at this again. I've added the fix to FAST_BUILD OFF for legacy code and will merge it in latest. Note, that we may remove the FAST_BUILD OFF option all together at some point, so users are strongly encouraged to use the default FAST_BUILD=ON and let us know if there are any issues with that!

galabovaa avatar Mar 12 '24 15:03 galabovaa

That's great. Is there a reason not to add the flag for FAST_BUILD ON, so that it can stay when FAST_BUILD OFF disappears?

lkapelevich avatar Mar 12 '24 16:03 lkapelevich

Yes, it is best not to add it at all! Removing it won't happen for another few months, but still, since FAST_BUILD=ON is default now, you don't need it. It was needed just before we made it default, as we were adding features and bug fixes to the "more modern cmake" and we didn't change much in FAST_BUILD OFF to avoid breaking what people were using at the time as we upgraded.

galabovaa avatar Mar 12 '24 16:03 galabovaa