soegaard2
2020-5-23 07:55:58

@jcoo092 Well, math/matrix being a functional library, there weren’t a way to do so. However other matrix libraries can do so. FWIW I think it would make more sense to benchmark the individual matrix operations. It makes it easier to compare apples-to-apples.


soegaard2
2020-5-23 07:56:39

I didn’t attempt to fix the Makefile, I just ran the benchmarks with (time ...).


soegaard2
2020-5-23 07:57:22

@jcoo092 About BLAS/LAPACK let’s ask @laurent.orseau how he installed it on Debian.


soegaard2
2020-5-23 07:57:58

Both BLAS and LAPACK are very old, so they exist in several variations.


soegaard2
2020-5-23 07:58:37

The original was written in Fortran and now there are a Fortran-based version and one based on the output of a Fortran-to-C compiler.


soegaard2
2020-5-23 07:59:06

I think the naming conventions differ: Some export names with a prefixed _ and some omit it.


soegaard2
2020-5-23 07:59:40

The Apple supplied libraries offer both (I think) - so maybe one needs to supply a flag when installing the library?


soegaard2
2020-5-23 08:01:11

I see in the comments, that macOS uses CBLAS (the C-version), so maybe there is a both a BLAS and a CBLAS package?


soegaard2
2020-5-23 08:04:21

@jcoo092 BTW - the benchmark you wrote using math/matrix might turn out to be significantly faster if you run it in #lang typed/racket instead. I can’t remember why, but at some point there were a problem with contracts that slowed things down when working with math/array which math/matrix uses. Maybe @samth knows whether things have improved.


joe
2020-5-23 08:07:46

Also how would I deal with e.g., logging the chat to disk if I used Universe. Would it be an expensive operation and need to write the whole chat window again every tick rather than append to e.g., a DB.


joe
2020-5-23 08:07:51

?


joe
2020-5-23 08:09:47

James Cooper. Thanks for the idea. I will ask her. Not sure exactly what her group does in the RP, but they don’t meet in person.


jcoo092
2020-5-23 08:10:20

Yip, I very much intend to get to trying out Typed Racket also :slightly_smiling_face: I wanted to get proper versions in regular Racket first (and I have to make sure that I actually have working programs in the other languages too)


laurent.orseau
2020-5-23 08:12:11

@jcoo092 I probably got these after installing scipy I guess, but otherwise you can probably install them with something like sudo apt install libblas liblapack. There seems to be a libopenblas too, not sure which is better


soegaard2
2020-5-23 08:25:08

@laurent.orseau @jcoo092 Rereading the error message “ffi-obj: couldn’t get "cblas_scopy” from “libblas.so.3” (/lib64/libblas.so.3: undefined symbol: cblas_scopy)" I think it means that “libblas.so.3” was found, but “cblas_copy” wasn’t in the library. From that name it is clear, that we are using the C-version. Using the scipy version might be a good idea - since they probably also make macOS and Windows versions.


jcoo092
2020-5-23 08:27:07

Yeah, that’s what it looks like. I’ve tried installing just about everything I can think of/find - I strongly suspect now that the issue might be that whatever goes searching for the dependency finds a version of libblas which doesn’t have cblas_scopy in it (the others all apparently are fine :confused: ).

I’ll need to work out how I can change the ordering of the search path.


soegaard2
2020-5-23 08:30:23

You can temporarily change the path on line 85 to an absolute path. The macOS path is absolute (the string-append was just to break the line). https://github.com/soegaard/flmatrix/blob/master/flmatrix.rkt#L85


soegaard2
2020-5-23 08:30:45

Also we need a way to list the symbols in a .so to check the names.


jcoo092
2020-5-23 08:31:00

Yeah… :thinking_face:


soegaard2
2020-5-23 08:31:42

I think nm -D <path-of-shared-library> ought to work.


soegaard2
2020-5-23 08:36:45

The Racket uses this process to find the shared library: https://docs.racket-lang.org/foreign/Loading_Foreign_Libraries.html It’s a bit complicated - shared libraries always are :disappointed:


