Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Docker alpine Image - Forte & OPC UA - compiling errrors(I'm creating a Docker alpine image with Forte & OPC UA; however, I get Forte compiling errors)
Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791465] Fri, 29 June 2018 20:16 Go to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 5
Registered: June 2018
Junior Member
Dear 4diac community,

I'm in need of running forte with OPC UA. I have created my Docker image build file (Dockerfile_alpine) as you can see from the Error.Log, there are several warnings, but the final error seems to be related to the following;

make[1]: *** [CMakeFiles/Makefile2:138: src/CMakeFiles/forte.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

This could be the result of using cmake directly as oppose to using the setup_posix.sh file. However, when I use the setup_posix.sh file. I receive the following error:

make: *** No targets specified and no makefile found. Stop.

Note: this Docker image is going to be publicly release for the community with future improvements on other communication protocols (MODBUS/MQTT).

Any help would greatly be appreciated. Thanks!

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791583 is a reply to message #1791465] Mon, 02 July 2018 15:47 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 666
Registered: January 2014
Senior Member
Hi,

the causing error is shown in line 818 of your log file. What compiler are you using. What is the target platform for your docker image. On recent pthread libraries you a recursive mutix should be available.

Cheers,
Alois

P.S.: We are working on getting rid of the ocndition sync. hopefully this will happen soon.
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791594 is a reply to message #1791583] Mon, 02 July 2018 16:52 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 5
Registered: June 2018
Junior Member
Thank you for your help,

Looks like during installation gnu gcc (6.4.0-r5) and gnu g++ (6.4.0-r5) is being installed. I checked the packages for pthread.c/h files and they are part of the musl-dev package (x86_64 arch).

I'm running Docker on Windows 10 (amd64) computer in linux container mode and my docker image is Apline:latest. I will try different images other than amd64/alpine for different results. Once fully installed and without errors, I plan remove all the dev packages to maintain a lean and clean alpine linux image hopefully less than 30MB!

Could the problem be that I'm trying to compile forte on a 64bit machine instead of 16/32 bit?

Regards,
Franklin
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1791600 is a reply to message #1791594] Mon, 02 July 2018 17:15 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 666
Registered: January 2014
Senior Member
Hi,

My main development machines are a Debian 64bit and a Win10 64 bit machine. There I'm testing also forte. So I don't think it is a 64 bit issue. I think the problem is in the musl-dev library. For testing and until we got rid of the ConditionSynch I would try libc6-dev.

Alois
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792325 is a reply to message #1791600] Mon, 16 July 2018 07:20 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 5
Registered: June 2018
Junior Member
Ok, So I finally was able to compile forte on Alipine Linux @ 35MB! with the standard libraries (musl-dev).

In my investigation, I created an ubuntu and debian image and they installed just fine. After dealing with the libraries, I finally edited the following command line in your ConditionSynch.cpp line 30 code:

from:pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP);
to: pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE);

Not sure why _Cygwin_ would only need the correct datatype as oppose to the rest of the system. Please advise if this is safe to do!!!

My final output for running my new container from the created image is as follows: See Attached Image

Here is my new Dockefile: See attached File.

NOTE: The copied forte directory has the /src/posix/arch/conditionSynch.cpp file modified as above.

Regards,
Franklin
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792330 is a reply to message #1792325] Mon, 16 July 2018 07:57 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 666
Registered: January 2014
Senior Member
As pointed out in my last post this file will go and if you switch your docker file to the develop branch the conditionSynch.cpp has already be removed. In your setting it was anyhow not used. So any changes are save for you to test.
Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792381 is a reply to message #1792330] Mon, 16 July 2018 16:55 Go to previous messageGo to next message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 5
Registered: June 2018
Junior Member
I appreciate your input and will use the develop branch for compiling and testing.

I'll post all my work in github then try to create an Alpine forte image (35MB) with OPC UA (9MB), Modbus (4MB) and MQTT (?MB) already preconfigured. I won't be able to install OPC DA since this is a linux image. Also, I'm not sure I want to install FBDK (default protocol) as it will push the image to over 200MBs with Java JDK, but people are more than welcome to create their own images.

To summarize, my goal is for this image to be small enough to run in embedded devices already capable of running docker ce, but without the overhead of needing to compile forte.

Regards,
Franklin

[Updated on: Mon, 16 July 2018 16:56]

Report message to a moderator

Re: Docker alpine Image - Forte & OPC UA - compiling errrors [message #1792428 is a reply to message #1792381] Tue, 17 July 2018 17:06 Go to previous message
Franklin Amador is currently offline Franklin AmadorFriend
Messages: 5
Registered: June 2018
Junior Member
As promised, here is the new Dockerfile for Forte (develop). It has OPC UA, MODBUS and MQTT compiled and installed @ 50MB. Small embedded linux machines with Docker ce should be able to run this.

After running the container, forte should run immediately.

I would appreciate if you can tell me if the forte's cmake parameters look good.

Thanks!

[Updated on: Tue, 17 July 2018 17:10]

Report message to a moderator

Previous Topic:[SOLVED] Request validation FB according to standard
Next Topic:Making ROS Work on Forte Master Branch
Goto Forum:
  


Current Time: Sun Nov 18 02:22:48 GMT 2018

Powered by FUDForum. Page generated in 0.02472 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top