                "output" (str "file=" t "/output.csv"))
       (first (output/read-stan-output (str t "/output.csv"))))))
 
+(defn lib
+  [path lib-name]
+  (first (filter (fn [s]
+                   (.startsWith s (str path lib-name "_")))
+                 (map str (.listFiles (io/file path))))))
+
 (defn make
   [model]
   (let [text (slurp model)

                 "-O3" "-o" exe
                 (str home "/src/cmdstan/main.cpp")
                 "-include" hpp-file
                 (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_nvecserial.a")
                 (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_cvodes.a"))))
    (->CompiledModel exe)))

                 (str "-I" home "/src")
                 (str "-I" home "/stan/src")
                 "-isystem" (str home "/stan/lib/stan_math/")
                 "-isystem" (lib lib-path "eigen")
                 "-isystem" (lib lib-path "boost")
                 "-isystem" (str (lib lib-path "cvodes") "/include")
                 "-Wall"
                 "-DEIGEN_NO_DEBUG" "-DBOOST_RESULT_OF_USE_TR1" "-DBOOST_NO_DECLTYPE"
                 "-DBOOST_DISABLE_ASSERTS" "-DFUSION_MAX_VECTOR_SIZE=12" "-DNO_FPRINTF_OUTPUT"
