-
Notifications
You must be signed in to change notification settings - Fork 30
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
compilation and installation #241
Comments
Thanks for reaching out. Can you check whether there is a copy of find xxx/opencilk/build/ -name "libopencilk.a" It also seems that you're using a pretty old version of OpenCilk. The latest version is OpenCilk 2.1. Is there a reason why you're using an older version? |
I used the command find xxx/opencilk/build/ -name "libopencilk.a" to locate libopencilk.a, and here is its location:
I made the following modifications in infrastructures/tool/build:
Then I rebuilt, and the aforementioned error was resolved, so perhaps there is an issue with the
I compile using the following command:
The error message is:
Is this because certain files weren't linked during compilation?
|
On Linux, clang uses the libraries and headers from a GCC installation it finds on the system. Because it sounds like you have multiple installations of GCC on your system, including an an installation of GCC 4.8, I suspect that clang is finding the GCC 4.8 installation, which doesn't fully support C++17. As a result, it fails to find the To confirm this, can you share the verbose output of your clang compile command, that is, the output of this command: clang++ -std=c++17 option.cpp -o option -v The verbose output will include a list of GCC installations clang finds and a message about which GCC installation clang chooses to use. Clang supports the Can you search inside find /gpfs/software/gcc/10.3.0/ --name "optional" Hopefully, you will find the There are some other options we can try if that doesn't work, but they may be more complicated. Let's try searching the GCC 10.3 installation first.
Got it, thanks. If you have a chance, can you tell me what fails when trying to compile with OpenCilk 2.1? |
I executed the following command:
The following is part of the output:
It seems that it indeed chose an older version of GCC. After I specified --gcc-toolchain pointing to GCC 10.3.0, it reported some strange errors like error: use of undeclared identifier 'std'. Could it be that after specifying --gcc-toolchain, I need to manually link some libraries? I now want to recompile OpenCilk 1.1. Where should I specify the location of GCC? It seems that specifying the GCC location in the opencilk/llvm/CMakeLists.txt file only allows it to pass the GCC version check, but it actually uses GCC 4.8?
The API of OpenCilk 2.1 seems to have subtle differences from the API of 1.1. This has caused the code provided in the paper to fail to compile. On another computer with Ubuntu 18, I can successfully compile the code using OpenCilk 1.1. |
The errors you saw when you specified Can you share the full
For that version of OpenCilk, you should be able specify the to CMake the flag Edit: Alternatively, if you're rebuilding OpenCilk, you might try building OpenCilk with its own copies of the C++ standard headers and libraries. To do that, modify this line in the - : "${COMPILER_RT_COMPONENTS:=";compiler-rt"}" ;;
+ : "${COMPILER_RT_COMPONENTS:=";compiler-rt;libcxx;libcxxabi"}" ;; Those custom-built C++ standard headers and libraries won't be the same as those in your copy of GCC 10.3, but they might suffice for what you're trying to do. |
Firstly, use OpenCilk2.1 to compile our project and encounter an error
Then Mentionally, Clang supports the --gcc-toolchain=<dir>should As of Clang-16 maybe? because try this encounter an error:
about this we found this https://discourse.llvm.org/t/add-gcc-install-dir-deprecate-gcc-toolchain-and-remove-gcc-install-prefix/65091 may be useful. |
Yes, OpenCilk 2.1 has a revamped implementation of reducers, and the If you would like to try that new header in OpenCilk 2.1, the code change looks something like this. Wherever the program uses an opadd reducer cilk::reducer<cilk::op_add<int>> r; the declaration for the reducer cilk::opadd_reducer<int> r; If you want to give that a try, let me know how it goes. I'm happy to help you resolve any issues you encounter with the new reducers.
OpenCilk 1.1 is based on Clang 12, so it won't support the newer |
I specified the GCC location in the + : GCC_PREFIX=/gpfs/software/gcc/10.3.0
cmake -DLLVM_ENABLE_PROJECTS="${COMPONENTS}" \
-DLLVM_ENABLE_RUNTIMES="${RUNTIMES}" \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_ENABLE_ASSERTIONS="${OPENCILK_ASSERTIONS:?}" \
-DCMAKE_BUILD_TYPE="${OPENCILK_RELEASE:?}" \
+ : -DCMAKE_C_COMPILER=${GCC_PREFIX}/bin/gcc \
+ : -DCMAKE_CXX_COMPILER=${GCC_PREFIX}/bin/g++ \
+ : -DGCC_INSTALL_PREFIX=${GCC_PREFIX} \
"${OPENCILK_SOURCE}/llvm"
I saw here https://stackoverflow.com/questions/47734094/build-clang-from-source-using-specific-gcc-toolchain that this is an equivalent operation to |
Glad to hear you resolved the issue. Please reach out if you have any more questions or run into any other issues. |
My system is RedHat 7, and I executed the following commands to install opencilk:
When I executed the last command, it threw an error indicating that my gcc version is 4.8.5, while the minimum required is 5.1. I'm not quite sure what went wrong. I have loaded gcc 10.3.0 using the module, perhaps the gcc used here is referenced by an absolute path? I set the absolute path of gcc in opencilk/llvm/CMakeLists.txt:
Then I executed the last command again, this time without error about the gcc version being too low. However, another problem occurred. Below is the error message:
I'm wondering how to solve this issue?
The text was updated successfully, but these errors were encountered: