Hello,
First, congratulations to the Polyml 5.5 developpers !
To give it a serious try, I need to compile poly for various architectures, in both 32 bit and 64 bit versions.
I could successfully compile the 64 bit version for MacOSX on my macbook (that compiles in 64 bits by default), but I failed to build a 32 bit version of poly on that machine. I tried various configure options, like --build=i386-apple-darwin10.8.0, and adding -m32 to CFLAGS, CXXFLAGS and LDFLAGS, but with no success so far :-(
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
Any hints ?
Regards, Bernard.
Hi Bernard, Sorry about the problems you had posting this.
On 25/09/2012 20:55, Bernard Berthomieu wrote:
To give it a serious try, I need to compile poly for various architectures, in both 32 bit and 64 bit versions.
I could successfully compile the 64 bit version for MacOSX on my macbook (that compiles in 64 bits by default), but I failed to build a 32 bit version of poly on that machine. I tried various configure options, like --build=i386-apple-darwin10.8.0, and adding -m32 to CFLAGS, CXXFLAGS and LDFLAGS, but with no success so far :-(
I have a feeling that this needs a combination of options. Makarius sent me a script to do this so he may be able to shed a bit more light on it but this is what I managed to find.
--build=i686-darwin CFLAGS='-arch i686 -O3 -I../libffi/include' CXXFLAGS='-arch i686 -O3 -I../libffi/include' CCASFLAGS='-arch i686 -O3'
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
David
On Wed, 26 Sep 2012, David Matthews wrote:
Makarius sent me a script to do this so he may be able to shed a bit more light on it but this is what I managed to find.
Here is a dynamic reference to the Isabelle-way of building Poly/ML. The "tip" will change whenever there is an update on the repository: http://isabelle.in.tum.de/repos/isabelle/file/tip/Admin/polyml
My current build script for Poly/ML 5.5.0 is this http://isabelle.in.tum.de/repos/isabelle/file/11bcea724b2c/Admin/polyml/buil...
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
I used to have the same ambition to support all possible platforms, but gave up on Solaris OS, Sparc and PPC CPU some years ago. We now do everything uniformly for x86_64 and x86 on linux, darwin, windows (via cygwin).
Makarius
On 9/26/12 3:35 PM, Makarius wrote:
My current build script for Poly/ML 5.5.0 is this http://isabelle.in.tum.de/repos/isabelle/file/11bcea724b2c/Admin/polyml/buil...
Nice ! I might borrow your script :-)
I used to have the same ambition to support all possible platforms, but gave up on Solaris OS, Sparc and PPC CPU some years ago. We now do everything uniformly for x86_64 and x86 on linux, darwin, windows (via cygwin).
We left ppc and sparc too. The only reason for solaris x86 is that we still have some Sun HPC servers around still worth to use.
Bernard.
On Wed, 26 Sep 2012, Bernard Berthomieu wrote:
On 9/26/12 3:35 PM, Makarius wrote:
My current build script for Poly/ML 5.5.0 is this http://isabelle.in.tum.de/repos/isabelle/file/11bcea724b2c/Admin/polyml/buil...
Nice ! I might borrow your script :-)
You are welcome.
One detail worth noting is Linux: there are no options in the script, because the diversity of Linux distributions makes it difficult to do this uniformly. Instead I run the script on an actual x86 and x86_64 Linux, respectively, without any ambitions for "cross-compilation".
This is done on a standard Linux distribution that is neither too old nor too new, presently Ubuntu 10.04 LTS. It then has a high chance to work by accident on most other Linux versions that users might have, usually without knowing about the details themselves. (Surprisingly many Linux users do not even know if they have 32 or 64 bit under the hood.)
Further explanations of the Isabelle multiplatform approach is here: http://isabelle.in.tum.de/repos/isabelle/file/11bcea724b2c/Admin/PLATFORMS
Makarius
Hello,
I have a feeling that this needs a combination of options. Makarius sent me a script to do this so he may be able to shed a bit more light on it but this is what I managed to find.
--build=i686-darwin CFLAGS='-arch i686 -O3 -I../libffi/include' CXXFLAGS='-arch i686 -O3 -I../libffi/include' CCASFLAGS='-arch i686 -O3'
Thanks Dave and Makarius, this solves the problem for 32 bit MacOSX.
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
Well, I tried, along the same lines:
--build=x86_64-solaris and --build=amd64-solaris CFLAGS='-m64 -O3 -I../libffi/include' CXXFLAGS='-m64 -O3 -I../libffi/include' CCASFLAGS='-m64 -O3'
But I get an error when building: elfexport.cpp: In member function `virtual void ELFExport::exportStore()': elfexport.cpp:365: error: `R_X86_64_64' undeclared (first use this function)
Solaris 11 has sys/elf_386.h and sys/elf_amd64.h, the latter defining R_AMD64_64, but elf_amd64.h is not loaded to in elfexport.cpp ...
Looks like 64 bit solaris requires some tweaking of configure and changes to elfexport.cpp. I'll try to understand the issues later.
Thanks again, Bernard.
Hello,
I have a feeling that this needs a combination of options. Makarius sent me a script to do this so he may be able to shed a bit more light on it but this is what I managed to find.
--build=i686-darwin CFLAGS='-arch i686 -O3 -I../libffi/include' CXXFLAGS='-arch i686 -O3 -I../libffi/include' CCASFLAGS='-arch i686 -O3'
Thanks Dave and Makarius, this solves the problem for 32 bit MacOSX.
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
Well, I tried, along the same lines:
--build=x86_64-solaris and --build=amd64-solaris CFLAGS='-m64 -O3 -I../libffi/include' CXXFLAGS='-m64 -O3 -I../libffi/include' CCASFLAGS='-m64 -O3'
But I get an error when building: elfexport.cpp: In member function `virtual void ELFExport::exportStore()': elfexport.cpp:365: error: `R_X86_64_64' undeclared (first use this function)
Solaris 11 has sys/elf_386.h and sys/elf_amd64.h, the latter defining R_AMD64_64, but elf_amd64.h is not loaded to in elfexport.cpp ...
Looks like 64 bit solaris requires some tweaking of configure and changes to elfexport.cpp. I'll try to understand the issues later.
Thanks again, Bernard.
On 26/09/2012 13:28, Bernard Berthomieu wrote:
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
Well, I tried, along the same lines:
--build=x86_64-solaris and --build=amd64-solaris CFLAGS='-m64 -O3 -I../libffi/include' CXXFLAGS='-m64 -O3 -I../libffi/include' CCASFLAGS='-m64 -O3'
But I get an error when building: elfexport.cpp: In member function `virtual void ELFExport::exportStore()': elfexport.cpp:365: error: `R_X86_64_64' undeclared (first use this function)
Solaris 11 has sys/elf_386.h and sys/elf_amd64.h, the latter defining R_AMD64_64, but elf_amd64.h is not loaded to in elfexport.cpp ...
Looks like 64 bit solaris requires some tweaking of configure and changes to elfexport.cpp. I'll try to understand the issues later.
From the comment near the top of elfexport.cpp it seems that there is an explicit inclusion of sys/elf_386.h if it is present:
// Solaris seems to put processor-specific constants in separate files #ifdef HAVE_SYS_ELF_SPARC_H #include <sys/elf_SPARC.h> #endif #ifdef HAVE_SYS_ELF_386_H #include <sys/elf_386.h> #endif
Does it work if you add #include <sys/elf_amd64.h> just after that (without any ifdef)? If so it would be easy for me to fix.
David
On 9/26/12 5:47 PM, David Matthews wrote:
Well, I tried, along the same lines:
--build=x86_64-solaris and --build=amd64-solaris CFLAGS='-m64 -O3 -I../libffi/include' CXXFLAGS='-m64 -O3 -I../libffi/include' CCASFLAGS='-m64 -O3' .....
From the comment near the top of elfexport.cpp it seems that there is an explicit inclusion of sys/elf_386.h if it is present:
// Solaris seems to put processor-specific constants in separate files #ifdef HAVE_SYS_ELF_SPARC_H #include <sys/elf_SPARC.h> #endif #ifdef HAVE_SYS_ELF_386_H #include <sys/elf_386.h> #endif
Does it work if you add #include <sys/elf_amd64.h> just after that (without any ifdef)? If so it would be easy for me to fix.
make goes much further then. Here are the last 30 lines printed:
Making STRUCT Created functor STRUCT Created structure Struct Making Conversions Making CONVERSIONS Created signature ForeignExceptionSig_Import Created functor CONVERSIONS Created structure Conversions Making StructConversionals Making STRUCT_CONVERSIONALS Created functor STRUCT_CONVERSIONALS Created structure StructConversionals Created structure CInterface /bin/sh ./libtool --tag=CC --mode=link gcc -DSOLARIS -Wall -fno-strict-aliasing -m64 -O3 -I../libffi/include -I../libffi/include -o poly polyexport.o libpolymain/libpolymain.la libpolyml/libpolyml.la -lpthread -lgmp -lsocket -lnsl -lm -ldl -lstdc++ -lgcc_s -lgcc libtool: link: gcc -DSOLARIS -Wall -fno-strict-aliasing -m64 -O3 -I../libffi/include -I../libffi/include -o .libs/poly polyexport.o libpolymain/.libs/libpolymain.a -lstdc++ libpolyml/.libs/libpolyml.so -L/usr/sfw/lib/amd64 -lpthread -lgmp -lsocket -lnsl -ldl /usr/sfw/lib/amd64/libstdc++.so -lm -lgcc_s -lgcc -R/home/bernard/local/polyml/i86pc-64/lib -R/usr/sfw/lib/amd64 ld: fatal: file polyexport.o: section .rel.data has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.text has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.data has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.data has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.data has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.text has invalid type [ SHT_REL ] ld: fatal: file polyexport.o: section .rel.data has invalid type [ SHT_REL ] ld: warning: file /usr/sfw/lib/amd64/libstdc++.so: attempted multiple inclusion of file ld: fatal: file processing errors. No output written to .libs/poly collect2: ld returned 1 exit status gmake[2]: *** [poly] Error 1 gmake[2]: Leaving directory `/home/bernard/local/polyml.5.5' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/home/bernard/local/polyml.5.5' gmake: *** [all] Error 2
Bernard.
Hello,
On 09/26/12 11:40, David Matthews wrote:
On 25/09/2012 20:55, Bernard Berthomieu wrote:
Same question, but symmetric, for solaris 11 (x86) 64bit: I could successfully build a 32 bit poly (default for gcc on that machine), but could not build a 64 bit version ...
I think you'll have to experiment there unless someone has an answer. I've not had much success with Solaris/X86 myself.
Thanks to the responsiveness of David, this problem is now solved. From the svn sources, poly builds on Solaris (x86), both in 32 bit and 64 bit. All regression tests pass.
For those interested, with gcc compiling in 32 bit by default: no configure options are needed for the 32 bit version for the 64 bit version, the following works:
configure --build=amd64-solaris 'CFLAGS=-m64 -O3 -I../libffi/include' 'CXXFLAGS=-m64 -O3 -I../libffi/include' 'CCASFLAGS=-m64 -O3'
Best, Bernard.