You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by Marcel Bootsma <ma...@ict.nl.INVALID> on 2022/02/09 11:54:04 UTC

Help with Building and Installing and 'Creating a simple Bundle'

Hello,

I just started on a project that uses Celix bundles, so I wanted to get accounted into the system.

I Followed the Building and Installing guide (https://github.com/apache/celix/blob/master/documents/building/README.md).
I tried both on a VM's running Ubuntu 18.04 and Ubuntu 20.04

I got the following error: Missing rapidJson
I was able to build and install this package.

After this I could build Celix and run and install it.

Going on I tried create a simple Celix bundle (https://celix.apache.org/docs/2.2.1/celix/documents/getting_started/creating_a_simple_bundle.html)

I get the following error:

CMake Error at CMakeLists.txt:17 (find_package):
  By not providing "FindCELIX.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "CELIX", but
  CMake did not find one.

  Could not find a package configuration file provided by "CELIX" with any of
  the following names:

    CELIXConfig.cmake
    celix-config.cmake

  Add the installation prefix of "CELIX" to CMAKE_PREFIX_PATH or set
  "CELIX_DIR" to a directory containing one of the above files.  If "CELIX"
  provides a separate development package or SDK, be sure it has been
  installed.

From older Celix versions I see that there is a findCelix present.
Where did it go?
Did I forget something?
Something changed?

Thank you in advance for any help.

Greetings,

Marcel Bootsma







-------- Disclaimer --------
This email and any files transmitted may contain proprietary and confidential information of ICT Group or any of its subsidiaries ("ICT") and is intended only for the (use of the) named recipient(s) above. If you have received this message in error or are not the intended or named recipient(s) of this message, please immediately notify the sender by return and delete this email message from your computer. Any views or opinions presented are solely those of its author and do not necessarily represent those of ICT. You are hereby notified that unauthorized disclosure, use, dissemination, forwarding, printing or copying of this e-mail and its attachments either whole or partial of its contents is strictly prohibited. ICT cannot guarantee that email communications are secured and error-free and does not accept any liability for damages resulting from the use of email. The general terms and conditions of purchase respectively sale and delivery of ICT are applicable to all transactions and undertakings resulting therefrom.


RE: Help with Building and Installing and 'Creating a simple Bundle'

Posted by Marcel Bootsma <ma...@ict.nl.INVALID>.
Hello Pepijn,

Thank you for your answer.

We did some more tests and got to a working solution.

We started with a clean Ubuntu 20.04.3 VM and did steps below.
I compared it with your new documentation and these are the differences:
- sudo apt-get update
- sudo apt-get upgrade
- added dependency git
- only do the snap install of cmake

Hope this helps to make your docs more complete!
Greetings,
Marcel

########## Install Celix ##########

#### prepare system
sudo apt-get update
sudo apt-get upgrade

#### get depedencies
# NOTE: no cmake yet, added git
sudo apt-get install -yq --no-install-recommends \
    build-essential \
    git \
    curl \
    uuid-dev \
    libjansson-dev \
    libcurl4-openssl-dev \
    default-jdk \
    libffi-dev \
    libzip-dev \
    libxml2-dev \
    libczmq-dev \
    libcpputest-dev \
    rapidjson-dev

snap install --classic cmake

#### Create workspace and get Celix
mkdir ${HOME}/workspace
export WS=${HOME}/workspace
cd ${WS}

#clone the repro
git clone --single-branch --branch master https://github.com/apache/celix.git

#### build and install
cd ${WS}/celix
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make

sudo make install

# try run
celixs
[2022-02-10T11:41:49] [   info] [celix_framework] [framework_start:521] Celix framework started





-------- Disclaimer --------
This email and any files transmitted may contain proprietary and confidential information of ICT Group or any of its subsidiaries (“ICT”) and is intended only for the (use of the) named recipient(s) above. If you have received this message in error or are not the intended or named recipient(s) of this message, please immediately notify the sender by return and delete this email message from your computer. Any views or opinions presented are solely those of its author and do not necessarily represent those of ICT. You are hereby notified that unauthorized disclosure, use, dissemination, forwarding, printing or copying of this e-mail and its attachments either whole or partial of its contents is strictly prohibited. ICT cannot guarantee that email communications are secured and error-free and does not accept any liability for damages resulting from the use of email. The general terms and conditions of purchase respectively sale and delivery of ICT are applicable to all transactions and undertakings resulting therefrom.


Re: Help with Building and Installing and 'Creating a simple Bundle'

Posted by Pepijn Noltes <pe...@gmail.com>.
Hi Marcel,

Good to hear that you now have a working Celix environment and thanks for
the feedback.
I will apply the needed changes in the documentation update branch.

Greetings,
Pepijn

On Thu, Feb 10, 2022 at 12:19 PM Marcel Bootsma
<ma...@ict.nl.invalid> wrote:

> Hello again,
>
> We also got the Simple Bundle example working.
>
> For some reason I do not get the findCELIX error again.
> With the new install cmake runs fine.
>
> But I get a  errors running make:
> marcel@Ubuntu2004B:~/workspace/myproject/build$ make
> [  7%] Building CXX object
> bundles/HelloWorld_cxx/CMakeFiles/HelloWorld_cxx.dir/src/HelloWorldActivator.cc.o
> /home/marcel/workspace/myproject/bundles/HelloWorld_cxx/src/HelloWorldActivator.cc:11:51:
> error: ‘BundleContext’ is not a member of ‘celix’
>    11 |   explicit BundleActivator(std::shared_ptr<celix::BundleContext>
> _ctx) : ctx{std::move(_ctx)} {
>       |                                                   ^~~~~~~~~~~~~
> ....
>
> Switching to C++17 solves the errors.
> In ${WS}/myproject/CMakeLists.txt change:
>   SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
> To
>   SET(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
>
> And all works fine.
>
> I am glad I can finally start learning Celix from a working development
> environment.
> Hope this helps you to improve the package
>
> Greetings
>
> Marcel
>
>
>
>
>
>
>
>
>
> -------- Disclaimer --------
> This email and any files transmitted may contain proprietary and
> confidential information of ICT Group or any of its subsidiaries (“ICT”)
> and is intended only for the (use of the) named recipient(s) above. If you
> have received this message in error or are not the intended or named
> recipient(s) of this message, please immediately notify the sender by
> return and delete this email message from your computer. Any views or
> opinions presented are solely those of its author and do not necessarily
> represent those of ICT. You are hereby notified that unauthorized
> disclosure, use, dissemination, forwarding, printing or copying of this
> e-mail and its attachments either whole or partial of its contents is
> strictly prohibited. ICT cannot guarantee that email communications are
> secured and error-free and does not accept any liability for damages
> resulting from the use of email. The general terms and conditions of
> purchase respectively sale and delivery of ICT are applicable to all
> transactions and undertakings resulting therefrom.
>
>

RE: Help with Building and Installing and 'Creating a simple Bundle'

Posted by Marcel Bootsma <ma...@ict.nl.INVALID>.
Hello again,

We also got the Simple Bundle example working.

For some reason I do not get the findCELIX error again.
With the new install cmake runs fine.

But I get a  errors running make:
marcel@Ubuntu2004B:~/workspace/myproject/build$ make
[  7%] Building CXX object bundles/HelloWorld_cxx/CMakeFiles/HelloWorld_cxx.dir/src/HelloWorldActivator.cc.o
/home/marcel/workspace/myproject/bundles/HelloWorld_cxx/src/HelloWorldActivator.cc:11:51: error: ‘BundleContext’ is not a member of ‘celix’
   11 |   explicit BundleActivator(std::shared_ptr<celix::BundleContext> _ctx) : ctx{std::move(_ctx)} {
      |                                                   ^~~~~~~~~~~~~
....

Switching to C++17 solves the errors.
In ${WS}/myproject/CMakeLists.txt change:
  SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
To
  SET(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")

And all works fine.

I am glad I can finally start learning Celix from a working development environment.
Hope this helps you to improve the package

Greetings

Marcel









-------- Disclaimer --------
This email and any files transmitted may contain proprietary and confidential information of ICT Group or any of its subsidiaries (“ICT”) and is intended only for the (use of the) named recipient(s) above. If you have received this message in error or are not the intended or named recipient(s) of this message, please immediately notify the sender by return and delete this email message from your computer. Any views or opinions presented are solely those of its author and do not necessarily represent those of ICT. You are hereby notified that unauthorized disclosure, use, dissemination, forwarding, printing or copying of this e-mail and its attachments either whole or partial of its contents is strictly prohibited. ICT cannot guarantee that email communications are secured and error-free and does not accept any liability for damages resulting from the use of email. The general terms and conditions of purchase respectively sale and delivery of ICT are applicable to all transactions and undertakings resulting therefrom.


Re: Help with Building and Installing and 'Creating a simple Bundle'

Posted by Pepijn Noltes <pe...@gmail.com>.
Hi Marcel,


On Wed, Feb 9, 2022 at 12:54 PM Marcel Bootsma
<ma...@ict.nl.invalid> wrote:

> Hello,
>
> I just started on a project that uses Celix bundles, so I wanted to get
> accounted into the system.
>
> I Followed the Building and Installing guide (
> https://github.com/apache/celix/blob/master/documents/building/README.md).
> I tried both on a VM's running Ubuntu 18.04 and Ubuntu 20.04
>
> I got the following error: Missing rapidJson
> I was able to build and install this package.
>

Yes, the instruction to install rapid json is missing in the current build
readme.
I am working on an update for the documentation, which also contains an
updated building info.
This updated currently can be found on the following branch and location:
https://github.com/pnoltes/celix/tree/feature/update_documentation/documents/building

Please note that I have not tested the instruction on a clean ubuntu
environment.


>
> After this I could build Celix and run and install it.
>
> Going on I tried create a simple Celix bundle (
> https://celix.apache.org/docs/2.2.1/celix/documents/getting_started/creating_a_simple_bundle.html
> )
>
> I get the following error:
>
> CMake Error at CMakeLists.txt:17 (find_package):
>   By not providing "FindCELIX.cmake" in CMAKE_MODULE_PATH this project has
>   asked CMake to find a package configuration file provided by "CELIX", but
>   CMake did not find one.
>
>   Could not find a package configuration file provided by "CELIX" with any
> of
>   the following names:
>
>     CELIXConfig.cmake
>     celix-config.cmake
>
>   Add the installation prefix of "CELIX" to CMAKE_PREFIX_PATH or set
>   "CELIX_DIR" to a directory containing one of the above files.  If "CELIX"
>   provides a separate development package or SDK, be sure it has been
>   installed.
>
> From older Celix versions I see that there is a findCelix present.
> Where did it go?
> Did I forget something?
> Something changed?
>

The FindCelix.cmake has been replaced with a CelixConfig.cmake file.
CMake supports two ways to find packages using find_package (Module mode
and a Config mode).
For more info see:
https://cmake.org/cmake/help/latest/command/find_package.html

Do you know where you installed Celix? So is this /usr or /usr/local or
/opt, /opt/local, etc
I expect that if you add a CMAKE_PREFIX_PATH environment variable pointing
to the Celix install location, Celix will be found.
e.g.:
export CMAKE_PREFIX_PATH=/opt


>
> Thank you in advance for any help.
>
> Greetings,
>
> Marcel Bootsma


Greetings,
Pepijn

>
>
>
>
>
>
>
> -------- Disclaimer --------
> This email and any files transmitted may contain proprietary and
> confidential information of ICT Group or any of its subsidiaries ("ICT")
> and is intended only for the (use of the) named recipient(s) above. If you
> have received this message in error or are not the intended or named
> recipient(s) of this message, please immediately notify the sender by
> return and delete this email message from your computer. Any views or
> opinions presented are solely those of its author and do not necessarily
> represent those of ICT. You are hereby notified that unauthorized
> disclosure, use, dissemination, forwarding, printing or copying of this
> e-mail and its attachments either whole or partial of its contents is
> strictly prohibited. ICT cannot guarantee that email communications are
> secured and error-free and does not accept any liability for damages
> resulting from the use of email. The general terms and conditions of
> purchase respectively sale and delivery of ICT are applicable to all
> transactions and undertakings resulting therefrom.
>
>