spike-imperial / FastLAS

MIT License
19 stars 8 forks source link

compilation of FastLAS2 #2

Closed dio4ev closed 3 years ago

dio4ev commented 3 years ago

Hi!

I would like to compile FastLAS2 on my machine, but get the following error:

$ make                                                                                                                                                                                                                                                                            [dcefbc9]
[  4%] Building CXX object CMakeFiles/FastLAS_LIB.dir/.parser.cpp.o
cc1plus: error: too many filenames given; type ‘cc1plus --help’ for usage
cc1plus: fatal error: CMakeFiles/FastLAS_LIB.dir/.parser.cpp.d: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/FastLAS_LIB.dir/build.make:87: CMakeFiles/FastLAS_LIB.dir/.parser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/FastLAS_LIB.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Do you know how I can fix that?

Thanks!

marklaw commented 3 years ago

Hi,

Do you have bison installed? I've never come across this error before, and can't reproduce it. But the parser depends on bison (although I'd have thought that cmake would have complained if you didn't have it).

Mark

dio4ev commented 3 years ago

Yes bison is installed. I have no clue what causes this error. Do you have another idea?

marklaw commented 3 years ago

No. Are you able to build other things in CMake?

I've just made a simple Dockerfile with all the FastLAS dependencies, installing on a fresh (dockerised) instance of Ubuntu 20.04, and it builds fine. The Dockerfile is below. Could you try running each of the steps in the Dockerfile?

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get -y install git cmake gringo g++ build-essential flex bison
RUN apt-get -y install libboost-dev libboost-program-options-dev
RUN git clone https://github.com/spike-imperial/FastLAS
WORKDIR FastLAS/FastLAS2/implementation

RUN cmake CMakeLists.txt
RUN make -j8
dio4ev commented 3 years ago

Yes, until now I never had any problems with CMake.

Hmmm strange...the Dockerfile builds without errors and I also checked that I have all the listed dependencies installed on my system. I am using Arch Linux.

marklaw commented 3 years ago

Ah, well I've only ever tested FastLAS on Ubuntu. I've had a quick look and found this:

https://stackoverflow.com/questions/68968819/cmake-on-linux-givs-error-cc1plus-error-too-many-filenames-given

Apparently -o3 should be -O3. It seems Ubuntu and macOS c++ compilers are more tolerant and allow -o3 too. Could you try changing the flag in CMakeLists.txt? If it works, please let me know and I'll update CMakeLists.txt. If this is the issue, I'm sorry for the time it's cost you.

dio4ev commented 3 years ago

I also looked through stackoverflow, but didn't find this thread :) Apparently, this solves the problem with parser.cpp.

But now I get a lot errors with Solve.cpp -> 0

marklaw commented 3 years ago

It looks like adding #include <string> to the headers that it is complaining about should fix that. If you let me know which headers you have to add it to, I'll update the version in the repo so that people don't have the same issue on Arch in the future.

dio4ev commented 3 years ago

I thought it is easier to just fork and open a pull request :)

At least for me, the changes in the pull request fix all problems.

marklaw commented 3 years ago

Thanks!

dio4ev commented 3 years ago

Thank you!