NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone Look Into Wine?

Fun times.  So with the help of Alejandro over on this thread I was able to get the latest source for the opkg manager, which added support for xz compressed packages.  This is important because just about all modern Debian made packages use this compression and the alternative (which I started down) is to download the source for each package, then remake the package with the gzip compression.  I may still go down this route eventually since it doesn't require a beta version of the package manager (and all development tools) installed.  But that's besides the point.

With the new opkg installed I started down the road of finding all the dependent packages for wine and installed them one at a time but I've hit a bit of a road block.  A dependency of the libwine package is the libgcc1 package.  NI's repository apparently has this (version 4.8.2-r0.270) which is good, and the dependency for libwine is for version >= 1:4.1.1 and >= 4.8.2.  The problem is when I go to install libwine it states it cannot satisfy those dependencies...but it's installed?  I figured I might be able to update the libgcc1 but I can't do that either because it states that installing it woud break an existing dependency.  It looks like the libgcc-s-dev package requires that exact version of that package.  So is there something nonstandard about how that package is installed, which makes libwine not realize it is installed?  Can I force an update?  I'll play around and see what I break figure out I just wanted to know if NI had an answer for this particularly stuborn package.

admin@NI-cDAQ-9132-01B8C19E:~/DebWine# opkg install libgcc1

Package libgcc1 (4.8.2-r0.270) installed in root is up to date.

admin@NI-cDAQ-9132-01B8C19E:~/DebWine# opkg install ./libwine_1.6.2-20_amd64.deb

Not selecting libgcc1 4.8.2 as installing it would break existing dependencies.

Not selecting libgcc1 4.8.2 as installing it would break existing dependencies.

libwine: unsatisfied recommendation for fonts-liberation

libwine: unsatisfied recommendation for cups-bsd

Collected errors:

* calculate_dependencies_for: Cannot satisfy the following dependencies for libwine:

*      libgcc1 (>= 1:4.1.1) *  libgcc1 (>= 4.8.2) *

* opkg_solver_install: Cannot install package libwine.

0 Kudos
Message 11 of 28
(2,740 Views)

maybe you can try to use the --force-depends flag?

0 Kudos
Message 12 of 28
(2,740 Views)

Well I thought I was close to getting this to work but I guess not.  After forcing to install a bunch of packages I ran wine and got errors.  Googling those errors made it seem as if not all the dependencies were installed.  So I started fresh, and tracked down each dependency, and their dependency. 

I do have a conflict as mentioned where libwine depends on a newer libgcc1, but upgrading libgcc1 would cause lots of other issues.  Even so trying to go through this process results in opkg returning "Segmentation fault" and packages won't be installed.  Even without forcing odd installs I am getting this error on a few packages I would expect to just install without any issue like the libpcre3 package found here.  I just can't seem to resolve all the dependency issues, and some packages just won't install preventing me from getting further.

EDIT: Okay rebuilding stuborn packages from source seems to be helping with segmentation fault errors.

0 Kudos
Message 13 of 28
(2,740 Views)

another option would be to keep libgcc1 at it's current version, but force the installation of libwine (--force-depends --nodeps). Not sure if libwine will run on an older libgcc1, but might be worth a try.

0 Kudos
Message 14 of 28
(2,740 Views)

Well I have it installed...but it doesn't work. I still don't think it is installed right.  I downloaded each dependency that NI doesn't have from a debian site, compiled for 64bit, then went through installing them one at a time, here's what I installed.

gcc-4.9-base_4.9.2-10_amd64.deb

lib32z1_1.2.8.dfsg-2_amd64.deb

libasound2-plugins_1.0.28-1+b1_amd64.deb

libedit2_3.1-20140620-2_amd64.deb

libgl1-mesa-dri_10.3.2-1+deb8u1_amd64.deb

libgl1-mesa-glx_10.3.2-1+deb8u1_amd64.deb

libglapi-mesa_10.3.2-1+deb8u1_amd64.deb

libglib2.0-0_2.42.1-1+b1_amd64.deb

libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb

libgstreamer0.10-0_0.10.36-1.5_amd64.deb

liblcms2-2_2.6-3_amd64.deb

libllvm3.5_3.5-10_amd64.deb

libmpg123-0_1.20.1-2_amd64.deb

libopenal-data_1.15.1-5_all.deb

libopenal1_1.15.1-5_amd64.deb

liborc-0.4-0_0.4.22-1_amd64.deb

libpcre3_8.35-3.3+deb8u4_amd64.deb

libstdc++6_4.9.2-10_amd64.deb

libudev1_215-17+deb8u4_amd64.deb

libwine-gecko-2.21_2.21+dfsg2-1_all.deb

libwine_1.6.2-20_amd64.deb

libx11-6_1.6.2-3_amd64.deb

libx11-data_1.6.2-3_all.deb

libxrandr2_1.4.2-1+b1_amd64.deb

libxshmfence1_1.1-4_amd64.deb

multiarch-support_2.19-18+deb8u4_amd64.deb

wine32_1.6.2-20_i386.deb

wine64_1.6.2-20_amd64.deb

wine_1.6.2-20_amd64.deb

