going to a new windows setup

7 views
Skip to first unread message

Roger Kaufman

unread,
Sep 28, 2023, 8:30:43 PM9/28/23
to anti...@googlegroups.com
Hi Adrian,

> I have pushed an update to the build.
>
> When building for Windows the two extra libraries are automatically
> linked.

Going to FreeGlut 3.4.0 have managed to be able to create the static
executables (.exe files) in Ubuntu for use in Windows. This is the
configure statement I used, and the static freeglut library was copied
as libfreeglut.a

CXX="x86_64-w64-mingw32-g++ -I/home/roger/freeglut-3.4.0/include
-L/home/roger/freeglut-3.4.0/cross-woe/lib -DFREEGLUT_STATIC \
-Wall -Wextra -static -static-libgcc -static-libstdc++ -Wl,-Bstatic
-lstdc++ -lpthread" \
./configure --host=x86_64-w64-mingw32 --with-freeglut


I'm not going to wait for Microsoft to solve the performance problem
with WSL2. So I did the procedure (option 3) to use C:/lhome as the home
directory external to WSL.

https://superuser.com/questions/1727140/wsl-2-0-ubuntu-relocating-home-directory

In kind, I also pointed Cygwin64 home to the same directory in
/etc/nsswitch.conf, although the end game is not to have to used Cygwin.

https://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation


