terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.72k stars 201 forks source link

Unable to build terra on Centos 8 #428

Closed Nischay-Pro closed 4 years ago

Nischay-Pro commented 4 years ago

Hi,

I'm trying to build Terra on Centos 8. I've installed gcc 9.2.0 and clang 9.0.0 and ran the usual build steps.

I got a lot of undefined reference errors

Here is the attached build log. Warning the log is around 6.9 MB https://filebin.net/r43u393e1ni7ultc/log?t=wj33et3g

I've tried using clang 6.0.1 and got the same issue. Any idea why this is happening?

elliottslaughter commented 4 years ago

Can you give us some steps for reproducing? E.g. what packages did you install, did you use SCL, etc. Ideally such that someone would be able to docker run -ti centos:8 and get to a reproducing state.

Looking at the logs, my initial reaction is all the missing stuff seems to be in the C++ standard library. So it could be a case of linking against a different libc++/libstdc++ from what LLVM was built with, or something similar.

Nischay-Pro commented 4 years ago

I installed GCC 8.2.1 available in the Base repo of Centos. Installed spack and used GCC 8.2.1 to build GCC 9.2.0.

Used GCC 9.2.0 to build LLVM 9.0.0 and then ran the build steps using GCC 9.2.0 and LLVM 9.0.0.

Nischay-Pro commented 4 years ago

Ok, the issue got fixed.

So for some reason my GCC 8.2.1 environment was leaking into my GCC 9.2.0 environment. I added the absolute paths to the following CMAKE flags and it worked.

DCMAKE_CXX_COMPILER=g++ DCMAKE_C_COMPILER=gcc

elliottslaughter commented 4 years ago

Ok, cool. I'm going to close this issue but please feel free to open a new one if you have any further issues.