#7982 closed defect (fixed)
sage_fortran is not working properly on Open Solaris x64 in 64 bit mode
Reported by: | Jaap Spies | Owned by: | David Kirkby |
---|---|---|---|
Priority: | major | Milestone: | sage-4.5 |
Component: | porting | Keywords: | |
Cc: | David Kirkby | Merged in: | sage-4.5.alpha0 |
Authors: | Jaap Spies, David Kirkby | Reviewers: | David Kirkby, Jaap Spies |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
The fortran-20071120.p9.spkg does not build well on Open Solaris 64 bit. It defaults to 32 bit.
What is the way to go?
1) try to build g95 from src
or
2) export SAGE_FORTRAN='path to gfortran'
export SAGE_FORTAN_LIB='path to lib/amd64/libgfortran.so
I all cases there must be a way to inserting the compiler option -m64 in sage_fortran.
For now I went for 2) and edited the file by hand.
jaap@opensolaris:~/Downloads/sage-4.3.1.rc0$ cat local/bin/sage_fortran #!/bin/sh /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/bin/gfortran -m64 -fPIC $@
Jaap
Attachments (1)
Change History (19)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Also, be aware -m64 is not universally used to support the building of 64-bit binaries. It is better to use $CFLAG64, where CFLAG64 will be set in sage-env.
It is difficult enough porting Sage to Solaris. Let's not make life any more difficult for someone that wants to port it to something else. Hard-coding flags will certainly do that.
Dave
comment:3 Changed 13 years ago by
Authors: | → Jaap Spies |
---|---|
Description: | modified (diff) |
Status: | new → needs_review |
Summary: | sage_fortran on Open Solaris 64 bit is the wrong thing → [with spkg, needs review] sage_fortran on Open Solaris 64 bit is the wrong thing (solved) |
The new fortran-20100118.spkg made it easy #7485 (g95 is gone) just use gfortran.
Setting SAGE_FORTRAN and SAGE_FORTRAN_LIB to the right files, e.g. export SAGE_FORTAN_LIB='path to lib/amd64/libgfortran.so
The patched spkg can be found here: http://boxen.math.washington.edu/home/jsp/ports/fortran-20100118.p0.spkg
Jaap
comment:4 Changed 13 years ago by
Cc: | David Kirkby added; drkirby William Stein removed |
---|
comment:5 Changed 13 years ago by
Status: | needs_review → needs_work |
---|---|
Summary: | [with spkg, needs review] sage_fortran on Open Solaris 64 bit is the wrong thing (solved) → sage_fortran is not working properly on Open Solaris x64 in 64 bit mode. |
This is not working correctly. It is copying a 32-bit version of the Fortran libary to SAGE_ROOT/local/lib
First, I delete any library, and set SAGE_FORTRAN_LIB correctly:
drkirkby@hawk:~/sage-4.3.1$ rm local/lib/libgfortran.so rm: local/lib/libgfortran.so: No such file or directory drkirkby@hawk:~/sage-4.3.1$ export SAGE_FORTRAN_LIB=/usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/amd64/libgfortran.so
Now install the package
drkirkby@hawk:~/sage-4.3.1$ ./sage -f fortran-20100118.p0 Force installing fortran-20100118.p0 Calling sage-spkg on fortran-20100118.p0 <SNIP> Successfully installed fortran-20100118.p0 Now cleaning up tmp files. rm: Cannot remove any directory in the path of the current working directory /export/home/drkirkby/sage-4.3.1/spkg/build/fortran-20100118.p0 Making Sage/Python scripts relocatable... Making script relocatable Finished installing fortran-20100118.p0.spkg
It claims to have built, yet there is still a 32-bit library copied.
drkirkby@hawk:~/sage-4.3.1$ file local/lib/libgfortran.so local/lib/libgfortran.so: ELF 32-bit LSB dynamic lib 80386 Version 1, dynamically linked, not stripped
There is no 64-bit version in any of the subdirectories either, though it needs to be put in local/lib.
drkirkby@hawk:~/sage-4.3.1$ file local/lib/64/libgfortran.so local/lib/64/libgfortran.so: cannot open: No such file or directory drkirkby@hawk:~/sage-4.3.1$ file local/lib/amd64/libgfortran.so local/lib/amd64/libgfortran.so: cannot open: No such file or directory drkirkby@hawk:~/sage-4.3.1$
I forget what the command is, but I send it to you the other day, which will allow the correct directory to be determined. It will return one of sparcv9 or amd64, though I would suggest not hard-coding them, as that might change in future. In particular on SPARC.
PS, when you fix this, update SPKG.txt to have the correct trac number (#7982) against the entry. Dave
comment:6 Changed 13 years ago by
Status: | needs_work → needs_review |
---|
Made a new spkg:
http://boxen.math.washington.edu/home/jsp/ports/fortran-20100118.p0.patch
jaap@opensolaris:~/Downloads/sage-4.3.3.alpha1$ cat local/bin/sage_fortran #!/bin/sh /usr/local/gcc-4.4.2/bin/gfortran -m64 -fPIC $@
And on hawk:
-bash-3.2$ file local/lib/*fortran* local/lib/libgfortran.so: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped -bash-3.2$
Jaap
comment:7 Changed 13 years ago by
Sorry the spkg is here:
http://boxen.math.washington.edu/home/jsp/ports/fortran-20100118.p0.spkg
Jaap
comment:8 follow-up: 9 Changed 13 years ago by
Authors: | Jaap Spies → Jaap Spies, David Kirkby |
---|
Your package works fine, so I would give it positive review. However, since you produced this, sage_fortran has been updated, so I created a new .spkg and put it here
http://boxen.math.washington.edu/home/kirkby/patches/fortran-20100523.spkg
comment:9 Changed 13 years ago by
Replying to drkirkby:
Your package works fine, so I would give it positive review. However, since you produced this, sage_fortran has been updated, so I created a new .spkg and put it here
http://boxen.math.washington.edu/home/kirkby/patches/fortran-20100523.spkg
Ok, as we are both mentioned as author, we need to find a reviewer :)
Jaap
comment:10 Changed 13 years ago by
Reviewers: | → David Kirkby, Jaap Spies |
---|---|
Status: | needs_review → positive_review |
Dave,
The best way out seems to be: you review my part and I review your changes.
As you gave my package a positive review, I give your spkg a positive review.
I'll do this right now!
Jaap
comment:11 Changed 13 years ago by
That does seem quite logical in this case.
- You made the change, which I checked and agreed with.
- I just rebased it, in light of another package.
- You have checked my changes.
So all done!
dave
comment:12 Changed 13 years ago by
Merged in: | → sage-4.5.alpha0 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
comment:13 Changed 13 years ago by
Summary: | sage_fortran is not working properly on Open Solaris x64 in 64 bit mode. → sage_fortran is not working properly on Open Solaris x64 in 64 bit mode |
---|
comment:14 follow-up: 17 Changed 13 years ago by
I noticed a problem with the updated spkg-install
on t2. If SAGE64
is not set to "yes"
, I get
$ cat local/bin/sage_fortran
#!/bin/sh
comment:15 Changed 13 years ago by
The following seems to work
if OS == "sunos" and os.environ.get("SAGE64") == "yes": f.write("%s -m64 -fPIC $@"%name) else: f.write("%s -fPIC $@"%name)
but I have not tested it with SAGE64="yes"
.
comment:16 Changed 13 years ago by
That does work with SAGE64=yes.
drkirkby@hawk:~/2/sage-4.5.alpha0$ cat local/bin/sage_fortran
#!/bin/sh /usr/local/gcc-4.4.4-multilib/bin/gfortran -m64 -fPIC $@
After that, if I try to build lapack, the object files it creates are 64-bit
./spkg/build/lapack-20071123.p1/src/SRC/shseqr.o: ELF 64-bit LSB relocatable AMD64 Version 1
comment:17 Changed 13 years ago by
Replying to mpatel:
I noticed a problem with the updated
spkg-install
on t2. IfSAGE64
is not set to"yes"
, I get$ cat local/bin/sage_fortran #!/bin/sh
I've created #9346 to address this issue, which is quite serious as it totally breaks Sage on Solaris.
Do you want to create the patch and I review it? If you don't have time, I can create it and get someone else to review it.
Dave
I tried that approach, but it did not work for all packages - I forget what one it is, but at least one will not accept the shell script.
The way to go is to get into the spkg, and edit that to include $CFLAG64. That will then be set to -m64 (for 64 bit builds with gcc), unset for 32-bit builds with gcc, and whatever else is neeeded for 64-bit builds with other compilers.
Either use a modified version of sage-env, or simply set CFLAG64 to -m64 for now.
Ultimately, the packages need to be fixed - not the compiler.
Dave