Creating an X11 frame in mit-scheme + scmutils - mit-scheme

I am working through the book Structure and Interpretation of Classical Mechanics, which requires writing scheme code in mit-scheme for its exercises. I've installed scmutils, the scheme library provided with the book, and when I launch mit-scheme, the following items are listed:
Release 10.1.10
Microcode 15.3
Runtime 15.7
SF 4.41
LIAR/x86-64 4.118
SOS 1.8
XML 1.0
Edwin 3.117
X11 1.3
X11-Screen 1.0
ScmUtils Mechanics.Summer 2019
This seems to suggest that X11 support is enabled. However when I use the frame command to try and create a window for a plot,
(frame 0 :pi/2 0 5)
I get the error:
;Could not find plugin: "x11"
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1
This is on Linux with X11, with mit-scheme installed through the package manager (pacman) and scmutils downloaded from the book/course website.
Moreover, some other commands from scmutils that involve invoking X-windows, like show-expression (that generates DVI output from an input math expression and launches XDVI) work fine.
The install guide for mit-scheme says I need libx11-dev (or equivalent) installed if I want support for X11 graphics, but I downloaded the binary package from the repositories and I can't tell if it comes with X11 support.

Figured it out. The version of mit-scheme available in the Arch Linux repositories does not come bundled with the plugin x11 for X11 support, and it wasn't straightforward to add it manually.
Instead I downloaded the source from gnu.org and compiled it manually, then reinstalled scmutils on top for the SICM-specific features.

Related

`Haskell` extension for `VSCode` not working on `Linux`

