Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LoongArch. #371

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Add support for LoongArch. #371

merged 2 commits into from
Jan 29, 2024

Conversation

liuxiang88
Copy link
Contributor

The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style.

Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html

@olebole
Copy link
Member

olebole commented Jan 23, 2024

Thank you for this patch! I am happy to see this port!
I have just two remarks: First, the change in cfitsio.h is almost obsolete, as we are going to remove cfitsio from IRAF (#330 is ready for merge, just kept open for discussion with NOIRLAB).
And could you add the CPU type to INSTALL.md as well?

@olebole olebole self-requested a review January 26, 2024 09:17
Copy link
Member

@olebole olebole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An attempt to build IRAF on LoongArch failed on Debian:

cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -I/<<PKGBUILDDIR>>/unix/hlib/libc -D_GNU_SOURCE -DNOVOS -Wdate-time -D_FORTIFY_SOURCE=2  -c -o zgmtco.o zgmtco.c
In file included from /usr/include/linux/stat.h:5,
                 from /usr/include/loongarch64-linux-gnu/bits/statx.h:31,
                 from /usr/include/loongarch64-linux-gnu/sys/stat.h:465,
                 from zfiond.c:5:
/usr/include/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
    5 | #include <asm/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[4]: *** [<builtin>: zfiond.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [<builtin>: zfmkdr.o] Error 1
In file included from /usr/include/signal.h:301,
                 from zpanic.c:5:
/usr/include/loongarch64-linux-gnu/bits/sigcontext.h:30:11: fatal error: asm/sigcontext.h: No such file or directory
   30 | # include <asm/sigcontext.h>
      |           ^~~~~~~~~~~~~~~~~~
compilation terminated.
[…]

Full build log here.
Could you fix this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in cfitsio should be omitted here, since we are going to remove cfitsio soon.

@liuxiang88
Copy link
Contributor Author

liuxiang88 commented Jan 29, 2024

I just spent some time to confirm that this error is because the current version of linux-libc-dev on the buildd has not yet been merged into the patch to fix this problem.It can be resolved with a lower version of the kernel, 6.6.9-1+loong64 for now.

@olebole
Copy link
Member

olebole commented Jan 29, 2024

Because I have no access to a loonghorn machine, I would wait until we see a successful build on Debian. Alternatively, could you attach a build and test log from a build if you tested it?

@liuxiang88
Copy link
Contributor Author

I see.Here is my local build log.

complete-debian-build-iraf.log
test-result.log

@olebole
Copy link
Member

olebole commented Jan 29, 2024

Thank you very much! I will merge it once I finished with the NOIRLAB changes.

@liuxiang88
Copy link
Contributor Author

OK,thank you very mach!

@olebole olebole merged commit 4e960f5 into iraf-community:main Jan 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants