mostly minor c/cxx/linker flags
- Only tested against clang 9.0.0
Differential D5976
Add support for building with OpenMP support for clang on windows. Authored by Ray Molenkamp (LazyDodo) on Oct 2 2019, 10:28 PM. Tags None Subscribers None Tokens
Details mostly minor c/cxx/linker flags
Diff Detail
Event TimelineComment Actions While this restores OpenMP support for the main blender executable, the test executables that end up in bin\tests\release and they won't run until you manually copy libomp.dll there not entirely sure where would be the best place to copy that automatically? Comment Actions Are other dlls copied to the tests directory? If I remember correctly, ctest runs tests with bin as the current working directory, and then it finds the dlls there. Comment Actions
no , but we kinda count on the msvc run-time being installed since we just ran the compiler... so that took care of that issue for regular msvc builds
this does not seem to be the case for atleast the libmv tests (which are the only ones that are failing to load, didn't check any of the other executables) from the CreateProcess Event: Parent PID: 10964 Command line: K:/BlenderGit/ninja_full/bin/tests/Release/libmv_modal_solver_test.exe Current directory: K:\BlenderGit\ninja_full\intern\libmv\ Comment Actions The path containing libomp.dll needs to be enclosed in double quotes, otherwise there will be linking errors: [745/3935] Linking C executable bin\datatoc.exe FAILED: bin/datatoc.exe cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=source\blender\datatoc\CMakeFiles\datatoc.dir --manifests -- C:\PROGRA~2\MICROS~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo source\blender\datatoc\CMakeFiles\datatoc.dir\datatoc.c.obj /out:bin\datatoc.exe /implib:bin\datatoc.lib /pdb:bin\datatoc.pdb /version:0.0 /machine:x64 C:/Program Files/LLVM/lib/libomp.lib /SAFESEH:NO /MACHINE:X64 /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib /ignore:4049 /ignore:4217 /ignore:4221 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK: command "C:\PROGRA~2\MICROS~1\2017\PROFES~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo source\blender\datatoc\CMakeFiles\datatoc.dir\datatoc.c.obj /out:bin\datatoc.exe /implib:bin\datatoc.lib /pdb:bin\datatoc.pdb /version:0.0 /machine:x64 C:/Program Files/LLVM/lib/libomp.lib /SAFESEH:NO /MACHINE:X64 /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib /ignore:4049 /ignore:4217 /ignore:4221 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\datatoc.exe.manifest" failed (exit code 1181) with the following output: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj' The location for libomp.lib here is at default location as given by the Clang/LLVM installer. Comment Actions To be clear, you are running the libmv tests with something like ctest -R libmv and not running the executables directly? Anyway, it's more convenient if these executables can run correctly without that. So I think you can put code to install the dll to TESTS_OUTPUT_DIR in tests/gtests/CMakeLists.txt. Comment Actions Took a closer look, the working folder should actually be the bin folder, but due to a bug in our buildscripts it is not, will address in a separate diff since it really has nothing to do with openmp. Comment Actions
|