You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by Jeroen Kouwer <je...@gmail.com> on 2012/01/25 23:39:56 UTC

Celix on win32

Hello,

I'm trying to set-up an environment on windows to compile celix.

I've downloaded and installed visual studio express 2010, celix 2.8,
TurtoiseSVN (to get the sources). Won't use gmake, will use nmake from
visual studio instead.

Still looking for Zlib and CUnit, but ran into another requirement also:
the APR library. This one is required by the (celix sub-project) utils,
which is required for the framework. I think this should therefore be added
to the requirements also.

I also would like to know which versions of ZLib, CUnit and Apache APR are
required to build celix, so I can download and (try to) compile these
libraries for windows.

Regards,
Jeroen Kouwer
-- 
:wq!

Re: Celix on win32

Posted by Alexander Broekhuis <a....@gmail.com>.
Hello,

Thanks for your interest in Celix. Although some work has been done to get
Celix working on Windows, this isn't done.. So be prepared to expect
compilation problems (probably quite a lot), and also some extra
work/quirks when setting up everything.

I'll try to summarize the steps needed to get Visual Studio going. There is
no need to directly use nmake, as CMake create a Visual Studio solution
which works out of the box (if all paths are setup correctly using CMake).

Since most of these libraries don't come prebuild for windows, you need to
compile them your self. The following list of software is needed:

   1. Celix sources
   2. Cmake
   3. APR sources
   4. ZLIB
   5. CUnit
   6. CUrl

APR:
Download from apr.apache.org, the project has a Visual Studio dsw file
which can be openend to compile and build the APR libs. Latest version
should work, if not, please leave a reply so we can take a look at it.

ZLib:
Can be found at http://zlib.net/, I am not sure anymore if a precompiled
binary can be used. Again, the latest version should work.

CUnit:
A slightly adapted version of CUnit is used, this version is hosted at
http://code.google.com/p/c-unit/, it has a VIsual Studio project file, but
there seem to be some problems now and then. I'll try to recover what these
problems where and mention them here if needed. And again.. The latest
version can be used. This project by itself seems rather dead. We are
looking at an alternative for unit testing, but nothing implemented/added
so far.

cURL:
cURL can be downloaded from http://curl.haxx.se/download.html, this
download has a dsw file. Again, please try the latest version, as far as I
know there aren't any specifc version needed for most libraries.

CMake:
Next step is running CMake.

   1. Start the CMake GUI
   2. Select the source and binary location. Binary location should be the
   build directory inside the source directory.
   3. Configure the project, select the correct Visual Studio version.
   4. Select "Finish", CMake will report errors now, this is OK, the paths
   still need to be set up. Note: some required libraries will not show in the
   list. Select Advanced and Grouped to see all items.
   5. Now all includes and libraries must be set:
      1. APR: Set the APR_INCLUDE_DIR and APR_LIBRARY to the correct
      directory and library (the .lib file) (depending on where you
download and
      build APR)
      2. ZLib: Do the same
      3. cURL: again the same
      4. CUnit: again the same. Note: CMake does not seem to report an
      error if CUnit isn't found. But it is needed.

Work has been done to make the Utils and the Framework subproject work
under windows. Utils has been finished in the past, I don't know what the
status is today. Framework hasn't been finished.

To be able to test these 2 sub project, all other sub project can be
disabled. To disable these edit the toplevel CMakeLists.txt file. All
add_subdirectory lines can be commented (except for utils and framework).

Also, in {celix-source}/cmake/Includes.cmake an APRUTIL_INCLUDE is set,
this one can be disabled to. Unless you build and setup APRUTIL in the
CMake GUI (but it isn't needed for the framework itself).

With this setup CMake should be able to generate the Visual Studio project
files. Configure and Generate using the CMake GUI.

But now you will run into compilation problems.
These problems are mostly because of the lack of support for C99 in Visual
Studio (it does support C90). Since Celix was started using C99, there are
some problems.

   - Variable Length Arrays aren't supported, a possible solution is using
   malloc/free (or better, APR pools and apr_palloc)
   - Variable declarations should be at the start of a block. (this is the
   most common problem)

And there are still some pre-APR APIs being used, most notably:

   - No pthreads for Windows (pthread usage must be replaced with the
   threading API from APR)
   - File/Directory handing

I hope you can use this somehow to get things going. As said before,
WIndows support isn't complete. Bug reports and/or patches are welcome!
Also, if there are any questions, feel free to ask!

Hope this helps!

Alexander




2012/1/25 Jeroen Kouwer <je...@gmail.com>

> Hello,
>
> I'm trying to set-up an environment on windows to compile celix.
>
> I've downloaded and installed visual studio express 2010, celix 2.8,
> TurtoiseSVN (to get the sources). Won't use gmake, will use nmake from
> visual studio instead.
>
> Still looking for Zlib and CUnit, but ran into another requirement also:
> the APR library. This one is required by the (celix sub-project) utils,
> which is required for the framework. I think this should therefore be added
> to the requirements also.
>
> I also would like to know which versions of ZLib, CUnit and Apache APR are
> required to build celix, so I can download and (try to) compile these
> libraries for windows.
>
> Regards,
> Jeroen Kouwer
> --
> :wq!
>



-- 
Met vriendelijke groet,

Alexander Broekhuis