configure file fails when checking mpi

Pages: 12
Hi,

I am trying to compile the blochlib-1.2 libraries on Ubuntu 15.04. After compiling the fftw3 and mpi libraries into /usr/local/ the configure with option --with-mpi=/usr/local and --with-fftw=/usr/local fails with the error message: "checking for functioning MPI library .. configure: error: couldn't find mpi library for --with-mpi"
If I take away the mpi option the same message appears but with fftw libraries.
The libraries libmpi.a and the corresponding include files are all located in usr/local/lib & usr/local/include.

Does anybody now how the configure script generated by autoconf checks for functioning mpi & fftw libraries?

Thanks,
Zolo
Last edited on
closed account (zNASE3v7)
I am not sure exactly how you are compiling the binaries, but I might suggest you try something like:
sudo apt-get install blochlib
That should find the entire set of libraries and install them for you, where the files are supposed to be installed, and will update the config files if the files are located, and installed properly... and if that fails then try apt-get install the fftw or MPI respectively...
apt-get is good at finding the required packages and all the related files to complete the entire installation...That is why I use it whenever possible.

Another alternative I try to use is the Synaptic Package Utility-it will also install many of the same ways as using a terminal, only you don't have to work much:)
One more method that is a last attempt is to open a tar file with Ubuntu Software store...If it works it will be easy because it is just about like any other program you install in the software store. Simply say yes to install, authenticate and it should open and perform the installation...

I also was wondering if you used the \.configure as well as the makefile and install because those should have helped to install the programe into the proper locales, as well as updated any configs...
Note that in order to use the \.configure to install the files, you must be in the directory, and it (.configure) file must also be part of the extracted files where the directory was created.

I feel your pain...I have had some of these same trials:)
I suggest if the install goes ok, that you follow-up with sudo apt-get update, or sudo apt-get dist-upgrade
I hope this helps, and best of luck!
Oh, and one more note that works to help remove and clean your system of the files that can create disparity for the kernel: sudo apt-get autoclean...

if that fails try: man configure
Hi,

thanks for the answer. I have looked for blochlibs in many repositories but I have not found any. So apt-get and synaptic wont work in this case. I have tried many combination of the configure options such as --enable and --with as I found in the ./configure --help but still fails when checking for the libraries. I have set the correct LD_LIBRARY_PATH and mpicc is in the path.

I checked in the configure file and there is some conftest done and that is failing.

What does conftest do? every single file is installed libmpi.a fftw3.a and includes. They are all in the correct library.



You have to look at the autoconfig files for blochlib to see how it tests for a working MPI. Start with configure.ac, look for the --with-mpi option and follow the code. It'll be written M4, but will eventually create a C or C++ program that it tries to build and run.

If you're still interested in this a month after posting the initial request for help, it's worth looking into this yourself. If you get stuck on the way, ask for help.
Yes I started looking into myself and it seems that there is a little cpp code with fftw3 and mpi which is compiled and run during configure. So I copied the code out and tried to compile it outside the configure.in. The fftw3 library test code compiled and run very well after linking with static library but the mpi test code looks like this:

1
2
3
4
5
6
7
 
                   #include <mpi.h>
		    int main(int argc, char *argv[])
		    {
		    MPI_Init(&argc,&argv);
		    return 0;
		    }


running this against the mpi.a gives this error:

undefined reference to MPI_Win_set_name


Any idea why?

I installed libhdf5-mpi-dev that does not help either.

Thanks,
Z

How many mpi.h files exist on your system?
Hi,

that is a good question. I typed locate mpi.h and I definitely got more answers than one. But I am trying to link to the opnempi which I compiled.

This was the result of the locate mpi.h:

/usr/include/boost/mpi.hpp
/usr/include/boost/graph/use_mpi.hpp
/usr/include/mpich/mpi.h
/usr/lib/openmpi/include/mpi.h
/usr/lib/openmpi/include/openmpi/ompi/mpi/f77/prototypes_mpi.h
/usr/local/include/mpi.h
/usr/local/include/ql/boost/mpi.hpp
/usr/local/include/ql/boost/graph/use_mpi.hpp
/usr/local/lib/boost_1_55_0/boost/mpi.hpp
/usr/local/lib/boost_1_55_0/boost/graph/use_mpi.hpp
/usr/local/lib/boost_1_55_0/doc/html/mpi.html
/usr/local/mpi/include/mpi.h
/usr/src/linux-headers-3.2.0-23-generic-pae/include/config/usb/serial/siemens/mpi.h


But in the compilation process I only link the /usr/local/mpi/include/mpi.h file.
Do the other ones make some trouble?

thanks,
Z




It's clear that you're not using the same header file as the autoconfig system.

I guess the next step is to try to work out what paths it's using for the include and lib. And while you're at it, can you also let us know what paths were used from the compile you did outside of that environment.
Last edited on
Hi,

When I start compiling I use --with-mpi=/usr/local hoping that the locations usr/local/include and usr/local/lib will be used. this is the path I gave when I compiled mpi.

I am using the same location when I compile outside the configure script. Is it worth re-compiling mpi?

Z
alright I am getting somewhere. The above code with mpi can be compiled like this:
 
g++ mpicheck.cpp -o mpicheck2 -I/usr/local/include -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi_cxx -lmpi


or the equivalent short is:
 
mpicxx mpicheck.cpp -o mpicheck


I just have to figure out how to tell this to the configure file.
Ok So I exchanged MPICC to mpicxx in the configure file and so the it successfully finishes the checking and runs to the end without error. BUt then during make it gives this error message:


Makefile:253: recipe for target 'mpi_config.lo' failed
make[2]: *** [mpi_config.lo] Error 1

I hate autoconf. It's tedious to write, tedious to maintain and worst of all, it's the wrong solution to the problem.

That .lo is the libtool version of the library.

How was OpenMPI installed on the system anyway? Was installed thru a package or built from source on the box?

You could modify that test program test program to dump the environment. I dunno if that will show the path being used.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <mpi.h>
#include <stdio.h>
#include <string.h>

void process(char** env)
{
        size_t i;
        for (i = 0; env[i]; ++i)
        {
                const char* p = env[i];

                const char* key = p;
                const char* val = p + strlen(p) + 1;
                printf("%s%s\n", key, val);
        }
}

int main(int argc, char** argv, char** env)
{
        process(env);
        MPI_Init(&argc,&argv);
}
Hi,

I have never used autoconf before but it seems like it is a bit messy. I have gone through the configure file and changed the test code compiler to mpicxx. So that run to the end without error. But then the make failed with the mpiconfig lib. Then I recognized that it is taking the mpi from a src folder which has an mpi folder. In that folder there is a Makefile and a mpi_config.cc mpi_config.h. The answer to your question is that I have installed through the package manager and also compiled my own version but as it seems now the blochlib uses its own mpi version.

thanks,
Z
That's bonkers. You're saying blochlib packages its own openmpi and when you try to use it, it says
checking for functioning MPI library .. configure: error: couldn't find mpi library for --with-mpi


If I have the time, I'll take a look. But I don't have access to an Ubuntu system.

EDIT:
I started looking and the option reads:
--with-mpi=<path> prefix of MPI installation. e.g. /usr/local/

Did you specify the path to your installation of MPI?

Another EDIT:
Ok, I get the same thing.
I ran it on FreeBSD in a brand new jail with openmpi installed. My system has all the apparently needed files.

I've been thru all the obvious (to me) things and delved a little deeper. It's gonna take me much longer than I want to spend on it to understand why it reports this error.

I'd say blochlib with mpi autoconf is broken. Report it to the project.
Last edited on
Hi,

Thanks for checking it anyway. I also arrived at the conclusion that it is not trivial to fox this so I reduced the time massively which I spend with it. I might abandon it as is.

Thanks for helping,
Z
closed account (zNASE3v7)
Hi zolo
Sorry I didn't get back with you until now and thanks to kbw, looks like you both are experts in the configs...
I might sound a little bit like an idiot, for asking, but sometimes in my life, I've been taught that it is oftentimes the little things with errors like this and others...
Might I ask if you added MPI to your bash.config path?
I know that there is sometimes an alternative user config in the locale for bash also, but it amazes me how many times this has resolved issues with my path, and especially when extracting and installing TARs...

one last question<:)> do you already have a MPI library installed?, maybe another version or slightly different name?

also maybe a different source: I hope this helps: http://sourceforge.net/projects/blochlib/

N Good Luck...
To summarise the difficulties:

Autoconf compiles and runs a test program that zolo listed above. If this fails, the config process stops.

You can change the program, but the program presented seems minimal. If you are to change the program, you need a full dev environment with autoconf, automake, libtool, ... installed and working as you'll need to repackage blochlib

On FreeBSD 10, if the package openmpi is installed, all the necessary files (header and lib) are present. But there's an error in OpenMPI on this platform. The IPv6 binding does not work and the package is built with this option on. So the programs produced do not work. The package would need to be rebuilt from source.

On Mint Linux, the distro I have access to right now, installing openmpi does not install the necessary files to build a program. I don't know what happens on other distros.

To summarise, for one reason or another, the --with-mpi option doesn't seem to work on the platforms zolo and I have used.
Last edited on
Hi,

I will check the the bashrc asap. Although I am pretty sure I did have it there. since then I have tried to compile blochlibs on FEDORA 18 and OpenSuse 13.1 but both failed for the same reason. On my ubuntu system I got the configure file working by replacing mpiCC to mpicxx. this compiles the test programs and runs them. The problem is then with the wrapper of blochlibs to MPI. The mpi-tools.cpp fails to compile. this is in the folder blochlibs/src.

Cheers,
Zolo
Hi again,

On both Fedora and OpenSuse the mpi was in the bashrc file. On my Ubuntu system it wasn't. Quickly adding it to the bashrc and checking it with mpiCC -showme it showed the right path. I still needed to modify the configure file since one needs to add -lmpi_cxx and -lmpi not only -lmpi as it is in the original file. After modifying other trivial things in the configure file it again run and did the configure without errors. typing make after that I ended up having the exact same error as on the other 2 systems. Here it comes:

../../src/blochconfig.h:99:26: error: expected declaration before '}' token
#define END_BL_NAMESPACE };
^
../../src/container/matrix/_matrix.h:2270:1: note: in expansion of macro 'END_BL_NAMESPACE'
END_BL_NAMESPACE
^
Makefile:253: recipe for target 'mpi_config.lo' failed
make[3]: *** [mpi_config.lo] Error 1
make[3]: Leaving directory '/home/zolo/Downloads/blochlib-1.2/src/mpi'
Makefile:369: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/zolo/Downloads/blochlib-1.2/src'
Makefile:233: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/zolo/Downloads/blochlib-1.2/src'
Makefile:225: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1


Thanks,
Z


closed account (zNASE3v7)
I think like kbw said that you probably could submit a report to the project or to sourceforge...
I would guess the author will quickly rewrite other patches or find the bug in it...
I will see if I can find his bio again.
Ok here's a link to his page, but I couldn't find a link to make a report on the problem, but I know sourceforge has topic and tech support, so I apologize for this limited attempt to give assistance..I also want to send a shoutout to kbw! great job to both of you, I become very apprehensive when writing and changing code in these configs and what-not, LOL Anyway best of luck!!
http://sourceforge.net/u/wyndhblb/profile/
Last edited on
Pages: 12