safe-rl / safe-rl-shielding

MIT License
38 stars 12 forks source link

Getting Error during: make (inside directory: shield_synthesis/) #14

Open skmalviya opened 3 years ago

skmalviya commented 3 years ago

Running "make" (after installing cudd-3.0.0):

$ cd safe-rl-shielding/shield_synthesis
$ make

Getting Error:

collect2: error: ld returned 1 exit status 
make: *** [Makefile:22: shield_synthesizer] Error 1
skmalviya commented 3 years ago

I solve the above problem as below steps:

  1. Installing cudd-3.0.0

    $ git clone https://github.com/ivmai/cudd.git
    $ cd cudd
    $ ./configure CC=clang CXX=clang++ --enable-silent-rules --enable-shared --enable-obj
    $ make -j4 check
    (isntall sudo apt install clang -- if getting clang related error)
  2. Update the following lines in _shieldsynthesis/Makefile

OLD:

CUDD_PATH = /usr/local
LIBS       = -L$(CUDD_PATH)/lib -l cudd -l obj
INCLUDE    = -I$(CUDD_PATH)/include

NEW:

CUDD_PATH = /path/to/newly/installed/cudd
LIBS       = -L$(CUDD_PATH)/cudd/.libs -l cudd
INCLUDE    = -I$(CUDD_PATH)/cudd
  1. Now make _shieldsynthesis/Makefile:
    $ cd safe-rl-shielding/shield_synthesis
    $ make

    You should see the last output lines if successfully done!!

    g++ -o shield_synthesizer Dfa.o ShieldMonitor.o ProductDfa.o Synthesizer.o PythonFormatter.o main.o DfaParser.o -L/home/shrikant/Dialogue_Implement/cudd-3.0.0/cudd/.libs -l cudd
    chmod u+x shield_synthesizer