Errors in building Dart on CentOS 6.5 (does not have any field named 'TemplateInstruction')

78 views
Skip to first unread message

Joseph B. Axenroth

unread,
Mar 23, 2016, 4:29:36 PM3/23/16
to Dart Misc
Hello,

I asked this question over on StackOverflow, and it was suggested that I also ask here:


Basically I've had a lot of issues in attempting to build Dart on a machine with CentOS 6.5.  I've worked through them up until this one.  Now when I attempt to build, I receive about 70 errors relating to some "error: class ‘dart::[insert various source classes here]’ does not have any field named ‘TemplateInstruction’" errors.  The output from the build is on the SO question.

The machine uses CentOS 6.5, with glibc 2.12.  Upgrading to CentOS 7 or glib 2.14 is unfortunately not possible.

Can anyone that has experience (or, even if you don't) with building Dart provide some explanation relating to this error?  Please let me know if there is any additional information you may need from me.

Thanks,
Joe

Jan Mostert

unread,
Mar 24, 2016, 7:39:15 AM3/24/16
to Dart Misc
I've spent a lot of time trying to get Dart compiling on CentOS 6.5, CentOS7 works perfectly.
On CentOS6.5, as soon as you switch the python version, Yum stops working, so had to run old and new python alongside each other switching between versions if I wanted to compile Dart. Never got pass the last step which was changing glibc, was even running my own GCC, but not sure how to force it to compile using my custom built GCC.

What have you tried in the meantime?
Do you have the right version of Git, Python and all the other dependencies?

This is from my notes, I was messing around on a GCE instance to not destroy the actual machine I was working on at the time.
If you can get the glibc part working, let me know, I still have use for Dart on CentOS 6.5 / 6.7 and if my GCC setup is incorrect, please correct me.

----------------------------------------------

building dart on GCE instance

----------------------------------------------

create CentOS 6.7 instance

Be sure to resize root partition, otherwise you’ll be stuck on 10GB and GCC compile step wil run out of disk space. Was using 11GB after GCC compile.

See: https://serverfault.com/questions/747022/df-h-only-shows-10gb-but-ive-assigned-a-500gb-disk-to-the-gce-instance/747027#747027


# resize disk

sudo fdisk /dev/sda

type: c

type: u

type: p

type: d

type: n p 1 (use defaults)

type: w

sudo reboot


# make sure you have gsutil which we’ll use later to copy the SDK to a bucket

gsutil


# since we don’t care about security on this machine, let’s do everything as root

sudo su


# install some basics

yum update

yum groupinstall "Development Tools"

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

yum install  gcc perl-ExtUtils-MakeMaker

yum install svn texinfo-tex flex zip libgcc.i686 glibc-devel.i686

yum install java

yum install wget

yum remove git


# setup git

cd /usr/src

wget https://www.kernel.org/pub/software/scm/git/git-2.0.5.tar.gz

tar xzf git-2.0.5.tar.gz

mv git-2.0.5 git

cd git
make prefix=/usr/local/git all

make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

git --version # should print: git version 2.0.5


# setup python

cd /usr/src

wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz

tar -xvf Python-2.7.8.tgz

mv Python-2.7.8 python

# move python simlink in case we need to use yum again

mv /usr/bin/python /usr/bin/python-old

cd python

./configure

make

make install

ln -s /usr/src/python/python /usr/bin/python

python --version # should print: Python 2.7.8


# setup gcc - try this first

mv /usr/bin/python /usr/bin/python27

mv /usr/bin/python-old /usr/bin/python

wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo

yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++

yum install devtoolset-2-gcc-gfortran

mv /usr/bin/python /usr/bin/python-old

mv /usr/bin/python27 /usr/bin/python




export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc

export CPP=/opt/rh/devtoolset-2/root/usr/bin/c++

export CXX=/opt/rh/devtoolset-2/root/usr/bin/g++


# setup gcc

# from: https://www.vultr.com/docs/how-to-install-gcc-on-centos-6

# from: https://gcc.gnu.org/wiki/InstallingGCC


svn ls svn://gcc.gnu.org/svn/gcc/tags | grep gcc | grep release

mkdir /usr/src/gcc
cd /usr/src/gcc
svn co svn://gcc.gnu.org/svn/gcc/tags/gcc_4_6_0_release/

cd gcc_4_6_0_release/

./contrib/download_prerequisites


cd ..
mkdir gcc_4_6_0_release_build/
cd gcc_4_6_0_release_build/
../gcc_4_6_0_release/configure

make

make install    # busy here


hash -r


echo "/usr/local/lib64" > usrLocalLib64.conf
sudo mv usrLocalLib64.conf /etc/ld.so.conf.d/
sudo ldconfig


/usr/local/bin/gcc --version # should print: gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

mv /usr/bin/gcc /usr/bin/gcc-old

ln -s /usr/local/bin/gcc /usr/bin/gcc

gcc --version


export CC=/usr/local/bin/gcc

export CPP=/usr/local/bin/cpp

export CXX=/usr/local/bin/gcc

mv /usr/bin/gcc /usr/bin/gcc-old

ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc


# build dart

cd /usr/src

mkdir dart

cd dart

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

git clone https://github.com/dart-lang/sdk.git -b stable

export PATH=$PATH:`pwd`/depot_tools


gclient config --name=sdk --unmanaged g...@github.com:dart-lang/sdk.git

gclient sync # --jobs=1 --verbose

gclient runhooks


cd sdk

tools/build.py --mode=release --arch=x64 create_sdk

out/ReleaseX64/dart --version





--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Joseph B. Axenroth

unread,
Mar 24, 2016, 1:17:22 PM3/24/16
to Dart Misc
I'm not sure if anyone told you recently that you are awesome?  Those instructions are very thorough.  I did a bit of research in what it would take to upgrade the system from 6.5 to 6.7, and apparently I already am at 6.7.

It's been a journey in my attempts to get Dart to build on 6.5/6.7.  Ironic part to me is that I've done this before on CentOS 6.5, back in the Dart pre-1.0 days, without any issues.

What have I done in the meantime?  I had to build git, like you have in your instructions, since the latest version CentOS 6.7 can update to naturally won't work; I went with 2.7.4, which is working fine.  This had to be done before installing depot_tools.  I did not do anything with Python or gcc (though my gcc is the same version you list above).  My Python version is 2.6.6, do you think that could be an issue?

For whatever reason, gclient would not sync the files properly from the git repo.  There were about 30 or so files I had to manually download and patch into the right spots.  It was a bit tedious in having to attempt to sync, let it error on a file, then patch that file, and move on to the next.

With build.py, the create_sdk is the only thing that has 'worked' the best for me.  Any other value (such as leaving blank or 'runtime') gives me a 'no rule for target' type message.  So I've been sticking with the create_sdk.

I did figure out the 'does not have any field named [...]' messages.  I'm not well versed in C++, so my understanding is very limited (and idioms are wrong, I'm sure).  Something to do when compiling with g++, with the constructors of 'TemplateInstruction', 'TemplateDefinition', and 'InstructionPattern' were templatized, but the compiler didn't like when the constructors were called via subclass constructors without the templatized parameters.  I typed in the templatized parameters, thankfully only had to for three files (intermediate_language.h, intermediate_language.cc, and instructions_x64.h, all under runtime/vm).  That seems to have fixed the errors that I outlined in the original post.

I'm on to my next set of errors in the bitfield.h and scopes.cc files, but I am definitely getting closer.  Not a clue how close or how far, but closer.  This is where I'm at now for errors:

cc1plus: warnings being treated as errors
runtime/vm/bitfield.h: In member function ‘void dart::LocalScope::CollectLocalVariables(dart::GrowableArray<dart::LocalScope::VarDesc>*, int16_t*)’:
runtime/vm/bitfield.h:64: error: ‘desc.dart::LocalScope::VarDesc::info.dart::RawLocalVarDescriptors::VarInfo::index_kind’ may be used uninitialized in this function
runtime/vm/scopes.cc:312: note: ‘desc.dart::LocalScope::VarDesc::info.dart::RawLocalVarDescriptors::VarInfo::index_kind’ was declared here
runtime/vm/scopes.cc:327: error: ‘desc.dart::LocalScope::VarDesc::info.dart::RawLocalVarDescriptors::VarInfo::index_kind’ may be used uninitialized in this function
runtime/vm/scopes.cc:337: error: ‘desc.dart::LocalScope::VarDesc::info.dart::RawLocalVarDescriptors::VarInfo::index_kind’ may be used uninitialized in this function
make: *** [out/ReleaseX64/obj.target/libdart_vm_nosnapshot/runtime/vm/scopes.o] Error 1
BUILD FAILED

I am determined to get this to build successfully.  Not sure how close or far I am, but it's going to happen.  I'll be sure to share what I end up with when I do.

Jan Mostert

unread,
Mar 24, 2016, 1:44:23 PM3/24/16
to Dart Misc
I got it working up to 1.12 or 1.11 if I remember correctly, the later versions of Dart I simply couldn't get working on CentOS 6.7 - the amount of time just didn't seem worth it.
Eventually just installed a Debian Docker image on CentOS 6.7 and setup Dart on there; mapping my code folder to something that both Docker Debian and CentOS 6.7 could see - this works ok for a backend service, I'm not sure how to make it work for Chromium without setting up a complete desktop inside a Docker image.
If you don't mind the slower reloads, you could always run pub serve inside docker and map the ports outwards, pub will then compile to JS every time your code changes and you should be able to see it in a normal browser.


Joseph B. Axenroth

unread,
Mar 24, 2016, 2:30:13 PM3/24/16
to Dart Misc
I'm doing this to run Dart server-side on a production server, which is what establishes the constraints.  In any case, I've come too far to stop now.  :)  And if nothing else, I'm learning quite a lot that I had little knowledge of beforehand, so it's worth that, at least.
Reply all
Reply to author
Forward
0 new messages