From: Gereon Kremer Date: Mon, 1 Nov 2021 18:37:22 +0000 (-0700) Subject: Add fuzzing target for murxla (#7490) X-Git-Tag: cvc5-1.0.0~919 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7e2f6718823ddb65179bc74dc043074bc2bfafb;p=cvc5.git Add fuzzing target for murxla (#7490) This PR aims to make it easier for cvc5 developers to fuzz the current cvc5 working copy with murxla. It adds a new external project Murxla-EP that builds murxla, linking (only) against cvc5. It depends (indirectly) on the make install target, which is called with a custom install prefix for this purpose. As the murxla repository is not public yet, automatically downloading it does not work, but instead we need the user to clone it manually for now. The user should simply execute make fuzz-murxla and follow the instructions. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1afb2cfc8..f5184b2df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,6 +445,7 @@ endif() # Provide targets to inspect iwyu suggestions include(IWYU) +include(fuzzing-murxla) #-----------------------------------------------------------------------------# diff --git a/cmake/fuzzing-murxla.cmake b/cmake/fuzzing-murxla.cmake new file mode 100644 index 000000000..b5699e925 --- /dev/null +++ b/cmake/fuzzing-murxla.cmake @@ -0,0 +1,59 @@ +############################################################################### +# Top contributors (to current version): +# Gereon Kremer +# +# This file is part of the cvc5 project. +# +# Copyright (c) 2009-2021 by the authors listed in the file AUTHORS +# in the top-level source directory and their institutional affiliations. +# All rights reserved. See the file COPYING in the top-level source +# directory for licensing information. +# ############################################################################# +# +# Find Murxla +# Murxla_FOUND - system has Murxla +## + +if(NOT IS_DIRECTORY "${CMAKE_BINARY_DIR}/murxla") + # this is only necessary while the murxla repository is private + add_custom_target(fuzz-murxla + COMMAND echo "To enable make fuzz-murxla run" + COMMAND echo "git clone git@github.com:murxla/murxla.git ${CMAKE_BINARY_DIR}/murxla" + ) + return() +endif() + +include(ExternalProject) + +set(Murxla_COMMIT "afc5744766d6aa61ad5b7ea27007666ac7a5aec2") + +add_custom_target(install-for-murxla + COMMAND ${CMAKE_MAKE_PROGRAM} install DESTDIR=murxla-install + DEPENDS cvc5-bin +) + +ExternalProject_Add( + Murxla-EP + EXCLUDE_FROM_ALL ON + ${COMMON_EP_CONFIG} + #URL https://github.com/murxla/murxla/archive/${Murxla_COMMIT}.tar.gz + #URL_HASH SHA1=da39a3ee5e6b4b0d3255bfef95601890afd80709 + SOURCE_DIR ${CMAKE_BINARY_DIR}/murxla + CMAKE_ARGS + -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/murxla-install/usr/local/ + -DENABLE_BITWUZLA=OFF + -DENABLE_BOOLECTOR=OFF + -DENABLE_YICES=OFF + INSTALL_COMMAND + ${CMAKE_COMMAND} -E copy /bin/murxla /bin/murxla + DEPENDS install-for-murxla +) +ExternalProject_Get_Property(Murxla-EP BINARY_DIR) +set(MURXLA_BINARY "deps/bin/murxla") + +add_custom_target(fuzz-murxla + COMMAND echo "" + COMMAND echo "Run Murxla as follows:" + COMMAND echo " LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/murxla-install/usr/local/lib/ ${MURXLA_BINARY} -t 1 --cvc5" + DEPENDS Murxla-EP +) \ No newline at end of file