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

Compile using Clang: cannot specify -o when generating multiple output files #156

Open
lelzeiny opened this issue Apr 26, 2023 · 3 comments

Comments

@lelzeiny
Copy link

I am trying to compile using clang. I am using cmake 3.21 and clang/llvm 14.0, but I am running into what I think is a linking issue. I'm quite new to cmake though, so I would appreciate any pointers

Commands:
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DKAHYPAR_USE_MINIMAL_BOOST=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_COMPILER=<my path>/bin/clang-cpp -DCMAKE_CXX_STANDARD=17
make

Error output:
[ 11%] Linking CXX executable evo_partitioner_test clang-15: warning: CMakeFiles/evo_partitioner_test.dir/evo_partitioner_test.cc.o: 'linker' input unused in cpp mode [-Wunused-command-line-argument] clang-15: warning: -lpthread: 'linker' input unused in cpp mode [-Wunused-command-line-argument] clang-15: warning: -lpthread: 'linker' input unused in cpp mode [-Wunused-command-line-argument] clang-15: error: cannot specify -o when generating multiple output files make[2]: *** [tests/partition/evolutionary/evo_partitioner_test] Error 1 make[1]: *** [tests/partition/evolutionary/CMakeFiles/evo_partitioner_test.dir/all] Error 2 make: *** [all] Error 2

@SebastianSchlag
Copy link
Member

Hey @lelzeiny,

Thanks for reaching out. Interesting, I haven't seen this error before. Have you tried running without -DCMAKE_POSITION_INDEPENDENT_CODE=ON?

What happens if you run make KaHyPar instead of just make after running cmake? I'd be curious if this is something related to the tests or a more general problem.

@lelzeiny
Copy link
Author

lelzeiny commented Apr 27, 2023

Looks like make KaHyPar works fine, but once I run the binary ./build/application/kahypar/KaHyPar --help I get Missing name for redirect.

Also, DCMAKE_POSITION_INDEPENDENT_CODE=ON doesn't change anything. I was trying to dive into why this error might be and this post looks relevant. I might just need to downgrade my clang if this is the case

@SebastianSchlag
Copy link
Member

Hm... this is strange. Out of curiosity: Does make mutation_test or make partitioner_test work, or do you get the same error there as well? I'm wondering whether we do something wrong when setting up the tests.

As for the Missing name for redirect error: That one I also haven't seen before.

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

No branches or pull requests

2 participants