I just tried installing LFortran from the latest tarball (0.17) but when I run make -j8, I get the following error:
In file included from /home/grishkin/lfortran-0.17.0-11-g36f3f4875/src/libasr/codegen/asr_to_wasm.cpp:11:
/home/grishkin/lfortran-0.17.0-11-g36f3f4875/src/libasr/…/libasr/codegen/wasm_assembler.h:129:5: error: use of undeclared identifier ‘assert’
assert(num.size() <= 4);
^
1 error generated.
I have checked and wasm_assembler.h has cassert included at the start.
The default compiler was gcc 12 so I tried using clang but got the same result.
Try commenting that one assert line, and see if it continues. We test Ubuntu at our CI and everything works, so it must be some slight incompatibility with our CI setup and your local setup. If you manage to fix it, please send us a PR!
? One possibility might be that there are some other assert.h in the include path that interferes with the desired one. For example, if I put “assert.h” in the current directory like
// ./assert.h
/* foo */
I get an error
$ g++-12 -I. mytest.cpp
mytest.cpp: In function ‘int main()’:
mytest.cpp:7:5: error: ‘assert’ was not declared in this scope
7 | assert( x == 1 );
| ^~~~~~
In the case of clang, the error message becomes like this (similar to OP)
$ clang++ -I. mytest.cpp
mytest.cpp:7:5: error: use of undeclared identifier 'assert'
assert( x == 1 );
^