soegaard2
2020-5-23 08:37:20

But (get-lib-search-dirs) in the repl should give you an idea where Racket looks first.


jcoo092
2020-5-23 08:38:53

I’m still not 100% sure on the details, but it turned out that I had both libblas and libcblas .so files installed. Changing the reference in flmatrix to libcblas seems to have worked ¯_(ツ)_/¯


laurent.orseau
2020-5-23 08:40:00

I do have libcblas too btw :slightly_smiling_face:


laurent.orseau
2020-5-23 08:40:03

strange


jcoo092
2020-5-23 08:40:08

Thanks @soegaard2 & @laurent.orseau :slightly_smiling_face:


laurent.orseau
2020-5-23 08:40:10

3.10


laurent.orseau
2020-5-23 08:40:40

Although: Debian science team maintainers have merged the CBLAS ABI into the libblas.so shared object. Everything you need from libcblas.so can be found in libblas.so . Please link your program against it instead. See also


laurent.orseau
2020-5-23 08:41:02

Seems specific to debian though


soegaard2
2020-5-23 08:41:57

So flmatrix ought to look for libcblas first and then libblas ? Or is there a way to tell Debian apart?


jcoo092
2020-5-23 08:41:58

Looks like mine are 3.8. I’m still on the Fedora distro before the current one, so probably mine aren’t 100% up to date. Regardless, I now know how to get this working so I can play around with it!


soegaard2
2020-5-23 08:43:57

As far as I know, the version of BLAS used on mac is very old, so 3.8 is fine.


laurent.orseau
2020-5-23 08:44:42

I think I have 3.8 on my other laptop also


soegaard2
2020-5-23 08:55:51

It is confusing. I can’t even find the exact version used by Apple :disappointed:


laurent.orseau
2020-5-23 08:56:49

Probably 3.apple


laurent.orseau
2020-5-23 09:10:14

I wish there was a linux distribution called Orange, just so I could say “In terms of distribution, you really can’t compare Apple’s to Orange’s”


soegaard2
2020-5-23 14:29:44

Whalesong is no longer maintained. I recommend using JavaScript in the browser and Racket on the server.


sam.halliday
2020-5-23 19:56:36

sorry for the late response, I’ve been playing dad for a newborn :slightly_smiling_face: … I finally managed to watch this talk and it was very interesting.


sam.halliday
2020-5-23 19:57:21

unfortunately it’s not really a diff of scheme and racket, so I think I’ll just read the rackett guide from cover to cover and try to figure out the differences myself


spdegabrielle
2020-5-23 20:33:37

Would a custom browser protocol for Racket be something that racketeers would find useful? e.g. being able to have a link like racket:<args> launch DrRacket Racket Mode and do something?


laurent.orseau
2020-5-23 20:38:27

Sounds like a fun attack vector ;)


spdegabrielle
2020-5-23 20:39:04

How?


spdegabrielle
2020-5-23 20:39:25

Or are you just being funny?


scolobb-slack
2020-5-23 21:41:23

@greg Just checked out the master of Racket Mode. Navigation in racket-xp-mode is considerably more fluid than in the previous version! Very nice :thumbsup:


spdegabrielle
2020-5-24 01:43:13

Congratulations (on the newborn)


pocmatos
2020-5-24 06:18:18

Hi, I am trying to understand my examples in scribble are not showing the expected output. Take for example a package providing struct foo: (struct foo (x) #:methods gen:custom-write [(define (write-proc self port mode) (match self [(foo x) (fprintf port "#~a#" x)]))]) then having in its documentation an example as follows: @(define fooeval (parameterize ([sandbox-output 'string] [sandbox-error-output 'string] [sandbox-memory-limit 50]) (make-evaluator 'racket/base #:requires (list 'foo-pkg)))) @examples[#:eval fooeval (foo 2) ] Unfortunately the documentation will show as output of the example: (foo 2) instead of #2#. Is this my fault or some sort of Scribble breaking the generic gen:custom-write method?