-
Notifications
You must be signed in to change notification settings - Fork 138
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
add support for macOS #592
base: master
Are you sure you want to change the base?
Conversation
…) since it doesn't exist on macOS
…ce a lot is still hard-coded for Linux but at least it works
Simon, can you do an individual contributor license agreement for us so we can take this pull request? NVIDIA is requiring that we do CLAs for this sort of outside contribution. This is described in the Flang wiki here: https://github.com/flang-compiler/flang/wiki/Community |
@s-u FYI, I can't take these changes without a completed contributor license agreement. At least for about another few weeks. If you have an update for this, please let me know. |
@s-u CLA (contributor license agreement) is not a requirement now. If you are interested in submitting this PR please rebase, else consider closing. |
@kiranchandramohan thanks, rebased and updated. |
Seems like each time I thought I was approving particular commit, it was approval for the entire PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message user fileno() instead of direct structure access
is about fileno()
only, yet the commit additionally sorts out dumpregs()/getRegs() definitions. This is considered as lame behavior, consider splitting this commit in two, or update the commit message to reflect correctly the scope of the change.
|
Build instruction are like in the Wiki only slightly modified - your mileage may wary depending on tools used. BASE="`pwd`"
CMAKE=/Applications/CMake.app/Contents/bin/cmake
INSTALL_PREFIX=/opt/flang
CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DLLVM_CONFIG=$INSTALL_PREFIX/bin/llvm-config \
-DCMAKE_CXX_COMPILER=$INSTALL_PREFIX/bin/clang++ \
-DCMAKE_C_COMPILER=$INSTALL_PREFIX/bin/clang \
-DCMAKE_Fortran_COMPILER=$INSTALL_PREFIX/bin/flang
-DCMAKE_Fortran_COMPILER_ID=Flang \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=X86"
cd classic-flang-llvm-project
mkdir -p build && cd build
## There is a bug in that branch that uses wrong flags for xml2 so we have to disable it
$CMAKE $CMAKE_OPTIONS -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DLLVM_ENABLE_CLASSIC_FLANG=ON -DLLVM_ENABLE_PROJECTS="clang;openmp;libcxx;libcxxabi" \
-DLLVM_ENABLE_LIBXML2=OFF ../llvm
make -j12
cd "$BASE"
(cd flang/runtime/libpgmath
mkdir -p build && cd build
$CMAKE $CMAKE_OPTIONS ..
make -j12
make install)
(cd flang
mkdir -p build && cd build
$CMAKE $CMAKE_OPTIONS -DFLANG_LLVM_EXTENSIONS=ON \
-DFLANG_LIBOMP=$INSTALL_PREFIX/lib/libomp.dylib -DLIBPGMATH=$INSTALL_PREFIX/lib/libpgmath.dylib ..
make -j12
make install) @dnoan it says that those are undefined, so if you define them it works, no code change needed. I have now added a fix for the suffixes as well (so now you no longer need to set those). |
This is a minimal set of code changes and additions to cmake rules to allow
flang
andlibpgmath
to build on macOS (aka Darwin).[Tested using clang6 to build on Darwin 15.6.0 (aka OS X 10.11.6)]