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

Port IRAF to several architectures #31

Merged
merged 7 commits into from
Apr 27, 2018
Merged

Port IRAF to several architectures #31

merged 7 commits into from
Apr 27, 2018

Conversation

olebole
Copy link
Member

@olebole olebole commented Apr 1, 2018

This PR is used as a proof that the current structure is portable. While the ports are not complete (no documentation, minimal testing), they show that we didn't loose flexibility while cleaning up.

List of ports:

  • FreeBSD intel 32 bit, freebsd - untested, but should work
  • FreeBSD intel 64 bit, freebsd64 - passes all tests
  • GNU Hurd intel 32 bit, hurd - passes all tests, created as Debian package
  • Debian Linux arm 32 bit, linux - passes all tests, created as Debian package
  • Debian Linux arm 64 bit, linux64 - passes all tests, created as Debian package
  • Debian Linux MIPS 32 bit, linux - little endian passes all tests, created as Debian package; big endian fails
  • Debian Linux MIPS 64 bit, linux64 - little endian passes all tests, created as Debian package; big endian untested (but will fail)
  • Debian Linux PowerPC 64 bit, linux64 - little endian passes all tests, created as Debian package; big endian untested (but will fail)
  • Debian Linux x32 ABI, linux - passes all tests, will be created as Debian package
  • Debian Linux zSystems 64 bit big endian, linux64 - failing tests, see below
  • Mac OS X PowerPC - removed: outdated, failing (big endian)

To avoid filling up the unix/ subdir with too many (rarely used) as.foo/ subdirs, all Linux archs are combined in two zsvjmp.S file (one for 32, one for 64 bit). See also this StackOverflow discussion about putting assembler for several architectures into one file. The freeBSD and Hurd subdirs are just links to the linux subdirs, so there is a chance that non-intel freeBSD ports will work as well.

As a side effect, we get propagated CFLAGS and LDFLAGS, which is nice to provide distribution specific changes during packaging.

@olebole olebole added the Not to merge Pull requests that shall stay open, but will probably not merge label Apr 1, 2018
@olebole olebole force-pushed the local/porting branch 2 times, most recently from 6b3369b to 9defb5a Compare April 2, 2018 11:57
@olebole olebole added enhancement and removed Not to merge Pull requests that shall stay open, but will probably not merge labels Apr 2, 2018
@olebole olebole changed the title Port IRAF to several architectures WIP: Port IRAF to several architectures Apr 2, 2018
@olebole
Copy link
Member Author

olebole commented Apr 2, 2018

Remark to big endian systems

It seems that 32-bit big endian support was lost somewhere during the 64-bit port. 64-bit big endian systems were never supported by IRAF.

IBM zSystems (s390x)

the following comment may help:

sys/osb/i32to64.c
sys/osb/i64to32.c
    Imported int 32/64 pack/unpack from IRAF64 code.  Note these are 
    MACHDEP on Intel byte order!

The failing test is

cl> imarith image.short / 1 image.real pixtype=r
cl> imarith image.short / 1 image.dbl pixtype=d
cl> imhead image.*
image.dbl.fits[512,512][double]: m51  B  600s
image.real.fits[512,512][real]: m51  B  600s
image.short.fits[512,512][short]: m51  B  600s

followed by

cl> minmax image.dbl,image.real,image.short
image.dbl [77,4] -1. [348,189] 19936.
image.real [77,4] -1. [348,189] 19936.
image.short [77,4] -1. [348,189] 19936.

Output
======
cl> minmax image.dbl,image.real,image.short
    image.dbl [77,4] -1. [348,189] 19936.
    image.real [1,1] 0. [1,1] 0.
    image.short [77,4] -1. [348,189] 19936.

which means: creation of a double precision floating point worked, but single precision not.

@olebole
Copy link
Member Author

olebole commented Apr 8, 2018

Pinging @lupinix for a review -- this PR may me the base to include other architectures for Debian/Ubuntu as well as for Fedora. Does this fit your needs wrt. other archs?

@olebole olebole force-pushed the local/porting branch 8 times, most recently from 628fa7d to ac2e144 Compare April 9, 2018 12:14
@olebole olebole changed the title WIP: Port IRAF to several architectures Port IRAF to several architectures Apr 12, 2018
Note that big endian systems (MIPS, S390x) don't work in the
moment. There were probably some bugs introduced during the 64-bit
support.
Rename them to zsvjmp.S to run them through the preprocessor,
add machine specific #ifdefs

Not working:

 - s390x (Big Endian)
 - MIPS big endian, PPC64 big endian (little endians work)
 - x32 (unknown reason)
Instead of hardcoding "linux"/"macosx" to "-m32", the "-m32" flag must
be given now as "CARCH" environment variable when starting make.

This allows cross compilation on non-intel platforms that don't
provide -m32.
@lupinix
Copy link
Collaborator

lupinix commented Apr 25, 2018

Tested with Fedora, I also get the expected failures for the big endian architectures. In general you've taken all architectures into account which are supported by Fedora. Thanks!

@olebole olebole merged commit 14ac424 into master Apr 27, 2018
@olebole olebole deleted the local/porting branch April 27, 2018 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants