You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2021/02/26 03:26:42 UTC

[GitHub] [celix] wanglzh opened a new issue #321: building celix on cygwin environment

wanglzh opened a new issue #321:
URL: https://github.com/apache/celix/issues/321


   Hello,
   
   There is a need for me to run celix on windows, I see the BUILDING say "Currently Apache Celix only builds and works on Unix/Linux like systems", but not sure whether cygwin is support or not. I have a try but not compiled correctly as below. Would you give me some advice for that? Thanks !
   
   ```
   lab@LZ-WORK ~/projects/celix/build
   $ cmake ..
   -- Using jar to create bundles
   -- Configuring done
   CMake Error at cmake/cmake_celix/BundlePackaging.cmake:449 (add_custom_command):
     Error evaluating generator expression:
   
       $<TARGET_SONAME_FILE_NAME:http_admin>
   
     TARGET_SONAME_FILE is not allowed for DLL target platforms.
   Call Stack (most recent call first):
     cmake/cmake_celix/BundlePackaging.cmake:336 (celix_bundle_libs)
     bundles/http_admin/http_admin/CMakeLists.txt:18 (add_celix_bundle)
   
   
   CMake Error at cmake/cmake_celix/BundlePackaging.cmake:449 (add_custom_command):
     Error evaluating generator expression:
   
       $<TARGET_SONAME_FILE_NAME:civetweb_shared>
   
     TARGET_SONAME_FILE is not allowed for DLL target platforms.
   Call Stack (most recent call first):
     cmake/cmake_celix/BundlePackaging.cmake:395 (celix_bundle_libs)
     bundles/http_admin/http_admin/CMakeLists.txt:32 (celix_bundle_private_libs)
   
   
   CMake Error at cmake/cmake_celix/BundlePackaging.cmake:449 (add_custom_command):
     Error evaluating generator expression:
   
       $<TARGET_SONAME_FILE_NAME:log_writer_stdout>
   
     TARGET_SONAME_FILE is not allowed for DLL target platforms.
   Call Stack (most recent call first):
     cmake/cmake_celix/BundlePackaging.cmake:336 (celix_bundle_libs)
     bundles/logging/log_service_v2/CMakeLists.txt:36 (add_celix_bundle)
   ```
    


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [celix] pnoltes commented on issue #321: building celix on cygwin environment

Posted by GitBox <gi...@apache.org>.
pnoltes commented on issue #321:
URL: https://github.com/apache/celix/issues/321#issuecomment-787460256


   Hi,
   
   Indeed Celix currently is only build and tested on Linux and Mac. 
   
   I am not a windows expert, so take this with a grain of salt, but to get Celix running under windows I think we need to do the following:
   
   1) Update the Celix CMake files to handle dll libraries next to so (linux) and dylib (mac) libraries. 
   This is currently the error you are seeing. Apparently the cmake-generator-expresssion TARGET_SONAME_FILE does not work with dll libraries. Btw strange, because it does work with mac dylib libraries.
   https://cmake.org/cmake/help/v3.0/manual/cmake-generator-expressions.7.html
   
   2) Support pthread. Celix thread and mutex support is build on top of pthread. To get Celix running on windows the easiest way would be to support pthread. If I am correct this can be done with cygwin. 
   
   2) Be able do dynamically load dll libraries 
   Celix uses a load library abstraction:
   https://github.com/apache/celix/blob/master/libs/framework/src/celix_library_loader.h
   And currently there is only a dlopen implementation, but In the beginning of Celix (around 2010/2011) we also had an DLL loading abstraction. This could be reintroduced (i.e. compile a  celix_windows_library_loader.c instead of celix_library_loader.c on windows).  
   
   4) If I am correct with windows C/C++ functions need to explicitly declared exported in a library. This is currently not done and needs to be done for lib framework, utils and the bundle activators.
   
   5) Setup a CI pipeline to ensure Celix works and keeps working for a windows environment. 
   
   Hopefully this helps in getting a better overview were Celix stands with respect for Windows support. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org