Open leonardt opened 4 years ago
Thanks for documenting this -- I'll try to look into it when I get a chance. Glad you were able to unblock yourself for now. I have no idea what the issue is unfortunately. Do you know what OS the version of coreir
you're downloading is compiled on? I'm not sure if it matters as long as it's linux and there's no ABI issue, but in case it's relevant.
That's a good idea to use a SOURCES
variable though. I'll make that change at some point just to avoid the re-linking.
CoreIR release is built on travis, here is an example log https://travis-ci.org/github/rdaly525/coreir/jobs/737560277
It uses Ubuntu 14.04 (trusty) with gcc-4.8 as the default but we install gcc-7 https://github.com/rdaly525/coreir/blob/master/.travis.yml#L11
Here's an example log: https://github.com/leonardt/fault/runs/1311361414?check_suite_focus=true
Since the undefined references involved string methods, I thought it might be related to
-D_GLIBCXX_USE_CXX11_ABI=0
. However from what I can tell, the coreir release being used is built on travis with gcc-7 without setting that define, and when I forced gcc-8 on github actions, still got the same error. One thing I haven't tried is building pono with-D_GLIBCXX_USE_CXX11_ABI=0
, but given the next finding detailed below, I didn't pursue this.What's even more confusing: building pono-lib works (linking coreir), but building the pono executable (which links pono-lib) fails with the linker errors, so that makes me think it's not related to the string ABI problems. I poked around and still couldn't seem to resolve the issue. This process seems to work fine on the pono travis environment, as well as my local macos environment, so I'm guessing it's something different about the github environment. I haven't been able to figure out what might be the cause though.
I did find that it seems that using target_sources (https://github.com/upscale-project/pono/blob/master/CMakeLists.txt#L167) causes the coreir_encoder.cpp file to be rebuilt for the executable. However, even when I changed the cmake logic to just use a SOURCES variable (https://github.com/upscale-project/pono/blob/7777658cbf349892341906ccb8716ab2117eef35/CMakeLists.txt#L157) to avoid the recompilation, I still got linker errors related to coreir (here's an example log: https://github.com/leonardt/fault/runs/1311285582?check_suite_focus=true). (again this recompilation doesn't seem to be problematic for pono travis or my local env)
FWIW: I managed to unblock myself by just building
pono-lib
since that's actually all I need for my flow, so I don't think this should be high priority until someone else comes along that is blocked by this issue. But I figured it's worth documenting so if it does come up again we have somewhere to start.Here are the relevant error messages so it may be easier to find this note.