eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.67k stars 390 forks source link

Building 1.0 on Windows (MSVC 2019) #868

Closed wolfv closed 3 years ago

wolfv commented 3 years ago

Required information

Operating system: Windows 10

Compiler version: MSVC 2019

Observed result or behaviour: Unfortunately, building a shared library (dll) on Windows seems to fail for iceoryx_utils. Here is a log: https://dev.azure.com/robostack/ros_pipelines/_build/results?buildId=2146&view=logs&j=c37ce413-640d-54e1-a15a-6fd3f816233d&t=81694da9-5e46-5c3e-6be0-f0d56769eb52

The error is

[41/42] Linking CXX shared library iceoryx_platform.dll
[42/42] Linking CXX shared library iceoryx_utils.dll
FAILED: iceoryx_utils.dll iceoryx_utils.lib 
cmd.exe /C "cd . && %BUILD_PREFIX%\Library\bin\cmake.exe -E vs_link_dll --intdir=CMakeFiles\iceoryx_utils.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\ENTERP~1\VC\Tools\MSVC\1429~1.300\bin\Hostx64\x64\link.exe /nologo CMakeFiles\iceoryx_utils.dir\source\concurrent\active_object.cpp.obj CMakeFiles\iceoryx_utils.dir\source\concurrent\loffli.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\deadline_timer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\helplets.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\generic_raii.cpp.obj CMakeFiles\iceoryx_utils.dir\source\error_handling\error_handling.cpp.obj CMakeFiles\iceoryx_utils.dir\source\file_reader\file_reader.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logcommon.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logger.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logging.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logging_internal.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logmanager.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logstream.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\access_control.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\mutex.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\file_lock.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\semaphore.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\timer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\timespec.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\signal_handler.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\message_queue.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\unix_domain_socket.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\allocator.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\memory_map.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\shared_memory.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\system_configuration.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\posix_access_rights.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\thread.cpp.obj CMakeFiles\iceoryx_utils.dir\source\units\duration.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\base_relative_pointer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\base_relocatable_pointer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\relative_pointer_data.cpp.obj  /out:iceoryx_utils.dll /implib:iceoryx_utils.lib /pdb:iceoryx_utils.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO  iceoryx_platform.lib  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\2019\ENTERP~1\VC\Tools\MSVC\1429~1.300\bin\Hostx64\x64\link.exe /nologo CMakeFiles\iceoryx_utils.dir\source\concurrent\active_object.cpp.obj CMakeFiles\iceoryx_utils.dir\source\concurrent\loffli.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\deadline_timer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\helplets.cpp.obj CMakeFiles\iceoryx_utils.dir\source\cxx\generic_raii.cpp.obj CMakeFiles\iceoryx_utils.dir\source\error_handling\error_handling.cpp.obj CMakeFiles\iceoryx_utils.dir\source\file_reader\file_reader.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logcommon.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logger.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logging.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logging_internal.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logmanager.cpp.obj CMakeFiles\iceoryx_utils.dir\source\log\logstream.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\access_control.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\mutex.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\file_lock.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\semaphore.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\timer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\timespec.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\signal_handler.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\message_queue.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\unix_domain_socket.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\allocator.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\memory_map.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\shared_memory_object\shared_memory.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\system_configuration.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\posix_access_rights.cpp.obj CMakeFiles\iceoryx_utils.dir\source\posix_wrapper\thread.cpp.obj CMakeFiles\iceoryx_utils.dir\source\units\duration.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\base_relative_pointer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\base_relocatable_pointer.cpp.obj CMakeFiles\iceoryx_utils.dir\source\relocatable_pointer\relative_pointer_data.cpp.obj /out:iceoryx_utils.dll /implib:iceoryx_utils.lib /pdb:iceoryx_utils.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO iceoryx_platform.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:iceoryx_utils.dll.manifest" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: cannot open input file 'iceoryx_platform.lib'
ninja: build stopped: subcommand failed.

Any chance someone else came across this? Has this already been patched?

elBoberido commented 3 years ago

iceoryx 1.0 doesn't run on Windows. We just build it in our CI to prevent breakages in the unfinished port. Recently #33 was finished and our master branch now has basic Windows support. I don't know if there are issues with dynamic linking. AFAIK we use static linking in our CI.

@dkroenke from the azure link it seems it was build for ROS. I thought iceoryx was disabled for Windows on ROS. Did I miss something?

wolfv commented 3 years ago

Thanks for the reply! If I understand correctly, then iceoryx 0.7 did work? Or some previous version of cyclonedds?

I am trying again, removing iceoryx + cyclonedds from the build now. I think ideally this should be encoded in the package.xml metadata, maybe at the level of https://github.com/ros2/rmw_implementation/blob/master/rmw_implementation/package.xml

elBoberido commented 3 years ago

No, iceoryx did not work on Windows up until recently with master. It was always only building to catch regressions in the port. I'm not quite sure if we build DLLs on ROS for Windows or if there are also statically build. At least cyclonedds should not use iceoryx when built for Windows. I don't know it that is fully prevented or if just the switch to use iceoryx is set to false by default on Windows.

wolfv commented 3 years ago

Thanks @elBoberido sorry for bothering you guys! I'll discuss with the ROS folks / cyclonedds folks then.

elBoberido commented 3 years ago

Since we promised to also support Windows for the next ROS2 release, I think we should keep this issue open until we know if the linker issues persists with our current master

dkroenke commented 3 years ago

@wolfv @elBoberido On ROS 2 iceoryx is compiled as static lib (*.lib files) like all the other libraries (see here) and on Linux as shared library. CycloneDDS enables the shared memory transport only on Linux/MacOS platforms.

Yes building iceoryx as dll would make sense, added that as a task to https://github.com/eclipse-iceoryx/iceoryx/issues/846

elBoberido commented 3 years ago

@dkroenke since it is build as static lib on ROS 2 and you added a task to the full Windows support issue, do you think we can close this now?

dkroenke commented 3 years ago

agreed --> closed

wolfv commented 3 years ago

@dkroenke thanks! It's not quite true -- most libraries are dll's in ROS 2 (check the bin folder in the link you posted).

But anyways, we could patch our build scripts to force a static build of the iceoryx libs for now!

Cheers!

dkroenke commented 3 years ago

@wolfv You are right! I forgot that on Windows the dll files are mostly exported to bin instead of lib. I'm mostly running on Linux where it goes to lib. Thanks for the hint.

Greetings from Berlin :wink: