prosyslab / DAFL-artifact

35 stars 3 forks source link

Using smake/sparrow/DAFL on custom projects #9

Closed cloudbopper closed 6 months ago

cloudbopper commented 6 months ago

I'm interested in running DAFL on a custom project (not one of the benchmarks from the paper). I'm trying to understand how to preprocess the C source using smake so that I can run Sparrow on it. The DAFL-artifact Docker image includes already processed *.i files under smake-out but it's unclear how they were generated.

I attempted to run smake inside the docker image on some test projects (bzip2-1.0.5 from https://sourceware.org/pub/bzip2/bzip2-1.0.5.tar.gz, hello-world from https://github.com/offchan42/Hello-C-and-Makefile) using the instructions in the README in the smake repo. However, I haven't been to generate any preprocessed source files. The contents of the sparrow directory (set using env variable $AMAKEDIR) include a generic generated Makefile, a log file .smake.log, an empty directory sparrow, and an empty .targets file. Could you outline the steps required to generate the preprocessed *.i source files in order to run Sparrow?

goodtaeeun commented 6 months ago

Hi, the script I used to utilize smake and generate preprocessed files is https://github.com/prosyslab/DAFL-artifact/blob/main/docker-setup/run-smake.sh In this script, you will notice that I build the project first, then run smake

Likewise, I recommend you first configure and build your desired target project. Then run smake --init and smake afterward. smake is a wrapper of make, so it only works when make works. So make sure that the project is successfully built in the first place.

cloudbopper commented 6 months ago

Thanks, I was able to get it to work using https://github.com/prosyslab/DAFL-artifact/blob/main/docker-setup/run-smake.sh as a template.