votca / csg

Coarse-graining potentials from atomistic references made easy
26 stars 24 forks source link

unit_test_lammpsdumpreaderwriter fails on epel7 with ppc64le only #326

Closed junghans closed 5 years ago

junghans commented 5 years ago
46/52 Test #46: unit_test_lammpsdumpreaderwriter .......***Failed    0.01 sec
Running 2 test cases...
Reading frame, timestep 1
/builddir/build/BUILD/csg-1.5/src/tests/test_lammpsdumpreaderwriter.cc(236): error in "test_trajectoryreader": difference{200%} between b->Pos().y(){2.912328} and atom_xyz_file.at(ind).at(1){-2.912328} ex
ceeds 0.01%
/builddir/build/BUILD/csg-1.5/src/tests/test_lammpsdumpreaderwriter.cc(236): error in "test_trajectoryreader": difference{200%} between b->Pos().y(){1.7464770000000001} and atom_xyz_file.at(ind).at(1){-1.
7464770000000001} exceeds 0.01%
/builddir/build/BUILD/csg-1.5/src/tests/test_lammpsdumpreaderwriter.cc(236): error in "test_trajectoryreader": difference{200%} between b->Pos().y(){2.025836} and atom_xyz_file.at(ind).at(1){-2.025836} ex
ceeds 0.01%
/builddir/build/BUILD/csg-1.5/src/tests/test_lammpsdumpreaderwriter.cc(236): error in "test_trajectoryreader": difference{200%} between b->Pos().y(){3.9929049999999999} and atom_xyz_file.at(ind).at(1){-3.
9929049999999999} exceeds 0.01%
/builddir/build/BUILD/csg-1.5/src/tests/test_lammpsdumpreaderwriter.cc(236): error in "test_trajectoryreader": difference{200%} between b->Pos().y(){2.88232} and atom_xyz_file.at(ind).at(1){-2.88232} exce
eds 0.01%

It seems there is always a sign too much, e.g. 2.88232 vs. -2.88232.

Details here

JensWehner commented 5 years ago

okay, this is weird

JoshuaSBrown commented 5 years ago

That is really weird.

JensWehner commented 5 years ago

is lammps a binary format?

JensWehner commented 5 years ago

does anybody know what kind of architecture this is?

junghans commented 5 years ago

No, it is text!

JoshuaSBrown commented 5 years ago

Is this from a run on git lab or did a user report it? I'm not sure how to reproduce this?

junghans commented 5 years ago

This cake out during build of the packages on Fedora!

junghans commented 5 years ago

@JoshuaSBrown @jens the gcc compile farm has some ppc64le machines, but they might not be at the same OS package level!

I was able to reproduce this on copr: https://copr.fedorainfracloud.org/coprs/junghans/votca/build/854269/ if you click on "epel-7-ppc64le", you will see all the stuff there.

To trigger and new build just modify https://github.com/votca/fedora-copr/blob/master/votca.spec You can do some crazy stuff in the %check block to debug this!

JoshuaSBrown commented 5 years ago

Is this with the stable or master branch?

junghans commented 5 years ago

it builds from the 1.5 tarballs!

JoshuaSBrown commented 5 years ago

This is a little overwhelming. I can write shell commands in the check block?

junghans commented 5 years ago

Yes, you can write whatever code you want there!

There are two caveats though, 1.) the program needs to be installed, so you might need to add a BuildRequires: line for valgrind etc. 2.) rpmbuild will stop on the first error, so if you want to run multiple commands, one which might fail do something like:

%check
command1 || true
command2 || true
exit 1
JoshuaSBrown commented 5 years ago

@junghans Can you find an easier bug to fix? This one sucks.

junghans commented 5 years ago

No really, I don't have an ppc64le machine.....

JoshuaSBrown commented 5 years ago

I'm downloading an iso for the ppc64le crap. That will be easier than going through copr.

JoshuaSBrown commented 5 years ago

Turns out ppc64le is not compatible with virtual box.

junghans commented 5 years ago

I currently looking into qemu!

junghans commented 5 years ago

Actually on Fedora, install mock

dnf install mock qemu-user-static

set it up for your user:

usermod -a -G mock <username>

then setup an epel7 for ppc64le environment:

mock -r epel-7-ppc64le --forcearch ppc64le --dnf --init

Now you need to make the VOTCA srpm

wget https://raw.githubusercontent.com/votca/fedora-copr/master/votca.spec
spectool -g votca.spec
rpmbuild -D"_sourcedir ${PWD}" -D"_srcrpmdir ${PWD}" -bs votca.spec

and then build it in mock:

mock -r epel-7-ppc64le --forcearch ppc64le --dnf --no-clean votca-1.5-1.*.src.rpm

it will fail of course, but then you can go in to debug:

mock -r epel-7-ppc64le --forcearch ppc64le --shell
JoshuaSBrown commented 5 years ago

So of course this didn't work when I did it. I had to add the following two lines at the beginning:

dnf update
dnf install qemu-user-static
JoshuaSBrown commented 5 years ago

and don't forget another soft dependency:

dnf install dnf-utils
JoshuaSBrown commented 5 years ago

Now I'm getting this:

mock -r epel-7-ppc64le --forcearch ppc64le --no-clean votca-1.5-1.*.src.rpm
INFO: mock.py version 1.4.13 starting (python version = 3.7.2)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
INFO: Start(votca-1.5-1.fc29.src.rpm)  Config(epel-7-ppc64le)
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled HW Info plugin
Mock Version: 1.4.13
INFO: Mock Version: 1.4.13
Finish: chroot init
Start: build phase for votca-1.5-1.fc29.src.rpm
Start: build setup for votca-1.5-1.fc29.src.rpm
Unsupported setsockopt level=270 optname=3
Building target platforms: ppc64le
Building for target ppc64le
Wrote: /builddir/build/SRPMS/votca-1.5-1.el7.src.rpm
BaseOS                                                                   2.5 MB/s | 8.5 MB     00:03    
epel                                                                     3.5 MB/s |  14 MB     00:04    
extras                                                                   153 kB/s | 209 kB     00:01    
sclo-rh                                                                  138 kB/s | 353 kB     00:02    
updates                                                                  940 kB/s | 2.6 MB     00:02    
Package gcc-c++-4.8.5-36.el7.ppc64le is already installed.
No matching package to install: 'cmake3'
No matching package to install: 'expat-devel'
No matching package to install: 'fftw-devel'
No matching package to install: 'boost-devel'
No matching package to install: 'gromacs-devel'
No matching package to install: 'gsl-devel'
No matching package to install: 'sqlite-devel'
No matching package to install: 'texlive'
No matching package to install: 'inkscape'
No matching package to install: 'transfig'
No matching package to install: 'graphviz'
No matching package to install: 'hdf5-devel'
No matching package to install: 'lammps'
No matching package to install: 'libxc-devel'
No matching package to install: 'ceres-solver-devel'
No matching package to install: 'ImageMagick'
No matching package to install: '/usr/bin/dvipdf'
No matching package to install: 'gromacs'
No matching package to install: 'gromacs-openmpi'
No matching package to install: 'openmpi-devel'
No matching package to install: 'python2'
No matching package to install: 'gnuplot'
No matching package to install: 'psmisc'
No matching package to install: 'octave'
Not all dependencies satisfied
Error: Some packages could not be found.
ERROR: Exception(votca-1.5-1.fc29.src.rpm) Config(epel-7-ppc64le) 0 minutes 39 seconds
INFO: Results and/or logs in: /var/lib/mock/epel-7-ppc64le/result
ERROR: Command failed: 
 # /usr/bin/yum-builddep --installroot /var/lib/mock/epel-7-ppc64le/root/ --releasever 7 /var/lib/mock/epel-7-ppc64le/root//builddir/build/SRPMS/votca-1.5-1.el7.src.rpm
BaseOS                                                                   2.5 MB/s | 8.5 MB     00:03    
epel                                                                     3.5 MB/s |  14 MB     00:04    
extras                                                                   153 kB/s | 209 kB     00:01    
sclo-rh                                                                  138 kB/s | 353 kB     00:02    
updates                                                                  940 kB/s | 2.6 MB     00:02    
Package gcc-c++-4.8.5-36.el7.ppc64le is already installed.
No matching package to install: 'cmake3'
No matching package to install: 'expat-devel'
No matching package to install: 'fftw-devel'
No matching package to install: 'boost-devel'
No matching package to install: 'gromacs-devel'
No matching package to install: 'gsl-devel'
No matching package to install: 'sqlite-devel'
No matching package to install: 'texlive'
No matching package to install: 'inkscape'
No matching package to install: 'transfig'
No matching package to install: 'graphviz'
No matching package to install: 'hdf5-devel'
No matching package to install: 'lammps'
No matching package to install: 'libxc-devel'
No matching package to install: 'ceres-solver-devel'
No matching package to install: 'ImageMagick'
No matching package to install: '/usr/bin/dvipdf'
No matching package to install: 'gromacs'
No matching package to install: 'gromacs-openmpi'
No matching package to install: 'openmpi-devel'
No matching package to install: 'python2'
No matching package to install: 'gnuplot'
No matching package to install: 'psmisc'
No matching package to install: 'octave'
Not all dependencies satisfied
Error: Some packages could not be found.
JoshuaSBrown commented 5 years ago

I know that this is supposed to fail but I'm pretty sure it's not here that it is supposed to fail.

junghans commented 5 years ago

Can you add --dnf as an option?

JoshuaSBrown commented 5 years ago

It would be that easy... I spent all morning trying to get this thing to work. mock --help thats really all I had to do. Though it's not immediately obvious that no package manger would be automatically used.

junghans commented 5 years ago

The default is --yum for epel7, but for some reason that doesn't work if you are on a newer version of fedora...

JoshuaSBrown commented 5 years ago

Need to temporarily add a text editor to votca.spec to actually make this useful before calling:

    rpmbuild -D"_sourcedir ${PWD}" -D"_srcrpmdir ${PWD}" -bs votca.spec

Add line:

    BuildRequires:  vim   
junghans commented 5 years ago

I think mock ... --install vim does the same!

JoshuaSBrown commented 5 years ago

I found the problem, it is boost::lexical_cast that is the problem it fails to preserve the sign. stod however does work. Unless there is a reason to avoid stod?

JoshuaSBrown commented 5 years ago

@junghans do you think we should report this to boost?

JoshuaSBrown commented 5 years ago

Fix: tools-stable csg-stable csgapps-stable ctp-stable xtp-stable votca-stable

JensWehner commented 5 years ago

Wow thank you guys, :)

junghans commented 5 years ago

Confirmed it is fixed!

JoshuaSBrown commented 5 years ago

Yay!

junghans commented 5 years ago

Now you can have a look at https://github.com/votca/xtp/issues/227 ;-)

junghans commented 5 years ago

@junghans do you think we should report this to boost?

It is only old versions, so let's ignore that!