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

Build on Mac OS 11.1: error: expected ';' at end of declaration list #8

Closed
akakikuumeri opened this issue Jan 19, 2021 · 10 comments
Closed

Comments

@akakikuumeri
Copy link

Trying to compile BurrTools on Mac OS 11.1, following the steps at https://github.com/burr-tools/burr-tools/blob/master/README.build/MacOS-10.15.5.readme .

make fails with following error:

% make           
Making all in src
/Library/Developer/CommandLineTools/usr/bin/make  all-am
  CXX      burrTxt.o
In file included from burrTxt.cpp:32:
./tools/xml.h:79:23: error: expected ';' at end of declaration list
    ~xmlWriter_c(void) noexcept(false);
                      ^
                      ;
1 error generated.
make[2]: *** [burrTxt.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
@akoehn
Copy link
Member

akoehn commented Jan 19, 2021

I am pretty sure this has something to do with the compiler being used. I made the latest changes using gcc 10. Maybe @tomburns can chime in about what compiler to user under macos?

@akoehn
Copy link
Member

akoehn commented Mar 7, 2021

Others compiled the code on MacOS in the meantime without problems. Feel free to reopen with additional info if you can reproduce this.

@akoehn akoehn closed this as completed Mar 7, 2021
@edbaranoski
Copy link

I am running into the same error that @akakikuumeri had seen. Do you know what other users did to get around this? My Mac OS (Monterrey 12.2.1 now) is using clang as the compiler. I have installed gcc-11 with brew, but I can't seem to force the ./configure process to use gcc-11 instead of clang. Thanks for any pointers.

@edbaranoski
Copy link

A little more digging found that I could force gcc-11 instead of Clang just by using
./configure CC=gcc-11
Unfortunately, that didn't fix the original error in ./tools/xml.h so I'm still stuck.

@akoehn
Copy link
Member

akoehn commented Mar 10, 2022

Did you also set the c++ compiler to gcc? (CXX=g++-11)

@edbaranoski
Copy link

Thanks for the tip (should have thought of that). When I include that flag, I get a about twenty errors complaining about the register storage classified similar to this:

In file included from lib/assembler_0.cpp:21:
lib/assembler_0.h:94:40: error: ISO C++17 does not allow 'register' storage class specifier [-Werror=register]
94 | void cover_row(register unsigned int r);

I got around this by include the additional flag CXXFLAGS="-Werror -Wno-error=register"
It then had failed with this warning:

lib/thread.h:25:10: fatal error: boost/thread.hpp: No such file or directory
25 | #include <boost/thread.hpp>

I can find a file by that name in /usr/local/Cellar/boost/1.78.0_1/include/boost/thread.hpp (the default brew location, I guess). Is this the missing file it references, or is there another version? How would I get the make to find the correct file?

Thanks again for your help.

@akoehn
Copy link
Member

akoehn commented Mar 10, 2022

Thanks for the tip (should have thought of that). When I include that flag, I get a about twenty errors complaining about the register storage classified similar to this:

I got around this by include the additional flag CXXFLAGS="-Werror -Wno-error=register"

Alternatively, you could switch to the c++11 standard.

It then had failed with this warning:

lib/thread.h:25:10: fatal error: boost/thread.hpp: No such file or directory

I don't know how the paths work on Mac, never had one. The configure script should give you the relevant options to peovide paths with --help.

Can't test that right now because I am on mobile.

@edbaranoski
Copy link

Switching to CXX=c++-11 didn't solve it, nor did my attempts to try flags like
--with-boost=/usr/local/Cellar/boost/1.78.0_1 --with-boost-libdir=/usr/local/Cellar/boost/1.78.0_1/lib
work either.

This has shown me how outdated my ancient C programming skills have become. I'll check with some of the younger more current programmers I work with if they can guide me out of this. I appreciate you taking the time to answer my query.

@edbaranoski
Copy link

I finally had time to return to the problem of porting burr-tools to a Mac (now with Monterrey 12.6) after putting it aside for months. I was able to blunder my way through it using the following:
./configure CC=gcc-12 CFLAGS=-I/usr/local/Cellar/boost/1.79.0_2/include CXX=g++-12 CXXFLAGS=-I/usr/local/Cellar/boost/1.79.0_2/include --with-boost=/usr/local/Cellar/boost/1.79.0_2 --with-boost-libdir=/usr/local/Cellar/boost/1.79.0_2/include

with the latest gcc-12 and g++-12 and using Homebrew's default location for the boost folder. The (hopefully) last hurdle now appears to be compiling lib/libburr_a-voxel_2_mesh.o with an error stating "struct std::iterator' is deprecated". I tried the ignore deprecation command -Wno-deprecated, but that yielded a lot of issues downstream with the linker.

Is the std::iterator a general problem with the source code (at least for later compilers), or should I keep digging?

@edbaranoski
Copy link

For MacOS users, Bryan Turner's port of burr-tools at https://github.com/burr-tools/burr-tools-0.6.3-original was modified to compile well (at least under Ventura 13.1).

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