Commits

Aleš Erjavec committed 64da095

Changed the order of linked libraries.

Fixes an undefined symbol error.

Comments (0)

Files changed (1)

 
     site = site_config()
 
+    # NOTE: The order of the libraries is important because the rlib
+    # also depends on blas it must be first so gcc linker can resolve
+    # all symbols in one pass (otherwise some symbols remain undefined)
+
+    if site.R:
+        # Link to the provided R library
+        libraries += site.R.libraries
+        library_dirs += site.R.library_dirs
+    else:
+        config.add_library("R", sources=sources("src/rlib/*.c"))
+
     if site.blas:
         # Link to provided blas library
         libraries += site.blas.libraries
         # Compile and link the included blas subset
         config.add_library("blas", sources=sources("src/blas/*.c"))
 
-    if site.R:
-        # Link to the provided R library
-        libraries += site.R.libraries
-        library_dirs += site.R.library_dirs
-    else:
-        config.add_library("R", sources=sources("src/rlib/*.c"))
-
     config.add_extension(
         "_earth",
         sources=["src/_earth.c"],