Hello Peter,
While I need to do more (learning and) testing, I think I have managed
to get a build with an apparently working ⎕PLOT without ⎕GTK, but ⎕PLOT
segfaults if I try to add ⎕GTK to the build. Also, I included ⎕FFT and
⎕SQL, but I'm pretty sure that ⎕SQL doesn't work either (but I haven't
tried it yet).
I really know very little about how all this stuff works, so if my Cargo
Cult coding is poor, that's why. Embarrassment risk notwithstanding, let
me share what I've tried thus far. I have the full terminal log from the
--with-gtk3 option, let me know if you would like me to send it.
Hopefully there is some useful learning buried in this report. I have to
get back to my day job, so I'm putting this down for a few days.
/John
GNU-APL Build Notes
Please also know that I'm very unfamiliar with the autoconf stuff and
really only understand OS X through the lens of traditional Unix and
Linux systems. Put another way, I'm pretty much a newbie. So here it goes:
1) build a clean OS X Mojave VM using VMWare fusion
2) cd to_a_workPlace; git clone https://git.savannah.gnu.org/git/apl.git
3) download and installed XQuartz from (https://www.xquartz.org/)
4) installed fftw from http://www.fftw.org/download.html
5) Install GTK3 from scratch from
(https://wiki.gnome.org/Projects/GTK/OSX/Building) I didn't use the
MacPorts version b/c I wanted as few changes to the virgin OS X
environment as possible, I'll try this next; I'm sure it will be easier
than a full compile of GTK (30+ min)
6) Misc snags and learnings:
6.1) Mojave puts sqlite3.h in
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr"
6.2) Configure /HARD CODES/ the path for pkg-config as
/usr/bin/pkg-config.
Because of SIP, this is very inconvenient. Being lazy, I edited
configure to call pkg-config via a shell variable defined as:
export PATH_PKG_CONF=`which pkg-config`
and changed the TWO calls in config from
if test -x /usr/bin/pkg-config ; then # we have pkg-config
to
if test -x $PATH_PKG_CONF ; then # we have pkg-config
6.3 !!!! Added #include <sys/time.h> to
~/apl-gitsvn/trunk/src/Gtk/Gtk_server.cc
to redress:
Gtk_server.cc:579:4: error: use of undeclared identifier 'gettimeofday'
__sem_init(drawarea_sema, /* pshared */ 0, 1);
^
./../Common.hh:166:20: note: expanded from macro '__sem_init'
timeval tv; gettimeofday(&tv, 0); \
^
1 error generated.
7) Do the build
$> cd ~/tmp/apl-gitsvn/trunk/
$> jhbuild shell #do this for access to gtk
$> export CXXFLAGS="-I/opt/X11/include/ -I/usr/local/include/
-I/Users/jlh/gtk/inst/include/gtk-3.0"
$> export LDFLAGS="-L/opt/X11/lib/ -L/Users/jlh/gtk/inst/lib"
$> ./configure
--with-sqlite3="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr"
--with-gtk3
$> make
$> # etc...
The result?
⎕PLOT +⌿1 0J1×[1]1 2 ∘.○ (0,⍳2×N) × ○÷N←10
===================================================
SEGMENTATION FAULT
----------------------------------------
-- Stack trace at main.cc:94
----------------------------------------
0x0 @@@@
0x0 @@@@
0xA @@@@
0x0 @@@@
0x0 @@@@
0x0 @@@@
0x0 @@@@
0x0 @@@@
0xF @@@@
0xC @@@@
0x0 @@@@
0x0 @@@@
0xA @@@@
========================================
====================================================
Goodbye.
Session duration: 61.5801 seconds
bash-3.2$
6) Do the build again, but this time w/o GTK3, and ⎕PLOT works
⎕PLOT +⌿1 0J1×[1]1 2 ∘.○ (0,⍳2×N) × ○÷N←10
123145385943040
On 3/21/21 7:30 AM, Dr. Jürgen Sauermann wrote:
Hi Peter,
1. most ⎕-functions have no dependencies. All remaining dependencies
are (ideally) determined by ./configue. The result of that is
stored in
config.h by ./configure and you can easily check it with:
*grep HAVE_ config.h*
in the top-level directory (and after ./configure).
2. To see who cares for what you can then:
*grep HAVE_ src/*hh src/*cc**
*
3. of all *HAVE_* macroa shown, only the following ones are related
to ⎕-functions /in some way/:
*src/Quad_RVAL.hh:#if HAVE_LIBC**
**src/Quad_RE.hh:#ifdef HAVE_LIBPCRE2_32**
**src/Plot_xcb.cc:#if HAVE_LIBX11 && HAVE_LIBXCB && HAVE_LIBX11_XCB &&
HAVE_X11_XLIB_XCB_H**
**src/Quad_FFT.cc:#if defined(HAVE_LIBFFTW3) && defined(HAVE_FFTW3_H)**
**src/Quad_PLOT.cc:# if defined( HAVE_LIBX11 )**
**src/Quad_PLOT.cc:# if defined( HAVE_LIBXCB )**
**src/Quad_PLOT.cc:#i**
**src/Quad_RE.cc:#if HAVE_LIBPCRE2_32*
which boils down to ⎕RVAL, ⎕RE, ⎕FFT, and ⎕PLOT being dependent on
additional libraries,
4. Not all libraries are always needed, though. For example:
⎕PLOT can switch between GTK3 and XCB and then uses the better (=
GTK3) of them,
⎕SQL adapts itself to different SQL providers SQLITE3 and POSTGRES
and then uses all of them,
The HAVE_ macros are not only used to control the behaviour of
⎕-functions but to deal
with platform differences in general. Forr that reason there are more
HAVE_ macros than
optional libraries.
5. The*./configure* script not only *#define*s or *#undef*s the
*HAVE_* macros in *config.h *but
also manipulates the compiler and linker flags in the various
Makefiles. So that at the end
of the day only existing librariees and header files are being used in
the build process.
6. The test for libraries and header files themselves are located in
either *configure.ac* (from
which *./configure* is created) or in one of the *m4/*.m4* files
(which are all included by *configure.ac*).
The test are the point where the build preferences of the user are
combined with the existing
libraries. A well-supported library comes with a *.m4* file that
checks its installation. Most of the
autoconf magic happens here, the rest above is only the results of the
magic.
Best Regards,
Jürgen
On 3/20/21 8:45 PM, Peter Teeson wrote:
Hi Jürgen:
It does indeed
Gandalf:~ pteeson$ pkg-config --version
0.29.2
I will look into installing GTK 3, re-builing & testing, and will
report back.
Homebrew has installer for version 3 for Mojave, Catalina, and Big Sur.
<https://formulae.brew.sh/formula/gtk+3#default
<https://formulae.brew.sh/formula/gtk+3#default>>
I have a question though -
How do I find out what the dependancies are for the various add-on
System Quad functions?
respect….
Peter
On Mar 19, 2021, at 3:41 PM, Dr. Jürgen Sauermann
<m...@xn--jrgen-sauermann-zvb.de
<mailto:m...@xn--jrgen-sauermann-zvb.de>> wrote:
Hi Peter,
for GTK you need gtk+-3.0, The version on your box looks too old.
Does Apple support *pkg-config*? In that case (and if *gtk+3* is
installed)
then *./configure* should find everything and *pkg-config* should
say (e.g.):
*eedjsa@server68:~$ pkg-config --cflags gtk+-3.0 **
**-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo
-I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng16 -I/usr/include/freetype2
-I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/libpng16 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include**
**eedjsa@server68:~$ pkg-config --libs gtk+-3.0 **
**-lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0
-lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0
-lglib-2.0**
*
Best Regards,
Jürgen
On 3/19/21 5:12 PM, Peter Teeson wrote:
Thanks very much J_ürgen.._
_
_
build log shows
~/Desktop/ForJohn.txt:207: checking for gtk_init in -lgtk-3... no
locate shows
/usr/local/opt/gtk
/usr/local/opt/gtk+
I don’t recall when or why I installed these libs. Maybe because
Doxygen required one or the other.
Anyhow it doesn’t really matter why they are there; my ./configure
needs fixing if I want to use ⎕PLOT.
Since ⎕PLOT is an “extra” to APL I will file this thread so I can
remember these libs are needed.
My understanding of ./configure is that all of these additional
System functions are included by default in the build process.
In this case it was only when trying to plot that the issue surfaced.
Well we learned a lot.
respect
Peter
On Mar 19, 2021, at 8:41 AM, Dr. Jürgen Sauermann
<m...@xn--jrgen-sauermann-zvb.de
<mailto:m...@xn--jrgen-sauermann-zvb.de>> wrote:
Gentlemen,
I suppose all you need is to tell *./configure* where to find the
additional include
and library files for X11, e.g.:
*CXXFLAGS="-I /an_extra_include_path -I /another_include_path" \**
**LDFLAGS="-L /an_extra_library_path -L /another_library_path" \**
**./configure <your-configure-options>**
*
Note that \ is THE trailing character in the first two lines (so
that the above
becomes a single line) and that there are NO whitespace before =.
Then check the output of *./configure *as to if all relevant
components
for *⎕PLOT* were found:
*checking xcb/xcb.h usability... yes**
**checking xcb/xcb.h presence... yes**
**checking for xcb/xcb.h... yes**
**checking X11/Xlib.h usability... yes**
**checking X11/Xlib.h presence... yes**
**checking for X11/Xlib.h... yes**
**checking X11/Xlib-xcb.h usability... yes**
**checking X11/Xlib-xcb.h presence... yes**
**checking for X11/Xlib-xcb.h... yes**
**checking X11/Xutil.h usability... yes**
**checking X11/Xutil.h presence... yes**
**checking for X11/Xutil.h... yes**
*
Note also that *xcb* has some issues with Unicode characters that make
in particular APL characters in window titles and inside the plot
windows
unreadable. Try to use GTK3 instead.
Best Regards,
Jürgen
On 3/19/21 3:52 AM, Peter Teeson wrote:
P.S. Gandalf:~ pteeson$ ls -al /usr/X11
lrwxr-xr-x 1 root wheel 8 9 Jul 2020 /usr/X11 -> /opt/X11
Gandalf:~ pteeson$ ls -al /opt/X11
total 0
drwxr-xr-x 9 root wheel 288 27 Sep 2016 .
drwxr-xr-x 3 root wheel 96 26 Sep 2016 ..
drwxr-xr-x 128 root wheel 4096 9 Jul 2020 bin
drwxr-xr-x 4 root wheel 128 29 Oct 2016 etc
drwxr-xr-x 19 root wheel 608 9 Jul 2020 include
drwxr-xr-x 204 root wheel 6528 9 Jul 2020 lib
drwxr-xr-x 4 root wheel 128 26 Oct 2016 libexec
drwxr-xr-x 14 root wheel 448 27 Sep 2016 share
drwxr-xr-x 5 root wheel 160 27 Sep 2016 var
On Mar 18, 2021, at 10:32 PM, Peter Teeson <peter.tee...@me.com
<mailto:peter.tee...@me.com>> wrote:
Hi John:
Same issue here…(svn 1410) on Mojave 10.14.6.
I have copied the list.
⎕PLOT ''
SYNTAX ERROR+
⎕PLOT ‘'
I searched the bug-app archives and there was a bunch of emails
last summer about missing X11.
<https://lists.gnu.org/archive/html/bug-apl/2020-08/msg00000.html
<https://lists.gnu.org/archive/html/bug-apl/2020-08/msg00000.html>>
<— read this
Never use ⎕PLOT myself. But I did find X11 in my build log:
checking for XGetXCBConnection in -lX11-xcb... no
checking for XOpenDisplay in -lX11... no
When I do locate X11 in Terminal I get this
/opt/X11
/usr/X11
So maybe that’s the issue?
Need to fix $PATH for GNU APL build??
respect
Peter
On Mar 18, 2021, at 4:25 PM, John Helm <jh...@usa.net
<mailto:jh...@usa.net>> wrote:
Hello Peter -
Please forgive me in advance for reaching out directly, but I
fear I have a local problem and don't want to spam the list.
I just tried your clone suggestion below and it fails for me...
* I built a VMware Fusion virtual machine with a clean
install of Mojave 10.14.6
* Installed the XCode command line tools
* Ran: git clone https://git.savannah.gnu.org/git/apl.git
* cd trunk, followed by./configure, make, sudo make install
* Installed the apl keyboard and tested with⎕plot '', which
returns a syntax error instead of the ⎕plot message.
I have repeated this exercise with High Sierra and Catalina on
physical machines with the same result.
Also, I performed a MacPorts install on High Sierra and
Catalina on physical machines; again, with the same result.
I spend much of my time in OS X command shell (iTerm2, to be
specific) and seldom have this much difficulty doing builds.
Nonetheless, I'm okay with being guilty of user-error until
proven innocent. In any case it seems clear that something
big-and-basic is wrong.
Would you be willing to send me the console log of one of your
successful builds? This would let me do a diff against my build
logs and possibly give me some clues as to what I'm doing wrong.
Kind regards,
John
On 3/7/21 9:59 PM, Peter Teeson wrote:
Hi Jürgen:
As promised a brief update note.
On a clean install of macOS Mojave 10.14.6 I confirm that using
git clone https://git.savannah.gnu.org/git/apl.git
<https://git.savannah.gnu.org/git/apl.git> just works.
And with the default settings the Terminal waltz builds clean.
And APL executes.
My hardware is an Early 2009 Mac Pro and so far there has
never been a need
to patch the installer from 2009 Snow Leopard 10.6 thru to
2018 Mojave 10.14.
I did apply a patch to the firmware to make it a 5,1 from the
original 4,1.
Will look into whether it’s reasonable to install Catalina and
Bug Sur.
respect
Peter