Skip to content

Commit

Permalink
Allow user to specify libraries for building Mathematica interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Harries committed Nov 12, 2017
1 parent 773f69a commit b0c1522
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/Makefile.in
Expand Up @@ -61,6 +61,7 @@ LDFLAGS := @LDFLAGS@
LDLIBS := @LDLIBS@
LIBLNK_LIBEXT := @LIBLNK_LIBEXT@
LIBLNK_MAKE_LIB_CMD:= @LIBLNK_MAKE_LIB_CMD@
LLLIBS := @LLLIBS@
BLASLIBS := @BLASLIBS@
BOOSTTESTLIBS := @BOOSTTESTLIBS@
BOOSTTHREADLIBS := @BOOSTTHREADLIBS@
Expand Down Expand Up @@ -246,6 +247,7 @@ showbuild:
@echo "FLIBS = $(FLIBS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "LDLIBS = $(LDLIBS)"
@echo "LLLIBS = $(LLLIBS)"
@echo "BLASLIBS = $(BLASLIBS)"
@echo "BOOSTTESTLIBS = $(BOOSTTESTLIBS)"
@echo "BOOSTTHREADLIBS = $(BOOSTTHREADLIBS)"
Expand Down
1 change: 1 addition & 0 deletions config/config.h.in
Expand Up @@ -46,6 +46,7 @@
#define LAPACKLIBS "@LAPACKLIBS@"
#define LDFLAGS "@LDFLAGS@"
#define LDLIBS "@LDLIBS@"
#define LLLIBS "@LLLIBS@"
#define LOOPFUNCFLAGS "@LOOPFUNCFLAGS@"
#define LOOPFUNCLIBS "@LOOPFUNCLIBS@"
#define SQLITELIBS "@SQLITELIBS@"
Expand Down
3 changes: 3 additions & 0 deletions config/flexiblesusy-config.in
Expand Up @@ -29,6 +29,7 @@ himalayalibs="@HIMALAYALIBS@"
lapacklibs="@LAPACKLIBS@"
ldflags="@LDFLAGS@"
ldlibs="@LDLIBS@"
lllibs="@LLLIBS@"
loopfuncflags="@LOOPFUNCFLAGS@"
loopfunclibs="@LOOPFUNCLIBS@"
math="@MATH@"
Expand Down Expand Up @@ -151,6 +152,7 @@ Options:
--ldflags Print flags for optional libraries, LDFLAGS
--ldlibs Print optional libraries, LDLIBS
--libs Print all libraries linked to an executable
--lllibs Print flags for LibraryLink libraries, LLLIBS
--loopfuncflags Print compiler flags for loop function library, LOOPFUNCFLAGS
--loopfunclibs Print loop function libraries, LOOPFUNCLIBS
--math-cmd Print Mathematica kernel command, MATH
Expand Down Expand Up @@ -207,6 +209,7 @@ while test $# -gt 0; do
--ldflags) out="$out $ldflags" ;;
--ldlibs) out="$out $ldlibs" ;;
--libs) out="$out $libs" ;;
--lllibs) out="$out $lllibs" ;;
--loopfuncflags) out="$out $loopfuncflags" ;;
--loopfunclibs) out="$out $loopfunclibs" ;;
--math-cmd) out="$out $math" ;;
Expand Down
5 changes: 5 additions & 0 deletions configure
Expand Up @@ -199,6 +199,7 @@ LOOPFUNCFLAGS=""
LOOPFUNCLIBS=""
LDFLAGS="$SHARED_LDFLAGS"
LDLIBS="$SHARED_LDLIBS"
LLLIBS=""
himalaya_lib_dir=""
himalaya_inc_dir=""
sqlite_lib_dir=""
Expand Down Expand Up @@ -2536,6 +2537,7 @@ replace_markers() {
-e "s|@LAPACKLIBS@|$LAPACKLIBS|" \
-e "s|@LDFLAGS@|$LDFLAGS|" \
-e "s|@LDLIBS@|$LDLIBS|" \
-e "s|@LLLIBS@|$LLLIBS|" \
-e "s|@SARAH_DEP_GEN@|$SARAH_DEP_GEN|" \
-e "s|@ENABLE_COLORS@|$enable_colors|" \
-e "s|@ENABLE_COMPILE@|$enable_compile|" \
Expand Down Expand Up @@ -2635,6 +2637,7 @@ Package directories, compilation settings and model selection
--with-install-dir= Path to source code installation directory
--with-lapack-libdir= Path to search for LAPACK library
--with-lapack-libs= LAPACK libraries to be linked
--with-lllibs= Libraries to be linked for LibraryLink (default: $LLLIBS)
--with-looptools-libdir= Path to search for LoopTools libraries
--with-looptools-incdir= Path to search for LoopTools headers
EOF
Expand Down Expand Up @@ -2752,6 +2755,7 @@ if test $# -gt 0 ; then
--with-install-dir=*) INSTALL_DIR=$optarg ;;
--with-lapack-libdir=*) lapack_lib_dir=$optarg ;;
--with-lapack-libs=*) LAPACKLIBS=$optarg ;;
--with-lllibs=*) LLLIBS=$optarg ;;
--with-looptools-libdir=*) looptools_lib_dir=$optarg ;;
--with-looptools-incdir=*) looptools_inc_dir=$optarg ;;
--with-math-cmd=*) MATH=$optarg ;;
Expand Down Expand Up @@ -2894,6 +2898,7 @@ sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \
-e "s|@LAPACKLIBS@|$LAPACKLIBS|" \
-e "s|@LDFLAGS@|$LDFLAGS|" \
-e "s|@LDLIBS@|$LDLIBS|" \
-e "s|@LLLIBS@|$LLLIBS|" \
-e "s|@LOOPFUNCLIBS@|$LOOPFUNCLIBS|" \
-e "s|@LOOPFUNCFLAGS@|$LOOPFUNCFLAGS|" \
-e "s|@MATH_VERSION@|$MATH_VERSION|" \
Expand Down
1 change: 1 addition & 0 deletions src/build_info.cpp
Expand Up @@ -91,6 +91,7 @@ void print_build_info(std::ostream& ostr)
"GSL flags (GSLFLAGS): " GSLFLAGS "\n"
"GSL libraries (GSLLIBS): " GSLLIBS "\n"
"LAPACK library (LAPACKLIBS): " LAPACKLIBS "\n"
"LibraryLink library (LLLIBS): " LLLIBS "\n"
"Loop function flags (LOOPFUNCFLAGS): " LOOPFUNCFLAGS "\n"
"Loop function libraries (LOOPFUNCLIBS): " LOOPFUNCLIBS "\n"
"Additional flags (LDFLAGS): " LDFLAGS "\n"
Expand Down
2 changes: 1 addition & 1 deletion templates/module.mk.in
Expand Up @@ -283,7 +283,7 @@ $(DIR)/%.x: $(DIR)/%.o $(LIB@CLASSNAME@) $(LIBFLEXI) $(filter-out -%,$(LOOPFUNCL
$(CXX) $(LDFLAGS) -o $@ $(call abspathx,$(ADDONLIBS) $^ $(LIBGM2Calc)) $(filter -%,$(LOOPFUNCLIBS)) $(HIMALAYALIBS) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS)

$(LL@CLASSNAME@_LIB): $(LL@CLASSNAME@_OBJ) $(LIB@CLASSNAME@) $(LIBFLEXI) $(filter-out -%,$(LOOPFUNCLIBS))
$(LIBLNK_MAKE_LIB_CMD) $@ $(CPPFLAGS) $(CFLAGS) $(call abspathx,$(ADDONLIBS) $^ $(LIBGM2Calc)) $(filter -%,$(LOOPFUNCLIBS)) $(HIMALAYALIBS) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS)
$(LIBLNK_MAKE_LIB_CMD) $@ $(CPPFLAGS) $(CFLAGS) $(call abspathx,$(ADDONLIBS) $^ $(LIBGM2Calc)) $(filter -%,$(LOOPFUNCLIBS)) $(HIMALAYALIBS) $(GSLLIBS) $(BOOSTTHREADLIBS) $(LAPACKLIBS) $(BLASLIBS) $(FLIBS) $(SQLITELIBS) $(TSILLIBS) $(THREADLIBS) $(LDLIBS) $(LLLIBS)

ALLDEP += $(LIB@CLASSNAME@_DEP) $(EXE@CLASSNAME@_DEP)
ALLSRC += $(LIB@CLASSNAME@_SRC) $(EXE@CLASSNAME@_SRC)
Expand Down

0 comments on commit b0c1522

Please sign in to comment.