Cannot generate LaTeX from Isabelle/HOL under Windows7 - windows-7

I have spent too many hours trying to generate a .pdf document out of my Isabelle theory Increments.thy. The Isabelle build command gets stuck and apparently this is an installation thing on Windows. Frustratingly enough, friends have done this on their linux machines and they experience no problems at all. But I cannot find the right documentation to get it going on my Windows 7 laptop. Does anyone have the recipe?
I have a full LaTeX installation on my laptop, working like a breeze. I have installed CYGWIN, but it gave problems with access rights of files, that I couldn't solve (neither from the windows-end, nor from the cygwin-end). I tried various manuals, without much luck.

With some hands-on help of the university of Innsbruck, I could finally generate a pdf from an Isabelle theory on my Windows-7 laptop. I'd like to share the result for the community at large. Here is what I did to make it work:
In Microsoft Explorer, I went to the directory that contains the Isabelle executables. This directory is called Isabelle2016-1.
I found it by searching for Isabelle2016-1 in the file system. It is on C:\Users\sjo\AppData\Roaming\local\bin\Isabelle2016-1.
I checked that it contains the file Cygwin-Terminal.bat.
I called the file Cygwin-Terminal.bat by double-clicking it.
This opens a command-line interpreter (CLI), which is the GNU Bash interpreter.
In this CLI, I navigated to the directory that contains my Isabelle source code, Increments.sty, by issuing the command:
$ cd /cygdrive/d/git/Publications/2017AFPproofs
I used the command ls -al to verify that this directory contains my Isabelle source code file Increments.thy.
I generated a pdf-file D:\git\Publications\2017AFPproofs\output\document\root.pdf by calling Isabelle:
$ isabelle build -v -D .
I checked the result in Microsoft Explorer and displayed it with my pdf-viewer.
That worked.

Related

Can't run any commands in zsh: "Command not found"

I am simply trying to set up a dev environment to code on my Windows 10 PC for use alongside my Mac when I need it.
I have installed Bash, Z shell and Node.js.
All I want to do, bare minimum, is simply:
Be able to run npm commands, etc. (npm install X)
Open files with appropriate programs from the terminal. (on Mac, I can run open index.html or atom .)
My problem: Literally no commands work. I can't run node -v, I can't do start index.html, I can't even open the current directory I'm in with explorer.
For every command, I receive an error: zsh: Command not found (:node/start/explorer/etc.)
I am guessing it has something to do with my PATH variables? I'm not sure; I'm relatively new...
Please help - I've spent four hours searching Google, Stack Overflow, page after page, but somehow can't find a solution.
Thanks.
Sounds like you have an 'eco-system challenge'... :)
Perhaps whatever tool you used to install the tools you mention:
did not do a complete install OR
requires a 'reboot' to enable all the goodies?
I suggest using a small footprint Linux OS in a VM for this type of tinkering; there are many challenges in using *nix tools on Windows - better to learn/experiment in a more Bash-friendly environment, and then, when comfy, bring the tool sets to another OS.
If you still want to give things a whirl:
locate your Bash binary
Right-click and select 'run as admin'
then use your favorite online Bash tutorial or book to explore...
:)
Dale

Regularly copying files from Windows to Bash Ubuntu

For my school work, I have to make sure that my programs compile on xterm (it's similar to bash). I work in Visual Studio on Windows and regularly FTP my code to a school server to test it. But, this is cumbersome because I have to log into FTP, upload the file, then use putty to connect to xterm on the school's server, and then compile and run the program. I can't even keep the putty connection open for very long because it disconnects and/or freezes after a while (maybe 30 mins).
So, I prefer to use ubuntu bash in Windows.
Here is the information that I have found so far:
1- you do not want to ever open up the ubuntu bash files from Windows explorer. Doing this can corrupt the files.
2- seems like reading the Windows files using vim is ok.
3- Microsoft seems to not support having one side (windows or bash) access files from the other side.
Here are my questions:
1- Is this the process that I should go through. (1) close Visual Studio; (2) open up Ubuntu bash; (3) copy the appropriate visual studio files to a directory in the Ubuntu bash directories using Ubuntu bash commands; (4) compile the program
Or, instead of step 3, can I just compile the program using the g++ command and referencing the files in the Windows directory?
2- Is the process that I laid out in 1 a bad idea given that we are dealing here with the beta version of bash ubuntu and that moving files between the 2 systems is not really supported? I suppose the alternative is to copy and paste the program from visual studio to vim. Also, I am mostly a tech newbie, with just a basic understanding of Windows and OSX for day to day use. I could do something that's less user error prone, like running a virtual machine (would upgrade my ram for that). Do you think that would be a better plan?
3- If I do copy files back and forth, I believe the command is cp /mnt/c/users/johnDoe/Documents/Visual Studio 2017/Projects/Project1/Project1/Source.cpp /~
So, in other words, the /~ will mean the main (top directory) in Ubuntu bash directory. I believe this directory is located somewhere in apps data. Does that command look correct (mainly questioning the /~ part)?

How to run Maxima from Windows command line

Have Maxima installed on Win10. No problem running wxMaxima and xMaxima via quick launch buttons.
But I'd like to occasionally open basic Maxima from Windows command line. So I'm looking for the maxima.exe file in order to add the path to the environment variables, such that just giving the command "maxima" at the command line opens 'er up.
But I'll be darned if I can find maxima.exe anywhere! wxMaxima.exe and xmaxima.exe are both there.
My Maxima files are at
C:\Program Files\Maxima-sbcl-5.38.0
...and I've looked everywhere underneath those directories for the maxima.exe executable, to no avail.
Yup, Maxima newbie here (he said unnecessarily!). Suggestions?
Start windows powershell:
Go when you have maxima installed, go inside bin folder and execute the maxima.bat file
PS C:\Program Files (x86)\Maxima-sbcl-5.38.1\bin> .\maxima.bat
Maxima 5.38.1 http://maxima.sourceforge.net
using Lisp SBCL 1.3.4
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) 2+2;
(%o1) 4
(%i2)
Then you can also add this folder tho the Path variable in Edit the system environment variables. and restart your powershell. Then you can execute maxima without going to that directory.

