Open IngwiePhoenix opened 5 years ago
Well, here we are.
My workaround was to utilize environment variables, since string-substitution in the fish
shell is not that great. So here is a direct copy of what I did:
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_LIBS (/usr/local/opt/llvm/bin/llvm-config --libs)
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_CFLAGS (/usr/local/opt/llvm/bin/llvm-config --cflags)
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_CXXFLAGS (/usr/local/opt/llvm/bin/llvm-config --cxxflags)
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_LDFLAGS (/usr/local/opt/llvm/bin/llvm-config --ldflags)
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ rm -rf *
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ cmake .. -G Ninja -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_FLAGS="-I /usr/local/opt/llvm/include -std=c++11 $LLVM_CXXFLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LLVM_LDFLAGS $LLVM_LIBS"
-- The CXX compiler identification is Clang 7.0.1
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Ingwie/Work/git/c2compiler/out
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ ninja
[57/98] Building CXX object c2c/CMakeFiles/c2core.dir/Analyser/FunctionAnalyser.cpp.o
../c2c/Analyser/FunctionAnalyser.cpp:2178:21: warning: variable length arrays are a C99 feature [-Wvla-extension]
char enumHandled[ETD->numConstants()];
^
1 warning generated.
[67/98] Building CXX object c2c/CMakeFiles/c2core.dir/Algo/TagWriter.cpp.o
../c2c/Algo/TagWriter.cpp:197:18: warning: variable length arrays are a C99 feature [-Wvla-extension]
char* offsets[files.size()];
^
1 warning generated.
[92/98] Building CXX object tools/CMakeFiles/tester.dir/tester/main.cpp.o
../tools/tester/main.cpp:1183:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
char* end = (char*) &target[strlen(target) -1];
^
1 warning generated.
[98/98] Linking CXX executable c2c/c2c
Hope it helps!
Hi ,
I'll look into it. I dont have my Macbook with me now, but this afternoon I should have some time for it..
On Mon, Feb 4, 2019 at 2:52 AM Ingwie Phoenix notifications@github.com wrote:
Well, here we are.
My workaround was to utilize environment variables, since string-substitution in the fish shell is not that great. So here is a direct copy of what I did:
Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_LIBS (/usr/local/opt/llvm/bin/llvm-config --libs) Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_CFLAGS (/usr/local/opt/llvm/bin/llvm-config --cflags) Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_CXXFLAGS (/usr/local/opt/llvm/bin/llvm-config --cxxflags) Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ set LLVM_LDFLAGS (/usr/local/opt/llvm/bin/llvm-config --ldflags) Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ rm -rf Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ cmake .. -G Ninja -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_FLAGS="-I /usr/local/opt/llvm/include -std=c++11 $LLVM_CXXFLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LLVM_LDFLAGS $LLVM_LIBS" -- The CXX compiler identification is Clang 7.0.1 -- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/Ingwie/Work/git/c2compiler/out Ingwie@Ingwies-Macbook-Pro.local ~/W/g/c/out $ ninja [57/98] Building CXX object c2c/CMakeFiles/c2core.dir/Analyser/FunctionAnalyser.cpp.o ../c2c/Analyser/FunctionAnalyser.cpp:2178:21: warning: variable length arrays are a C99 feature [-Wvla-extension] char enumHandled[ETD->numConstants()]; ^ 1 warning generated. [67/98] Building CXX object c2c/CMakeFiles/c2core.dir/Algo/TagWriter.cpp.o ../c2c/Algo/TagWriter.cpp:197:18: warning: variable length arrays are a C99 feature [-Wvla-extension] char offsets[files.size()]; ^ 1 warning generated. [92/98] Building CXX object tools/CMakeFiles/tester.dir/tester/main.cpp.o ../tools/tester/main.cpp:1183:29: warning: cast from 'const char ' to 'char ' drops const qualifier [-Wcast-qual] char end = (char) &target[strlen(target) -1]; ^ 1 warning generated. [98/98] Linking CXX executable c2c/c2c
Hope it helps!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/c2lang/c2compiler/issues/105#issuecomment-460110620, or mute the thread https://github.com/notifications/unsubscribe-auth/AAC1mrxUvIDIvdK8auCOXWVOJzq_bXUpks5vJ5JbgaJpZM4agcKS .
If you need anything tested on a Mac, feel free to ask. :)
Also: Travis offers building on OS X as well. So technically, you can use that too.
I wanted to try out c2 and went ahead and tried to build right away. Well, this is unfortunately what happened:
What I had to do beforehand was to install LLVM via Homebrew (
brew install llvm
). Now, what I am guessing is that there are a lot of flags missing, possibly due tollvm-config
not being in my$PATH
by default. I would suggest you to use the LLVM CMake files.Could save you some troubble. :)
I'll try and see if I can find a workaround here. By looking at my CMake invocation above, you can already see a bit of that.