Menu

#2841 Maxima 5.34.1 compilation for windows

None
closed
nobody
5
2021-02-16
2014-11-10
singerk
No

Problem gcc not properly pathed inside maxima.exe executable.
It occured on maxima 5.34.1 for windows when compiled with msys2 (see below for explanation why I used msys2).
Running e.g. wxMaxima and typing:

f(x):=x
compile(f)

then I get:
Compiling C:/Users/k/AppData/Local/Temp/gazonk_4132_0.lsp.
End of Pass 1.
End of Pass 2.
Maxima encountered a Lisp error:
SIMPLE-ERROR: (SYSTEM "gcc -c -Wall -fsigned-char -Wno-unused-but-set-variable -pipe -fno-zero-initialized-in-bss -mms-bitfields -march=i386 -I\"C:\PROGRA~2\MAXIMA~1.1\include\" -I\"C:\PROGRA~2\MAXIMA~1.1\lib\gcc-lib\mingw32\4.9.2\include\" -IC:/msys32/usr/local/lib/gcl-2.6.11/unixport/../h -O3 -c -w \"C:/Users/k/AppData/Local/Temp/gazonk_4132_0.c\" -o \"C:/Users/k/AppData/Local/Temp/gazonk_4132_0.o\"") returned a non-zero value 1.
Automatically continuing.
To enable the Lisp debugger set debugger-hook to nil.

also load(draw) gives:
Compiling /PROGRA~2/MAXIMA~1.1/share/maxima/5.34.1/share/draw/grcommon.lisp.
End of Pass 1.
End of Pass 2.
loadfile: failed to load C:/PROGRA~2/MAXIMA~1.1/share/maxima/5.34.1/share/draw/draw.lisp
-- an error. To debug this try: debugmode(true);

There seems to be a mingw path used: -IC:/msys32/usr/local/lib/gcl-2.6.11/unixport/../h

maybe this gives a hint to the problem.


Compiling maxima 5.34.1 for windows:

This was quite hard due to:
1) mingw from www.mingw.com works unstable on eg windows 7 64 bit. While working under windows 8.1 64 bit. But the generated gcl is unstable.
2) msys2 works very stable but the directory layout is different but I managed to document a way of compiling everything.

So I tried msys2 and managed to compile everything a detailed updated description (also on how to setup msys2) can be found here:
https://www.dropbox.com/s/zznrqob6x1z3krd/maxima_compile_msys2.0.txt?dl=0
The maxima 5.34.1 installer I generated is here:
https://www.dropbox.com/s/eoyvryv8ryg7i17/maxima-5.34.1.exe?dl=0
Also the full build environment for making a maxima can be found here:

It needs to be unzipped into c:\

call
"C:\msys32\autorebase.bat"
open msys2 shell:
"C:\msys32\mingw32_shell.bat"
cd into /home/k/maxima-5.34.1

Then go directly to point 12) of the build description I put on the dropbox (maxima_compile_msys2.0.txt)
You should content of the c:\maxima
folder before issuing a make install.

To simplify life with restructuring the files in the c:\maxima\wxMaxima folder
there is "wxMaxima - Kopie" finally just erase c:\maxima\wxMaxima and copy the wxMaxima - Kopie into wxMaxima.


Some other hints:
During build of maxima I have to issue twice make because the first run breaks with an error:
But the build problem seems to be related with this error massage during make. Which is only emited the first time make is called:

gcl -batch -eval '(progn (load "../lisp-utils/defsystem.lisp") (load "../lisp-utils/make-depends.lisp") (funcall (intern "CREATE-DEPENDENCY-FILE" :mk) (list "binary-gcl/maxima" "sys-proclaim.lisp") "gcl-depends.mk") )'

Warning:
SIMPLE-WARNING: REQUIRE is being redefined.
Warning:
SIMPLE-WARNING: ENSURE-DIRECTORIES-EXIST is being redefined.
rm -rf binary-gcl
touch sys-proclaim.lisp
make bd
make[2]: Verzeichnis „/home/k/maxima-5.34.1/src“ wird betreten
for l in gcl; do for d in / /numerical /numerical/slatec; do /usr/bin/mkdir -p binary-$l$d; done; done
make[2]: Verzeichnis „/home/k/maxima-5.34.1/src“ wird verlassen
gcl -batch -eval '(progn (load "generate-sys-proclaim.lisp"))'

Warning:
SIMPLE-WARNING: REQUIRE is being redefined.
Warning:
SIMPLE-WARNING: ENSURE-DIRECTORIES-EXIST is being redefined.
SIMPLE-ERROR: Lookup failed in directories:("/usr/local/lib/gcl-2.6.11/xgcl-2/"
"/usr/local/lib/gcl-2.6.11/lsp/"
"/usr/local/lib/gcl-2.6.11/gcl-tk/"
"/usr/local/lib/gcl-2.6.11/cmpnew/") for name SYSTEM::|../cmpnew/gcl_collectfn| with extensions (".o"
".lsp"
".lisp")

Discussion

  • singerk

    singerk - 2014-11-10

    here is the version info:
    wxMaxima version: 14.9.0
    Maxima version: 5.34.1
    Maxima build date: 2014-11-09 23:30:26
    Host type: i686-pc-mingw32
    Lisp implementation type: GNU Common Lisp (GCL)
    Lisp implementation version: GCL 2.6.11

     
  • singerk

    singerk - 2014-11-11

    Solved the problem thanks to David Billinghurst's help:

    There are some brief notes on gcc issues in INSTALL.win32
    http://sourceforge.net/p/maxima/code/ci/master/tree/INSTALL.win32

    The Windows installer for gcl-based maxima requires gcc and as.  The
    gcc
    files required depend on the version of gcc used. If compilation fails
    then some troubleshooting is required.
    
    One way to do this is to save the .c file generated by gcl:
      f(x):=x+2$
      :lisp (setq compiler::*keep-gaz* t)
      compile(f);
    then open a cmd window and run gcc from the command line.
    

    Most of my problems have been missing dlls, as each gcc version requires
    a different set of dlls

    Run the gcc installed with maxima as "c:\path\to\gcc -v
    c:\path\to\gazonk.c" and see if you get any errors or popup messages.
    Usually I have to add a dll to the install directory; sometimes a new
    executable is required.

    See if this helps.

     
  • singerk

    singerk - 2014-11-11

    Dear David,
    great! it worked I just copied
    exe and dll from :
    "C:\msys32\mingw32\libexec\gcc\mingw32\4.9.2\cc1.exe"
    "C:\msys32\mingw32\libexec\gcc\mingw32\4.9.2\liblto_plugin-0.dll"
    to c:\maxima\bin
    an all files from c:\msys\bingw32\bin into c:\maxima\bin

    Then it worked nicely. Thanks a lot.

    I know its a bit brute force and one could now use filemon to watch
    which files are really needed...

    A working maxima 5.34.1 installer for windows can be downloaded from:
    https://www.dropbox.com/s/eoyvryv8ryg7i17/maxima-5.34.1.exe?dl=0

     
  • Rene Hansen

    Rene Hansen - 2014-11-26

    I'm very happy that someone (singerk) will spend time and effort to compilers Maxima / wxMaxima for Windows. Unfortunately I have not experienced enough to do it.

    I have tried it out. At a first glance it seems to work.
    1) In the previous windows version (5.31.2-Windows) it was a new function that: When placing a wxMaxima notebook in the same diretory as the data files used, the data files could be loaded (read_matrix) without having to provide the full path to the data file (relative path). That was very nice! - this function dos not work in the new version - now I have to provide the full path again :-(
    2) When trying to save a large (1.7Mb) wxMaxima notebook, wxMaxima crashes and leave an 1kB emty file..

    Anyhow - thanks a lot for your effort

     
  • Leo Butler

    Leo Butler - 2021-02-16
    • labels: --> mingw, compile, msys2, Windows
    • status: open --> closed
     
  • Leo Butler

    Leo Butler - 2021-02-16

    I am closing this bug report as singerk indicates the problem was solved with the help of David Billinghurst.

     

Log in to post a comment.