Find out where bash command definition is stored?

I used make/cmake for a project a while ago to build a command line tool, and I thought the binary was only executable while in that directory, but I just found out I'm able to call the command from any directory. This is troublesome because I'm having trouble building a newer project and I suspect this is related.
For example, I can run the command caffe train from a specific folder where I built the binary, but it turns out I can run caffe train from any folder, which I shouldn't be able to do. I could delete the binary, but the problem is that the command for it is stored and being called from somewhere, but I don't know where.
How can I find out where the definition for this command is stored? I examined my .bash_profile and looked at all the paths it listed, but I'm not seeing a relevant one. Is there another place I ought to be looking to find where command line tools are installed?
Ah sorry I just found out: Using type command gives where it is stored. Apparently whereis command should also do the same thing, though it gives me no output; for anyone else who has this problem, trying both would be good!

What to copy when moving cygwin from one machine to the other?

I'm reinstalling everything on my machine, and amongst those is Cygwin. I'm trying to avoid reinstallation, partly because I don't even know what it is that I've installed. Can I just move the Cygwin directory from one machine to another and expect everything to work, or are there some other important settings that I need to move as well?
As far as I saw, it's pretty self-contained, but one never knows.
Yep! Go for it. You won't encounter any problems.
You can just copy the entire cygwin directory to your new machine, open up the cygwin shell and everything (as long as you are only calling cygwin-internal programs and stuff that's within the path) will just work as if you you are working on your old machine.
The only thing you'll loose is the directory where the "already downloaded and compressed" packages for a possible re-installation are stored. Fortunately this directory is optional, so no problem for migration to another platform. You could copy that directory as well, but most likely all the packages that you have are outdated anyways and a run of setup.exe would fetch the new versions anyway...
Btw - since someone said exactly the opposite some real-life experience: I use this feature quite often with success. I've copied my cygwin dir to USB-sticks and used it on friends computers. I also copied it to the laptop of my fiance when we go to holidays and take a laptop with us.
It always worked without any problems....
The short answer is: No, you can't copy the whole Cygwin folder. You just copy the configuration files(bash files, vim file, etc.) you need.
The long answer is: If you copy the whole Cygwin folder, it may work in some case, and may not in some other case.
The reason is: you will lose linux file mode when copying files on Windows. And that will cause a lot of troubles. However, you may not have the troubles when you use Cygwin just like a common Windows Program(which means you don't care file mode and anything related), and run it as Windows Administrator(which is not required when Cygwin is installed as usual).
BTW: you can export the packages you installed by cygcheck.exe -c and install them on the new Cygwin. You can also install/update Cygwin packages by Cygwin's setup-x86_64.exe in command line like:
setup-x86_64.exe -q -P package1,package2,package3
No, you have to reinstall it from the cygwin installer, sorry!
Most importantly you'll want to copy everything from your home directory (default is c:/cygwin/home/) especially anything w/ a "." in front of the filename.
As for individual application preferences, etc., you may lose those -- but if you do the reinstall while you still have access to your old machine -- you can probably get to 90% of your previous install without too much trouble.
My experience with copying from one cygwin64 (I don't think there is a difference) to another machine is that all of the symbolic links got crushed:
As an example:
What used to be /usr/bin/cc -> /usr/bin/gcc.exe (or something like that)
After the copy /usr/bin/cc became a text file containing the string:
!<symlink>/usr/bin/gcc.exe
My method of copy was merely cp -r /cygwin/c/cygwin64 <dest>
My dest was a FAT32 FS, but I don't think that had anything to do with it.
There were also characters 0x00 and 0xFF sprinkled among many of these 'text' files so that they appeared to be binary.

Resources