Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building 1.0 on Windows (MSVC 2019) #868

Closed
wolfv opened this issue Jul 1, 2021 · 10 comments
Closed

Building 1.0 on Windows (MSVC 2019) #868

wolfv opened this issue Jul 1, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@wolfv
Copy link

wolfv commented Jul 1, 2021

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
Copy link
Member

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
Copy link
Author

wolfv commented Jul 1, 2021

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
Copy link
Member

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
Copy link
Author

wolfv commented Jul 1, 2021

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

@wolfv wolfv closed this as completed Jul 1, 2021
@elBoberido
Copy link
Member

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

@elBoberido elBoberido reopened this Jul 1, 2021
@elBoberido elBoberido added the bug Something isn't working label Jul 1, 2021
@dkroenke
Copy link
Member

dkroenke commented Jul 1, 2021

@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 #846

@elBoberido
Copy link
Member

@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
Copy link
Member

dkroenke commented Jul 1, 2021

agreed --> closed

@dkroenke dkroenke closed this as completed Jul 1, 2021
@wolfv
Copy link
Author

wolfv commented Jul 1, 2021

@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
Copy link
Member

dkroenke commented Jul 1, 2021

@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 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants