Dear @andrea,

I've tried the nimscript format in Nimble to download and build a C library 
([http://github.com/sdwfrost/rmath)](http://forum.nim-lang.org///github.com/sdwfrost/rmath\)).
 The relevant bit from my .nimble looks like this:
    
    
    # Tasks
    
    before install:
      echo "Building libRmath-nim"
      exec "git clone https://github.com/sdwfrost/libRmath-nim";
      withDir "libRmath-nim":
        exec "make"
      when defined(windows):
        const
          rmathlib = "Rmath-nim.dll"
      elif defined(macosx):
        const
          rmathlib = "libRmath-nim.dylib"
      else:
        const
          rmathlib = "libRmath-nim.so"
      cpFile(thisDir() & "/libRmath-nim/src/" & rmathlib, thisDir() & 
"/private/" & rmathlib)
      rmDir("libRmath-nim")
    

The only problem is that Nim can't find the shared library unless I add to 
LD_LIBRARY_PATH. Does anyone know how to refer to a shared library in an 
installed package? (I also had problems with joinPath, as ospaths wouldn't 
load, hence the use of concatenation in the .nimble)

Best

Simon

Reply via email to