x11-utils_7.7+2_amd64.deb

zlib1g_1.2.8.dfsg-2_amd64.deb

To install these a few forces were needed:

opkg install ./libwine_1.6.2-20_amd64.deb --force-depends

opkg install ./x11-utils_7.7+2_amd64.deb --force-overwrite

opkg install ./libstdc++6_4.9.2-10_amd64.deb --force-depends

opkg install ./libllvm3.5_3.5-10_amd64.deb --force-depends

opkg install ./libgl1-mesa-dri_10.3.2-1+deb8u1_amd64.deb --force-depends

The force depends are times when libgcc1, or gcc-4.9-base needed to be updated.  The force overwrite was for a package that already had some files installed, that it also wanted to install.

Once all of this was done if I type wine into bash I get:

/usr/bin/wine: line 45: /usr/bin/wine32: No such file or directory

This is different from a command not found error, and these files actually exist where they should.  Now I didn't install all the recommended packages but I'd hope they aren't needed just to get the help.  Searching this error with wine sounds like a dependency or something isn't installed right.  Oh and when isntalling the libglib2.0-0 package an error came up during the configuring, about not finding dpkg but it wasn't listed as a dependency.  Any suggestions, or help is appreciated.  Docker maybe an option but man I feel so close...  Oh and another thing I read somewhere that installing a deb with opkg would work, but some of the post run scripts might not work right, I wonder if that could also be a reason these packages weren't installed right.

EDIT:  This last error seems to come from the fact that I am trying to run a 32bit binary on a 64 bit machine.  I see multiarch-support is installed, is there anything else NI would suggest to help ensure running 32 bit binaries will work?

0 Kudos
Message 15 of 28
(2,740 Views)

Normally I would say "there's no multiarch support" but I see that was among the packages you added, and I don't know exactly what it takes to make that work, so no comment there. Do you actually need the 32-bit version of Wine, though? I see you installed both wine32_1.6.2-20_i386.deb and wine64_1.6.2-20_amd64.deb, but all the dependencies you only installed as 64-bit. What if you don't install the 32-bit one and just use 64-bit?

Now having said that, ironically, I would expect the 64-bit one to fail with the exact same symptom. Distros disagree on where 64-bit libraries go and my desktop and embedded OS's are always spitting out that "no such file" error when I copy 64-bit binaries back and forth between them. The file in question is (probably) "/lib/ld-linux-x86-64.so.2", which desktop builds look for in /lib64 instead of /lib. I always just symlink /lib64 -> /lib (or vice versa) to work around this.

0 Kudos
Message 16 of 28
(2,740 Views)

First thanks for the continued comments and help.  Yes I installed both wine64 and wine32, this is because "wine" itself depends on either wine32 or wine64.  I assumed this meant if you installed wine32 you'd be able to execute Windows 32-bit binaries, and wine64 would be for Windows 64-bit binaries, and installing both would work for both.

As for why I loaded what I did?  Well I just went with the dependencies listed by the package, or listed on the debian package page.  Here is the one for wine32.

I can try to just have wine64 installed, but to be honest I did both because I didn't have a command line Windows 64 bit program.  I was able to compile an AutoIt3 EXE with command line functionality in both 32 and 64 bit, but on my Ubuntu server with wine (32 and 64) they both wouldn't run because they still loaded some Windows GUI function and would crap out.  I can look into finding a 64 bit command line program.

Another thing that it might be is the system just needs to be reset after getting all these new things installed.  Of course after installing these things a restart makes the system not usable.  The login information is somehow changed.  It probably has to do with some of those packages that replace existing files.  I'll try again reinstalling the NI packages, or backing up and replacing files.  I'll also look into what package actually causes the lockup of the system if I get time.

0 Kudos
Message 17 of 28
(2,740 Views)

Okay so I successfully installed Wine64 and am able to run a 64 bit Windows built command line program, and even run a 64 bit Windows program with a UI on the embedded UI.  Here's the steps which I'll make into a document if I can get 32 bit programs working:

I started with a freshly formatted controller, installed Legacy FTP software and its dependencies just to get out of software install mode.  Enabled the embedded UI, enabled SSH and restarted.  Performed the following to install tools to upgrade opkg:

opkg update

opkg install packagegroup-core-buildessential

opkg install packagegroup-core-buildessential-dev

opkg install libarchive-dev

opkg install libcurl-dev

opkg install gpgme-dev

opkg install intltool-dev

Then restarted.  Then downloaded the OPKG master 0.3.4-SNAPSHOT.  Then on that directory ran ./autogen.sh, then the usual ./configure, make, make install.  This installs the updated opkg which enables xz compression, and I suspect adds other support and bug fixes.

Then I added these lines to the /etc/opkg/arch.conf to support the debian packages to be installed:

arch i386 27

arch amd64 28

Then finally installed these packages, in this order:

opkg install ./multiarch-support_2.19-18+deb8u4_amd64.deb

opkg install ./libedit2_3.1-20140620-2_amd64.deb

opkg install ./libmpg123-0_1.20.1-2_amd64.deb

opkg install ./liblcms2-2_2.6-3_amd64.deb

