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

configure fails to find mpfr library in non-standard location #1

Closed
claudiopica opened this issue Sep 1, 2011 · 5 comments
Closed
Assignees

Comments

@claudiopica
Copy link

The flag "--with-mpfr=/non-standard/path/to/lib/" seems to be ignored by the configure script.

A temporary hack to avoid the problem is to set LIBRARY_PATH to point to the library location.

Maybe due to old version of autotools? (v2.59)

@ghost ghost assigned coppolachan Sep 2, 2011
@coppolachan
Copy link
Owner

I think I solved it with the new Makefile.am.
Unfortunately I do not have access to a machine without a std installation, but I'm pretty sure this is working now. See the commit history for details.

Tell me if this solved the issue and I will close this issue.

@claudiopica
Copy link
Author

The issue still persists. I think it is at the level of the configure.ac file in the root directory.
The test program to check for the mpfr library fails to compile because of the non-standard location of the library, resulting in configure to exit with a missing library error.

I think at the moment there are 2 problems in the configure.ac file:

  1. we should test for the presence of "--with-mpfr" before the check of the library;
  2. set LIB to include MPFR_LIB before the check of the library.

This is an extract of the config.log file:

[Omissis]
It was created by rhmc_staggered_cuda configure 0.1.2, which was
generated by GNU Autoconf 2.67. Invocation command line was

$ ./configure --enable-cuda=sm_20 --with-mpfr=/people/disk2/pica

[omissis]

configure:4484: checking for mpfr_init in -lmpfr
configure:4509: gcc -o conftest -g -O2 conftest.c -lmpfr >&5
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libmpfr.a(set_dfl_prec.o): In function mpfr_set_default_prec': (.text+0x37): undefined reference to__gmp_assert_fail'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libmpfr.a(init2.o): In function mpfr_init2': (.text+0x3c): undefined reference to__gmp_assert_fail'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libmpfr.a(init2.o): In function mpfr_init2': (.text+0x56): undefined reference to__gmp_allocate_func'
collect2: ld returned 1 exit status
configure:4509: $? = 1
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME "rhmc_staggered_cuda"
| #define PACKAGE_TARNAME "rhmc_staggered_cuda"
| #define PACKAGE_VERSION "0.1.2"
| #define PACKAGE_STRING "rhmc_staggered_cuda 0.1.2"
| #define PACKAGE_BUGREPORT "cossu@post.kek.jp"
| #define PACKAGE_URL ""
| #define PACKAGE "rhmc_staggered_cuda"
| #define VERSION "0.1.2"
| /
end confdefs.h. /
|
| /
Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char mpfr_init ();
| int
| main ()
| {
| return mpfr_init ();
| ;
| return 0;
| }
configure:4518: result: no

@coppolachan
Copy link
Owner

Try the new version. I included a special test for MPFR library in a separate .m4 file and I am not using anymore the AC_CHECK_LIB directive in configure.ac . I tried with a non standard installation in my machine and it works, the test is passed and it is invoked using the correct -I and -L flags.
Tell me if it works.

@claudiopica
Copy link
Author

Everything works fine now!

@coppolachan
Copy link
Owner

Perfect. Now should work also in Rome, where they had similar problems.

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

2 participants