Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error: suffix or operands invalid for `movq' #406

Open
dimidd opened this issue Nov 10, 2015 · 10 comments
Open

Installation error: suffix or operands invalid for `movq' #406

dimidd opened this issue Nov 10, 2015 · 10 comments

Comments

@dimidd
Copy link

dimidd commented Nov 10, 2015

I tried installing using gem install nmatrix on osx, using gcc 5.2.0.

In file included from nmatrix.cpp:283:0:
ruby_nmatrix.c: In function 'VALUE nm_reshape_bang(VALUE, VALUE)':
ruby_nmatrix.c:1117:11: warning: unused variable 'elem' [-Wunused-variable]
void* elem = s->elements;
^
ruby_nmatrix.c: In function 'VALUE nm_complex_conjugate(VALUE)':
ruby_nmatrix.c:1095:35: warning: 'copy' is used uninitialized in this function [-Wuninitialized]
return nm_complex_conjugate_bang(nm_init_copy(copy,self));
^
ruby_nmatrix.c: In function 'VALUE nm_init_new_version(int, VALUE_, VALUE)':
ruby_nmatrix.c:1175:11: warning: 'init' may be used uninitialized in this function [-Wmaybe-uninitialized]
void_ init;
^
/var/folders/sc/2zd_v0qn76gdq5sdg63_jx4r0000gn/T//cc1KmZTQ.s:13579:suffix or operands invalid for `movq'
make: *** [nmatrix.o] Error 1

make failed, exit code 2

@translunar
Copy link
Member

I've never tried to install with GCC 5.2, and this is a new one. What happens if you use 4.9?

@dimidd
Copy link
Author

dimidd commented Nov 12, 2015

same error, the warnings are slightly different:
In file included from nmatrix.cpp:283:0:
ruby_nmatrix.c: In function 'VALUE nm_reshape_bang(VALUE, VALUE)':
ruby_nmatrix.c:1117:11: warning: unused variable 'elem' [-Wunused-variable]
void* elem = s->elements;
^
ruby_nmatrix.c: In function 'VALUE nm_complex_conjugate(VALUE)':
ruby_nmatrix.c:1095:59: warning: 'copy' is used uninitialized in this function [-Wuninitialized]
return nm_complex_conjugate_bang(nm_init_copy(copy,self));
^
ruby_nmatrix.c: In function 'VALUE nm_init_new_version(int, VALUE_, VALUE)':
ruby_nmatrix.c:578:9: warning: 'init' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (curr->val == values) {
^
ruby_nmatrix.c:1175:11: note: 'init' was declared here
void_ init;
^
/var/folders/sc/2zd_v0qn76gdq5sdg63_jx4r0000gn/T//ccM1fWw3.s:13173:suffix or operands invalid for `movq'
make: *** [nmatrix.o] Error 1

make failed, exit code 2

@wlevine
Copy link

wlevine commented Nov 12, 2015

Googling around for this error, it only seems to occur when a project has some inline assembly code, which nmatrix doesn't have, so that's a little puzzling.

It seems like this error sometimes comes from some sort of 32- vs 64-bit incompatibility, but these days I think OS X is always purely 64-bit, so that also doesn't really make sense.

@dimidd, does the .s file in /var/folders still exist after you finish building? You could try to look at it, or upload (a snippet of) it for us to look. Hopefully it will provide some clue as to where this is coming from.

@dimidd
Copy link
Author

dimidd commented Nov 12, 2015

@wlevine, unfortunately no. Perhaps I should put a breakpoint in ruby_nmatrix.c and inspect the assembly.

@wlevine
Copy link

wlevine commented Nov 12, 2015

There should be an option to get gcc to output the assembly. gcc -S, not
quite
sure if it would be trivial to get that working in the nmatrix build. This
also looks like it might be useful, to get an annotated version of the
assembly:http://stackoverflow.com/a/19083877/4992690

On Thu, Nov 12, 2015 at 10:23 AM, dimidd notifications@github.com wrote:

@wlevine https://github.com/wlevine, unfortunately no. Perhaps I should
put a breakpoint in ruby_nmatrix.c and inspect the assembly.


Reply to this email directly or view it on GitHub
#406 (comment).

@dimidd
Copy link
Author

dimidd commented Nov 12, 2015

The makefile has a lots of flags variables, where should I add -S?

@wlevine
Copy link

wlevine commented Nov 16, 2015

Sorry for the slow response. You can add it to CFLAGS and CPPFLAGS. Then when you run make you should end up with some ".o" files that are actually not object files, but assembly files in disguise. You can run as on them to isolate where the error is.

@translunar
Copy link
Member

@dimidd Have you had any luck? I can try this week if you're still struggling.

@dimidd
Copy link
Author

dimidd commented Jan 6, 2016

Sorry for the late response, I had a problem installing ATLAS. I've finally managed to install using macports, and added -L/opt/local/lib in LDFLAGS. Now when running bundle exec rake spec I have a different issue:

list {
    can be duplicated OK (0.00s)
    enforces shape boundaries OK (0.00s)
    sets and gets OK (0.00s)
    sets and gets references OK (0.00s)
    Ruby object {
      allows iteration of matrices dyld: lazy symbol binding failed: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_
  Referenced from: /Users/dimidd/nmatrix/lib/nmatrix.bundle
  Expected in: flat namespace

dyld: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_
  Referenced from: /Users/dimidd/nmatrix/lib/nmatrix.bundle
  Expected in: flat namespace

This may be relevant:
https://groups.google.com/forum/#!topic/sciruby-dev/M2MOsmNH8Oo

@translunar
Copy link
Member

This kind of stuff seems to happen when linking between things compiled by different compilers. I'm not sure why I didn't mention that before. I may have only just recognized the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants