[erlang-questions] How to get wxerlang working in in Ubuntu 14.04.4 LTS

Stefan Houtzager stefan.houtzager@REDACTED
Mon Apr 11 11:30:39 CEST 2016


That could be of course. How I connect to erlang? I just start a
dockercontainer from a terminal session (pico):

sudo docker run -it -h NEWCONTAINER --volumes-from stefancontainer
stefan/phoenix /bin/bash

and then type erl (in the same pico editor).

echo $DISPLAY gives :100 as response (while in the dockercontainer of
course), so
RUN echo "export DISPLAY=:100.0" >> ~/.bashrc
in the dockerfile seemed to work


On Mon, Apr 11, 2016 at 11:04 AM, Boris Mühmer <boris.muehmer@REDACTED>
wrote:

> Maybe the problem is related to the docker environment. I only had a brief
> contact with docker so I am not sure if I remember everything correctly.
>
> How do You connect to Erlang in the docker environment? Do You use SSH? Do
> You use "-X" for the connection?
> Could You check if "DISPLAY" is set?! If DISPLAY is empty You will always
> get the above error.
>
> This is just a *pseudo example* using a ssh connection to localhost:
>
> LOCAL> ssh -X bsmr@REDACTED
> Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-85-generic x86_64)
> REMOTE> echo $DISPLAY
> localhost:10.0
>
>
> But without a proper DISPLAY variable wx (or every other X11 application)
> will fail.
>
>
> Regards,
> Boris
>
>
>
> 2016-04-11 10:37 GMT+02:00 Stefan Houtzager <stefan.houtzager@REDACTED>:
>
>> Thanks Boris,
>>
>> When I install libwxbase3.0-dev, libwxgtk3.0-dev and libglu1-mesa-dev
>> instead of  freeglut3-dev wx2.8-headers wx-common libwxbase2.8
>> libwxgtk2.8-dev libqt4-opengl-dev libgtk2.0-dev libgl1-mesa-dev
>> libglu1-mesa-dev libpng3
>> I get the same error on  wx:demo().
>> which wx-config && wx-config --version-full gives
>> /usr/bin/wx-config
>> 3.0.0.0
>>   Maybe I have to configure some files from within my script?
>>
>>
>> On Mon, Apr 11, 2016 at 10:00 AM, Boris Mühmer <boris.muehmer@REDACTED>
>> wrote:
>>
>>> Hello Stefan,
>>>
>>> You need to install *libwxbase3.0-dev* and *libwxgtk3.0-dev*.
>>>
>>> I also believe You should install *libglu1-mesa-dev*. I have it in my
>>> erlang setup dependency list, but I can not remember why this was needed.
>>> It is possible that the gl demo did not work without it.
>>>
>>> But "my dependency list" started with 12.04, and some things were
>>> manuall changed/configured with 14.04. Maybe some things are automatically
>>> resolved now (like libwxgtk3.0-dev automatically includes libwxbase3.0-dev
>>> and libglu1-mesa-dev).
>>>
>>>
>>> Regards,
>>> Boris
>>>
>>> 2016-04-11 9:22 GMT+02:00 Stefan Houtzager <stefan.houtzager@REDACTED>:
>>>
>>>> Hi,
>>>>
>>>> I would appreciate an installscript for a recent erlang version
>>>> on Ubuntu 14.04.4 LTS with wxerlang working.
>>>>   I am a starting elixir developer (and for that need erlang). I would
>>>> like to get wxerlang working and created a dockerimage to make my
>>>> installation easy portable. I use otp_src_18.3.tar.gz and install several
>>>> wx packages and others, I'm not sure if I miss some or install some that
>>>> are not needed. Anyway, after the install the output of which
>>>> wx-config && wx-config --version-full is
>>>>
>>>> /usr/bin/wx-config
>>>> 2.8.12.1
>>>>
>>>> But wx:demo(). results in an error:
>>>>
>>>> Eshell V7.3  (abort with ^G)
>>>> 1> wx:demo().
>>>> Error: Unable to initialize gtk, is DISPLAY set properly?
>>>> ok
>>>> 2>
>>>>
>>>> The most important installs in the dockerfile (just linux commands
>>>> after the RUN statements, phusion/baseimage:0.9.18 is Ubuntu 14.04.4 LTS
>>>> reworked for docker)  I copied below, the full dockerfile and the logging
>>>> of the output I arttached.
>>>>
>>>>
>>>> FROM phusion/baseimage:0.9.18
>>>> MAINTAINER Stefan Houtzager <stefan.houtzager@REDACTED>
>>>>
>>>> # Important!  Update this no-op ENV variable when this Dockerfile
>>>> # is updated with the current date. It will force refresh of all
>>>> # of the base images and things like `apt-get update` won't be using
>>>> # old cached versions when the Dockerfile is built.
>>>> ENV REFRESHED_AT 05-04-2016
>>>>
>>>> # Set correct environment variables.
>>>>
>>>> # Setting ENV HOME does not seem to work currently. HOME is unset in
>>>> Docker container.
>>>> # See bug : https://github.com/phusion/baseimage-docker/issues/119
>>>> #ENV HOME /root
>>>> # Workaround:
>>>> RUN echo /root > /etc/container_environment/HOME
>>>>
>>>> # Regenerate SSH host keys. baseimage-docker does not contain any, so
>>>> you
>>>> # have to do that yourself. You may also comment out this instruction;
>>>> the
>>>> # init system will auto-generate one during boot.
>>>> RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
>>>>
>>>> # Use baseimage-docker's init system.
>>>> CMD ["/sbin/my_init"]
>>>>
>>>> # ...put your own build instructions here...
>>>>
>>>> # Set the locale
>>>> RUN locale-gen en_US.UTF-8
>>>> ENV LANG en_US.UTF-8
>>>> ENV LANGUAGE en_US:en
>>>> ENV LC_ALL en_US.UTF-8
>>>>
>>>> WORKDIR /tmp
>>>>
>>>> # See : https://github.com/phusion/baseimage-docker/issues/58
>>>> RUN echo 'debconf debconf/frontend select Noninteractive' |
>>>> debconf-set-selections
>>>>
>>>> # update and install some software requirements
>>>> RUN apt-get update && apt-get upgrade -y && apt-get install -y curl
>>>> wget git unzip autoconf make g++ gcc fop libxml2-utils xsltproc
>>>>
>>>> WORKDIR /
>>>>
>>>> RUN add-apt-repository ppa:openjdk-r/ppa
>>>> RUN apt-get update && apt-get install openjdk-8-jdk -y
>>>>
>>>> WORKDIR /
>>>>
>>>> # install nano (and pico)
>>>> RUN apt-get update && apt-get install nano -y
>>>>
>>>> # Needed for terminal handling (libc-dev libncurses5 libtinfo-dev
>>>> libtinfo5 ncurses-bin)
>>>> RUN apt-get -y install libncurses5-dev openssl libssl-dev m4
>>>> libncurses-dev libgmp3-dev libglu-dev
>>>>
>>>> # For building with wxWidgets
>>>> RUN apt-get -y install freeglut3-dev wx2.8-headers wx-common
>>>> libwxbase2.8 libwxgtk2.8-dev libqt4-opengl-dev libgtk2.0-dev
>>>> libgl1-mesa-dev libglu1-mesa-dev libpng3
>>>>
>>>> # For building ssl (libssh-4 libssl-dev zlib1g-dev)
>>>> RUN apt-get -y install libssh-dev
>>>>
>>>> # ODBC support (libltdl3-dev odbcinst1debian2 unixodbc)
>>>> RUN apt-get -y install unixodbc-dev
>>>> RUN apt-get -y install ncurses-dev
>>>> RUN wget http://www.erlang.org/download/otp_src_18.3.tar.gz
>>>> RUN tar -xvzf otp_src_18.3.tar.gz
>>>> RUN chmod -R 777 otp_src_18.3
>>>> WORKDIR otp_src_18.3
>>>> RUN ./configure
>>>> RUN make
>>>> RUN make install
>>>> RUN cd .. && rm -R otp_src_18.3/
>>>>
>>>> RUN echo "ERLANG_HOME=/usr/local/lib/erlang" >> ~/.bashrc
>>>> RUN echo "export PATH=$PATH:$ERLANG_HOME/bin" >> ~/.bashrc
>>>> RUN echo "export DISPLAY=:100.0" >> ~/.bashrc
>>>>
>>>> RUN apt-get purge --auto-remove openjdk-8-jdk -y
>>>> RUN rm -R /usr/lib/jvm
>>>>
>>>>
>>>> --
>>>> Kind regards,
>>>>
>>>> Stefan Houtzager
>>>>
>>>> Houtzager ICT consultancy & development
>>>>
>>>> www.linkedin.com/in/stefanhoutzager
>>>>
>>>> _______________________________________________
>>>> erlang-questions mailing list
>>>> erlang-questions@REDACTED
>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>
>>>>
>>>
>>
>>
>> --
>> Kind regards,
>>
>> Stefan Houtzager
>>
>> Houtzager ICT consultancy & development
>>
>> www.linkedin.com/in/stefanhoutzager
>>
>
>


-- 
Kind regards,

Stefan Houtzager

Houtzager ICT consultancy & development

www.linkedin.com/in/stefanhoutzager
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160411/eb4e5ef2/attachment.htm>


More information about the erlang-questions mailing list