                  (str "-I" home "/src")
                  (str "-I" home "/stan/src")
                  "-isystem" (str home "/stan/lib/stan_math/")
-                 "-isystem" (str home "/stan/lib/stan_math/lib/eigen_3.3.3")
-                 "-isystem" (str home "/stan/lib/stan_math/lib/boost_1.62.0")
-                 "-isystem" (str home "/stan/lib/stan_math/lib/cvodes_2.9.0/include")
+                 "-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"

               "output" (str "file=" t "/output.csv"))
      (first (output/read-stan-output (str t "/output.csv"))))))

(defn make
  [model]
  (let [text (slurp model)

                     (throw (Exception. "STAN_HOME environment variable is not set.
                                     See `clj-stan` documentation.")))
            model-file (str exe ".stan")
            hpp-file (str exe ".hpp")
            lib-path (str home "/stan/lib/stan_math/lib/")]
        (spit model-file text)
        (println (format "Compiling %s to C++." model))
        (execute (str home "/bin/stanc") model-file (str "--o=" hpp-file))
