-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Standalone Flang build Not building omp_lib.mod on M1 Mac #90543
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
Comments
This has worked for me for the main branch of today using CMake 3.29.2: cmake $HOME/projects/llvm/llvm-project/llvm \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_INSTALL_PREFIX=/work1/micklemm/installs/clang \
-DLLVM_ENABLE_PROJECTS="clang;lld"
ninja
ninja install
cmake $HOME/projects/llvm/llvm-project/flang \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_BUILD_MAIN_SRC_DIR=/home/micklemm/git/llvm/llvm-project/build-dev/lib/cmake/llvm \
-DLLVM_EXTERNAL_LIT=/home/micklemm/git/llvm/llvm-project/build-dev/bin/llvm-lit \
-DLLVM_LIT_ARGS=-v \
-DLLVM_DIR=/home/micklemm/git/llvm/llvm-project/build-dev/lib/cmake/llvm \
-DCLANG_DIR=/home/micklemm/git/llvm/llvm-project/build-dev/lib/cmake/clang \
-DMLIR_DIR=/home/micklemm/git/llvm/llvm-project/build-dev/lib/cmake/mlir \
-DCMAKE_INSTALL_PREFIX=/work1/micklemm/installs/flang
ninja
ninja install
cmake $HOME/projects/llvm/llvm-project/runtimes \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_Fortran_COMPILER=flang-new \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RUNTIMES=openmp \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_DIR=/home/micklemm/git/llvm/llvm-project/build-dev/lib/cmake/llvm \
-DOPENMP_STANDALONE_BUILD=ON \
-DLIBOMP_FORTRAN_MODULES=ON \
-DCMAKE_INSTALL_PREFIX=/work1/micklemm/installs/flang
ninja
ninja install I guess the non-obvious part is Let me know if that worked for you. |
I followed your instructions and this was the output of the install:
It seems that the runtime built omp_lib.mod in the llvm folder in homebrew, but not in the Flang folder, and flang cannot access OpenMP still. |
OK, good news is that it is being built for you. Bad news is, that there's still a bug that the module files do end up in the right place. Would it be acceptable for you to copy the files to the right place or point Flang to pick them up from where there are right now, while we are working on a fix? |
As long as it works; I'll take anything lol. Just let me know what to put where. |
Update: I copied the exact files installed into my Cellar folder into the folder corresponding to the location in my flang folder (so, from /opt/homebrew/Cellar/llvm/17.0.6_1/lib/clang/17/include to /opt/flang/lib/clang/19/include) and I still get errors compiling files using openmp. I then copied those files to flang's include folder directly (/opt/flang/include) and tried to compile and still got the error. For the record, this is the error I'm receiving while trying to compile programs utilizing openmp:
|
This has worked for me:
|
Placed the files where you asked and this happened:
I step forward, one step back I guess 🥲 |
Hmpf. Looks like it. :-( |
Can you please tell me where in your system the file is? I don't have access to a Mac, so I cannot really test this. |
Sure! As stated before, the runtime build you helped me with installed libomp in /opt/flang/lib (with /opt/flang being the install folder prefix). However, I also have a copy of libomp in the homebrew folder /opt/homebrew/opt/libomp/lib. |
Any updates? Do you need any more info from me? |
Hi, I’ve been trying to install the standalone Flang compiler, as I have Clang and Clang++ installed from Homebrew. I was following the instructions and thought I was doing fine, but noticed that I couldn’t get omp_lib.mod to build ONLY with the standalone build.
I’m using these flags to build llvm to build flang off of:
(I had to name LLVM compilers “blang” and “blang++” to prevent conflict from Apple’s own Clang compilers)
When I do that, everything is fine; omp_lib.mod gets built in the build folder. I then follow the standalone instructions and use these flags for my Flang build:
Whenever This gets made however, I get a notifications stating the following:
I’ve tried several things to get this to work, including putting the flag -DLLVM_ENABLE_PROJECTS=“openmp” in the standalone flags, but they get ignored. Can someone let me know what I am doing incorrectly? Thanks.
The text was updated successfully, but these errors were encountered: