Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math library ordered wrong in compile commands #2

Open
unkadoug opened this issue Sep 26, 2019 · 0 comments
Open

math library ordered wrong in compile commands #2

unkadoug opened this issue Sep 26, 2019 · 0 comments

Comments

@unkadoug
Copy link

In order to complete the sequence
./bootstrap.sh
./configure
make
successfully, I first had to edit makefile.in so that "-lm" appeared after, not before, "$<" in the compile command lines. Otherwise, math library symbols were not found because the math library was not in line to be searched after the source file. FWIW, this is Ubuntu 18.04.

A corrective patch:
diff --git a/makefile.in b/makefile.in
index 2b8320c..15c3e8f 100644
--- a/makefile.in
+++ b/makefile.in
@@ -180,7 +180,7 @@ gentab_objects = $(patsubst %.c,%.o,$(gentab_targets))

result is a program that generates a source file to be

built for the target system.

$(gentab_programs) : % : %.c ./include/liquidfpm.h

  •   $(CC) $(INCLUDE_CFLAGS) -lm $< -o $@
    
  •   $(CC) $(INCLUDE_CFLAGS) $< -lm -o $@
    

Run the natively-built program to generate the source

file. This file is to be built for the target system.

@@ -312,7 +312,7 @@ install:
@echo " Please report bugs to $(BUGREPORT)"
@echo "---------------------------------------------------------"
@echo ""

TARGET : uninstall - uninstalls the libraries and header files in the host system

@@ -373,7 +373,7 @@ $(benchmark_include): $(benchmarkgen_prog) $(benchmark_headers)
./$(benchmarkgen_prog) $(benchmark_headers) &gt; $@

$(benchmark_prog): bench/bench.c $(benchmark_include) libliquidfpm.a

  •   $(CC) $(BENCH_CFLAGS) -lm $< $(LDFLAGS) libliquidfpm.a -o $@
    
  •   $(CC) $(BENCH_CFLAGS) $< -lm $(LDFLAGS) libliquidfpm.a -o $@
    

bench: $(benchmark_prog)
./$<
@@ -401,7 +401,7 @@ $(autotest_include): $(autotestgen_prog) $(autotest_headers)
./$(autotestgen_prog) $(autotest_headers) &gt; $@

$(autotest_prog): autotest/autotest.c $(autotest_include) libliquidfpm.a

  •   $(CC) $(AUTOTEST_CFLAGS) -lm $< $(LDFLAGS) libliquidfpm.a -o $@
    
  •   $(CC) $(AUTOTEST_CFLAGS) $< -lm $(LDFLAGS) libliquidfpm.a -o $@
    

check: $(autotest_prog)
./$<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant