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

configure: line 17503: syntax error near unexpected token `ATOMIC_OPS' #69

Closed
raoulvdberge opened this issue Jun 26, 2015 · 9 comments
Closed

Comments

@raoulvdberge
Copy link

configure: line 17503: syntax error near unexpected token `ATOMIC_OPS,'
configure: line 17503: `   PKG_CHECK_MODULES(ATOMIC_OPS, atomic_ops, ,'

This happens when I run ./configure in Linux and Windows using Autoconf 2.69.

This occurs on the master branch and on the 7.4.2 release.

I am able to get a makefile by using the make -f Makefile.direct test command, but when running make then it gives me:

^^^^Starting command^^^^
tests/test.o:test.c:(.rdata$.refptr._bss_start__[.refptr._bss_start__]+0x0): undefined reference to `_bss_start__'
tests/test.o:test.c:(.rdata$.refptr._data_start__[.refptr._data_start__]+0x0): undefined reference to `_data_start__'
tests/test.o:test.c:(.rdata$.refptr._bss_end__[.refptr._bss_end__]+0x0): undefined reference to `_bss_end__'
tests/test.o:test.c:(.rdata$.refptr._data_end__[.refptr._data_end__]+0x0): undefined reference to `_data_end__'
collect2: error: ld returned 1 exit status
Makefile.direct:394: recipe for target 'gctest' failed
make: *** [gctest] Error 1
@ivmai
Copy link
Owner

ivmai commented Jun 28, 2015

As written in configure.ac:

Note: "syntax error near unexpected token ATOMIC_OPS" reported by configure

means Autotools pkg.m4 file was not found during aclocal.m4 generation.

So, please check the installation of Autotools. Actually I added this comment after having this issue on my PC. (BTW If you download the release tarball then no need to run Autotools.)

PS I will check "make -f Makefile.direct test" a bit later.

@raoulvdberge
Copy link
Author

I must note that the problem with the undefined references was only happening on Windows, sorry.

Also, was very happy to see I could compile with CMake, that worked fine.

@ivmai
Copy link
Owner

ivmai commented Jun 28, 2015

I checked "make -f Makefile.direct test" on Cygwin - I cannot reproduce the issue.

@schovi
Copy link

schovi commented Nov 3, 2016

Hi I run into same problem. Even with installed autotools. I have clean playground with Docker on Debian Jessie. You can check what I am doing there and tell me what should I do? https://gist.github.com/schovi/6ba1ca8084619639383d7540ce61c649

Error is obviously

checking sys/dg_sys_info.h presence... no
checking for sys/dg_sys_info.h... no
./configure: line 16943: syntax error near unexpected token `ATOMIC_OPS,'
./configure: line 16943: `   PKG_CHECK_MODULES(ATOMIC_OPS, atomic_ops, ,'
The command '/bin/sh -c cd /tmp/bdwgc && ./configure' returned a non-zero code: 2

@ivmai
Copy link
Owner

ivmai commented Nov 4, 2016

As written in configure.ac:

Note: "syntax error near unexpected token ATOMIC_OPS" reported by configure

means Autotools pkg.m4 file was not found during aclocal.m4 generation.

So, please check the installation of Autotools. Actually I added this comment after having this issue on my PC. (BTW If you download the release tarball then no need to run Autotools.)

If you know a better fix, please contribute.

@matiasgarciaisaia
Copy link

matiasgarciaisaia commented Nov 10, 2016

Sorry to bother, but maybe my question can help other newbies too.

I'm hitting this bug trying to compile bdwgc on Bash on Ubuntu on Windows 10. I've been hitting errors and errors due to packages that weren't installed previously and things like that. I know no one has probably tested the project on this platform - I expect things to be broken, but want to make sure if they work or not, and try to help fixing if that helps.

Anyways, what I've done:

git clone git://github.com/ivmai/bdwgc.git
cd bdwgc
git clone git://github.com/ivmai/libatomic_ops.git
autoreconf -vif
automake --add-missing
./configure

And hit this bug. I read your note, and all I know to do to "check the installation of Autotools" is to run aptitude search autotools - which shows autotools-dev is installed. I've ran make -f Makefile.direct test, and it also says "SUCCEEDED" after a ton of log - which I haven't read.

So I think I have autotools installed, but I'm not sure what should I do after checking this.

Am I missing something? What could I check or do to go on with this?

Thanks :)


PS: the full log of the build is here: https://gist.github.com/matiasgarciaisaia/039593189c3bbe235a05d7135d2b9720

I'm hitting the same issue in a Ubuntu 14.04.1 LTS installation, also.

@ivmai
Copy link
Owner

ivmai commented Nov 11, 2016

This means that pkg.m4 file was not found. I don't know the proper fix.
On Ubuntu, it should present in the following directories:
/usr/local/share/aclocal/
/usr/share/aclocal/

@matiasgarciaisaia
Copy link

🎉 🎉 🎉 Nailed it!

I didn't have that pkg.m4 file in those dirs - nor the .deb packages for autotools included it -, but found that there's an associated pkg-config command you can run that's somehow linked to that file.

I've tried it, and wasn't installed - and Ubuntu suggested me to install either pkg-config or pkgconf. I went on installing pkg-config (sudo apt-get install pkg-config, just in case), and then re-did the autoreconf, automake and ./configure.

I'm not sure if you want to document that anywhere else - maybe this issue is enough. I'm letting the Crystal guys know, by the way.

Thanks for your help! 😄

@ivmai
Copy link
Owner

ivmai commented Nov 16, 2016

Documented in README.md - see c91eb28

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

4 participants