
Racket Users virtual meetup 28 November
Platform to be decided; zoom / jitsi / ? - suggestions please — 30 Minutes 1pm Pacific Time 9pm UK time (contact me so we can work out when this is in your time zone)
— If this is problematic let me know
- this is intended to become a regular thing - maybe every 6–12 weeks
Kind regards
Stephen & Sam Phillips (Not posting in racket-news yet because really need feedback on what platform people prefer? Zoom/Jitsi /gather.town/or something else)

system-type
returns 'unix
, 'window
or 'macosx
. Is there a way to differentiate between Arch, Debian and Ubuntu?

On linux, uname -a
should give you most of the info you want. However, I can’t tell you how to parse it properly.


Are you Debian? What’s your output?

Linux <my-machine-name> 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

How about /etc/lsb-release ? I’m just about to check it give me a moment

lsb-release may not work with all distros IIUC

So for Ubuntu I can simply search for the string “Ubuntu”. That’s simple enough.

that should work I guess

uname -v
should actually be enough: #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020

uname -i
gives you the architecture: x86_64

It’s for flomat
turns Debian and Arch name the libraries differently (sigh).

sigh sigh indeed

Debian should also have the name Debian
somewhere in uname -v

Cool. So now I only need to check whether Arch behaves nicely as well.


Found on the internet: uname -r
Linux archlinux 4.16.13-2-ARCH

Maybe make sure to fail with an error in case neither Debian
, Ubuntu
and ARCH
are not found :wink:

Don’t count on that.

I am on arch: uname -r
5.8.12-arch1-1

So… the string is not necessarily archlinux
.

the other examples have ARCH
, not archlinux

but yeah, caps/no caps difference anyway.

I used “uname -a”. Downcased the string. Then searched for “arch”, “ubuntu” and “debian”.

That would work over here: ~ uname -a
Linux andromeda 5.8.12-arch1-1 #1 SMP PREEMPT Sat, 26 Sep 2020 21:42:58 +0000 x86_64 GNU/Linux

@soegaard2 Could there be a more straightforward (and maybe more general) way to solve your problem, that doesn’t involve the OS name?

I suppose I could distribute the actual library used, but not being on Linux I hesitate to do that.

I meant, checking for lib names directly

I think this arch1
is due to using a patched version of the kernel by arch. If I build a custom vanilla kernel, you might not see the string, even if I am on arch, so it doesn’t feel bullet proof btw.

Also a parameter holding the library name is probably a good idea - but I think I need the OS name to pick a reasonable default.

What about a more straightforward check: perform a simple operation on matrices to check whether the correct version on the library is installed. If not, output a meaningful error message saying how to resolve?

or even try to load a different lib if cblas_scopy
can’t be found?

That sounds good too. But I already committed the other approach :slightly_smiling_face:

(it just seems a little fragile)

Agree.

@feriattmac has joined the channel

Some years ago (5 or more?) there was an issue where Racket wanted a .so (for SSL??) that was named differently on both CentOS and Amazon Linux. I remember hacking an EC2 instance by just symlinking to the desired name.
But later that hack seemed unnecessary, it seemed fixed. I don’t know if it was resolved on the Racket end, or if so, how.
TL;DR There might be an example of how this sort of thing has been handled before, but my memory is vague.

@soegaard2 Maybe useful idk: https://github.com/racket/racket/blob/e71963c48b1292e9264b44405e52d8af9b65cb50/racket/collects/openssl/libcrypto.rkt

Sounds interesting, but what’s the specific topic or aim? Is it a get-together/chat or will there be a talk or specific theme for each gathering? FWIW, i did like the gather.town environment of RacketCon

@soegaard2 yeah, my suggestion would be to just add more and more versions and library names

This should be the correct answer, but apparently not all of the major linuxen could commit to actually making a uniform way to identify their platforms :face_with_rolling_eyes:

It was a 30 second search. I want to do flyby PR’s on the offending distros, but I know they will be ignored.

I’m thinking short ‘lightning’ talks(<5min), follows by discussion. Happy to go with what people think works best. I’m sure it will evolve.

has heard there are almost as many Linux distributions as there are flavors of BSD

has heard there are even more versions of BLAS

waits for someone to suggest using Cantor diagonalization

fetches popcorn

fortunately or unfortunately must leave to do a Zoom call

Emacs > Vim — there, I said it :wink:

:emacs:

You can use (system-type 'machine)
to get the same output as uname -a
without having to mess with external commands. But I agree with Sam, adding more version alternatives sounds like a better idea.

@ryanc I think (system-type 'machine)
only tells me it is a Linux machine. Not whether it is Arch, Debian or Ubuntu.

My problem is that some systems use libblas
and others libcblas
.

(different names for the same library)

Well, at least on Debian. I think the others have libblas
for the Fortran library and libcblas
for the C one. But them amount of different versions of BLAS makes everything confusing.

@kmallela has joined the channel

I get “Linux…Ubuntu SMP…” in my output.

Oh! I totally missed that (system-type machine)
returns a different result than (system-type 'machine)
. Now the comment @ryanc makes sense.

I’m guessing you meant (system-type)
vs. (system-type 'machine)
because (system-type machine)
gives an error for me.

Yep.

I have now changed the code to use (system-type 'machine)
instead of calling out to uname
.

Friday presentation coming up at work, another occasion to use glorious Slideshow. This time I want to pick a Matthew Butterick font. Does anyone have a favorite for use with Slideshow? There will be some Racket code in the presentation, a gentle intro to language-oriented programming.


I’ve tried so hard to be Vim-able. In IntelliJ, I’ve been giving Vim mode a fair trial. But honestly, after many months, I still find I do things faster when I use Emacs. IntelliJ’s Vim mode is complete, whereas its Emacs mode is fairly basic. I can function in Vim, but when I need to make a zillion changes quickly, I use Copy Path… in IntelliJ, go over to Emacs, and do the zillion edits I need to do quickly.

I actually love vim for most things (I do tons of ssh into remote machines type work). But for any Lisp code, etc. Emacs is just such a big win

It is good to know vi / vim, since by default it’s on every *nix machine.

About earlier — i think /etc/os-release might cover identifying most unix likes and distros.

Nice! That’s a great way to find the version also.

I haven’t used Emacs in ages, so when I need to make a zillion changes quickly I use vim :smile:

That’s great thanks!

Now I need to find out when everyone decided that would be a good idea.

(aha systemd, figures)

Probably only on machines with systemd
, may be useful to have a Racket interface to https://www.freedesktop.org/software/systemd/man/os-release.html

@cdep.illabout_slack has joined the channel

Triplicate T4s

I make extensive use of Emacs macros, and I often write Lisp functions to do combinations of things to save me work.

I have some code that compiles fine with raco make
using standard Racket 7.8, but fails on Racket CS. It still runs fine when executed directly under racket
with CS though. Here’s the backtrace, curious if this means anything to anyone? #<procedure>: arity mismatch;
the expected number of arguments does not match the given number
expected: 1
given: 2
compilation context...:
/Users/noah/Research/shiva-opentitan/opentitan.rkt
context...:
make-arity-exn
do-raise
dynamic-wind
start
dynamic-wind
do-compile-to-port
dynamic-wind
compile*-to-bytevector
make-jit-on-call
jitify-expr
jitify-let
jitify-expr
jitify-top-expr
loop
[repeats 2 more times]
thunk

Haven’t had a chance to cut down to a minimal example yet unfortunately (I’m dealing with a big chunk of gnarly autogenerated code), and don’t have any particular reason to use CS so will likely go back to standard. Just wondering if I’ve hit some known issue or something that might be an interesting bug!

I have managed to learn to do one thing properly in vim, quit. Always got stuck when using a new system, the thing starts vim by default and I have no idea how to get our of it, so I can finally export EDITOR=emacs
. :slightly_smiling_face: