|
From: | Dr . Jürgen Sauermann |
Subject: | Re: [EXTERNAL]Building GNU APL with clang |
Date: | Tue, 3 Oct 2023 14:16:50 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
Aha! I got it to build. In Termux, which currently uses clang-16:
After running ./configure,1. Add -std=gnu++11, rather than c++11, to src/Makefile and src/emacs_mode/Makefile CXXFLAGS;2. Add #include <pthread.h> to src/Thread_context.cc and change the call near line 49 from pthread_cancel(thread) to pthread_kill(thread, 0)
In regards to pthread_cancel() ...
I hope the following is not true: Termux (or Android beneath it) uses 'bionic libc' that does not implement pthread_cancel according to
https://github.com/termux/termux-app/discussions/2639
Some discussion about emulating it or replacing with pthread_kill(thread, 0) here: https://github.com/axel-download-accelerator/axel/issues/150
I don't know who or what to test to see what deleterious effects, if any, using pthread_kill() instead of pthread_cancel() will have on operation. However, the main prompt comes up and I can run basic APL expressions.
-Russ
On Mon, Oct 2, 2023 at 6:44 PM Callahan, Brian Robert <callab5@rpi.edu> wrote:
Hi Russ –
On OpenBSD, clang has been the default compiler for many years. I routinely build APL trunk on OpenBSD, and never had any problems so long as I add -std=gnu++11 to CXXFLAGS. I just rebuilt APL from a clean SVN checkout and it built without issues.
I am using clang-16.0.6. Not sure what version Termux uses these days.
~Brian
--
Brian Robert Callahan, Ph.D., CISSP, CCSP, SSCP, CC
Graduate Program Director, ITWS@RPI
Director, Rensselaer Cybersecurity Collaboratory
Office: Lally 304
From: bug-apl-bounces+callab5=rpi.edu@gnu.org <bug-apl-bounces+callab5=rpi.edu@gnu.org> On Behalf Of Russtopia
Sent: Monday, October 2, 2023 8:08 PM
To: bug-apl@gnu.org
Subject: [EXTERNAL]Building GNU APL with clang
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hello, See topic.
I would rather not, but in this case I am trying to re-build GNU APL in Termux on my newer Android phone, and Termux decided some time ago to remove gcc entirely from its packages, in preference to clang. :(
I am not up to date at all on modern C++, but this conversation on Stackoverflow suggests that auto_ptr is considered deprecated in newer C++ standards: https://stackoverflow.com/questions/69116001/how-do-i-re-enable-c17-removed-features-in-clang
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -Wno-deprecated-declarations -g -O2 -I /data/data/com.termux/files/home/gnuapl/trunk -c Listener.cc -o Listener.o >/dev/null 2>&1
network.cc:37:10: error: no member named 'auto_ptr' in namespace 'std'
std::auto_ptr<NetworkConnection> connection( (NetworkConnection *)arg );
~~~~~^
network.cc:37:19: error: 'NetworkConnection' does not refer to a value
std::auto_ptr<NetworkConnection> connection( (NetworkConnection *)arg );
^
Adding -std=c++11 to src/emacs-mode/Makefile CXXFLAGS got me past the auto_ptr issues, but then I hit issues with 'typeof()' in LineInput.cc:
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -I /data/data/com.termux/files/home/gnuapl/trunk -std=c++11 -g -O2 -I /data/data/com.termux/files/home/gnuapl/trunk -MT apl-Missing_Libraries.o -MD -MP -MF .deps/apl-Missing_Libraries.Tpo -c -o apl-Missing_Libraries.o `test -f 'Missing_Libraries.cc' || echo './'`Missing_Libraries.cc
LApack.cc:1784:37: error: unknown type name 'typeof'; did you mean 'typedef'? tau = reinterpret_cast<typeof(tau)> (work);
^~~~~~
typedef
LApack.cc:1784:43: error: expected a type tau = reinterpret_cast<typeof(tau)> (work);
^
LApack.cc:1784:37: error: type name does not allow storage class to be specified
tau = reinterpret_cast<typeof(tau)> (work);
^
Has anyone managed to build and successfully run GNU APL with clang?
-Russ
[Prev in Thread] | Current Thread | [Next in Thread] |