Hi AmgX team! This merge request fixes two build issues I had when compiling for Windows using Visual Studio 2022, this command line, and a clean CMake cache:
CMake reported that it couldn't find OpenMP, since its test compilations were failing. It turns out this was because CMakeLists.txt added /Zl to the Debug and MinSizeRel command lines before including Thrust, which would find OpenMP: it seems /Zl removes the information MSVC looks at to automatically link with OpenMP, linking fails because of that, and CMake fails. This merge request's fix is to call find_package(OpenMP) near the start where MPI is found; then CMake's test compilations succeed and it successfully finds OpenMP.
Building amgx_tests_launcher produces some unresolved symbol errors. I implemented the fix from wanjunling in https://github.com/NVIDIA/AMGX/issues/249#issuecomment-1652879283, except I linked with amgx_tests_library (which in turn links with amgx) instead of amgx. This also lets me remove an add_dependency() line, since CMake's target_link_libraries automatically adds dependencies.
Hi AmgX team! This merge request fixes two build issues I had when compiling for Windows using Visual Studio 2022, this command line, and a clean CMake cache:
CMake reported that it couldn't find OpenMP, since its test compilations were failing. It turns out this was because CMakeLists.txt added
/Zl
to the Debug and MinSizeRel command lines before including Thrust, which would find OpenMP: it seems/Zl
removes the information MSVC looks at to automatically link with OpenMP, linking fails because of that, and CMake fails. This merge request's fix is to callfind_package(OpenMP)
near the start whereMPI
is found; then CMake's test compilations succeed and it successfully finds OpenMP.Building
amgx_tests_launcher
produces some unresolved symbol errors. I implemented the fix from wanjunling in https://github.com/NVIDIA/AMGX/issues/249#issuecomment-1652879283, except I linked withamgx_tests_library
(which in turn links withamgx
) instead ofamgx
. This also lets me remove anadd_dependency()
line, since CMake'starget_link_libraries
automatically adds dependencies.Thanks!