diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,23 @@
 import Distribution.Simple
-main = defaultMain
+import Distribution.Simple.LocalBuildInfo
+import Distribution.PackageDescription
+import Distribution.Text (display)
+
+addCppOption new lbi = 
+   let pd = localPkgDescr lbi
+   in case library pd of
+       Nothing  -> lbi
+       Just lib ->
+           let libbi = libBuildInfo lib
+               cpp   = new : cppOptions libbi
+           in lbi { localPkgDescr = pd { library = Just lib { libBuildInfo = libbi { cppOptions = cpp } } } }
+
+version (CompilerId _ v) = v
+
+updateLBI lbi =
+   let v = display . version . compilerId $ compiler lbi
+       f = "-DCOMPILER_VERSION=\"" ++ v ++ "\""
+   in addCppOption f lbi 
+
+main = defaultMainWithHooks
+    simpleUserHooks { confHook = \i f -> updateLBI `fmap` confHook simpleUserHooks i f }
diff --git a/helics.cabal b/helics.cabal
--- a/helics.cabal
+++ b/helics.cabal
@@ -1,5 +1,5 @@
 name:                helics
-version:             0.1.0
+version:             0.1.1
 synopsis:            New Relic® agent SDK wrapper for Haskell.
 description:         
   New Relic® agent SDK wrapper for Haskell.
@@ -19,7 +19,7 @@
 maintainer:          philopon.dependence@gmail.com
 -- copyright:           
 category:            Network
-build-type:          Simple
+build-type:          Custom
 -- extra-source-files:
 cabal-version:       >=1.10
 
diff --git a/src/Network/Helics.hs b/src/Network/Helics.hs
--- a/src/Network/Helics.hs
+++ b/src/Network/Helics.hs
@@ -68,7 +68,7 @@
         (error "license key is not set.")
         "App"
         "Haskell"
-        TOOL_VERSION_ghc
+        COMPILER_VERSION
         Nothing
 
 guardNr :: CInt -> IO ()
