[mpich-discuss] Newbie getting started question?

Jeff Hammond jhammond at alcf.anl.gov
Sat Sep 15 05:52:35 CDT 2012


--rpath is a linker option.  See
http://www.linuxquestions.org/questions/programming-9/gcc-option-wl-rpath-what-does-it-mean-576766/
for a full explanation of how to use it.

I just tried --rpath with gfortran (trivially, since Blue Gene is
linking statically all the time), and it clearly works with the "-Wl"
option.

[jhammond at vestalac1 XL]$ mpif77 -Wl,--rpath,/tmp rpath.F
[jhammond at vestalac1 XL]$ mpif77 -show
/bgsys/drivers/V1R1M1/ppc64/gnu-linux/bin/powerpc64-bgq-linux-gfortran
-fno-underscoring -I/bgsys/drivers/V1R1M1/ppc64/comm/sys/include
-I/bgsys/drivers/V1R1M1/ppc64
-I/bgsys/drivers/V1R1M1/ppc64/spi/include
-I/bgsys/drivers/V1R1M1/ppc64/spi/include/kernel/cnk
-I/bgsys/drivers/V1R1M1/ppc64/comm/gcc/include
-L/bgsys/drivers/V1R1M1/ppc64/comm/gcc/lib -lmpich -lopa -lmpl -lrt
-ldl -L/bgsys/drivers/V1R1M1/ppc64/comm/sys/lib -lpami
-L/bgsys/drivers/V1R1M1/ppc64/spi/lib -lSPI -lSPI_cnk -lpthread -lrt
-lstdc++

Jeff

On Fri, Sep 14, 2012 at 10:10 PM, John Chludzinski
<john.chludzinski at gmail.com> wrote:
> BTW, both libopa.so.1 and libmpl.so.1 are defined links within
> /usr/lib/mpich2/lib/.  And both -rpath or -rpath-link are "unrecognized
> option" for gfortran.
>
>
> On Fri, Sep 14, 2012 at 10:47 PM, John Chludzinski
> <john.chludzinski at gmail.com> wrote:
>>
>> $ mpif90 -o ex1 ex1.f95
>> /usr/bin/ld: warning: libopa.so.1, needed by
>> /usr/lib/mpich2/lib/libmpichf90.so, not found (try using -rpath or
>> -rpath-link)
>> /usr/bin/ld: warning: libmpl.so.1, needed by
>> /usr/lib/mpich2/lib/libmpichf90.so, not found (try using -rpath or
>> -rpath-link)
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trfree'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_env2str'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trlevel'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trvalid'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trmalloc'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trspace'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_env2range'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trcalloc'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_env2int'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trdump'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_env2bool'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trstrdup'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trrealloc'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_TrSetMaxMem'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trinit'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trDebugLevel'
>> /usr/lib/mpich2/lib/libmpich.so: undefined reference to `MPL_trid'
>>
>>
>> On Fri, Sep 14, 2012 at 10:37 PM, John Chludzinski
>> <john.chludzinski at gmail.com> wrote:
>>>
>>> Just ran: yum install mpich2-devel
>>>
>>> # ls -l /usr/lib/mpich2/lib/
>>> total 7484
>>>
>>> -rw-r--r--. 1 root root   25459 Jan  2  2012 clog2print.jar
>>> -rw-r--r--. 1 root root  127339 Jan  2  2012 clog2TOdrawable.jar
>>> -rw-r--r--. 1 root root  183747 Jan  2  2012 clog2TOslog2.jar
>>> -rw-r--r--. 1 root root   17400 Jan  2  2012 clogprint.jar
>>> -rw-r--r--. 1 root root  108290 Jan  2  2012 clogTOdrawable.jar
>>> -rw-r--r--. 1 root root  164701 Jan  2  2012 clogTOslog2.jar
>>> -rw-r--r--. 1 root root 2449314 Jan  2  2012 jumpshot.jar
>>> -rw-r--r--. 1 root root    7140 Jan  2  2012 jumpshot_launcher.jar
>>> -rw-r--r--. 1 root root   16278 Jan  2  2012 libampe.a
>>> lrwxrwxrwx. 1 root root      16 Sep 14 22:33 libfmpich.so ->
>>> libfmpich.so.3.3
>>>
>>> lrwxrwxrwx. 1 root root      16 Sep 14 16:20 libfmpich.so.3 ->
>>> libfmpich.so.3.3
>>> -rwxr-xr-x. 1 root root  121604 Jan  2  2012 libfmpich.so.3.3
>>> -rw-r--r--. 1 root root  271832 Jan  2  2012 liblmpe.a
>>> -rw-r--r--. 1 root root  237292 Jan  2  2012 libmpe.a
>>> -rw-r--r--. 1 root root  182660 Jan  2  2012 libmpe_collchk.a
>>> -rw-r--r--. 1 root root   36448 Jan  2  2012 libmpe_f2cmpi.a
>>> -rw-r--r--. 1 root root  219056 Jan  2  2012 libmpe_nompi.a
>>> -rw-r--r--. 1 root root   20776 Jan  2  2012 libmpe_nompi_null.a
>>> -rw-r--r--. 1 root root   10356 Jan  2  2012 libmpe_null.a
>>> lrwxrwxrwx. 1 root root      18 Sep 14 22:33 libmpichcxx.so ->
>>> libmpichcxx.so.3.3
>>>
>>> lrwxrwxrwx. 1 root root      18 Sep 14 16:20 libmpichcxx.so.3 ->
>>> libmpichcxx.so.3.3
>>> -rwxr-xr-x. 1 root root  116756 Jan  2  2012 libmpichcxx.so.3.3
>>> lrwxrwxrwx. 1 root root      18 Sep 14 22:33 libmpichf90.so ->
>>> libmpichf90.so.3.3
>>>
>>> lrwxrwxrwx. 1 root root      18 Sep 14 16:20 libmpichf90.so.3 ->
>>> libmpichf90.so.3.3
>>> -rwxr-xr-x. 1 root root    5644 Jan  2  2012 libmpichf90.so.3.3
>>> lrwxrwxrwx. 1 root root      15 Sep 14 22:33 libmpich.so ->
>>> libmpich.so.3.3
>>>
>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libmpich.so.3 ->
>>> libmpich.so.3.3
>>> -rwxr-xr-x. 1 root root 1861652 Jan  2  2012 libmpich.so.3.3
>>> lrwxrwxrwx. 1 root root      15 Sep 14 22:33 libmpl.so -> libmpl.so.1.1.0
>>>
>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libmpl.so.1 ->
>>> libmpl.so.1.1.0
>>> -rwxr-xr-x. 1 root root   15612 Jan  2  2012 libmpl.so.1.1.0
>>> lrwxrwxrwx. 1 root root      15 Sep 14 22:33 libopa.so -> libopa.so.1.0.0
>>>
>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libopa.so.1 ->
>>> libopa.so.1.0.0
>>> -rwxr-xr-x. 1 root root    3940 Jan  2  2012 libopa.so.1.0.0
>>> -rw-r--r--. 1 root root   86000 Jan  2  2012 libtmpe.a
>>>
>>> -rw-r--r--. 1 root root  265485 Jan  2  2012 logconvertor.jar
>>> -rw-r--r--. 1 root root   10760 Jan  2  2012 mpe_prof.o
>>> -rw-r--r--. 1 root root  173622 Jan  2  2012 slog2filter.jar
>>> -rw-r--r--. 1 root root  136084 Jan  2  2012 slog2navigator.jar
>>> -rw-r--r--. 1 root root  136091 Jan  2  2012 slog2printrecur.jar
>>> -rw-r--r--. 1 root root  136086 Jan  2  2012 slog2printserial.jar
>>> -rw-r--r--. 1 root root  261610 Jan  2  2012 slog2update205to206.jar
>>> -rw-r--r--. 1 root root   67742 Jan  2  2012 traceprint.jar
>>> drwxr-xr-x. 2 root root    4096 Sep 14 22:33 trace_rlog
>>>
>>> -rw-r--r--. 1 root root  124160 Jan  2  2012 traceTOslog2.jar
>>>
>>>
>>> On Fri, Sep 14, 2012 at 8:08 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>>>
>>>> This package is missing the symlinks libmpich.so -> libmpich.so.3.3. Is
>>>> there a separate mpich2-devel package?
>>>>
>>>> On Fri, Sep 14, 2012 at 6:57 PM, John Chludzinski
>>>> <john.chludzinski at gmail.com> wrote:
>>>>>
>>>>> $ ls -l /usr/lib/mpich2/lib
>>>>> total 6412
>>>>> -rw-r--r--. 1 root root   25459 Jan  2  2012 clog2print.jar
>>>>> -rw-r--r--. 1 root root  127339 Jan  2  2012 clog2TOdrawable.jar
>>>>> -rw-r--r--. 1 root root  183747 Jan  2  2012 clog2TOslog2.jar
>>>>> -rw-r--r--. 1 root root   17400 Jan  2  2012 clogprint.jar
>>>>> -rw-r--r--. 1 root root  108290 Jan  2  2012 clogTOdrawable.jar
>>>>> -rw-r--r--. 1 root root  164701 Jan  2  2012 clogTOslog2.jar
>>>>> -rw-r--r--. 1 root root 2449314 Jan  2  2012 jumpshot.jar
>>>>> -rw-r--r--. 1 root root    7140 Jan  2  2012 jumpshot_launcher.jar
>>>>> lrwxrwxrwx. 1 root root      16 Sep 14 16:20 libfmpich.so.3 ->
>>>>> libfmpich.so.3.3
>>>>> -rwxr-xr-x. 1 root root  121604 Jan  2  2012 libfmpich.so.3.3
>>>>> lrwxrwxrwx. 1 root root      18 Sep 14 16:20 libmpichcxx.so.3 ->
>>>>> libmpichcxx.so.3.3
>>>>> -rwxr-xr-x. 1 root root  116756 Jan  2  2012 libmpichcxx.so.3.3
>>>>> lrwxrwxrwx. 1 root root      18 Sep 14 16:20 libmpichf90.so.3 ->
>>>>> libmpichf90.so.3.3
>>>>> -rwxr-xr-x. 1 root root    5644 Jan  2  2012 libmpichf90.so.3.3
>>>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libmpich.so.3 ->
>>>>> libmpich.so.3.3
>>>>> -rwxr-xr-x. 1 root root 1861652 Jan  2  2012 libmpich.so.3.3
>>>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libmpl.so.1 ->
>>>>> libmpl.so.1.1.0
>>>>> -rwxr-xr-x. 1 root root   15612 Jan  2  2012 libmpl.so.1.1.0
>>>>> lrwxrwxrwx. 1 root root      15 Sep 14 16:20 libopa.so.1 ->
>>>>> libopa.so.1.0.0
>>>>> -rwxr-xr-x. 1 root root    3940 Jan  2  2012 libopa.so.1.0.0
>>>>> -rw-r--r--. 1 root root  265485 Jan  2  2012 logconvertor.jar
>>>>> -rw-r--r--. 1 root root   10760 Jan  2  2012 mpe_prof.o
>>>>> -rw-r--r--. 1 root root  173622 Jan  2  2012 slog2filter.jar
>>>>> -rw-r--r--. 1 root root  136084 Jan  2  2012 slog2navigator.jar
>>>>> -rw-r--r--. 1 root root  136091 Jan  2  2012 slog2printrecur.jar
>>>>> -rw-r--r--. 1 root root  136086 Jan  2  2012 slog2printserial.jar
>>>>> -rw-r--r--. 1 root root  261610 Jan  2  2012 slog2update205to206.jar
>>>>> -rw-r--r--. 1 root root   67742 Jan  2  2012 traceprint.jar
>>>>> -rw-r--r--. 1 root root  124160 Jan  2  2012 traceTOslog2.jar
>>>>>
>>>>>
>>>>> $ mpif90 -show
>>>>> gfortran -m32 -O2 -fPIC -Wl,-z,noexecstack -I/usr/include/mpich2-i386
>>>>> -I/usr/include/mpich2-i386 -L/usr/lib/mpich2/lib -lmpichf90 -lmpichf90
>>>>> -lmpich
>>>>>
>>>>> On Fri, Sep 14, 2012 at 7:54 PM, Jed Brown <jedbrown at mcs.anl.gov>
>>>>> wrote:
>>>>>>
>>>>>> On Fri, Sep 14, 2012 at 6:41 PM, John Chludzinski
>>>>>> <john.chludzinski at gmail.com> wrote:
>>>>>>>
>>>>>>> MPICH2 Version:        1.4.1p1
>>>>>>> MPICH2 Release date:    Thu Sep  1 13:53:02 CDT 2011
>>>>>>> MPICH2 Device:        ch3:nemesis
>>>>>>> MPICH2 configure:     --build=i386-redhat-linux-gnu
>>>>>>> --host=i386-redhat-linux-gnu --program-prefix= --disable-dependency-tracking
>>>>>>> --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
>>>>>>> --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
>>>>>>> --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var
>>>>>>> --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
>>>>>>> --enable-sharedlibs=gcc --enable-shared --enable-lib-depend --disable-rpath
>>>>>>
>>>>>>
>>>>>> Because of this option, you will need
>>>>>> LD_LIBRARY_PATH=/usr/lib/mpich2/lib to run executables.
>>>>>>
>>>>>>>
>>>>>>> --enable-fc --with-device=ch3:nemesis --with-pm=hydra:gforker
>>>>>>> --sysconfdir=/etc/mpich2-i386 --includedir=/usr/include/mpich2-i386
>>>>>>> --bindir=/usr/lib/mpich2/bin --libdir=/usr/lib/mpich2/lib
>>>>>>
>>>>>>
>>>>>> According to the output you showed above, this option was either
>>>>>> missed or the distribution packaged it differently on install. What system
>>>>>> is this on? What is the output of
>>>>>>
>>>>>> $ ls -l /usr/lib/mpich2/lib
>>>>>>
>>>>>> $ mpif90 -show
>>>>>>
>>>>>>>
>>>>>>> --datadir=/usr/share/mpich2 --mandir=/usr/share/man/mpich2
>>>>>>> --docdir=/usr/share/mpich2/doc --htmldir=/usr/share/mpich2/doc
>>>>>>> --with-hwloc-prefix=system --with-java=/etc/alternatives/java_sdk
>>>>>>> FC=gfortran F77=gfortran CFLAGS=-m32 -O2 -fPIC CXXFLAGS=-m32 -O2 -fPIC
>>>>>>> FCFLAGS=-m32 -O2 -fPIC FFLAGS=-m32 -O2 -fPIC LDFLAGS=-Wl,-z,noexecstack
>>>>>>> MPICH2LIB_CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>>>>>>> -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables MPICH2LIB_CXXFLAGS=-O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables MPICH2LIB_FCFLAGS=-O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables MPICH2LIB_FFLAGS=-O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables
>>>>>>> MPICH2 CC:     gcc -m32 -O2 -fPIC -O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables  -O2
>>>>>>> MPICH2 CXX:     c++ -m32 -O2 -fPIC -O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables -O2
>>>>>>> MPICH2 F77:     gfortran -m32 -O2 -fPIC -O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables -O2
>>>>>>> MPICH2 FC:     gfortran -m32 -O2 -fPIC -O2 -g -pipe -Wall
>>>>>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
>>>>>>> --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom
>>>>>>> -fasynchronous-unwind-tables -O2
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Sep 14, 2012 at 7:31 PM, Jed Brown <jedbrown at mcs.anl.gov>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> On Fri, Sep 14, 2012 at 6:23 PM, John Chludzinski
>>>>>>>> <john.chludzinski at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> Why is this installation of MPICH2 ("compiler wrapper") trying to
>>>>>>>>> statically link against "mpichf90" and "mpich" ? Versus dynamically link
>>>>>>>>> against the shared object files in the lib directory.
>>>>>>>>
>>>>>>>>
>>>>>>>> It's not trying to "statically link", it's just trying to link. The
>>>>>>>> correct path is not being specified, but we'd have to see output of
>>>>>>>> mpich2version to say for sure. It's a waste of time to speculate.
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> How do I get the compiler wrapper to recognize this ?
>>>>>>>>>
>>>>>>>>> I assume I need to define: LD_LIBRARY_PATH=/usr/lib/mpich2/lib/ ?
>>>>>>>>
>>>>>>>>
>>>>>>>> This problem comes sooner.
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>>>>>>> To manage subscription options or unsubscribe:
>>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>>>>>> To manage subscription options or unsubscribe:
>>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>>>>> To manage subscription options or unsubscribe:
>>>>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>>>> To manage subscription options or unsubscribe:
>>>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>>> To manage subscription options or unsubscribe:
>>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>>>
>>>
>>
>
>
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond


More information about the mpich-discuss mailing list