Building frustration (on Oracle Linux 7.2, CentOS 7 and Fedora 23, solved)
Raffaello Giulietti
raffaello.giulietti at supsi.ch
Mon Dec 28 17:47:01 UTC 2015
On 2015-12-27 22:03, Raffaello Giulietti wrote:
> On 2015-12-27 20:30, Doug Simon wrote:
>>> I hope I'm such an idiot to have forgotten something trivial.
>>
>> No, you’re absolutely not. I ran into the same issue recently when I obtained a VM running "Oracle Linux 7 u1”. The problem is that the HotSpot build system wants to statically link in the stdc++ library and (in my case at least), there is no static version of libstdc++. That is, there is no libstdc++*.a files next to the libstdc++.so* files. My solution was to patch the relevant HotSpot make file to enable dynamic linking of the C++ library:
>>
>
>
> After your note about the static version of the library, I found the
> right and "official" package at
> http://public-yum.oracle.com/repo/OracleLinux/OL7/optional/latest/x86_64/index.html
>
> I just downloaded
> http://public-yum.oracle.com/repo/OracleLinux/OL7/optional/latest/x86_64/getPackage/libstdc++-static-4.8.5-4.el7.x86_64.rpm
> on the hard-drive and installed it from there. My yum cannot find it in
> the standard repositories but I didn't reconfigure them.
>
> After this, the build proceeds successfully.
>
> I think this solution is cleaner than a patch in the makefile. Maybe it
> is something worth documenting somewhere.
>
>
> Greetings
> Raffaello
>
Today I also successfully built Truffle/Graal on CentOS 7 and Fedora 23,
in addition to Oracle Linux 7.2 from yesterday's experiments.
At first, I faced the same problem as in Oracle Linux 7.2, namely that
libstdc++.a is *not* installed by default. Since all of them are RedHat
variants, it might happen with similar distributions, too. I didn't
check, though.
As with Oracle 7.2, you need to install the static library explicitly.
This is easier on CentOS 7 and Fedora 23. All you have to do is:
sudo yum install libstdc++-static
For Oracle 7.2 you either download the .rpm from
http://public-yum.oracle.com/repo/OracleLinux/OL7/optional/latest/x86_64/getPackage/libstdc++-static-4.8.5-4.el7.x86_64.rpm
and install it, or you tweak with the repositories so that you can use
yum as above.
Further, you might need to install Mercurial and Ant if they're not present:
sudo yum install hg
sudo yum install ant
You also need the Oracle JDK 8, for which I suggest the .rpm variant.
After installing the JDK, you might also want to:
sudo alternatives --config java
and choose Oracle's JDK when requested.
It turns out that, on Fedora 23, you also need to install the g++
toolchain explicitly:
sudo yum install gnu-c++
Then follow the instructions on
https://wiki.openjdk.java.net/display/Graal/Instructions and you should
end up with a working Truffle/Graal environment, including a working IGV.
Many thanks to Doug for pointing out the static library problem in the
first place.
@Oracle Labs/@JKU people:
The error message encountered during the build when the static
libstdc++.a library is missing, is rather confusing. It does not suggest
that the problem comes from the missing *static* library. Perhaps it can
be made more clear by suggesting to install the static library.
Take care
Raffaello
More information about the graal-dev
mailing list