ArthurSonzogni / Diagon

Interactive ASCII art diagram generators. :star2:
https://arthursonzogni.com/Diagon/
MIT License
1.48k stars 56 forks source link

How to build? #21

Closed hacker-DOM closed 3 years ago

hacker-DOM commented 3 years ago

Hi there, I'm not very proficient with C, just trying to typeset some nice math :)

I clone the repo on a Mac and ran cmake, then make and got the following output:

[  1%] Building CXX object CMakeFiles/diagon_base.dir/src/translator/Translator.cpp.o
In file included from /Users/dteiml/projects/Diagon/src/translator/Translator.cpp:5:
/Users/dteiml/projects/Diagon/src/translator/Translator.h:15:27: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
  virtual ~Translator() = default;
                          ^
/Users/dteiml/projects/Diagon/src/translator/Translator.h:34:61: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions]
  virtual std::vector<OptionDescription> Options() { return {}; }
                                                            ^~
/Users/dteiml/projects/Diagon/src/translator/Translator.h:34:61: error: non-aggregate type 'std::vector<OptionDescription>' cannot be initialized with an initializer list
  virtual std::vector<OptionDescription> Options() { return {}; }
                                                            ^~
/Users/dteiml/projects/Diagon/src/translator/Translator.h:40:52: warning: generalized initializer lists are a C++11 extension [-Wc++11-extensions]
  virtual std::vector<Example> Examples() { return {}; }
                                                   ^~
/Users/dteiml/projects/Diagon/src/translator/Translator.h:40:52: error: non-aggregate type 'std::vector<Example>' cannot be initialized with an initializer list
  virtual std::vector<Example> Examples() { return {}; }
                                                   ^~
3 warnings and 2 errors generated.
make[2]: *** [CMakeFiles/diagon_base.dir/src/translator/Translator.cpp.o] Error 1
make[1]: *** [CMakeFiles/diagon_base.dir/all] Error 2
make: *** [all] Error 2

I googled the errors and got here and then here, which together seemed to provide an answer.

Based on that, I tried running make CXXFLAGS='-std=c++11'. However, I got the same output. Any help, thanks!

ArthurSonzogni commented 3 years ago

Thanks for reporting this. This means there are some target where I missed executing:

  set_property(target PROPERTY CXX_STANDARD 17)

and you compiler default is less than C++11.

I will submit a fix.

ArthurSonzogni commented 3 years ago

BTW, you can use Diagon directly on: https://arthursonzogni.com/Diagon/

ArthurSonzogni commented 3 years ago

Could you check the fix worked for you?

execb5 commented 2 years ago

Hello, I'm trying to build the project on a mac so that I can try to use the vim plugin, but I have barely no experience building c++ projects.

I executed cmake CMakeLists.txt and then make and it failed at 87%.

random

Does anyone know what I could've missed?

nchase commented 2 years ago

macOS user here – I ran into the error that @execb5 ran into as well.

ArthurSonzogni commented 2 years ago

@execb5, @nchase,

To build it, you have to:

mkdir build;
cd build;
cmake ..;
make

The dependencies 'uuid-dev' and 'libboost-graph-dev" might be required.

I think I will add some github workflow for you to be able to download binaries directly.

execb5 commented 2 years ago

@ArthurSonzogni

I tried to find those libs for mac so I ended up installing boost and ossp-uuid, they're supposed to be the same but in brew. (I could be wrong though)

Still had the same result :'(

I think I'll have to wait for a binary.

[  1%] Built target diagon_base
[  3%] Built target translator_tree
[  3%] Built target make_lib_output_dir
[ 59%] Built target antlr4_static
[ 60%] Built target screen
[ 60%] Built target translator_frame
[ 64%] Built target common
[ 65%] Built target wsn
[ 65%] Built target abnf
[ 67%] Built target blab
[ 68%] Built target bnf
[ 68%] Built target dot
[ 68%] Built target ebnfhtml5
[ 70%] Built target html5
[ 71%] Built target iso-ebnf
[ 73%] Built target rbnf
[ 79%] Built target rrd
[ 79%] Built target rrdot
[ 81%] Built target rrdump
[ 81%] Built target rrll
[ 82%] Built target rrparcon
[ 82%] Built target rrta
[ 84%] Built target rrtdump
[ 84%] Built target rrtext
[ 84%] Built target sid
[ 85%] Built target svg
[ 87%] Linking C static library libkgt.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
make[2]: *** [_deps/kgt-build/libkgt.a] Error 1
make[1]: *** [_deps/kgt-build/CMakeFiles/kgt.dir/all] Error 2
make: *** [all] Error 2
ArthurSonzogni commented 2 years ago

Indeed. I get the same error on Mac: https://github.com/ArthurSonzogni/Diagon/runs/4609385209?check_suite_focus=true

I will take a look.