opkg install ./libpcre3_8.35-3.3+deb8u4_amd64.deb

opkg install ./liborc-0.4-0_0.4.22-1_amd64.deb

opkg install ./zlib1g_1.2.8.dfsg-2_amd64.deb

opkg install ./libopenal-data_1.15.1-5_all.deb

opkg install ./libopenal1_1.15.1-5_amd64.deb

opkg install ./libglib2.0-0_2.42.1-1+b1_amd64.deb

opkg install ./libgstreamer0.10-0_0.10.36-1.5_amd64.deb

opkg install ./libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb

opkg install ./libwine-gecko-2.21_2.21+dfsg2-1_all.deb

opkg install ./libwine_1.6.2-20_amd64.deb --force-depends

opkg install ./x11-utils_7.7+2_amd64.deb --force-overwrite --force-depends

opkg install ./wine64_1.6.2-20_amd64.deb

opkg install ./wine_1.6.2-20_amd64.deb

I tried recreating these packages with the gzip compression so updating opkg wouldn't be necessary, but some of these had errors when reading the header text, with the newest stable release of opkg.  Also some times I would get Segmentation Faults and I would just uncompress, then recompress with gzip and it would work fine.

After this Wine 64 is now installed, and I can use "wine <program> <switches>" and it works.  There are some programs that appear to be command line programs but still try to call some Windows UI functions and won't work.  For these you can use "DISPLAY=:0 wine <application> <switches>" and it will work only if you have an embedded UI and it is enabled.  I'd like to get around this limitation at some point but we still have progress.

But the part that is still tricky is Windows 32 bit programs.  If I install the following things after installing Wine64, then Wine32 should be installed:

opkg install ./gcc-4.9-base_4.9.2-10_amd64.deb

opkg install ./libllvm3.5_3.5-10_amd64.deb --force-depends

opkg install ./libgl1-mesa-dri_10.3.2-1+deb8u1_amd64.deb --force-depends

opkg install ./wine32_1.6.2-20_i386.deb

But running wine in bash results in:

/usr/bin/wine: line 45: /usr/bin/wine32: No such file or directory

In the bin folder wine, wine32, and wine64 do exist (wine32 and wine64 look like links).  Even after a reboot I get this error.  I'll keep looking into this and trying to get the programs that use a GUI call, to work without enabling the embedded UI.

0 Kudos
Message 18 of 28
(2,740 Views)

So I thought maybe the reason 32 bit programs aren't working is because I'm missing some kind of 32 bit support.  You'll notice all the packages I installed were for the 64bit platform.  So I tried instead focusing on the 32 bit packages and installed these:

opkg install ./multiarch-support_2.19-18+deb8u4_amd64.deb

opkg install ./libwine-gecko-2.21_2.21+dfsg2-1_all.deb

opkg install ./libmpg123-0_1.20.1-2_i386.deb

opkg install ./libopenal-data_1.15.1-5_all.deb

opkg install ./libopenal1_1.15.1-5_i386.deb

opkg install ./zlib1g_1.2.8.dfsg-2+b1_i386.deb

opkg install ./libpcre3_8.35-3.3+deb8u4_i386.deb

opkg install ./liblcms2-2_2.6-3+b3_i386.deb

opkg install ./libglib2.0-0_2.42.1-1+b1_i386.deb

opkg install ./libgstreamer0.10-0_0.10.36-1.5_i386.deb

opkg install ./liborc-0.4-0_0.4.22-1_i386.deb

opkg install ./libgstreamer-plugins-base0.10-0_0.10.36-2_i386.deb

opkg install ./libwine_1.6.2-20_i386.deb

opkg install ./libedit2_3.1-20140620-2_i386.deb

opkg install ./x11-utils_7.7+2_i386.deb --force-depends --force-overwrite

opkg install ./libllvm3.5_3.5-10_i386.deb --force-depends

opkg install ./libgl1-mesa-dri_10.3.2-1+deb8u1_i386.deb --force-depends

opkg install ./wine32_1.6.2-20_i386.deb

opkg install ./wine_1.6.2-20_amd64.deb

But after all of this the same error is seen.

/usr/bin/wine: line 45: /usr/bin/wine32: No such file or directory

0 Kudos
Message 19 of 28
(2,740 Views)

You'd need 32-bit versions of all the standard OS libraries too -- libc, ld-linux, etc. etc. etc. I don't think that stuff automatically resolves just by having multiarch installed. You might be able to get some direction by using ldd (opkg install ldd; ldd /usr/bin/wine32). I'd have said 32-bit support was likely to end in doom or disappointment, but I'm encouraged by your 64-bit success and I'm not betting against it anymore.

By the way, somewhat offtopic for this forum, but did you know there is a cRIO that runs Windows natively? Would that be a better option for you? The cRIO-9082 has a Windows ordering option. It's an older model and "not recommended for new designs" so you'd want to check with your sales rep on life cycle etc., but it has decent performance (Core i7 CPU) and I figured I should mention it. Depending why you're using cRIO it might not work for you of course (for example it doesn't offer real-time determinism).

0 Kudos
Message 20 of 28
(2,739 Views)