ChezScheme icon indicating copy to clipboard operation
ChezScheme copied to clipboard

Could I compile without X11 and ncurses?

Open linghutf opened this issue 9 years ago • 7 comments

My environment didn't permit use the libx11-dev,ncurses,is there anyway not to use them?

linghutf avatar Jul 20 '16 05:07 linghutf

comment out this line in version.h

#define LIBX11 "/usr/X11R6/lib/libX11.dylib"

Haofei avatar Aug 27 '16 04:08 Haofei

@Haofei I use Linux,the way is set

#define LIBX11 "/usr/xxx/libX11.so"

?

linghutf avatar Aug 29 '16 01:08 linghutf

X11 and ncurses are only needed for the expression editor, so in theory, if you disabled the expeditor feature, you should be able to compile without them and have the full functionality of the compiler and runtime. You can even use the repl, but you won't have the handy editing features that the expression editor provides (documented in the Chez Scheme User's Guide here. I've done this in the past for environments that didn't support ncurses.

The problem you'll likely run into is that if you try to build on a system without X11 and ncurses that supports the expression editor by default, like 64-bit Linux (i.e., a6le), in loading the pre-built boot file, it will attempt to load the expression editor and fail out. In my case, I got this:

"Error in foreign-procedure: no entry for ~s ("(cs)ee_init_term")

Unfortunately, I think you'll need to do your build on a machine that does have X11 and ncurses and move the boot files from that machine to your target. I got it to work starting from a 64-bit Linux machine (a6le-host) building for a 64-bit Linux VM with no X11 or ncurses (a6le-target). Here's roughly the steps I used:

[On a6le-target]

a6le-target:ChezScheme$ ./configure a6le-target:ChezScheme$ cd a6le/c a6le-target:ChezScheme/a6le/c$ make

[on a6le-host]

a6le-host:ChezScheme$ ./configure a6le-host:ChezScheme$ ./make a6le-host:ChezScheme$ ./workarea a6le a6le-no-ee a6le-host:ChezScheme$ cd a6le-no-ee/s a6le-host:ChezScheme$ vim machine.def [change the "(features iconv expeditor)" line at the end of the file to "(features iconv)"] a6le-host:ChezScheme/a6le-no-ee/s$ make -f Mf-cross base=../../a6le m=a6le xm=a6le a6le-host:ChezScheme/a6le-no-ee/s$ scp ../boot/a6le/*.boot a6le-target:ChezScheme/a6le/boot/a6le/

[On a6le-target]

a6le-target:ChezScheme/a6le/c$ ../bin/a6le/scheme -b ../boot/a6le/petite.boot -b ../boot/a6le/scheme.boot

cjfrisz avatar Oct 12 '16 21:10 cjfrisz

Edit ./c/version.h

  1. replace all #define LIBX11 "libX11.so" with /* #define LIBX11 "libX11.so" */
  2. replace all #define LIBX11 "/usr/X11R6/lib/libX11.dylib" with /* #define LIBX11 "/usr/X11R6/lib/libX11.dylib" */

Now you can build Chez Scheme without X11.

yunlingz avatar Jun 29 '18 03:06 yunlingz

I've posted a short note about this on #325, but just to follow up here, I believe it should be possible to build without ncurses by disabling the expression editor. This is a more involved change, unfortunately, and it requires that you have a machine available with ncurses on it to build a boot file that does not expect to find the expression editor, at least in its current incarnation. This is because both the Scheme and C side of the code expect to interact with each other to implement the expression editor.

akeep avatar Jun 29 '18 14:06 akeep

Update: New PR #331 , add an option --disable-x11 to configure, which allows you to build Chez Scheme with X11 disabled

yunlingz avatar Jun 29 '18 16:06 yunlingz

Looks like the X11 portion of this issue was resolved, but is there still an open issue for building when ncurses is not available?

jltaylor-us avatar Jun 08 '21 22:06 jltaylor-us

The configure script now supports --disable-curses, so probably this can be closed.

mflatt avatar Nov 21 '23 20:11 mflatt