I installed ghcup and:
Stack 2.9.1
HLS 1.8.0
cabal 3.6.2
GHC 9.2.5
All of them are the recommended versions(I verified it using ghcup tui). Then I installed the Haskell extension in VSCode. Unfortunately, it doesn't work. I get syntax highlighting (from the Haskell Syntax Highlighting extension, which seems to be automatically installed alongside the Haskell extension) but there is no Intellisense, no code completion, no error detection and no interactive mode (-->>> evaluation). I experimented with different folders and haskell files. The filetype is correct, because every time I open a .hs file, the Haskell extension checks for updates. I even installed Codium, because I suspected a fault in VSCode, but it was the same there as well.
The hsl language server doesn't seem to be working in Neovim, either. I uninstalled ghcup (ghcup nuke) and reinstalled again. The result is exactly the same. I prepended the PATH and chose vanilla and non-vanilla Stack integration in either installations.
Am I doing something wrong?
OS: Linux Mint on Ubuntu 20.04.1, kernel 5.15.0-56.
After around 10 tries, I managed to fix the problem. It turned out I had three problems:
I had only 12 GB free on my Linux partition, but it seems more are needed. I realised it, when it turned out some haskell-language-server files were missing. I enlarged my Linux partition (something I should have done months ago). The new installation installed all files
The Haskell Language Server HLS was not added to the PATH. I solved it by putting this snippet in ~/.ghcup/config.yaml:
"haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:$PATH"
}
The server was now discovered by the Haskell VS Code extension but crashed 5 times and gave up on trying. Restarting it manually didn't help. I opened the logs: View->Output->Haskell and saw the error:
haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by haskell-language-server-wrapper)
It turns out, my Linux Mint distribution uses GLIBC_2.31, not 2.32. This is a very important library, which most applications on the system use. If you are a newbie, it is strongly advised that you DO NOT update it manually.
Instead, what I did, was install a version of the HLS, which used GLIBC_2.31. This problem occured in September and was "fixed" but apparently not very well. There are two options:
download the HLS deb10 version manually (didn't work for me):
ghcup install hls -u https://downloads.haskell.org/~hls/haskell-language-server-1.8.0.0/h
download using ghcup tui HLS version 1.7.0.0 (or whatever newest, which uses your glibc version) and a GHC, which supports that particular version of the HLS (in my case 9.0.2).
I think it's a good idea to preemptively reinstall the extension, in case it used the PATH to configure the HLS, so that its settings are restored to default. It takes up to 20 seconds to initialize the server, so be patient. You can see what's happening in the Output window and verify there are no more errors.
I hope this helps.

why does the error regarding gcc is occuring in matlab?

I have download that code from github.
Whenever that code tries to check mexopencv (a file inside lib folder). It shows an error on Matlab 2017a that is:
[error 3] please make sure gcc >= 4.4 g++ >= 4.4 is installed ...
I am having a gcc version of 8.8.0
Following is the description of system
Window 10
Visual Studio 2012
Matlab 2017a
opencv 2.4.10
mexopencv (install from your folder LIB)
You might lack of standard libraries (.dll in Windows but .lib in Linux). The code was developed under Linux (help is also only provided for Linux systems) and once tested under Windows 7.
The method was tested under OS linux lubuntu 14.04, CPU intel i5 and
16GB of RAM. This guide was written under a linux-based distribution
scope, more precisely debian. Unfortunately we lack experience to
address bugs or any problem that could emerge in non-linux OS, we will
provide only linux OS help regarding execution problems, we apologise.
we tested this code on Windows7. We successfully installed opencv
2.4.10 following this tutorial: [http://www.learnopencv.com/install-opencv3-on-windows/]
This suggests that the mex-function is also linux-based. The error should vanish if you compile the source code yourself on your system, e.g. with MinGW (also GCC), see here.
EDITED:
the README.markdown file (under LIB/mexopencv-master.zip) provides a little guide through the installation process of both, openCV and the mexopencv function for unix (including ubuntu 14.04) and Windows systems. The latter states:
Browse to mexopencv root folder, and type the following in the MATLAB
command window:
>> mexopencv.make
By default, mexopencv assumes the OpenCV library is installed in
C:\opencv. If this is not the case, specify the path as an argument:
>> mexopencv.make('opencv_path', 'c:\your\path\to\opencv')
Note that if you build OpenCV from source, this path specification
might not work out of the box. You need to replace dll files in the
OpenCV package with newly built binaries. Or, you need to modify
+mexopencv/make.m to correctly link your MEX-files with the library.
To remove existing mexopencv binaries, use the following command.
>> mexopencv.make('clean', true)
It requires a standard C++ compiler supported by Matlab (see here), any Visual Studio installation should be OK, as an open-source option MinGW is recommended. Just remember to pick the right system (usually 64-bit).

Scheme Programming Language Support with Manjaro Arm?

I am trying out Manjaro Arm on my Raspberry Pi 3, but surprisingly find only Guile as the only viable Scheme interpreter/REPL.
I have tried the following:
Racket, and Mit-Scheme not found by pacman in the repositories.
Chicken Scheme seems to install, but will only run as the Chicken compiler, the csi REPL is MIA.
Chibi Scheme seems to compile and install fine (and make test ran fine before make install) but then crashes looking for a support file (libchibi-scheme.so.0).
Chez-Scheme is X86 centric, and no arm fork has been created yet. Historically older versions also ran on Sun SPARC. I did not try to compile or install it.
I would prefer a scheme REPL that is supported by Geiser, running within Emacs.
A couple of years later, and with a new install of Manjaro on a RPi4 (aarch64) I now have managed to install and get the following working:
Racket will compile from source. I had to use the "unix source" only, since "unix source + built packages" still crashed at the attempt at compiling. Compiling the full racket (including DrRacket) source took a few hours on the pi.
Chicken CSI is in the repositories under chicken-csi. A soft link in /usr/local/bin with the name csi fixes geiser's search for csi.
Exporting LD_LIBRARY_PATH as an env variable with the location of the chibi-scheme library ( /usr/local/lib/ by default ) makes chibi-scheme fully functional. Chibi-scheme compiled easily on the Rpi4.
Gambit Scheme seems to be in the repositories, although I have not played with it much.
Of course Guile 2.2 is in the repositories and works fine.

Matlab supportpackageinstaller not presemt

I have just installed a fresh copy of elementary OS freya in my lappy and after that did an installation of matlab R2012b. First I tried using the image acquisition commands but they didn't work as the library was not there. To install I typed
supportpackageinstaller
but it gave an error
Undefined function or variable 'supportPackageInstaller'.
This is the first time I am installing matlab on linux so I don't know how to solve the problem.
copied from: http://www.mathworks.com/matlabcentral/answers/88896-how-to-install-add-on
the supportPackageInstaller is a new feature in R2013b and doesn't exist in older releases than R2013b. Which version are you using? If its not 13b you need to look up the support package on the File Exchange. Only for example Simulink Support Package for Arduino Mega 2560 Hardware (R2012a)
refer to another:
http://148.204.81.206/simulink/ug/start-support-package-installer.html#
Start Support Package Installer
You can use Support Package Installer to install support for specific third-party hardware and software products.
Support Package Installer guides you through the process of downloading and installing a support package.
To start Support Package Installer, use one of the following methods:
In a MATLABĀ® Command Window, enter targetinstaller.
In a model, select Tools > Run on Target Hardware > Install/Update Support Package.
Double-click a *.mlpkginstall file.
On the MATLAB tool strip, click Add-Ons and select Get Hardware Support Packages.

How do you set up an x64 development environment based on gcc and eclipse?

I want to create 64 bit apps for (for example) 64 bit Windows 7. I've searched the web and found some help but couldn't get it to work.
Sorry I've taken so long to respond but I have tried to get the packages suggested to work but they're not easy or else I'm doing something wrong.
Anyway I ran across an environment called pellesc. It consists of a development environment around a compiler which traces is roots back to a 32-bit version that was once (according to Wikipedia) used to develop Quake. From what I've seen so far it's very promising and generates good code too!
In spite of what other people are saying, Eclipse actually has very good support for C++, even in Windows: check out the CDT project. It's very mature and well-supported -- it works for C/C++ at least as well as Eclipse JDT works for Java.
As for the compiler itself, VonC is right, MinGW-w64 (but the mingw-w64 project is moving to mingw-w64.org so i suggest to use mingw-w64.org) is the best option. Eclipse CDT has built-in support for MinGW so as long as you install MinGW first, Eclipse should automatically detect it.
This Eclipse MinGW64 tutorial mentions:
update (Nov 9, 2010): recent MinGW-w64 versions come with 'as', 'g++', and 'gcc' commands. This step may be unnecessary in your MinGW build.
Meaning you won't have anymore to update the GCC assembler, C++ compiler, C compiler and C++ linker, with 'x86_64-w64-mingw32-as', 'x86_64-w64-mingw32-g++', 'x86_64-w64-mingw32-gcc', and 'x86_64-w64-mingw32-g++'.
Other great source for w64 development tools:
Native windows x64 software develop with Mingw-w64 on drangon.org
A 64-bit version of GCC for Windows is available at http://tdm-gcc.tdragon.net/download. I can't see why you would want to use Eclipse for C or C++ programming - try the Code::Blocks IDE at http://www.codeblocks.org instead.
Honestly, I use cygwin. Its compatable with unix so you can easily move systems and has tons of functionality that is gcc friendly (autoconf, make, makedepends, ...). To use gcc to compile to 64 bit add the -m64 option. To compile for windows use the -mno-cygwin option. Make sure though that you're using gcc 3 and not 4 (then you'd use the mingw compiler series). Otherwise, its all the same as unix which is really useful.