jzimmerman / langcc

langcc: A Next-Generation Compiler Compiler

Home Page:https://langcc.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'langcc_rt.hpp' file not found on make

hernanmd opened this issue · comments

Probably a minor issue when doing make from the examples/basic directory:

> make
langcc basic.lang gen
[000:00:00.001602] -- Performing initial validation and tabulation
[000:00:00.002307] -- Compiling lexer
[000:00:00.006472] -- Compiling parser: tabulating symbols
[000:00:00.006569] -- Compiling parser: inferring attributes
[000:00:00.006809] -- Compiling parser: symbol iteration 1 (0 triggers)
[000:00:00.008675] -- SLR(1) NFA: 10 vertices, 9 edges
[000:00:00.009147] -- SLR(1) subset NFA: 8 vertices, 7 edges
[000:00:00.009313] -- Compiling parser: final lookaheads
[000:00:00.009852] -- Compiling parser: constructing LR NFA
[000:00:00.010270] -- Compiling parser: LR NFA subset construction
[000:00:00.010744] -- Compiling parser: no LR conflicts
[000:00:00.010766] -- LR NFA: 10 vertices, 9 edges
[000:00:00.010783] -- LR DFA: 8 vertices, 7 edges
[000:00:00.011062] -- Generating AST datatype definitions
[000:00:00.031205] -- Generating AST writer definitions
[000:00:00.031948] -- Generating AST parser definitions
[000:00:00.039334] -- Generating global definitions
[000:00:00.046865] -- Running: clang++ -D __MACOS__ -D __MACOS_SDKROOT__=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o build/gen_test_bin/basic__gen_test -g -ggdb -g3 -std=c++17 -fno-omit-frame-pointer -mmacosx-version-min=12.0 -ldl -I ./gen -I ./src gen/basic__gen.cpp gen/basic__gen_test.cpp 
In file included from gen/basic__gen.cpp:1:
./gen/basic__gen.hpp:3:10: fatal error: 'langcc_rt.hpp' file not found
#include <langcc_rt.hpp>
         ^~~~~~~~~~~~~~~
1 error generated.
In file included from gen/basic__gen_test.cpp:1:
./gen/basic__gen.hpp:3:10: fatal error: 'langcc_rt.hpp' file not found
#include <langcc_rt.hpp>
         ^~~~~~~~~~~~~~~
1 error generated.
[000:00:00.344294]
[000:00:00.344294] Failure: clang++ -D __MACOS__ -D __MACOS_SDKROOT__=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o build/gen_test_bin/basic__gen_test -g -ggdb -g3 -std=c++17 -fno-omit-frame-pointer -mmacosx-version-min=12.0 -ldl -I ./gen -I ./src gen/basic__gen.cpp gen/basic__gen_test.cpp 

Stack trace:
  #1: main [??:0:0]
  #2: compile_lang_full [??:0:0]
  #3: AX [??:0:0]
  #4: AT [??:0:0]
  #5: void AT<..> [??:0:0]
Assertion failed
Assertion failed: (cond), function AT, file langcc_util.hpp, line 1236.
make: *** [gen/basic__gen.cpp] Abort trap: 6
make: *** Deleting file `gen/basic__gen.cpp' 

The examples require first running sudo make install from the top-level langcc directory.

Hi Joe, I did it but that didn't worked:

> sudo make install
Password:
mkdir -p /usr/local/bin
mkdir -p /usr/local/include
cp build/datacc /usr/local/bin/
cp build/langcc /usr/local/bin/
cp src/langcc_util.hpp /usr/local/include/
cp src/langcc_rt.hpp /usr/local/include/                                                                                   3.35s
> cd examples/basic/                                                                                                       544ms
> l
total 16
-rw-r--r--  1 mvs  staff   126B Sep 24 22:50 Makefile
-rw-r--r--  1 mvs  staff   423B Sep 24 12:56 basic.lang
drwxr-xr-x  3 mvs  staff    96B Sep 24 22:11 build/
drwxr-xr-x  5 mvs  staff   160B Sep 24 22:50 gen/                                                                          421ms
> make
langcc basic.lang gen
[000:00:00.002081] -- Performing initial validation and tabulation
[000:00:00.002886] -- Compiling lexer
[000:00:00.006877] -- Compiling parser: tabulating symbols
[000:00:00.006973] -- Compiling parser: inferring attributes
[000:00:00.007242] -- Compiling parser: symbol iteration 1 (0 triggers)
[000:00:00.008467] -- SLR(1) NFA: 10 vertices, 9 edges
[000:00:00.008949] -- SLR(1) subset NFA: 8 vertices, 7 edges
[000:00:00.009160] -- Compiling parser: final lookaheads
[000:00:00.009714] -- Compiling parser: constructing LR NFA
[000:00:00.010120] -- Compiling parser: LR NFA subset construction
[000:00:00.010613] -- Compiling parser: no LR conflicts
[000:00:00.010635] -- LR NFA: 10 vertices, 9 edges
[000:00:00.010658] -- LR DFA: 8 vertices, 7 edges
[000:00:00.010994] -- Generating AST datatype definitions
[000:00:00.025377] -- Generating AST writer definitions
[000:00:00.025885] -- Generating AST parser definitions
[000:00:00.031058] -- Generating global definitions
[000:00:00.037181] -- Running: clang++ -D __MACOS__ -D __MACOS_SDKROOT__=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o build/gen_test_bin/basic__gen_test -g -ggdb -g3 -std=c++17 -fno-omit-frame-pointer -mmacosx-version-min=12.0 -ldl -I ./gen -I ./src gen/basic__gen.cpp gen/basic__gen_test.cpp
In file included from gen/basic__gen.cpp:1:
./gen/basic__gen.hpp:3:10: fatal error: 'langcc_rt.hpp' file not found
#include <langcc_rt.hpp>
         ^~~~~~~~~~~~~~~
1 error generated.
In file included from gen/basic__gen_test.cpp:1:
./gen/basic__gen.hpp:3:10: fatal error: 'langcc_rt.hpp' file not found
#include <langcc_rt.hpp>
         ^~~~~~~~~~~~~~~
1 error generated.
[000:00:00.412203]
[000:00:00.412203] Failure: clang++ -D __MACOS__ -D __MACOS_SDKROOT__=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o build/gen_test_bin/basic__gen_test -g -ggdb -g3 -std=c++17 -fno-omit-frame-pointer -mmacosx-version-min=12.0 -ldl -I ./gen -I ./src gen/basic__gen.cpp gen/basic__gen_test.cpp

Stack trace:
  #1: main [??:0:0]
  #2: compile_lang_full [??:0:0]
  #3: AX [??:0:0]
  #4: AT [??:0:0]
  #5: void AT<..> [??:0:0]
Assertion failed
Assertion failed: (cond), function AT, file langcc_util.hpp, line 1236.
make: *** [gen/basic__gen.cpp] Abort trap: 6
make: *** Deleting file `gen/basic__gen.cpp'

Could you try pulling a clean copy and building again? I just pushed some candidate fixes for the macOS build.

Thanks! Now the make command ran without problems.