csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.25k stars 123 forks source link

WIndows Build #136

Open Cellule opened 7 years ago

Cellule commented 7 years ago

I am trying to get this project to build on Windows, but I haven't had much luck. More documentation would be appreciated.

mpflanzer commented 7 years ago

Could you explain what you tried so far?

Cellule commented 7 years ago

Here's the step I have taken

-- Configuring incomplete, errors occurred! See also "E:/Projects/creduce/build/CMakeFiles/CMakeOutput.log".

where clang C:\Program Files\LLVM\bin\clang.exe

clang --version clang version 4.0.0 (tags/RELEASE_400/final) Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: C:\Program Files\LLVM\bin

You can see the CMake log at https://gist.github.com/Cellule/6ea447f9317efa7affac49d05d52ef2e

I tried setting the CMAKE_PREFIX_PATH, LLVM_DIR and Clang_DIR to a bunch of different paths, but nothing works. I have installed llvm from http://releases.llvm.org/4.0.0/LLVM-4.0.0-win64.exe I don't know where LLVMConfig.cmake is supposed to be

mpflanzer commented 7 years ago

Indeed, it seems like the *.cmake files are missing from the pre-built binaries. I'm not sure if that is something that changed recently. I thought they were included. After all they are copied to LLVM/lib/llvm/cmake/ if I build LLVM and clang myself on Windows.

I'm afraid that currently your best option will be to build LLVM and clang yourself for Windows to get C-Reduce working. You could have a look at my repository to get help how to build and install LLVM and clang from source on Windows. https://github.com/mpflanzer/clreduce#23-configure-and-build-llvm-and-clang

Cellule commented 7 years ago

I managed to get a little further using instructions on your project (btw your submodule to creduce is pointing to an invalid commit, force-pushed I guess). Now I can't seem to install the perl dependencies. For instance I do

> cpan -i 'Exporter::Lite'
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/c/Users/micfer/.cpan/Metadata'
  Database was generated on Mon, 10 Apr 2017 23:17:02 GMT
Running install for module 'Exporter::Lite'
Checksum for /c/Users/micfer/.cpan/sources/authors/id/N/NE/NEILB/Exporter-Lite-0.08.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring N/NE/NEILB/Exporter-Lite-0.08.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Exporter::Lite
Writing MYMETA.yml and MYMETA.json
  NEILB/Exporter-Lite-0.08.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for N/NE/NEILB/Exporter-Lite-0.08.tar.gz
  NEILB/Exporter-Lite-0.08.tar.gz
  make -- NOT OK
XVilka commented 5 years ago

Is there any progress with this effort? LLVM/Clang became way better since.

eeide commented 5 years ago

Hi, @XVilka. I think that the core problem addressed by this issue—merely building C-Reduce on Windows—has become a lot easier since this issue was created. (For that reason, maybe I should close this issue!) That said, I believe that i can still be tricky to run C-Reduce on Windows, for various reasons.

This project offers some tips for building/running C-Reduce on Windows: https://github.com/zjturner/creduce-windows

To my knowledge, none of the "core" C-Reduce maintainers regularly builds software on Windows.

We would welcome patches that make it easier for people to build/run C-Reduce on Windows.