Now I want to install antiprism in $HOME/.local instead of user local.
(/usr/local/ would still be affected by slow running executables so I
can't use it). To do this, I run to following from Virtualbox/Ubuntu to
install it on my d drive under d:/antiprism. It will be
d:/antiprism/usr/local

make DESTDIR=/home/roger/d/antiprism install-strip

Now I simply move the .exe files in that bin directory over to
c:/lhome/roger/.local/bin and the share directory over to
c:/home/roger/.local/share

I need no libraries. The executables run quickly.


I will probably retire Cygwin64 now. I will keep it around in case
something needs to be tested. One difference I discovered today is that
Cygwin is only up to Python3.9. This made it incompatible to run
antiprism_python on it and WSL2 which has Python3.10 while using the
same folders. This no longer matters, but I didn't know Cygwin was behind.

Roger

Roger Kaufman

unread,
Oct 23, 2023, 3:43:30 PM10/23/23
to anti...@googlegroups.com
Hi Adrian,

On 9/28/2023 8:31 PM, Roger Kaufman wrote:
> Now I want to install antiprism in $HOME/.local instead of user local.
> (/usr/local/ would still be affected by slow running executables so I
> can't use it). To do this, I run to following from Virtualbox/Ubuntu
> to install it on my d drive under d:/antiprism. It will be
> d:/antiprism/usr/local
>
> make DESTDIR=/home/roger/d/antiprism install-strip

Just for the record, I make this work directly now.

From my Virtualbox/Ubuntu they have the Windows C drive mounted as
/media/sf_C_DRIVE

I put comments in the shell script to annotate what it does
- makes the usr/local link in the $HOME directory
- does the make install-strip
- removes the usr/local link

Roger


#!/bin/bash -x

# cygwin would just take this:
#make DESTDIR=/media/sf_C_DRIVE/cygwin64/ install-strip

# make usr/local then return to original directory of execution
make_link() {
  pushd .

  # start out in home directory and make path to destination
  cd $HOME
  mkdir usr
  cd usr
  ln -s /media/sf_C_DRIVE/lhome/$USER/.local local

  popd
}

# remove link
del_link() {
  pushd .

  cd $HOME
  rm -rf usr

  popd
}

make_link

# make shuttles files as if it were /usr/local
# it does not need to be prefixed by sudo since .local is user owned
make DESTDIR=$HOME install-strip

#remove links
del_link

Roger Kaufman

unread,
Oct 25, 2023, 8:35:15 AM10/25/23
to anti...@googlegroups.com
Hi Adrian,

Just when I thought all was good with the WSL setup, it was not lol. (A
bit more frustrating than that but I'll not use any vernacular lol!)

The programs could not find see the ANTIPRISM_DATA directory. It turns
out (after several hours of debugging!) that as static programs, they
are not in the linux environment, rather they are in the Windows
environment! So for example in a c++ program, system('ls') isn't
recognized, but system('dir') is. This is where I discovered this,
though it isn't the exact question I was asking.

https://superuser.com/questions/1501478/wsl-is-not-recognized-as-an-internal-or-external-command

admittedly exe files are windows files so maybe I should have surmised
this :|


So here is a summery.

Static Programs (exe) needs Windows environment variable via the windows
system settings

ANTIPRISM_DATA as C:\lhome\roger\.local\share\antiprism

WSL2: programs see the variable
cygwin: programs see the variable

Dynamic programs (will work in native Ubuntu and WSL) variable set via
.bashrc

export ANTIPRISM_DATA=/mnt/c/$HOME/.local/share/antiprism

WSL2: programs see variable
cygwin: programs won't run

A couple of notes. The way I'm doing install, the symbolic link commands
are rejected. I had to do them manually

lrwxrwxrwx 1 roger roger      21 Oct 25 00:20 libantiprism.so ->
libantiprism.so.0.0.0
lrwxrwxrwx 1 roger roger      21 Oct 25 00:20 libantiprism.so.0 ->
libantiprism.so.0.0.0

Dynamic antiview would required installing opengl, etc, which I don't
want to deal with unless I need it for something else. I have read
briefly that some people are having trouble with opengl in wsl2 and need
to do some tweaking.

so... The static antiview.exe works so I keep that in another directory
and use that.

Roger




Roger Kaufman

unread,
Oct 26, 2023, 12:10:40 PM10/26/23
to anti...@googlegroups.com
To follow up

On 10/25/2023 8:35 AM, Roger Kaufman wrote:
> Dynamic Programs....
> cygwin: programs won't run

As should be expected, Cygwin is like a layer on top of Windows Command
Prompt.


The experiment of using same home directory for WSL2 and Cygwin was a
fail. I have reverted Cygwin to its legacy state, mostly for my reference.

I found that when compiling the antiprism .exe files under Cygwin, I was
being spoiled because those use the bash environment variables. That
difference in the two paradigms is what caused all the struggle.

Yet dynamic programs (non .exe) compiled for WSL2 do use the bash
environment variables. Now this is clear.

Roger

Roger Kaufman

unread,
Nov 2, 2023, 11:21:04 AM11/2/23
to anti...@googlegroups.com
Hi all,

On 9/28/2023 8:31 PM, Roger Kaufman wrote:
> I'm not going to wait for Microsoft to solve the performance problem
> with WSL2. So I did the procedure (option 3) to use C:/lhome as the
> home directory external to WSL.
>
> https://superuser.com/questions/1727140/wsl-2-0-ubuntu-relocating-home-directory

Windows has a way to set a directory as case-sensative such that A.off
and a.off can co-exist in the same folder. This is mentioned in the link
above. The linux file system has always been able to do this.

The problem I had is that if a directory is mixed case, it can't share
it on the local network with Window's share. There's no explanation
given, just an error message. I've had this question out on WSL forums
for some time with no response and there is little or no indication that
anyone else has tried it.

For the time being, I have gone with windows default non-posix
case-unsensitive directory structure. I am no unable to do these two
command in the same directory and have two files as a result.

conway bC > bC.off
conway BC > BC.off

I found a workaround using zip and unzip.

touch dummy.txt
zip output dummy.txt (bootstrap output.zip)

conway bC > bC.off; zip -u output bC.off
conway BC > BC.off; zip -u output BC.off

output.zip will now contain both files. And can be output to a pipe

unzip -p output bC.off | antiview
unzip -p output BC.off | antiview

This is the only time I've needed case-sensitivity; I had a script that
would run every conway operator on a seed. This would be a way to still
be able to do it using a zip file.

Roger
Reply all
Reply to author
Forward
0 new messages