-
Notifications
You must be signed in to change notification settings - Fork 23
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
Changes for compilation using AppleClang on MacOS #28
Conversation
Construct gr::complex with {float re, float im} instead of relying on complex literals, given that the latter may not work with Clang, as reported in #28.
Construct gr::complex with {float re, float im} instead of relying on complex literals, given that the latter may not work with Clang, as reported in #28. To reproduce the changes in this patch, use the following script: cmd='sed -i '' \ -e "s/(SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \ -e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \ -e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \ -e "s/(SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \ -e "s/(+SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \ -e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \ -e "s/(+SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \ -e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \ $1 && clang-format -i $1' find . -name *.h -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.cc -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.hh -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.cc -path "./bench/*" -exec bash -c "$cmd" -- {} \;
Construct gr::complex with {float re, float im} instead of relying on complex literals, given that the latter may not work with Clang, as reported in #28. To reproduce the changes in this patch, use the following script: cmd='sed -i '' \ -e "s/(SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \ -e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \ -e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \ -e "s/(SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \ -e "s/(+SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \ -e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \ -e "s/(+SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \ -e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \ -e "s/(-1.0j)/{ 0, -1.0 }/g" \ -e "s/(+1.0j)/{ 0, 1.0 }/g" \ -e "s/1j/{ 0, 1.0 }/g" \ $1 && clang-format -i $1' find . -name *.h -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.cc -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.hh -path "./lib/*" -exec bash -c "$cmd" -- {} \; find . -name *.cc -path "./bench/*" -exec bash -c "$cmd" -- {} \;
Hi @wbenoot , Thanks for the PR. These changes are a little tedious to review manually, so I thought I should make a script to reproduce them. I've pushed the changes in c079787, which were generated by the following script: #!/bin/bash
cmd='sed -i '' \
-e "s/(SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \
-e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \
-e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \
-e "s/(SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \
-e "s/(+SQRT2_2 + SQRT2_2i)/{SQRT2_2, SQRT2_2}/g" \
-e "s/(-SQRT2_2 + SQRT2_2i)/{-SQRT2_2, SQRT2_2}/g" \
-e "s/(+SQRT2_2 - SQRT2_2i)/{SQRT2_2, -SQRT2_2}/g" \
-e "s/(-SQRT2_2 - SQRT2_2i)/{-SQRT2_2, -SQRT2_2}/g" \
-e "s/(-1.0j)/{ 0, -1.0 }/g" \
-e "s/(+1.0j)/{ 0, 1.0 }/g" \
-e "s/1j/{ 0, 1.0 }/g" \
$1 && clang-format -i $1'
find . -name *.h -path "./lib/*" -exec bash -c "$cmd" -- {} \;
find . -name *.cc -path "./lib/*" -exec bash -c "$cmd" -- {} \;
find . -name *.hh -path "./lib/*" -exec bash -c "$cmd" -- {} \;
find . -name *.cc -path "./bench/*" -exec bash -c "$cmd" -- {} \; Could you please rebase your PR so that I can check if there was any change left? I also see the change about finding boost. I wonder if we should use |
Also, I've been meaning to test the compilation using Clang on CI for some time. The changes are in 2c3fdec. However, I never figured out a solution for the issue reported in #4 (comment). Have you tried running |
hi @igorauad I rebased, there was only one file not updated by your script. |
Thanks! |
As indicated in #28, the macOS build requires an explicit find_package call to find the Boost::unit_test_framework component to which each unit test application is linked (via the GR_ADD_CPP_TEST call).
As indicated in #28, the macOS build requires an explicit find_package call to find the Boost::unit_test_framework component to which each unit test application is linked (via the GR_ADD_CPP_TEST call).
As indicated in #28, the macOS build requires an explicit find_package call to find the Boost::unit_test_framework component to which each unit test application is linked (via the GR_ADD_CPP_TEST call).
Eventhough Boost was found, it had some issues with finding unit_test_framework.
Implicit casting caused troubles only when using Clang compiler, GCC worked fine.