Skip to content
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

Document compilation from scratch #123

Open
00sapo opened this issue Jul 19, 2020 · 1 comment
Open

Document compilation from scratch #123

00sapo opened this issue Jul 19, 2020 · 1 comment

Comments

@00sapo
Copy link

00sapo commented Jul 19, 2020

I'm having trouble while compiling Calypso from scratch. I did what follows:

  • git clone --recursive https://github.com/Syniurge/Calypso
  • download llvm 9.0 headers with my package manager (pacman)
  • cd Calypso; mkdir build; cd build
  • cmake
  • make

make fails because it tries to compile clang into the base directory. To overcome this, I run:

  • cd ../deps/clang
  • mkdir build; cd build
  • cmake; make
  • cd ../../../build
  • make

Now, ld fails in finding the newly compiled clang libraries. So I try make "LDFLAGS=-L$PWD/../deps/clang/build/lib" but it still fails with errors like:

/usr/bin/ld: cannot find -l/[absolute path]/Calypso/build/deps/clang/lib/libclangBasic.a

I also tried by using cmake -DCLANG_PREBUILT_DIR="../deps/clang/build/" but it doesn't change.

By using ninja, as suggested in the original ldc wiki, clang is compiled correctly out-of-the-box, but ld still fails in the same way and I have not found a way to specify the option -L.

Am I the only one with these problems? I'm using Manjaro with Linux 5.4.44, cmake 3.17.3, make 4.3.

@GavinRay97
Copy link

This is how I managed to compile it on Windows. Took me a few hours to figure out:

git clone --recursive https://github.com/Syniurge/Calypso
cd Calypso

# Download and place the below in directory
# https://github.com/ldc-developers/llvm-project/releases/download/ldc-v9.0.1/llvm-9.0.1-windows-x64.7z

cmake -B ./build -G Ninja ^
-DCMAKE_C_COMPILER:PATH=cl.exe ^
-DCMAKE_CXX_COMPILER:PATH=cl.exe ^
-DCMAKE_LINKER:PATH=lld-link.exe ^
-DCMAKE_RC:PATH=llvm-rc.exe ^
-DCMAKE_RC_COMPILER:PATH=llvm-rc.exe ^
-DCMAKE_MT:PATH=mt.exe ^
-DCMAKE_BUILD_TYPE=Release ^
-DLLVM_ROOT_DIR="./llvm-9.0.1-windows-x64" ^
-DD_COMPILER=ldmd2

cmake --build ./build

In another comment here, someone else said that this worked for them on Ubuntu:

# DMD64 D Compiler v2.090.0
export DMD=/snap/bin/dmd

mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja -DLLVM_CONFIG=/usr/lib/llvm-9/bin/llvm-config ..

You might try just grabbing a copy of prebuilt LLVM9 from LDC repo that matches your OS, and fiddling with the C_COMPILER, CXX_COMPILER, LINKER, RC/RC_COMPILER, and MT CMake binaries to get it to run.

This did NOT work for me using clang-cl.exe oddly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants