Permalink
Browse files

Add in a script to filter out duplicate libraries; only take the firs…

…t found one
  • Loading branch information...
1 parent c192258 commit 8594140cf332aabf35dcebc8de22e1a4b6653268 @staticfloat staticfloat committed May 22, 2013
Showing with 18 additions and 1 deletion.
  1. +17 −0 contrib/filterDupLibs.sh
  2. +1 −1 contrib/repackage_system_suitesparse4.make
View
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+libnames=""
+libpaths=""
+
+# Loop over all command line arguments
+for i in "$@"; do
+ # Get basename of this argument, check if it is already in libnames
+ name=$(basename "$i")
+
+ if [[ -z $(echo $libnames | grep "$name") ]]; then
+ libnames+="$name "
+ libpaths+="$i "
+ fi
+done
+
+echo $libpaths
@@ -10,7 +10,7 @@ default:
mkdir -p $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib
cd $(JULIAHOME)/deps/SuiteSparse-SYSTEM/lib && \
rm -f *.a && \
- cp -f $(shell find $(shell eval $(JULIAHOME)/contrib/filterArgs.sh $(LDFLAGS)) /lib /usr/lib /usr/local/lib -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a -o -name libspqr.a -o -name libsuitesparseconfig.a 2>/dev/null) . && \
+ cp -f $(shell eval $(JULIAHOME)/contrib/filterDupLibs.sh $(shell find $(shell eval $(JULIAHOME)/contrib/filterArgs.sh $(LDFLAGS)) /lib /usr/lib /usr/local/lib -name libamd.a -o -name libcolamd.a -o -name libcholmod.a -o -name libumfpack.a -o -name libspqr.a -o -name libsuitesparseconfig.a 2>/dev/null)) . && \
$(CC) -shared $(WHOLE_ARCHIVE) libamd.a $(NO_WHOLE_ARCHIVE) -o $(BUILD)/$(JL_LIBDIR)/libamd.$(SHLIB_EXT) && \
$(INSTALL_NAME_CMD)libamd.$(SHLIB_EXT) $(BUILD)/$(JL_LIBDIR)/libamd.$(SHLIB_EXT) && \
$(CC) -shared $(WHOLE_ARCHIVE) libcolamd.a $(NO_WHOLE_ARCHIVE) -o $(BUILD)/$(JL_LIBDIR)/libcolamd.$(SHLIB_EXT) && \

0 comments on commit 8594140

Please sign in to comment.