Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use CC not CXX to compile abc #1502

Closed
wants to merge 1 commit into from
Closed

use CC not CXX to compile abc #1502

wants to merge 1 commit into from

Conversation

rxrbln
Copy link

@rxrbln rxrbln commented Nov 18, 2019

Compiling Yosys w/ "make CC=gcc CPP=cpp CXX=g++ PREFIX=/usr docdir=/usr/doc/yosys ABCREV=default" I otherwise get:
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/main/mainInit.o: in function Abc_FrameInit': mainInit.c:(.text+0xcf): undefined reference to Glucose_Init(Abc_Frame_t_)'
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/main/mainInit.o: in function Abc_FrameEnd': mainInit.c:(.text+0x1b1): undefined reference to Glucose_End(Abc_Frame_t_
)'
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/acb/acbFunc.o: in function Acb_NtkEcoPerform(Acb_Ntk_t_*, Acb_Ntk_t_*, char*, int)': acbFunc.c:(.text+0xd125): undefined reference to Abc_SopSynthesizeOne(char*, int)'

Compiling Yosys w/ "make CC=gcc CPP=cpp CXX=g++ PREFIX=/usr docdir=/usr/doc/yosys ABCREV=default" I otherwise get:
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/main/mainInit.o: in function `Abc_FrameInit':
mainInit.c:(.text+0xcf): undefined reference to `Glucose_Init(Abc_Frame_t_*)'
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/main/mainInit.o: in function `Abc_FrameEnd':
mainInit.c:(.text+0x1b1): undefined reference to `Glucose_End(Abc_Frame_t_*)'
/usr/lib64/gcc/x86_64-t2-linux-gnu/8.1.0/../../../../x86_64-t2-linux-gnu/bin/ld: src/base/acb/acbFunc.o: in function `Acb_NtkEcoPerform(Acb_Ntk_t_*, Acb_Ntk_t_*, char*, int)':
acbFunc.c:(.text+0xd125): undefined reference to `Abc_SopSynthesizeOne(char*, int)'
@udif
Copy link
Contributor

udif commented Nov 18, 2019

You might want to revisit #285 and see if it is still relevant.

@rxrbln
Copy link
Author

rxrbln commented Nov 18, 2019

You might want to revisit #285 and see if it is still relevant.

Well, it occurs with yosys f02623a from some weeks ago as packaged in #t2sde (https://t2sde.org/packages/yosys), compiling natively. Looks like C++ symbol mangling vs. plain C. gcc vs. g++ mismatch, ..?

@mmicko
Copy link
Member

mmicko commented Jan 29, 2020

Actually it will be enough to use make CC=gcc CXX=gcc PREFIX=/usr docdir=/usr/doc/yosys ABCREV=default"
This way you would replicate exactly what yosys is doing inside it's Makefile
Or even better do it two-step:
make config-gcc
make PREFIX=/usr docdir=/usr/doc/yosys ABCREV=default"

@mmicko mmicko closed this Jan 29, 2020
@rxrbln
Copy link
Author

rxrbln commented Jan 29, 2020

not really best practice, right?

@mmicko
Copy link
Member

mmicko commented Jan 29, 2020

Right, but issue is on abc compile side, and mixing C and C++ there, and you were right, name mangling is actual problem there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants