RE: HelloWorld with CMake

2018-12-04 Thread Lange Norbert via Xenomai


> -Original Message-
> From: Xenomai  On Behalf Of Evandro
> Sestrem via Xenomai
> Sent: Dienstag, 4. Dezember 2018 12:40
> To: xenomai@xenomai.org
> Subject: HelloWorld with CMake
>
> ** cmake_xenomai attempt **
> -
> I also tried to use the cmake_xenomai github project:
> git clone https://github.com/nolange/cmake_xenomai
>
> But when I check the patch:
> git apply --check
> /home/pi/cmake_xenomai/patchset/0001-add-an-flexible-bootstrap-
> template-header.patch
>
> I got these errors, so I didn't applied it:
> error: include/xenomai/Makefile.am: no such file or directory
> error: include/xenomai/init.h: no such file or directory
> error: lib/boilerplate/init/Makefile.am: no such file or directory
> error: lib/boilerplate/init/bootstrap.c: no such file or directory
>
>
> Evandro Sestrem

I did rebased that patchset on the latest stable branch, but you probably tried 
to apply it in the wrong directory?

You are supposed to
*) change to  the xenomai  sources directoy
*) apply those patches
for p in PATH_TO/xeno_cmake/patchset/*; do git am $p; done
*) configure, build and install xenomai.

After that CMake support should be  either automatic (if you installed Xenomai 
in your root/sysroot),
or you can specifiy the location with 'cmake -DXenomai_DIR='.

An empty project is available here:
https://github.com/nolange/cmake_xenomai/tree/master/examples/template

Norbert


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You



Re: HelloWorld with CMake

2018-12-04 Thread Per Oberg via Xenomai
- Den 4 dec 2018, på kl 12:40, xenomai xenomai@xenomai.org skrev: 

> Hello, 

Hi, 

I accindently posted my answer directly to Evandro. So for completeness I 
include Xenomai list. 
You have some answers already, however my Xenomai 2 vs 3 comment was not 
mentioned earlier. 

> Is it possible to use CMake to compile a Xenomai program? 

Yes, I use CMake for compilation. I have found that a lot of examples out there 
needs Xenomai 2 and does not work with Xenomai 3. 

You may have a look at https://github.com/iocroblab/xenomai-cmake which i found 
worked quite well. 


> I want to use Xenomai in a ROS 2 node. To do this, I need to be able to 
> compile it with CMake. 

> I'm trying to compile a HelloWorld Xenomai program using CMake. 

> I put this project in https://github.com/sestrem/xenomai_helloworld_cmake 

> The main files are: 
> helloWorld.c 
> CMakeLists.txt 

> When I execute "cmake .", everything is fine: 

> -- The C compiler identification is GNU 6.3.0 
> -- The CXX compiler identification is GNU 6.3.0 
> -- Check for working C compiler: /usr/bin/cc 
> -- Check for working C compiler: /usr/bin/cc -- works 
> -- Detecting C compiler ABI info 
> -- Detecting C compiler ABI info - done 
> -- Detecting C compile features 
> -- Detecting C compile features - done 
> -- Check for working CXX compiler: /usr/bin/c++ 
> -- Check for working CXX compiler: /usr/bin/c++ -- works 
> -- Detecting CXX compiler ABI info 
> -- Detecting CXX compiler ABI info - done 
> -- Detecting CXX compile features 
> -- Detecting CXX compile features - done 
> -- Configuring done 
> -- Generating done 
> -- Build files have been written to: /home/pi/testes/xenomai/helloWorld 

> But, after this, when I execute "make": 

> Scanning dependencies of target helloWorld 
> [ 50%] Building C object CMakeFiles/helloWorld.dir/helloWorld.c.o 
> In file included from /usr/xenomai/include/copperplate/threadobj.h:28:0, 
> from /usr/xenomai/include/alchemy/task.h:25, 
> from /home/pi/testes/xenomai/helloWorld/helloWorld.c:5: 
> /usr/xenomai/include/boilerplate/lock.h:23:34: fatal error: 
> boilerplate/wrappers.h: file or directory not found 
> #include  
> ^ 
> compilation terminated. 
> CMakeFiles/helloWorld.dir/build.make:62: recipe for target 
> 'CMakeFiles/helloWorld.dir/helloWorld.c.o' failed 
> make[2]: *** [CMakeFiles/helloWorld.dir/helloWorld.c.o] Error 1 
> CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloWorld.dir/all' 
> failed 
> make[1]: *** [CMakeFiles/helloWorld.dir/all] Error 2 
> Makefile:83: recipe for target 'all' failed 
> make: *** [all] Error 2 

> ** cmake_xenomai attempt ** 
> - 
> I also tried to use the cmake_xenomai github project: 
> git clone https://github.com/nolange/cmake_xenomai 

> But when I check the patch: 
> git apply --check 
> /home/pi/cmake_xenomai/patchset/0001-add-an-flexible-bootstrap-template-header.patch
>  

> I got these errors, so I didn't applied it: 
> error: include/xenomai/Makefile.am: no such file or directory 
> error: include/xenomai/init.h: no such file or directory 
> error: lib/boilerplate/init/Makefile.am: no such file or directory 
> error: lib/boilerplate/init/bootstrap.c: no such file or directory 

> Evandro Sestrem 

Regards 
Per Öberg 


Re: HelloWorld with CMake

2018-12-04 Thread Leopold Palomo-Avellaneda via Xenomai
El 4/12/18 a les 12:40, Evandro Sestrem via Xenomai ha escrit:
> Hello,
> 
> Is it possible to use CMake to compile a Xenomai program?

Yes

> I want to use Xenomai in a ROS 2 node. To do this, I need to be able to
> compile it with CMake.

However I don't know if amend is able to do it.

> I'm trying to compile a HelloWorld Xenomai program using CMake.
> 
> I put this project in https://github.com/sestrem/xenomai_helloworld_cmake
> 
> The main files are:
> helloWorld.c
> CMakeLists.txt
> 
> When I execute "cmake .", everything is fine:
> 
> -- The C compiler identification is GNU 6.3.0
> -- The CXX compiler identification is GNU 6.3.0
> -- Check for working C compiler: /usr/bin/cc
> -- Check for working C compiler: /usr/bin/cc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/pi/testes/xenomai/helloWorld
> 
> 
> But, after this, when I execute "make":
> 
> Scanning dependencies of target helloWorld
> [ 50%] Building C object CMakeFiles/helloWorld.dir/helloWorld.c.o
> In file included from /usr/xenomai/include/copperplate/threadobj.h:28:0,
>  from /usr/xenomai/include/alchemy/task.h:25,
>  from /home/pi/testes/xenomai/helloWorld/helloWorld.c:5:
> /usr/xenomai/include/boilerplate/lock.h:23:34: fatal error:
> boilerplate/wrappers.h: file or directory not found
>  #include 

if fails with the includes.

>   ^
> compilation terminated.
> CMakeFiles/helloWorld.dir/build.make:62: recipe for target
> 'CMakeFiles/helloWorld.dir/helloWorld.c.o' failed
> make[2]: *** [CMakeFiles/helloWorld.dir/helloWorld.c.o] Error 1
> CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloWorld.dir/all'
> failed
> make[1]: *** [CMakeFiles/helloWorld.dir/all] Error 2
> Makefile:83: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> 
> ** cmake_xenomai attempt **
> -
> I also tried to use the cmake_xenomai github project:
> git clone https://github.com/nolange/cmake_xenomai
> 
> But when I check the patch:
> git apply --check
> /home/pi/cmake_xenomai/patchset/0001-add-an-flexible-bootstrap-template-header.patch
> 
> I got these errors, so I didn't applied it:
> error: include/xenomai/Makefile.am: no such file or directory
> error: include/xenomai/init.h: no such file or directory
> error: lib/boilerplate/init/Makefile.am: no such file or directory
> error: lib/boilerplate/init/bootstrap.c: no such file or directory
> 
> 
> Evandro Sestrem
> 

if you want, could you try to use:

https://github.com/iocroblab/xenomai-cmake

Cheers,

Leopold


-- 
--
Linux User 152692 GPG: 05F4A7A949A2D9AA
Catalonia
-
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: 



Re: HelloWorld with CMake

2018-12-04 Thread Jan Kiszka via Xenomai

On 04.12.18 12:40, Evandro Sestrem via Xenomai wrote:

Hello,

Is it possible to use CMake to compile a Xenomai program?

I want to use Xenomai in a ROS 2 node. To do this, I need to be able to
compile it with CMake.

I'm trying to compile a HelloWorld Xenomai program using CMake.

I put this project in https://github.com/sestrem/xenomai_helloworld_cmake

The main files are:
helloWorld.c
CMakeLists.txt

When I execute "cmake .", everything is fine:

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/testes/xenomai/helloWorld


But, after this, when I execute "make":

Scanning dependencies of target helloWorld
[ 50%] Building C object CMakeFiles/helloWorld.dir/helloWorld.c.o
In file included from /usr/xenomai/include/copperplate/threadobj.h:28:0,
  from /usr/xenomai/include/alchemy/task.h:25,
  from /home/pi/testes/xenomai/helloWorld/helloWorld.c:5:
/usr/xenomai/include/boilerplate/lock.h:23:34: fatal error:
boilerplate/wrappers.h: file or directory not found
  #include 
   ^
compilation terminated.
CMakeFiles/helloWorld.dir/build.make:62: recipe for target
'CMakeFiles/helloWorld.dir/helloWorld.c.o' failed
make[2]: *** [CMakeFiles/helloWorld.dir/helloWorld.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloWorld.dir/all'
failed
make[1]: *** [CMakeFiles/helloWorld.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


** cmake_xenomai attempt **
-
I also tried to use the cmake_xenomai github project:
git clone https://github.com/nolange/cmake_xenomai

But when I check the patch:
git apply --check
/home/pi/cmake_xenomai/patchset/0001-add-an-flexible-bootstrap-template-header.patch

I got these errors, so I didn't applied it:
error: include/xenomai/Makefile.am: no such file or directory
error: include/xenomai/init.h: no such file or directory
error: lib/boilerplate/init/Makefile.am: no such file or directory
error: lib/boilerplate/init/bootstrap.c: no such file or directory


Evandro Sestrem



I think someone once posted cmake templates, did you check the mailing list 
archive?

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux