jsoftware / jsource

J engine source mirror
Other
645 stars 91 forks source link

clang detection should not depend on spelling of cc #130

Closed rdm closed 1 year ago

bilam commented 2 years ago

As you had reported in another thread, the J source can only be built correctly using clang, so that the proposal change is not urgent.

rdm commented 2 years ago

I do not recall having said any such thing?

But this proposed change is about using clang command line options when clang is /usr/bin/cc so if it is actually the case that J source can currently only be built correctly using clang, I would imagine that that would add some urgency to this proposed change.

bilam commented 2 years ago

In your message to source forum /quote/ I am trying to compile J (on a nonavx linux system -- celeron processor), and I'm running into a memory alignment issue.

Specifically, test/g022.ijs triggers a segmentation fault, and when compiling, I'm getting a variety of warnings that the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6 /end quote/

I can reproduce the same compilation failure using gcc 8.0, I guess I can workaround the issue but not yet decided. If it is really decided that only clang will ever be supported, then there is no need to detect compiler. Just state clearly in documentation that the source must be compiled with clang. If users want to experiment with other compilers , they will be on their own.

rdm commented 2 years ago

I don't think that that issue generalizes to all jsource contexts, since it was an architecture specific issue (noavx x86_64 on linux).

HenryHRich commented 2 years ago

Beneath Bill's explanation lies the fact that some of the testcases don't run when the system is built with gcc.  For the nonce, I am the primary troubleshooter & I don't have gcc, so we don't know why these testcases fail.  If you or someone else could find that out, we would be happy.  Until then, we don't have much motivation to fix yet another thing that fails only under gcc.

Henry Rich

On 3/7/2022 4:11 AM, bilam wrote:

In your message to source forum /quote/ I am trying to compile J (on a nonavx linux system -- celeron processor), and I'm running into a memory alignment issue.

Specifically, test/g022.ijs triggers a segmentation fault, and when compiling, I'm getting a variety of warnings that the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6 /end quote/

I can reproduce the same compilation failure using gcc 8.0, I guess I can workaround the issue but not yet decided. If it is really decided that only clang will ever be supported, then there is no need to detect compiler. Just state clearly in documentation that the source must be compiled with clang. If users want to experiment with other compilers , they will be on their own.

— Reply to this email directly, view it on GitHub https://github.com/jsoftware/jsource/pull/130#issuecomment-1060368270, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKVAJ4QZOEAAVVSKMZTW33U6XB4VANCNFSM5QAHMPSA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- This email has been checked for viruses by AVG. https://www.avg.com

rdm commented 2 years ago

If you have a recent windows box, you can run linux, using the wsl command (Windows Subsystem for Linux). Here's how I did it on my windows 10 (21H1) box:

Administrator command prompt (rebooting as requested by system):

wsl --install wsl --install -d Debian wsl

This got me a command line running linux with windows as the host operating system. The version was a version of debian stretch, which is a bit dated (2017). To upgrade it to the current version, I needed to enable network connectivity for wsl in windows firewall, which I used the windows gui for, but I think that that's easy enough to search how to do, and then in wsl

sudo su - apt update apt upgrade vi /etc/apt/sources.list # change 'stretch' to 'buster' on all three lines apt update apt upgrade apt dist-upgrade vi /etc/apt/sources.list # change 'buster' to 'bullseye' on all three lines apt update apt upgrade apt dist-upgrade

I went with batch upgrade when I was prompted about that (which installs everything with default options).

And then: apt install gcc make binutils less clang

update-alternatives cc to switch /usr/bin/cc between gcc and clang

I might be forgetting something, you can email me if it's anything important.

HenryHRich commented 2 years ago

Thanks for the instructions, but you misunderstand me.  I have no interest in running gcc.

Henry Rich

On 3/7/2022 8:09 AM, Raul Miller wrote:

If you have a recent windows box, you can run linux, using the wsl command (Windows Subsystem for Linux). Here's how I did it on my windows 10 (21H1) box:

Administrator command prompt (rebooting as requested by system):

wsl --install wsl --install -d Debian wsl

This got me a command line running linux with windows as the host operating system. The version was a version of debian stretch, which is a bit dated (2017). To upgrade it to the current version, I needed to enable network connectivity for wsl in windows firewall, which I used the windows gui for, but I think that that's easy enough to search how to do, and then in wsl

sudo su - apt update apt upgrade vi /etc/apt/sources.list # change 'stretch' to 'buster' on all three lines apt update apt upgrade apt dist-upgrade vi /etc/apt/sources.list # change 'buster' to 'bullseye' on all three lines apt update apt upgrade apt dist-upgrade

I went with batch upgrade when I was prompted about that (which installs everything with default options).

And then: apt install gcc make binutils less clang

update-alternatives cc to switch /usr/bin/cc between gcc and clang

I might be forgetting something, you can email me if it's anything important.

— Reply to this email directly, view it on GitHub https://github.com/jsoftware/jsource/pull/130#issuecomment-1060669561, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKVAJ5HPFUT54PAXDAXISTU6X5Z5ANCNFSM5QAHMPSA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- This email has been checked for viruses by AVG. https://www.avg.com

bilam commented 2 years ago

I suspect you can't really fix it unless you have a branch that doesn't use avx thus emu_avx need not running. I think I can eventually fix the issue and JE can be built with gcc, but just as what you had said we have no motivation for that.

On Mon, 7 Mar 2022 at 8:52 PM HenryHRich @.***> wrote:

Beneath Bill's explanation lies the fact that some of the testcases don't run when the system is built with gcc. For the nonce, I am the primary troubleshooter & I don't have gcc, so we don't know why these testcases fail. If you or someone else could find that out, we would be happy. Until then, we don't have much motivation to fix yet another thing that fails only under gcc.

Henry Rich

On 3/7/2022 4:11 AM, bilam wrote:

In your message to source forum /quote/ I am trying to compile J (on a nonavx linux system -- celeron processor), and I'm running into a memory alignment issue.

Specifically, test/g022.ijs triggers a segmentation fault, and when compiling, I'm getting a variety of warnings that the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6 /end quote/

I can reproduce the same compilation failure using gcc 8.0, I guess I can workaround the issue but not yet decided. If it is really decided that only clang will ever be supported, then there is no need to detect compiler. Just state clearly in documentation that the source must be compiled with clang. If users want to experiment with other compilers , they will be on their own.

— Reply to this email directly, view it on GitHub https://github.com/jsoftware/jsource/pull/130#issuecomment-1060368270,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEKVAJ4QZOEAAVVSKMZTW33U6XB4VANCNFSM5QAHMPSA . Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- This email has been checked for viruses by AVG. https://www.avg.com

— Reply to this email directly, view it on GitHub https://github.com/jsoftware/jsource/pull/130#issuecomment-1060655078, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMDKYMJDIUPWNM3FFKAFPTU6X32LANCNFSM5QAHMPSA . You are receiving this because you commented.Message ID: @.***>

rdm commented 2 years ago

Well, anyways, this patch makes it easier to run clang on certain machines.

bilam commented 2 years ago

on 32-bit raspberry pi running wheezy, cc is symlinked to gcc and pi@raspberrypi ~ $ gcc --version gcc (Debian 4.6.3-14+rpi1) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

pi@raspberrypi ~ $ cc --version cc (Debian 4.6.3-14+rpi1) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.